Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Graphical Viewer null
Graphical Viewer null [message #685738] Sat, 18 June 2011 19:22 Go to next message
JeTBLaCK  is currently offline JeTBLaCK Friend
Messages: 41
Registered: March 2011
Member
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 10:28 Go to previous messageGo to next message
h1055071 is currently offline h1055071Friend
Messages: 335
Registered: July 2009
Senior Member
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 10:34 Go to previous messageGo to next message
JeTBLaCK  is currently offline JeTBLaCK Friend
Messages: 41
Registered: March 2011
Member
public class GraphicalEditor extends GraphicalEditorWithFlyoutPalette {
...
    public void createActions() {
        super.createActions();

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


Razz

[Updated on: Mon, 20 June 2011 10:35]

Report message to a moderator

Re: Graphical Viewer null [message #685861 is a reply to message #685837] Mon, 20 June 2011 12:31 Go to previous messageGo to next message
h1055071 is currently offline h1055071Friend
Messages: 335
Registered: July 2009
Senior Member
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 19:55 Go to previous message
JeTBLaCK  is currently offline JeTBLaCK Friend
Messages: 41
Registered: March 2011
Member
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 19:57]

Report message to a moderator

Previous Topic:Resizing LabelEditParts
Next Topic:Visual Designer - GEF + EMF + JEM - opensourced at eclipse labs
Goto Forum:
  


Current Time: Fri Oct 22 17:37:39 GMT 2021

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

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

Back to the top