diff --git a/gemsfx/src/main/java/com/dlsc/gemsfx/util/ResizingBehaviour.java b/gemsfx/src/main/java/com/dlsc/gemsfx/util/ResizingBehaviour.java index 1ec96b0e..5421fa48 100644 --- a/gemsfx/src/main/java/com/dlsc/gemsfx/util/ResizingBehaviour.java +++ b/gemsfx/src/main/java/com/dlsc/gemsfx/util/ResizingBehaviour.java @@ -2,6 +2,7 @@ import javafx.beans.property.BooleanProperty; import javafx.beans.property.DoubleProperty; +import javafx.beans.property.ListProperty; import javafx.beans.property.ObjectProperty; import javafx.beans.property.SimpleBooleanProperty; import javafx.beans.property.SimpleDoubleProperty; @@ -373,7 +374,7 @@ public final void setResizable(boolean resizable) { resizableProperty().set(resizable); } - private SimpleListProperty supportedOperations; + private final ListProperty supportedOperations = new SimpleListProperty<>(this, "supportedOperations", FXCollections.observableArrayList(Operation.values())); /** * The list of supported operations for resizing the region. @@ -382,15 +383,12 @@ public final void setResizable(boolean resizable) { * * @return the list of supported operations */ - public final SimpleListProperty supportedOperationsProperty() { - if (supportedOperations == null) { - supportedOperations = new SimpleListProperty<>(this, "supportedOperations", FXCollections.observableArrayList(Operation.values())); - } + public final ListProperty supportedOperationsProperty() { return supportedOperations; } public final ObservableList getSupportedOperations() { - return supportedOperations == null ? FXCollections.observableArrayList(Operation.values()) : supportedOperations.get(); + return supportedOperations.get(); } public final void setSupportedOperations(ObservableList supportedOperations) {