Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import javafx.scene.layout.GridPane;
import javafx.scene.layout.VBox;
import javafx.stage.Stage;
import org.fxmisc.richtext.AreaFactory;
import org.fxmisc.richtext.InlineCssTextArea;

public class CloneDemo extends Application {
Expand All @@ -22,8 +21,8 @@ public void start(Stage primaryStage) {
String selectedText = "selection";
String text = "Edit the top area (original)\nand watch the (clone) bottom area's displayed text change and its " +
"selected text [" + selectedText + "] update itself accordingly.";
InlineCssTextArea area = AreaFactory.inlineCssTextArea(text);
InlineCssTextArea clone = AreaFactory.cloneInlineCssTextArea(area);
InlineCssTextArea area = new InlineCssTextArea(text);
InlineCssTextArea clone = new InlineCssTextArea(area.getContent());

VBox vbox = new VBox(area, clone);
vbox.setSpacing(10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import javafx.stage.Stage;

import org.fxmisc.flowless.VirtualizedScrollPane;
import org.fxmisc.richtext.AreaFactory;
import org.fxmisc.richtext.Paragraph;
import org.fxmisc.richtext.StyleSpans;
import org.fxmisc.richtext.StyledTextArea;
Expand All @@ -46,10 +45,8 @@ public static void main(String[] args) {
launch(args);
}

private final StyledTextArea<ParStyle, TextStyle> area =
AreaFactory.<ParStyle, TextStyle>styledTextArea(
ParStyle.EMPTY,
( paragraph, style) -> paragraph.setStyle(style.toCss()),
private final StyledTextArea<ParStyle, TextStyle> area = new StyledTextArea<>(
ParStyle.EMPTY, ( paragraph, style) -> paragraph.setStyle(style.toCss()),
TextStyle.EMPTY.updateFontSize(12).updateFontFamily("Serif").updateTextColor(Color.BLACK),
( text, style) -> text.setStyle(style.toCss()));
{
Expand Down
206 changes: 0 additions & 206 deletions richtextfx/src/main/java/org/fxmisc/richtext/AreaFactory.java

This file was deleted.

17 changes: 14 additions & 3 deletions richtextfx/src/main/java/org/fxmisc/richtext/StyledTextArea.java
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,20 @@
* style or style classes.</p>
*
* <p>Note: Scroll bars no longer appear when the content spans outside
* of the viewport. To add scroll bars, the area needs to be embedded in
* a {@link VirtualizedScrollPane}. {@link AreaFactory} is provided to make
* this more convenient.</p>
* of the viewport. To add scroll bars, the area needs to be wrapped in
* a {@link VirtualizedScrollPane}. For example, </p>
* <pre>
* {@code
* // shows area without scroll bars
* InlineCssTextArea area = new InlineCssTextArea();
*
* // add scroll bars that will display as needed
* VirtualizedScrollPane<InlineCssTextArea> vsPane = new VirtualizedScrollPane(area);
*
* Parent parent = //;
* parent.getChildren().add(vsPane)
* }
* </pre>
*
* <h3>Overriding keyboard shortcuts</h3>
*
Expand Down