Package at.bestsolution.efxclipse.text.test.app.sample.jscanners

Examples of at.bestsolution.efxclipse.text.test.app.sample.jscanners.JavaTextTools


   
//    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());
   
    Scene s = new Scene(mainPane);
    s.getStylesheets().add(MainApplication.class.getResource("test.css").toExternalForm());
View Full Code Here


  }
 
  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;
  }
View Full Code Here

TOP

Related Classes of at.bestsolution.efxclipse.text.test.app.sample.jscanners.JavaTextTools

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.