| Edit the actions to do when a property is changed [message #752822] |
Wed, 26 October 2011 10:31  |
Eclipse User |
|
|
|
Hi everybody,
Where can I edit the activities to do when a property of a block is changed? The property I am talking about is not an attribute, is a reference to another block, so it does not appear in the *.diagram.edit.parts as a BlockAttributeEditPart.java file.
In my project, I have some objects called "task", which have a reference to another object called "customtask". The reference appears in properties to the "task" object, so the user has to specify it by selecting one of the declared "customtask"s of in the properties window.
Till now, I managed to do it by editing the "SetReference" command in the TaskImpl.java file in the "MyProgram" directory, but now I need to call a command that is placed in the "MyProgram.diagram" directory, so I need one of the followings:
a) Make an Import to a file that is outside the "MyProgram" directory, and then call the required command.
b) Edit the code of a file in the MyProgram.diagram directory instead of the one in "TaskImpl.java" file, in case it exists a code which is called every time a change is made in a property (take into account that the property is not changed directly in the diagram, but in the properties window).
Does anybody know how to do any of these?
[Updated on: Wed, 02 November 2011 07:24] by Moderator
|
|
|
|
|
|
|
| Re: How to refresh the diagram [message #754372 is a reply to message #754331] |
Wed, 02 November 2011 07:21  |
Eclipse User |
|
|
|
Hello,
I have noticed that the following behaves as pressing the F5 button, so I can use it sometimes:
((ModuleCanonicalEditPolicy)(this.getParent().getEditPolicy(EditPolicyRoles.CANONICAL_ROLE))).refresh();
but in some other cases, F5 does not update the diagram (so the former code doesn't either), and I need to close and open the diagram again to get it updated. Does anybody know which code updates the diagram as closing and opening it again does?
Thanks in advance,
Iban
|
|
|
Powered by
FUDForum. Page generated in 0.04176 seconds