Skip to content

Commit

Permalink
bind selection property (#299)
Browse files Browse the repository at this point in the history
  • Loading branch information
jperedadnr authored Jan 15, 2024
1 parent 5f04142 commit f48921c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions rta/src/main/java/com/gluonhq/richtextarea/RichTextArea.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2023, Gluon
* Copyright (c) 2022, 2024, Gluon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -180,7 +180,7 @@ public final ReadOnlyObjectProperty<Selection> selectionProperty() {
public final Selection getSelection() {
return selectionProperty.get();
}
private final ReadOnlyObjectWrapper<Selection> selectionProperty = new ReadOnlyObjectWrapper<>(this, "selection", Selection.UNDEFINED);
final ReadOnlyObjectWrapper<Selection> selectionProperty = new ReadOnlyObjectWrapper<>(this, "selection", Selection.UNDEFINED);

// textLengthProperty
/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2022, 2023, Gluon
* Copyright (c) 2022, 2024, Gluon
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -652,6 +652,7 @@ public void dispose() {
getSkinnable().tableAllowedProperty().removeListener(tableAllowedListener);
getSkinnable().textLengthProperty.unbind();
getSkinnable().modifiedProperty.unbind();
getSkinnable().selectionProperty.unbind();
getSkinnable().setOnKeyPressed(null);
getSkinnable().setOnKeyTyped(null);
getSkinnable().widthProperty().removeListener(controlPrefWidthListener);
Expand Down Expand Up @@ -715,6 +716,7 @@ private void setup(Document document) {
promptNode.fontProperty().bind(promptFontBinding);
getSkinnable().textLengthProperty.bind(viewModel.textLengthProperty());
getSkinnable().modifiedProperty.bind(viewModel.savedProperty().not());
getSkinnable().selectionProperty.bind(viewModel.selectionProperty());
getSkinnable().setOnContextMenuRequested(contextMenuEventEventHandler);
getSkinnable().editableProperty().addListener(this::editableChangeListener);
getSkinnable().tableAllowedProperty().addListener(tableAllowedListener);
Expand Down

0 comments on commit f48921c

Please sign in to comment.