Question on refreshing relations [message #1039440] |
Fri, 12 April 2013 07:08 |
Claudio Heeg Messages: 75 Registered: April 2013 |
Member |
|
|
Hello,
I have created the following diagram on an editor, it should be fairly self-explanatory. Links to the DataType Parts (String, in this case) are hidden but technically exist.
So if I change the name of the Datatype (i.e. String to String_), the actual properties of the elements of that Datatype are renewed, however the diagram itself doesn't refresh and still shows "[attribute] : String", not "[attribute] : String_".
However, if I close and reopen the file containing the diagram, attributes are shown correctly.
I've looked around on where I have to call what kind of refresh here, but I am kind of at a loss.
-
Attachment: model.png
(Size: 7.42KB, Downloaded 179 times)
|
|
|
|
|
|
|
Re: Question on refreshing relations [message #1041652 is a reply to message #1041642] |
Mon, 15 April 2013 11:22 |
Claudio Heeg Messages: 75 Registered: April 2013 |
Member |
|
|
Well what I do now is calling the refresh from the DatatypeNameEditPart and the EntityNameEditPart respectively.
For that I have to move through the EditPart hierarchy to find the corresponding WrappingLabelEditPart and call its refresh method.
Code called in the respective handleNotificationEvent methods via refreshLabels(this.getRoot()):
private void refreshLabels(EditPart ePart) {
if (ePart instanceof WrappingLabelEditPart) {
((WrappingLabelEditPart) ePart).refreshLabel();
return;
}
if (ePart.getChildren()==null) return;
else
for (Object child : ePart.getChildren())
refreshLabels((EditPart) child);
}
This does work as I want it to but I fear that this is firstly inefficient and secondly, as the handleNotificationEvent methods are also generated, might have to be redone after every nontrivial change.
I am also still wondering why that label refresh is not called by default on F5?
[Updated on: Mon, 15 April 2013 11:34] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.04073 seconds