Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to close an open editor
How to close an open editor [message #236145] Tue, 14 July 2009 15:13 Go to next message
Alireza Missing name is currently offline Alireza Missing nameFriend
Messages: 105
Registered: July 2009
Senior Member
I am loading several gmf diagram from db. User has several setting options
and based on current options the content of each diagram is loaded, e.g.,
within a specified time frame. User may change setting and want to re-open
an already open editor, I am thinking to find the already open one and
then close it and open a new one based on new setting. I used following
snipped

IWorkbenchWindow window;
window = this.getViewSite().getWorkbenchWindow();
IEditorPart[] openEditors = window.getActivePage().getEditors();


and then based on title (I am generating unique title for them), I can
find is any copy of the diagram is already open or not. But now I do not
know how to close it?!

If you think of other scenario please let me know (i.e., instead of
closing doing something else).

Best,
Ali
Re: How to close an open editor [message #236484 is a reply to message #236145] Mon, 20 July 2009 11:56 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Alireza,

You can use this.getViewSite().getPage().closeEditor(<editor>, true);
Another option is to call setInput() for the Editor referencing new input.

-----------------
Alex Shatalin
Re: How to close an open editor [message #236930 is a reply to message #236484] Mon, 20 July 2009 14:20 Go to previous message
Alireza Missing name is currently offline Alireza Missing nameFriend
Messages: 105
Registered: July 2009
Senior Member
Dear Alex,
It works,
I appreciate it :)
Cheers
Ali
Previous Topic:AbstractContributionItem causes deadlock
Next Topic:GMF common navigator Filter
Goto Forum:
  


Current Time: Sun Apr 05 23:00:37 GMT 2020

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

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

Back to the top