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
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 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) {
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 18 03:19:42 GMT 2024

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

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

Back to the top