Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug in supportedOperations property initialization #172

Merged
merged 1 commit into from
May 10, 2024
Merged
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
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
Loading