| Summary: | synchronized connections don't become visible/invisible | ||
|---|---|---|---|
| Product: | [Modeling] GMF-Runtime | Reporter: | Christian Waniek <chris.waniek> |
| Component: | General | Assignee: | Project Inbox <gmf-runtime-inbox> |
| Status: | RESOLVED DUPLICATE | QA Contact: | |
| Severity: | blocker | ||
| Priority: | P5 | ||
| Version: | 2.3.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
|
Description
Christian Waniek
If anyone knows a workaraound for this problem (e.g. overwrite a template), then it would be great if this workaraound could be posted here, so I can adapt it until the bug is fixed in GMF directly. Because we need a solution for this problem fast, I set the priority to P5. As a workaround for the first scenario you can include the following code in the handleNotifications() method of the DiagramEditPart. Maybe yu have to replace Connector by Edge.
@Override
protected void handleNotificationEvent(Notification event) {
super.handleNotificationEvent(event);
// FIXME Workaround for the case that there exists an Edge
// in the semantic model, but not yet in the notation
// model. So we need to render the Edge on the fly.
Object newValue = event.getNewValue();
if (newValue instanceof Connector) {
Map<View, EditPart> registry = getViewer().getEditPartRegistry();
Connector connector = (Connector) newValue;
// if the connection edit part already exists,
//just do nothing and return
if (registry.get(connector) != null) {
return;
}
EditPart sourceEditPart = registry.get(connector.getSource());
EditPart targetEditPart = registry.get(connector.getTarget());
// trigger an explicit refresh to create the connection edit part
// and draw the link
if (sourceEditPart != null && targetEditPart != null) {
sourceEditPart.refresh();
targetEditPart.refresh();
}
}
}
With this workaround links, which doesn't exist in the diagram but in the model file, are synchronized to the diagram. Once the link exists it can be edited in the diagram editor as you would expect it.
The problem has been fixed in the 2.4.0M5 build. *** This bug has been marked as a duplicate of bug 314670 *** |