Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Problem: replacing root edit part gives blank white editor
Problem: replacing root edit part gives blank white editor [message #228859] Thu, 11 January 2007 12:38 Go to next message
Steinar Bang is currently offline Steinar BangFriend
Messages: 108
Registered: July 2009
Senior Member
Platform: Intel Pentium M, Ubuntu Dapper
eclipse 3.2, eclipse GEF SDK 3.2

I'm trying to adapt the code for enabling zoom commands in the logic
editor GEF example to my GEF editor.

One problem I'm seeing now, is that when I try to replace the root
edit part (which according to the debugger by default is a
ScalableRootEditPart) with the ScalableFreeFormEditorPart of the
example, ie. in the editor use:
protected void configureGraphicalViewer() {
super.configureGraphicalViewer();
ScalableFreeformRootEditPart root = new ScalableFreeformRootEditPart();
getGraphicalViewer().setRootEditPart(root);
getGraphicalViewer().setEditPartFactory(this);
}
then the editor frame becomes blank.

I'm deriving from GraphicalEditor, while the logic editor derives from
GraphicalEditorWithFlyoutPalette, but that shouldn't matter...?

The logic example wizard is able to create a four bit adder in the
same workspace where my editor fails, so it shouldn't be a version
number? (...unless the example source is out of sync with the actual
example plugin, that is...).

Any idea what the problem might be? Is there somewhere else I have to
register the root edit part? Can't ScalableFreeformRootEditPart be
used by a GEF editor? (but if so, why does it work for LogicEditor?)

Thanx!
Re: Problem: replacing root edit part gives blank white editor [message #228867 is a reply to message #228859] Thu, 11 January 2007 12:45 Go to previous messageGo to next message
Steinar Bang is currently offline Steinar BangFriend
Messages: 108
Registered: July 2009
Senior Member
Looks like ScalableRootEditPart has a getZoomManager() method, which
gets me what I need (though the toolbar actions haven't appeared yet).

But I'm still curious why what works for the logic editor example
doesn't work for me...?
Re: Problem: replacing root edit part gives blank white editor [message #228874 is a reply to message #228867] Thu, 11 January 2007 12:48 Go to previous messageGo to next message
Steinar Bang is currently offline Steinar BangFriend
Messages: 108
Registered: July 2009
Senior Member
>>>>> Steinar Bang <sb@dod.no>:

> Looks like ScalableRootEditPart has a getZoomManager() method, which
> gets me what I need (though the toolbar actions haven't appeared
> yet).

Well, that was just stopping the eclipse application process where the
editor was running, and restarting it.

I'm occasionally fooled by the hot code replace thing going on there
(I'm not entirely sure when it updates and when it isn't. This could
also be a startup thing, not just an editor startup thing...?).
Re: Problem: replacing root edit part gives blank white editor [message #228882 is a reply to message #228874] Thu, 11 January 2007 13:29 Go to previous messageGo to next message
Steinar Bang is currently offline Steinar BangFriend
Messages: 108
Registered: July 2009
Senior Member
>>>>> Steinar Bang <sb@dod.no>:

>> Looks like ScalableRootEditPart has a getZoomManager() method,
>> which gets me what I need (though the toolbar actions haven't
>> appeared yet).

> Well, that was just stopping the eclipse application process where
> the editor was running, and restarting it.

But the ZoomComboContributionItem() is disabled, even though I've
copied all code relating to it from the logic editor's
configureGraphicalViewer() method, and the action bar contributor's
contributeToToolBar() method.

Is there something I'm missing, I wonder...?
Re: Problem: replacing root edit part gives blank white editor [message #228889 is a reply to message #228882] Thu, 11 January 2007 13:45 Go to previous messageGo to next message
Steinar Bang is currently offline Steinar BangFriend
Messages: 108
Registered: July 2009
Senior Member
>>>>> Steinar Bang <sb@dod.no>:

> But the ZoomComboContributionItem() is disabled, even though I've
> copied all code relating to it from the logic editor's
> configureGraphicalViewer() method, and the action bar contributor's
> contributeToToolBar() method.

> Is there something I'm missing, I wonder...?

Some edit policy on the root part, perhaps?

I haven't defined any edit policies on any edit parts, since what I
have is a pure viewer, and I haven't seemed to be needing any yet.
Re: Problem: replacing root edit part gives blank white editor [message #228935 is a reply to message #228889] Thu, 11 January 2007 15:08 Go to previous message
Steinar Bang is currently offline Steinar BangFriend
Messages: 108
Registered: July 2009
Senior Member
>>>>> Steinar Bang <sb@dod.no>:

>> But the ZoomComboContributionItem() is disabled, even though I've
>> copied all code relating to it from the logic editor's
>> configureGraphicalViewer() method, and the action bar contributor's
>> contributeToToolBar() method.

>> Is there something I'm missing, I wonder...?

> Some edit policy on the root part, perhaps?

> I haven't defined any edit policies on any edit parts, since what I
> have is a pure viewer, and I haven't seemed to be needing any yet.

I've now successfully enabled the zoom combo box.

I had to implement the ERDiagramEditor#getAdapter() method, as defined
in the IBM "Using the Graphical Editor Framework and the Eclipse
Modeling Framework", on page 146/147.

http://www.redbooks.ibm.com/redbooks/pdfs/sg246302.pdf
Previous Topic:Memory leak - unable to dispose of PaletteEntry images
Next Topic:Custom tool - howto?
Goto Forum:
  


Current Time: Sun Oct 17 05:41:17 GMT 2021

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

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

Back to the top