Delete Feature does not work in MPE [message #697819] |
Mon, 18 July 2011 02:39  |
Eclipse User |
|
|
|
Hello,
I have a graphical editor within a multipage editor. Some features like the 'DeleteFeature''AlignFeature'etc do not work in multipage environment. However it all works alone when the editor is run alone. my assumption is that the selection event is not being fired correctly. Am I in the right direction ? Any kind of help would be great.
Thanks.
Best Regards,
Murthy
|
|
|
|
|
|
|
Re: Delete Feature does not work in MPE [message #698858 is a reply to message #698849] |
Wed, 20 July 2011 07:33   |
Eclipse User |
|
|
|
Great, thanks for posting the solution as well :-)
What you are doing sounds fine, at least there are no immediate issues I can
see.
Michael
"Murthybhat" schrieb im Newsbeitrag news:j06d77$9hu$1@news.eclipse.org...
Hello,
I was able to figure out the solution. My problem was in
"DiagramEditorInternal.java" and specifically the "selectionChanged" method.
The "selectionChanged(IWorkbenchPart part, ISelection selection)" method
called its "super.selectionChanged(...)" method. That method checked if the
active editor was current editor(graphical editor) and only then the actions
would get updated(enabled).
But the ".getPage().getActiveEditor()" always returned my multipageEditor
instance.
public void selectionChanged(IWorkbenchPart part, ISelection selection) {
// If not the active editor, ignore selection changed.
if (this.equals(getSite().getPage().getActiveEditor()))
updateActions(selectionActions);
}
I had to hence make a change in "DiagramEditorInternal.java"
selectionChanged method. Instead of calling super.selectionChanged, i check
when multipageeditor, if selectedPage is same as the
current(graphicalEditor), then call update actions.
Hope I am not violating any intended behavior of graphiti.
Best Regards,
Murthy
|
|
|
|
Powered by
FUDForum. Page generated in 0.04869 seconds