本文整理汇总了Java中org.fxmisc.richtext.CodeArea.getText方法的典型用法代码示例。如果您正苦于以下问题:Java CodeArea.getText方法的具体用法?Java CodeArea.getText怎么用?Java CodeArea.getText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.fxmisc.richtext.CodeArea
的用法示例。
在下文中一共展示了CodeArea.getText方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: compute
import org.fxmisc.richtext.CodeArea; //导入方法依赖的package包/类
public void compute(CodeArea codeArea) {
this.codeArea = codeArea;
currText = codeArea.getText();
clearPrevHighlight();
highlightParents();
}
示例2: computeHighlightingAsync
import org.fxmisc.richtext.CodeArea; //导入方法依赖的package包/类
private Task<StyleSpans<Collection<String>>> computeHighlightingAsync() {
CodeArea codeArea = view.getCodeArea();
String sourcecode = codeArea.getText();
Task<StyleSpans<Collection<String>>> task = new Task<StyleSpans<Collection<String>>>() {
@Override protected StyleSpans<Collection<String>> call()
throws Exception {
return computeHighlighting(sourcecode);
}
};
executor.execute(task);
return task;
}
示例3: doSave
import org.fxmisc.richtext.CodeArea; //导入方法依赖的package包/类
@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);
}
}
示例4: postSave
import org.fxmisc.richtext.CodeArea; //导入方法依赖的package包/类
@Override
@FXThread
protected void postSave() {
super.postSave();
final CodeArea codeArea = getCodeArea();
final String newContent = codeArea.getText();
setOriginalContent(newContent);
updateDirty(newContent);
}
示例5: BabystepsService
import org.fxmisc.richtext.CodeArea; //导入方法依赖的package包/类
/**
* Counstructs babysteps service
*
* @param counterLabel
*/
public BabystepsService(Exercise exercise, Label timeLabel, CodeArea codeArea) {
this.exercise = exercise;
this.timeLabel = timeLabel;
finishedTask = false;
this.cachedContent = new String(codeArea.getText());
this.sourceCodeArea = codeArea;
if(!exercise.getConfig().isBabySteps())
timeLabel.setText(exercise.getName());
}
示例6: computeHighlightingAsync
import org.fxmisc.richtext.CodeArea; //导入方法依赖的package包/类
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;
}
示例7: setCodeArea
import org.fxmisc.richtext.CodeArea; //导入方法依赖的package包/类
/**
* @param sourceCodeArea the sourceCodeArea to set
*/
public void setCodeArea(CodeArea sourceCodeArea) {
this.sourceCodeArea = sourceCodeArea;
this.cachedContent = new String(sourceCodeArea.getText());
}