Select DiagramEditpart after opening the Diagram to show the propertysheet for the same. [message #1698431] |
Mon, 15 June 2015 16:25 |
|
HI All,
I am trying the following code in async call after i called the diagram open programmatically. but the diagrameditpart is always non selectable. Can I do it any other way ???
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
if (iw != null) {
IEditorPart editorPart = iw.getActivePage().getActiveEditor();
if (editorPart instanceof MappingEditor) {
RootEditPart rootEditPart = ((EMappingEditor) editorPart).getDiagramBehavior().getDiagramContainer().getGraphicalViewer().getRootEditPart();
GraphicalViewer viewer = ((EMappingEditor) editorPart).getDiagramBehavior().getDiagramContainer().getGraphicalViewer();
if (rootEditPart.getChildren() != null && rootEditPart.getChildren().size() > 0) {
DiagramEditPart diagramEditPart = (DiagramEditPart) rootEditPart.getChildren().get(0);
if (diagramEditPart.isSelectable()) {
viewer.reveal(diagramEditPart);
viewer.select(diagramEditPart);
}
}
}
}
}
});
Regards,
Abhishek Chakraborty
|
|
|
|
Powered by
FUDForum. Page generated in 0.03334 seconds