}
private StackPane createSourceViewerPane(File file) {
StackPane pane = new StackPane();
JavaTextTools t = new JavaTextTools();
Map<String, ITokenScanner> scanners = new HashMap<>();
scanners.put(IDocument.DEFAULT_CONTENT_TYPE, t.getCodeScanner());
scanners.put(IJavaPartitions.JAVA_DOC, t.getJavaDocScanner());
scanners.put(IJavaPartitions.JAVA_MULTI_LINE_COMMENT,
t.getMultilineCommentScanner());
scanners.put(IJavaPartitions.JAVA_SINGLE_LINE_COMMENT,
t.getSinglelineCommentScanner());
scanners.put(IJavaPartitions.JAVA_STRING, t.getStringScanner());
scanners.put(IJavaPartitions.JAVA_CHARACTER, t.getStringScanner());
StyledTextArea styledText = new StyledTextArea();
pane.getChildren().add(styledText);
IDocument doc = new Document(getFileContent(file));
SimpleSourceViewer viewer = new SimpleSourceViewer(styledText,
t.createDocumentPartitioner(), scanners);
viewer.setDocument(doc);
return pane;
}