jfxtras.labs.scene.control.edittable.triple.Triple Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jfxtras-labs Show documentation
Show all versions of jfxtras-labs Show documentation
Experimental components for JavaFX 2
package jfxtras.labs.scene.control.edittable.triple;
import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
public class Triple
{
private final ObjectProperty name = new SimpleObjectProperty(this, "name");
public ObjectProperty nameProperty() { return name; }
public void setName(A label) { this.name.set(label); }
public A getName() { return name.getValue(); }
public Triple withName(A value) { setName(value); return this; }
private final ObjectProperty value = new SimpleObjectProperty(this, "value");
public ObjectProperty valueProperty() { return value; }
public B getValue() { return value.getValue(); }
public void setValue(B value) {
this.value.set(value);
}
public boolean isEmpty() { return value.getValue() == null; }
public Triple withValue(B value) { setValue(value); return this; }
private final ObjectProperty primary = new SimpleObjectProperty(this, "primary");
public ObjectProperty primaryProperty() { return primary; }
public void setPrimary(C primary) { this.primary.set(primary); }
public C isPrimary() { return primary.getValue(); }
public Triple withPrimary(C value) { setPrimary(value); return this; }
@Override
public String toString() {
return "Triple [label=" + getName() + ", value=" + getValue() + ", primary=" + isPrimary() + "]";
}
}