Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Rich Client Platform (RCP) » howto "overwrite" the close() method of the Workbench
howto "overwrite" the close() method of the Workbench [message #435999] Mon, 29 August 2005 11:57 Go to next message
Andreas Pakulat is currently offline Andreas PakulatFriend
Messages: 127
Registered: July 2009
Senior Member
Hi,

I'd like to find a way to reject the workbench closing under certain
circuumstances. In particular I have an editor which has a button in it,
that calls IWorkbench.close() when clicked. But before the closing
can actually happen, I have to read some stuff from the editor input and
send that over a network connection to a server. Then depending on the
answer from the server the closing needs to be intercepted or not.

I did not yet try, but from the docs it seems that using a
WindowListener and listen to the close-Event of the Editor-Window might
be a proper way, or is there another way to do this?

Andreas
Re: howto "overwrite" the close() method of the Workbench [message #436050 is a reply to message #435999] Tue, 30 August 2005 11:13 Go to previous message
Alex Blewitt is currently offline Alex BlewittFriend
Messages: 946
Registered: July 2009
Senior Member
Have a look at the WorkbenchAdvisor class (assuming that you're dealing with a plugin that uses one).

http://help.eclipse.org/help31/index.jsp?topic=/org.eclipse. platform.doc.isv/reference/api/org/eclipse/ui/progress/Workb enchJob.html

There's a method called 'preShutdown' that returns true if the workbench is OK to be closed:

http://help.eclipse.org/help31/topic/org.eclipse.platform.do c.isv/reference/api/org/eclipse/ui/application/WorkbenchAdvi sor.html#preShutdown()

That may not be much use if you're not customising your own RCP though ...
Previous Topic:Is RCP a real subset of Platform ?
Next Topic:Show View menu in RCP
Goto Forum:
  


Current Time: Thu Dec 26 13:53:00 GMT 2024

Powered by FUDForum. Page generated in 0.03929 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top