Skip to main content



      Home
Home » Eclipse Projects » GEF » Graphical Viewer null
Graphical Viewer null [message #685738] Sat, 18 June 2011 15:22 Go to next message
Eclipse UserFriend
When I use getGraphicalViewer() from GraphicalEditorWithFlyoutPalette, the function return null... why???

I need add a listener to my graphical viewer.
Re: Graphical Viewer null [message #685835 is a reply to message #685738] Mon, 20 June 2011 06:28 Go to previous messageGo to next message
Eclipse UserFriend
When are you calling getGraphicalViewer()? Without more code this is not possible to answer.
Re: Graphical Viewer null [message #685837 is a reply to message #685835] Mon, 20 June 2011 06:34 Go to previous messageGo to next message
Eclipse UserFriend
public class GraphicalEditor extends GraphicalEditorWithFlyoutPalette {
...
    public void createActions() {
        super.createActions();

        ...
        PasteNodeAction pasteNodeAction = new PasteNodeAction(this, super.getGraphicalViewer());
        ...
    }
...
}


Razz

[Updated on: Mon, 20 June 2011 06:35] by Moderator

Re: Graphical Viewer null [message #685861 is a reply to message #685837] Mon, 20 June 2011 08:31 Go to previous messageGo to next message
Eclipse UserFriend
createActions() is called before createGraphicalViewer() so you'll have to declare PasteNodeAction somewhere else. I do this in over-ridden configureGraphicalViewer()
Re: Graphical Viewer null [message #685929 is a reply to message #685861] Mon, 20 June 2011 15:55 Go to previous message
Eclipse UserFriend
It works!!!

I've created createActions(GraphicalViewer viewer) and I've called it from configureGraphicalViewer().

Thank you very much, Phillip!

[Updated on: Mon, 20 June 2011 15:57] by Moderator

Previous Topic:Problem with Actions and Perspective
Next Topic:Resizing LabelEditParts
Goto Forum:
  


Current Time: Sun Apr 20 16:41:16 EDT 2025

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

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

Back to the top