Skip to main content



      Home
Home » Modeling » Graphiti » Delete Feature does not work in MPE
Delete Feature does not work in MPE [message #697819] Mon, 18 July 2011 02:39 Go to next message
Eclipse UserFriend
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 #697872 is a reply to message #697819] Mon, 18 July 2011 04:56 Go to previous messageGo to next message
Eclipse UserFriend
Murthy,

for the alignment I could imagine that the selection is not fired, but not
for the delete. Do you have an appropriate ActionBarContributor set for you
multipage editor? It needs to activate the alignment actions just as
DiagramEditorActionBarContributor does.

Does that help?
Michael


"Murthybhat" schrieb im Newsbeitrag news:j00jt3$i7d$1@news.eclipse.org...

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 #697878 is a reply to message #697872] Mon, 18 July 2011 05:19 Go to previous messageGo to next message
Eclipse UserFriend
Hi Michael,

I have made DiagramEditorActionBarContributor itself as the contributor to my multipage editor. Could that be the problem ?

Regards,
Murthy
Re: Delete Feature does not work in MPE [message #698341 is a reply to message #697878] Tue, 19 July 2011 05:50 Go to previous messageGo to next message
Eclipse UserFriend
I also tried creating a new "MultiPageEditorActionBarContributor". But no success. The menus/toolbar actions and context menu all appear but are disabled. Is there something extra that I need to override in my MPE to listen to selection and key events ?

Regards,
Murthy
Re: Delete Feature does not work in MPE [message #698849 is a reply to message #698341] Wed, 20 July 2011 07:22 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Delete Feature does not work in MPE [message #698858 is a reply to message #698849] Wed, 20 July 2011 07:33 Go to previous messageGo to next message
Eclipse UserFriend
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
Re: Delete Feature does not work in MPE [message #903869 is a reply to message #697819] Sun, 26 August 2012 19:42 Go to previous message
Eclipse UserFriend
Hi, I have a same problem as well, I want to try your solution, but I don't know what I should put into the variable "selectedActions". Can you elaborate more, thanks.

Emerson.
Previous Topic:Associate diagram extension
Next Topic:One CreateFeature for many palette entries
Goto Forum:
  


Current Time: Sat May 24 12:34:44 EDT 2025

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

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

Back to the top