|
Re: Different EditParts selected in GraphicalViewer and SelectionAction [message #195799 is a reply to message #195680] |
Tue, 13 September 2005 15:53 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
So you've added that action to both the action registry and the list of
selection actions? Does its update() method get called properly when the
selection changes?
"Felix L J Mayer" <felix.mayer@objectaid.com> wrote in message
news:dg4uam$cdp$1@news.eclipse.org...
> My diagram has node and children within those nodes. The children have a
> NonResizableEditPolicy so that they can be selected. The children also
have
> their own context menu SelectionAction. When I right-click a child, the
List
> of EditParts obtained of the diagram's GraphicalViewer is what I would
> expect, i.e. the EditPart of the child. However, in the SelectionAction it
> is just the diagram's EditPart, which means the action cannot do its job.
> What is the problem? The SelectionAction is properly registered as such.
>
>
|
|
|
|
Re: Different EditParts selected in GraphicalViewer and SelectionAction [message #196540 is a reply to message #196476] |
Thu, 22 September 2005 19:14 |
Eclipse User |
|
|
|
Originally posted by: none.unknown.com
In that case, does the selectionChanged() method in the GraphicalEditor ever
get called? Graphical editor adds itself as a selection listener in the
init() method, and it should be getting called whenever the seleciton
changes. If it's not being invoked, is your editor class overriding
GraphicalEditor#hookGraphicalViewer()?
"Nicolai Guba" <nicolai_guba@scee.net> wrote in message
news:1127294032.995532@joshua.ni.scee.sony.co.uk...
> Pratik Shah wrote:
>
> > So you've added that action to both the action registry and the list of
> > selection actions? Does its update() method get called properly when
the
> > selection changes?
>
> Ah. I seem to have a related problem. I also have a SelectionAction and
I
> initialized it as follows (in my GraphicalEditorWithFlyoutPalette)
>
> IAction action = new RenameAction(this);
> getActionRegistry().registerAction(action);
> getSelectionActions().add(action.getId());
>
> However, getSelection() inside my action always returns null. For eg
>
> /**
> * @see org.eclipse.jface.action.Action#run()
> */
> @Override
> public void run()
> {
> System.out.println(getSelection());
> super.run();
> }
>
> Prints null to the console.
>
> I set a trace on the update method and noticed it never gets called.
> Something escaped me but I am a bit lost as to what I forgot to make it
> work.
>
> Any pointers greatly appreciated :)
>
> --
> Nicolai Guba
> +44.(0)151.282.3709
> Sony Computer Entertainment Europe
> http://www.scee.com
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04066 seconds