Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » GEF » Property Sheet value updates a Figure
Property Sheet value updates a Figure [message #173513] Thu, 24 March 2005 16:04 Go to next message
Eclipse UserFriend
Originally posted by: jduley.mail.arc.nasa.gov

I am trying to update a label on a figure based on a string value in a
property sheet for that figure. When I select the figure and change its
label property, the EditPart for this Figure properly calls the
propertyChanged event which in turn calls refreshVisuals. In
refreshVisuals, I am not sure how to update the label in this Figure. I
have tried the following:

//get the new value
String mainLabel = getCastedModel().getMainLabel();
//update the Figure ???
setFigure(new OntologyClassFigure(new Label(mainLabel)));

this does not work and is probably nowhere near being correct. Any
suggestions would be great. Thanks.
Jason
Re: Property Sheet value updates a Figure [message #173554 is a reply to message #173513] Thu, 24 March 2005 16:45 Go to previous message
Pratik Shah is currently offline Pratik ShahFriend
Messages: 1077
Registered: July 2009
Senior Member
When you're not sure how to do something, the first thing you should do is
check to see how the GEF examples do the same thing. This is pretty common
in most of our examples.

Look at StickyNoteEditPart in the logic example or ClassEditPart in the
EDiagram example. Basically, you give the existing figure the new text, not
create a new figure.

"Jason" <jduley@mail.arc.nasa.gov> wrote in message
news:d1ut7q$rrc$1@news.eclipse.org...
>
> I am trying to update a label on a figure based on a string value in a
> property sheet for that figure. When I select the figure and change its
> label property, the EditPart for this Figure properly calls the
> propertyChanged event which in turn calls refreshVisuals. In
> refreshVisuals, I am not sure how to update the label in this Figure. I
> have tried the following:
>
> //get the new value
> String mainLabel = getCastedModel().getMainLabel();
> //update the Figure ???
> setFigure(new OntologyClassFigure(new Label(mainLabel)));
>
> this does not work and is probably nowhere near being correct. Any
> suggestions would be great. Thanks.
> Jason
Previous Topic:TextPropertyDescriptor and EInt
Next Topic:Creating Dynamic Entry of Objects In Palette
Goto Forum:
  


Current Time: Thu Apr 25 08:11:10 GMT 2024

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

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

Back to the top