Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Editor Visibility
Editor Visibility [message #894087] Fri, 06 July 2012 14:59 Go to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 529
Registered: June 2011
Senior Member
Hi,

When user presses the close button then i want to make editor hidden not dispose.

Actually i have a tree view with each node representing one editor. I want when user closes the editor then it should be somewhat become hidden and when user click on the respective node of tree view then it become visible again.

Any clue?

Cheers,
Re: Editor Visibility [message #894537 is a reply to message #894087] Mon, 09 July 2012 14:28 Go to previous messageGo to next message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

You can't intercept the close command, at least not without completely overriding it for the entire workbench (then you could do your hide for your editor and simply delegate back to the workbench for the other editors).

The other alternative is to stash your model and/or calculated state somewhere safe (a manager in your plugin) and check there when re-opening the editor for that node, and simply re-render it.

PW


Re: Editor Visibility [message #894709 is a reply to message #894537] Tue, 10 July 2012 08:51 Go to previous messageGo to next message
ModelGeek Mising name is currently offline ModelGeek Mising nameFriend
Messages: 529
Registered: June 2011
Senior Member
Actually i am already re-rendering editor to re-open. I am interested to intercept close command and override it for entire workbench.

Can you please guide me a bit in this regard?

Cheers,
Re: Editor Visibility [message #895129 is a reply to message #894709] Wed, 11 July 2012 18:33 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

There is a close command, org.eclipse.ui.IWorkbenchCommandConstants.FILE_CLOSE

Normally there is a handler registered for it, probably in the org.eclipse.ui plugin, org.eclipse.ui.internal.CloseEditorHandler

If you were to supply a handler with a higher priority, your handler would be active and then you could do what you want. You'll have to look at the plugin to figure out when the CloseEditorHandler is active.

PW


Previous Topic:Debugging Debug code
Next Topic:Register Isaveable object with workbench
Goto Forum:
  


Current Time: Wed Nov 26 03:26:14 GMT 2014

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

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