Example usage for com.jgoodies.binding.value ConverterFactory createBooleanNegator

List of usage examples for com.jgoodies.binding.value ConverterFactory createBooleanNegator

Introduction

In this page you can find the example usage for com.jgoodies.binding.value ConverterFactory createBooleanNegator.

Prototype

public static ValueModel createBooleanNegator(ValueModel booleanSource) 

Source Link

Document

Creates and returns a ValueModel that negates Booleans and leaves null unchanged.

Usage

From source file:org.drugis.addis.gui.MeasurementInputHelper.java

License:Open Source License

public static JFormattedTextField buildFormatted(ValueModel model, ValueModel disabledModel,
        AbstractFormatter formatter) {//from   ww  w  . j a v  a  2s. com
    final JFormattedTextField field = new JFormattedTextField(
            new DefaultFormatterFactory(formatter, formatter, formatter, formatter));
    PropertyConnector.connectAndUpdate(model, field, "value");
    PropertyConnector.connectAndUpdate(ConverterFactory.createBooleanNegator(disabledModel), field, "enabled");
    field.setColumns(5);
    return field;
}

From source file:org.drugis.mtc.gui.ValidationPanel.java

License:Open Source License

private JLabel buildErrorLabel(ValueModel validator, String errorText) {
    JLabel notEmptyLabel = new JLabel(errorText);
    notEmptyLabel.setForeground(Color.RED);
    Bindings.bind(notEmptyLabel, "visible", ConverterFactory.createBooleanNegator(validator));
    return notEmptyLabel;
}