List of usage examples for com.jgoodies.binding.value ConverterFactory createBooleanNegator
public static ValueModel createBooleanNegator(ValueModel booleanSource)
null unchanged. 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; }