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 06:48 Go to next message
Ioana  is currently offline Ioana
Messages: 6
Registered: March 2011
Junior Member
Hi,

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?

Thanks,

Ioana
Re: GMF Element(s) Selection [message #661411 is a reply to message #661350] Thu, 24 March 2011 10:51 Go to previous message
Giovanni De Sossi is currently offline Giovanni De Sossi
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) {
part.setSelected(EditPart.SELECTED);
}


this should do the trick.

Bye,

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


Current Time: Thu Apr 24 01:28:05 EDT 2014

Powered by FUDForum. Page generated in 0.29419 seconds