Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » GMF Element(s) Selection(How to tell an editor which nodes to select)
GMF Element(s) Selection [message #661350] Thu, 24 March 2011 10:48 Go to next message
Ioana  is currently offline Ioana Friend
Messages: 6
Registered: March 2011
Junior Member

having a GMF Diagram and a selected node, I want to select from this diagram all the nodes that are related(through egdes) to my initial selected node , or to draw them in a different way (e.g. another color or font).

Does someone has a clue how can I tell my editor to select the nodes and the edges that I want?Or to change their color/font?


Re: GMF Element(s) Selection [message #661411 is a reply to message #661350] Thu, 24 March 2011 14:51 Go to previous message
Giovanni De Sossi is currently offline Giovanni De SossiFriend
Messages: 161
Registered: October 2009
Location: Rome, Italy
Senior Member

Hi Ioana,

try this:

DiagramDocumentEditor editorPart = (DiagramDocumentEditor) page.findEditor(editorInput);
diagramEditPart = ((IDiagramWorkbenchPart) editorPart).getDiagramEditPart();
List<ShapeNodeEditPart> editParts = (List<ShapeNodeEditPart>) diagramEditPart.getChildren();

for (ShapeNodeEditPart part : editParts) {

this should do the trick.


Previous Topic:GMF: Save operation
Next Topic:Problem with GMF editor embedded in SharedHeaderFormEditor.
Goto Forum:

Current Time: Fri Mar 05 14:36:05 GMT 2021

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

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

Back to the top