Changing and saving the value of a label? [message #217827] |
Mon, 09 February 2009 04:28  |
Eclipse User |
|
|
|
In my diagram, I want to be able to assign event- and guard-values to my
transitions. These values should be chosen from two predefined lists of
values, taken from an XML-file. Right now, the values are fixed when you
draw the diagram (to prevent the user from entering a value by hand), as
shown in this picture.
http://farm4.static.flickr.com/3440/3265528805_5ab616a2a3.jp g
I have created a wizard that can be reached by clicking on a transition.
Through that wizard, a user can load such an XML-file and populate the
lists. After that, the user are presented with two drop-down menus
containing these value-lists.
Now to my problem...when a user chooses for example an event-value I want
that value to replace the default-value on the diagram, and I also want to
be able to save some other info about the chosen event (for example a type
and an id-number). But I don't know how to "reach" the appropriate
java-file (or which one it might be) from my wizard-code? Is there anyone
who can tell me how to do this?
(I also want to do the same thing with the state-names, but I'm guessing
that it can be done in the same way...)
Sincerely,
Anna
|
|
|
|
|
Re: Changing and saving the value of a label? [message #217927 is a reply to message #217910] |
Mon, 09 February 2009 07:39  |
Eclipse User |
|
|
|
Hello Anna,
> default name should change to the one that I have chosen. Is this (the
> answer below) the way to achieve this? I want to know how I can reach
> the appropriate java-file (where the state/transition labels are set) from
> my wizard-code.
In this case the solution is simple - use selection in a wizard to get corresponding
EditPart. From an EditPart you can get underlying domain model element by
calling:
((org.eclipse.gmf.runtime.notation.View) EditPart.getModel()).getElement()
-----------------
Alex Shatalin
|
|
|
Powered by
FUDForum. Page generated in 0.05911 seconds