getting objects from diagarm file [message #655727] |
Tue, 22 February 2011 08:35  |
Eclipse User |
|
|
|
hi i am using gmf for my graphical editor
i want to get the object in the diagarm file using the diagram file object. how is that possible
can you please give the code snippet
the below is my function
i want to an specific object and its attribute
TestCase is an object in my diagram file/ecore model that contains other objects
i want to get the name of testcase object
public String getTestCaseName(ExecutionEvent event)
{
ISelection currentSelection = HandlerUtil.getCurrentSelection(event);
if (currentSelection instanceof IStructuredSelection) {
IStructuredSelection ss = (IStructuredSelection)currentSelection;
if (!ss.isEmpty()) {
Object so = ss.getFirstElement();
if (so instanceof EditPart) {
Object m = ((EditPart)so).getModel();
if (m instanceof EObject) {
EObject eo=(EObject)m;
DiagramImpl di=(DiagramImpl)eo;
Diagram d=di.basicGetDiagram();
}
}
}
}
return null;
}
}
please reply
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.07635 seconds