Hi all,
I need to be able to iterate through ALL nodes of a CERTAIN TYPE that
have been created within my GMF editor. My idea is to be able to alter
the nodes line color IF one of their properties is set to a specific value.
The first thing I therefore need to do is to be able to ïselectï all the
nodes (note: I want to do this in the using a program not graphically)
so I can iterate through them.
I have a popup menu that is accessed by right clicking the blank space
of the editor (I have called this space the Canvas in the GMF model).
The IAction I have so far is below but Iïm not sure how to ïselectï the
nodes so I can iterate through them.
Could someone suggest how I might do this so I can firstly check one of
their properties and secondly change their line color if necessary?
(When the user calls this IAction I need all nodes to be iterated
through, irrelevant if none, some, all nodes have been graphically
selected within the GMF editor.)
Thanks for your help,
Gaff
Type of node trying to iterate through: AAA
public class HighlightPropertiesAction implements IObjectActionDelegate {
private CanvasEditPart editParter;
public void run(IAction action) {
IGraphicalEditPart editPart = (IGraphicalEditPart) editParter;
EObject modelElement = editPart.resolveSemanticElement();
Canvas my_canvas = (Canvas) modelElement;
List <AAA> list_of_aaa = my_canvas.getAAA();
// I know this will get a list of AAA nodes but probably isnït much help
as I need to alter the nodes graphically.
}
public void selectionChanged(IAction action, ISelection selection) {
//???
}
public void setActivePart(IAction action, IWorkbenchPart targetPart) {
}
}
??Possibly what I should be doing is iterating through the nodes and
selecting the nodes that have their properties is set to specific value
THEN changing all their line colors in one go rather than doing each
individually.??