Java Code Examples for com.dlsc.preferencesfx.model.Setting#of()

The following examples show how to use com.dlsc.preferencesfx.model.Setting#of() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: PreferencesDialog.java    From Quelea with GNU General Public License v3.0 5 votes vote down vote up
public static Setting getPositionSelector(String label, boolean horizontal, String selectedValue, BooleanProperty booleanBind, HashMap<Field, ObservableValue> bindings) {
    Setting setting;
    if (horizontal)
        setting = Setting.of(label, FXCollections.observableArrayList(LabelGrabber.INSTANCE.getLabel("left"), LabelGrabber.INSTANCE.getLabel("right")), new SimpleObjectProperty<>(LabelGrabber.INSTANCE.getLabel(selectedValue.toLowerCase())));
    else
        setting = Setting.of(label, FXCollections.observableArrayList(LabelGrabber.INSTANCE.getLabel("top.text.position"), LabelGrabber.INSTANCE.getLabel("bottom.text.position")), new SimpleObjectProperty<>(LabelGrabber.INSTANCE.getLabel(selectedValue.toLowerCase())));
    if (booleanBind != null)
        bindings.put(setting.getField(), booleanBind.not());
    return setting;
}
 
Example 2
Source File: PreferencesDialog.java    From Quelea with GNU General Public License v3.0 4 votes vote down vote up
public static Setting getColorPicker(String label, Color color) {
    StringProperty property = new SimpleStringProperty(QueleaProperties.get().getStr(color));
    StringField field = Field.ofStringType(property).render(
            new ColorPickerPreference(color));
    return Setting.of(label, field, property);
}