final GraphEditorInput input = (GraphEditorInput) getEditorInput();
input.init();
final Graph graph = new Graph(input);
graph.init();
Display.getDefault().asyncExec(new Runnable() {
public void run() {
if (getGraphicalViewer() != null && getGraphicalViewer().getControl() != null) {
setPartName(input.getName());
setContentDescription(input.getToolTipText());
graph.layout(getGraphicalViewer().getControl().getFont());
getGraphicalViewer().setContents(graph);
}
}
});
}