Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Decorations for Labels in GEF editors
Decorations for Labels in GEF editors [message #145831] Sat, 31 July 2004 16:28 Go to next message
Eclipse UserFriend
Originally posted by: doug.satchwell.btinternet.com

Hi - it would be nice if my nodes (which are Labels) could have the ability
to be decorated when certain properties of the model for a node are changed.
I was wondering how best to add decorations to achieve this in the GEF
framework. I thought that maybe I could use the org.eclipse.ui.decorators
extension point, and use:

WorkbenchPlugin.getDefault().getDecoratorManager().decorateI mage(myImage,myM
odel)

to decorate the image, where myImage is the label image and myModel would be
the model for the node (presumably, myModel would be an instance of the
class defined in the objectClass element for the decorators extension
point?).

Would this be the correct way to do it? If so, at what point do I decorate
the label - there is a createFigure() method in AbstractGraphicalEditPart,
and I could create the Label and decorate its image in there, but presumably
this is only called once per diagram and so woudn't get updated if the model
properties were changed? So perhaps I should override getFigure() instead??
Or does anyone know of a better way to do this??

Thanks,

Doug.
Re: Decorations for Labels in GEF editors [message #145965 is a reply to message #145831] Mon, 02 August 2004 16:29 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
I am not too familiar with the decoration API, so I can't comment on that.
However, the correct place to decorate your image be in refreshVisuals() in
your EditPart.

"Doug Satchwell" <doug.satchwell@btinternet.com> wrote in message
news:cegh84$j4l$1@eclipse.org...
> Hi - it would be nice if my nodes (which are Labels) could have the
ability
> to be decorated when certain properties of the model for a node are
changed.
> I was wondering how best to add decorations to achieve this in the GEF
> framework. I thought that maybe I could use the org.eclipse.ui.decorators
> extension point, and use:
>
>
WorkbenchPlugin.getDefault().getDecoratorManager().decorateI mage(myImage,myM
> odel)
>
> to decorate the image, where myImage is the label image and myModel would
be
> the model for the node (presumably, myModel would be an instance of the
> class defined in the objectClass element for the decorators extension
> point?).
>
> Would this be the correct way to do it? If so, at what point do I decorate
> the label - there is a createFigure() method in AbstractGraphicalEditPart,
> and I could create the Label and decorate its image in there, but
presumably
> this is only called once per diagram and so woudn't get updated if the
model
> properties were changed? So perhaps I should override getFigure()
instead??
> Or does anyone know of a better way to do this??
>
> Thanks,
>
> Doug.
>
>
>
>
Previous Topic:Print dialog
Next Topic:Saving (& Reloading) the ViewPort location
Goto Forum:
  


Current Time: Tue Apr 16 04:10:49 GMT 2024

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

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

Back to the top