propagating selections/selected state [message #674017] |
Wed, 25 May 2011 14:02 |
Eclipse User |
|
|
|
Originally posted by: rbenjamin
for a tree of nodes, I'd like to select not only a node but also its
outbound connections and their endpoint nodes, and so on. Obviously
need to detect cycles. I have found no example of this. Any ideas?
Thanks
Roy
|
|
|
Re: propagating selections/selected state [message #674266 is a reply to message #674017] |
Thu, 26 May 2011 11:11 |
|
List<?> objectToCycle = new ArrayList<?>;
List<ShapeNodeEditPart> editParts = (List<ShapeNodeEditPart>) diagramEditPart.getChildren();
editorPart = (DiagramDocumentEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
diagramWorkbenchPart = (IDiagramWorkbenchPart) editorPart;
for (ShapeNodeEditPart part : editParts) {
if(((View) part.getModel()).getElement() == objectToCycle ){
diagramWorkbenchPart.getDiagramGraphicalViewer().appendSelection(part);
}
}
HTH, bye
Giovanni
|
|
|
Powered by
FUDForum. Page generated in 0.02509 seconds