IWorkbenchPage page = PlatformUI.getWorkbench()
.getActiveWorkbenchWindow().getActivePage();
IEditorPart editor = page.getActiveEditor();
if (editor instanceof DAForJavaGraphEditor) {
DAForJavaGraphEditor graphEditor = (DAForJavaGraphEditor) editor;
fMonitor.worked(10);
// AbstractSelectionHandler selectionHandler = new JavaElementSelectionHandler(graphEditor.getPanel().getGraphLoader().getSnapshotAnalyzer());
// List<AbstractFamixEntity> entities = selectionHandler.getSelectedEntities(fSelection);
AbstractSelectionHandler selectionHandler = SelectionHandlerFactory.getInstance().getSelectionHandler(fSelection);
List<AbstractFamixEntity> entities = selectionHandler.getSelectedEntities(graphEditor.getPanel().getGraphLoader().getSnapshotAnalyzer());
AbstractGraphEditCommand command = new AddEntitiesCommand(entities, graphEditor.getPanel().getGraphLoader(), graphEditor.getPanel().getEdgeGrouper());
graphEditor.getPanel().getCommandController().executeCommand(command);
fMonitor.worked(25);
} else {
System.err.println("Editor is not a graph editor - select an active graph editor first");
}