Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » propagating selections/selected state
propagating selections/selected state [message #674017] Wed, 25 May 2011 14:02 Go to next message
Eclipse UserFriend
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 Go to previous message
Giovanni De Sossi is currently offline Giovanni De SossiFriend
Messages: 161
Registered: October 2009
Location: Rome, Italy
Senior Member

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
Previous Topic:Display editor within node
Next Topic:How to create nodes programmatically?
Goto Forum:
  


Current Time: Sun Dec 01 18:41:27 GMT 2024

Powered by FUDForum. Page generated in 0.03237 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top