Java Code Examples for org.fxmisc.richtext.CodeArea#getText()

The following examples show how to use org.fxmisc.richtext.CodeArea#getText() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CodeAreaConfigurator.java    From kafka-message-tool with MIT License 5 votes vote down vote up
private static Task<StyleSpans<Collection<String>>> computeHighlightingAsync(CodeArea codeArea,
                                                                             Pattern pattern,
                                                                             Function<Matcher, String> getStyleClassFunction,
                                                                             Executor executor) {
    String text = codeArea.getText();
    Task<StyleSpans<Collection<String>>> task = new Task<StyleSpans<Collection<String>>>() {
        @Override
        protected StyleSpans<Collection<String>> call() throws Exception {
            return computeHighlighting(text, pattern, getStyleClassFunction);
        }
    };
    executor.execute(task);
    return task;
}
 
Example 2
Source File: CodeAreaFileEditor.java    From jmonkeybuilder with Apache License 2.0 5 votes vote down vote up
@Override
@BackgroundThread
public void doSave(@NotNull final Path toStore) throws IOException {
    super.doSave(toStore);

    final CodeArea codeArea = getCodeArea();
    final String newContent = codeArea.getText();

    try (final PrintWriter out = new PrintWriter(Files.newOutputStream(toStore))) {
        out.print(newContent);
    }
}
 
Example 3
Source File: CodeAreaFileEditor.java    From jmonkeybuilder with Apache License 2.0 5 votes vote down vote up
@Override
@FxThread
protected void postSave() {
    super.postSave();

    final CodeArea codeArea = getCodeArea();
    final String newContent = codeArea.getText();

    setOriginalContent(newContent);
    updateDirty(newContent);
}
 
Example 4
Source File: DisassemblerView.java    From standalone-app with Apache License 2.0 5 votes vote down vote up
private Task<StyleSpans<Collection<String>>> computeHighlightingAsync(CodeArea codeArea) {
    String text = codeArea.getText();
    Task<StyleSpans<Collection<String>>> task = new Task<StyleSpans<Collection<String>>>() {
        @Override
        protected StyleSpans<Collection<String>> call() throws Exception {
            return computeHighlighting(text);
        }
    };
    Executors.newSingleThreadExecutor().execute(task);
    return task;
}
 
Example 5
Source File: DecompilerView.java    From standalone-app with Apache License 2.0 5 votes vote down vote up
private Task<StyleSpans<Collection<String>>> computeHighlightingAsync(CodeArea codeArea) {
    String text = codeArea.getText();
    Task<StyleSpans<Collection<String>>> task = new Task<StyleSpans<Collection<String>>>() {
        @Override
        protected StyleSpans<Collection<String>> call() throws Exception {
            return computeHighlighting(text);
        }
    };
    Executors.newSingleThreadExecutor().execute(task);
    return task;
}