Decorations for Labels in GEF editors [message #145831] |
Sat, 31 July 2004 16:28 |
Eclipse User |
|
|
|
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 |
Pratik Shah 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.
>
>
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.03049 seconds