Skip to content

Commit

Permalink
Merge pull request #172 from dlsc-software-consulting-gmbh/fix-suppor…
Browse files Browse the repository at this point in the history
…tedOperations-bug

Fix bug in supportedOperations property initialization
  • Loading branch information
dlemmermann authored May 10, 2024
2 parents 7b38475 + b6bbe94 commit ad87903
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions gemsfx/src/main/java/com/dlsc/gemsfx/util/ResizingBehaviour.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -373,7 +374,7 @@ public final void setResizable(boolean resizable) {
resizableProperty().set(resizable);
}

private SimpleListProperty<Operation> supportedOperations;
private final ListProperty<Operation> supportedOperations = new SimpleListProperty<>(this, "supportedOperations", FXCollections.observableArrayList(Operation.values()));

/**
* The list of supported operations for resizing the region.
Expand All @@ -382,15 +383,12 @@ public final void setResizable(boolean resizable) {
*
* @return the list of supported operations
*/
public final SimpleListProperty<Operation> supportedOperationsProperty() {
if (supportedOperations == null) {
supportedOperations = new SimpleListProperty<>(this, "supportedOperations", FXCollections.observableArrayList(Operation.values()));
}
public final ListProperty<Operation> supportedOperationsProperty() {
return supportedOperations;
}

public final ObservableList<Operation> getSupportedOperations() {
return supportedOperations == null ? FXCollections.observableArrayList(Operation.values()) : supportedOperations.get();
return supportedOperations.get();
}

public final void setSupportedOperations(ObservableList<Operation> supportedOperations) {
Expand Down

0 comments on commit ad87903

Please sign in to comment.