// mainPane.setCenter(createSourceViewerPane(new File("/Users/tomschindl/git/e-fx-clipse/at.bestsolution.efxclipse.text.test.app/sample/Grid.java")));
IDocument document = new Document(getFileContent(new File("/Users/tomschindl/git/e-fx-clipse/at.bestsolution.efxclipse.text.test.app/sample/Grid.java")));
final SourceViewer viewer = new SourceViewer();
JavaTextTools textTools = new JavaTextTools();
viewer.configure(new JavaSourceViewerConfiguration(textTools));
textTools.setupJavaDocumentPartitioner(document, IJavaPartitions.JAVA_PARTITIONING);
viewer.setDocument(document);
mainPane.setCenter(viewer.getLayoutNode());