Skip to content

Instantly share code, notes, and snippets.

@tschulte
Created April 14, 2016 08:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tschulte/ad698ea615da5d307300117a0e3c4fc6 to your computer and use it in GitHub Desktop.
Save tschulte/ad698ea615da5d307300117a0e3c4fc6 to your computer and use it in GitHub Desktop.
Handling of FXObservable Annotation for ObservableList, ObservableMap and ObservableSet
// Generated by delombok at Thu Apr 14 10:04:10 CEST 2016
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.collections.ObservableMap;
import javafx.collections.ObservableSet;
public class FXObservableListMapSet {
@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
private javafx.beans.property.ListProperty<java.lang.Integer> theListWithDefaultProperty;
@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
private javafx.beans.property.SetProperty<java.lang.Integer> theSetWithDefaultProperty;
@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
private javafx.beans.property.MapProperty<java.lang.String, java.lang.Integer> theMapWithDefaultProperty;
private ObservableMap<String, Integer> theMapWithDefault = FXCollections.observableHashMap();
private ObservableSet<Integer> theSetWithDefault = FXCollections.observableSet(42);
private ObservableList<Integer> theListWithDefault = FXCollections.observableArrayList(42);
@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public javafx.beans.property.MapProperty<java.lang.String, java.lang.Integer> theMapWithDefaultProperty() {
if (theMapWithDefaultProperty == null) theMapWithDefaultProperty = new javafx.beans.property.SimpleMapProperty<java.lang.String, java.lang.Integer>(theMapWithDefault);
return theMapWithDefaultProperty;
}
@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public ObservableMap<String, Integer> getTheMapWithDefault() {
return theMapWithDefaultProperty == null ? theMapWithDefault : theMapWithDefaultProperty.get();
}
@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public void setTheMapWithDefault(ObservableMap<String, Integer> value) {
if (theMapWithDefaultProperty == null) theMapWithDefault = value; else theMapWithDefaultProperty.set(value);
}
@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public javafx.beans.property.SetProperty<java.lang.Integer> theSetWithDefaultProperty() {
if (theSetWithDefaultProperty == null) theSetWithDefaultProperty = new javafx.beans.property.SimpleSetProperty<java.lang.Integer>(theSetWithDefault);
return theSetWithDefaultProperty;
}
@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public ObservableSet<Integer> getTheSetWithDefault() {
return theSetWithDefaultProperty == null ? theSetWithDefault : theSetWithDefaultProperty.get();
}
@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public void setTheSetWithDefault(ObservableSet<Integer> value) {
if (theSetWithDefaultProperty == null) theSetWithDefault = value; else theSetWithDefaultProperty.set(value);
}
@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public javafx.beans.property.ListProperty<java.lang.Integer> theListWithDefaultProperty() {
if (theListWithDefaultProperty == null) theListWithDefaultProperty = new javafx.beans.property.SimpleListProperty<java.lang.Integer>(theListWithDefault);
return theListWithDefaultProperty;
}
@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public ObservableList<Integer> getTheListWithDefault() {
return theListWithDefaultProperty == null ? theListWithDefault : theListWithDefaultProperty.get();
}
@java.lang.SuppressWarnings("all")
@javax.annotation.Generated("lombok")
public void setTheListWithDefault(ObservableList<Integer> value) {
if (theListWithDefaultProperty == null) theListWithDefault = value; else theListWithDefaultProperty.set(value);
}
}
import griffon.transform.FXObservable;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.collections.ObservableMap;
import javafx.collections.ObservableSet;
@FXObservable
public class FXObservableListMapSet {
private ObservableMap<String, Integer> theMapWithDefault = FXCollections.observableHashMap();
private ObservableSet<Integer> theSetWithDefault = FXCollections.observableSet(42);
private ObservableList<Integer> theListWithDefault = FXCollections.observableArrayList(42);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment