本文整理汇总了Java中org.fxmisc.richtext.StyledTextArea类的典型用法代码示例。如果您正苦于以下问题:Java StyledTextArea类的具体用法?Java StyledTextArea怎么用?Java StyledTextArea使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
StyledTextArea类属于org.fxmisc.richtext包,在下文中一共展示了StyledTextArea类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: highlightParagraphDifference
import org.fxmisc.richtext.StyledTextArea; //导入依赖的package包/类
private void highlightParagraphDifference() {
Collection styleClass = Collections.singleton("diff");
for (Pair<Pair<Integer, Integer>, Pair<Integer, Integer>> ppair : paragraphDiffList) {
for (int i = ppair.getFirst().getFirst(); i< ppair.getFirst().getFirst() + ppair.getFirst().getSecond(); i++) {
if(i < oldCodeArea.getParagraphs().size()) {
((StyledTextArea) oldCodeArea).setParagraphStyle(i, styleClass);
}
}
for (int i = ppair.getSecond().getFirst(); i< ppair.getSecond().getFirst() + ppair.getSecond().getSecond(); i++) {
if(i < newCodeArea.getParagraphs().size()) {
((StyledTextArea) newCodeArea).setParagraphStyle(i, styleClass);
}
}
}
}
开发者ID:iazarny,项目名称:gitember,代码行数:17,代码来源:DiffViewController.java
示例2: testForBug216
import org.fxmisc.richtext.StyledTextArea; //导入依赖的package包/类
@Test
public void testForBug216() {
interact(() -> {
// set up area with some styled text content
boolean initialStyle = false;
StyledTextArea<String, Boolean> area = new StyledTextArea<>(
"", (t, s) -> {},
initialStyle, (t, s) -> {},
new SimpleEditableStyledDocument<>("", initialStyle), true
);
area.replaceText("testtest");
area.setStyle(0, 8, true);
// add a space styled by initialStyle
area.setUseInitialStyleForInsertion(true);
area.insertText(4, " ");
// add another space
area.insertText(5, " ");
// testing that undo/redo don't throw an exception
area.undo();
area.redo();
});
}
开发者ID:FXMisc,项目名称:RichTextFX,代码行数:26,代码来源:UndoManagerTests.java
示例3: bindLineNumber
import org.fxmisc.richtext.StyledTextArea; //导入依赖的package包/类
private static void bindLineNumber(StyledTextArea<?, ?> textArea, IntFunction<Node> factory) {
Options.showLineNo.property().addListener((ob, o, n) -> {
if (n) {
textArea.setParagraphGraphicFactory(factory);
} else {
textArea.setParagraphGraphicFactory(null);
}
});
if (Options.showLineNo.get()) {
textArea.setParagraphGraphicFactory(factory);
}
}
开发者ID:XDean,项目名称:CSS-Editor-FX,代码行数:13,代码来源:CodeAreaManager.java
示例4: MarkedLineNumberFactory
import org.fxmisc.richtext.StyledTextArea; //导入依赖的package包/类
private MarkedLineNumberFactory(StyledTextArea<?, ?> area, IntFunction<String> format) {
this.area = area;
nParagraphs = LiveList.sizeOf(area.getParagraphs());
this.format = format;
lineMarkFactory.set(defaultLineMarkFactory());
graphicsMapperFactory.set(defaultGraphicsMapperFactory());
}
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:8,代码来源:MarkedLineNumberFactory.java
示例5: DiffLineNumberFactory
import org.fxmisc.richtext.StyledTextArea; //导入依赖的package包/类
private DiffLineNumberFactory(
StyledTextArea<?, ?> area,
IntFunction<String> format,
List<Pair<Integer, Integer>> highlightList) {
nParagraphs = LiveList.sizeOf(area.getParagraphs());
this.format = format;
this.highlightList = highlightList;
}
开发者ID:iazarny,项目名称:gitember,代码行数:9,代码来源:DiffLineNumberFactory.java
示例6: createNode
import org.fxmisc.richtext.StyledTextArea; //导入依赖的package包/类
private Node createNode(StyledSegment<Either<String, LinkedImage>, TextStyle> seg,
BiConsumer<? super TextExt, TextStyle> applyStyle) {
return seg.getSegment().unify(
text -> StyledTextArea.createStyledTextNode(text, seg.getStyle(), applyStyle),
LinkedImage::createNode
);
}
开发者ID:FXMisc,项目名称:RichTextFX,代码行数:8,代码来源:RichText.java
示例7: LineNumberFunction
import org.fxmisc.richtext.StyledTextArea; //导入依赖的package包/类
private LineNumberFunction(StyledTextArea<?, ?> area, IntFunction<String> format) {
paragraphs = LiveList.sizeOf(area.getParagraphs());
this.format = format;
}
开发者ID:kasirgalabs,项目名称:ETUmulator,代码行数:5,代码来源:LineNumberFunction.java
示例8: applyTo
import org.fxmisc.richtext.StyledTextArea; //导入依赖的package包/类
public static IntFunction<Node> applyTo(StyledTextArea<?, ?> area) {
return new LineNumberFunction(area, digits -> "%" + digits + "d");
}
开发者ID:kasirgalabs,项目名称:ETUmulator,代码行数:4,代码来源:LineNumberFunction.java
示例9: get
import org.fxmisc.richtext.StyledTextArea; //导入依赖的package包/类
public static IntFunction<Node> get(StyledTextArea<?, ?> area) {
return get(area, digits -> "%0" + digits + "d");
}
开发者ID:callakrsos,项目名称:Gargoyle,代码行数:4,代码来源:MarkedLineNumberFactory.java
示例10: ArrowFactory
import org.fxmisc.richtext.StyledTextArea; //导入依赖的package包/类
public ArrowFactory(StyledTextArea<?, ?> area) {
this.area =area;
this.shownLine = area.currentParagraphProperty();
}
开发者ID:iazarny,项目名称:gitember,代码行数:5,代码来源:ArrowFactory.java
示例11: get
import org.fxmisc.richtext.StyledTextArea; //导入依赖的package包/类
public static IntFunction<Node> get(
StyledTextArea<?, ?> area,
List<Pair<Integer, Integer>> highlightList) {
return get(area, digits -> "%0" + digits + "d", highlightList);
}
开发者ID:iazarny,项目名称:gitember,代码行数:6,代码来源:DiffLineNumberFactory.java
示例12: hasText
import org.fxmisc.richtext.StyledTextArea; //导入依赖的package包/类
@Factory
@Unstable(reason = "is missing apidocs")
public static Matcher<Node> hasText(String string) {
String descriptionText = "has text \"" + string + "\"";
return typeSafeMatcher(StyledTextArea.class, descriptionText, node -> hasText(node, string));
}
开发者ID:aalmiray,项目名称:javatrove,代码行数:7,代码来源:StyledTextAreaMatchers.java
示例13: containsText
import org.fxmisc.richtext.StyledTextArea; //导入依赖的package包/类
@Factory
@Unstable(reason = "is missing apidocs")
public static Matcher<Node> containsText(String string) {
String descriptionText = "contains text \"" + string + "\"";
return typeSafeMatcher(StyledTextArea.class, descriptionText, node -> containsText(node, string));
}
开发者ID:aalmiray,项目名称:javatrove,代码行数:7,代码来源:StyledTextAreaMatchers.java
示例14: lookupText
import org.fxmisc.richtext.StyledTextArea; //导入依赖的package包/类
private static String lookupText(StyledTextArea text) {
return text.getText();
}
开发者ID:aalmiray,项目名称:javatrove,代码行数:4,代码来源:StyledTextAreaMatchers.java
注:本文中的org.fxmisc.richtext.StyledTextArea类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论