public <T extends Enum<?> & ModelUpdate> void update(T... changed) { try { String text = ""; Object obj = mutator.get(); if (obj != null) { text = obj.toString(); } label.setText(text); } catch (Exception ex) { Wiring.logger.error("exception in JLabel binding", ex); } } };
public <T extends Enum<?> & ModelUpdate> void update(T... changed) { try { String string = (String)mutator.get(); if (string == null) { string = ""; } if (!string.equals(textField.getText())) { textField.setText(string); } } catch (Exception ex) { Wiring.logger.error("exception in JTextField binding", ex); } } };
public <T extends Enum<?> & ModelUpdate> void update(T... changed) { try { Object current = mutator.get(); if (current == null) { current = nullValue; } if (!Objects.equal(combo.getSelectedItem(), current)) { combo.setSelectedItem(current); } } catch (Exception ex) { logger.error("could not invoke JComboBox binding", ex); } } };
public <T extends Enum<?> & ModelUpdate> void update(T... changed) { if (!BindingContext.isOn(ons, changed)) { return; } try { updateComboModel(combo, (List<?>)mutator.get(), nullValue); } catch (Exception ex) { Wiring.logger.error("exception in JList binding", ex); } } };
public <T extends Enum<?> & ModelUpdate> void update(T... changed) { try { abstractButton.setSelected((Boolean)mutator.get()); } catch (Exception ex) { Wiring.logger.error("exception in AbstractButton binding", ex); } } };
public <T extends Enum<?> & ModelUpdate> void update(T... changed) { try { button.setSelected(mutator.get().equals(Boolean.valueOf(booleanValue))); } catch (Exception ex) { Wiring.logger.error("exception in JRadioButton binding", ex); //$NON-NLS-1$ } } };
public <T extends Enum<?> & ModelUpdate> void update(T... changed) { try { button.setSelected(mutator.get() == enumValue); } catch (Exception ex) { Wiring.logger.error("exception in JToggleButton binding", ex); //$NON-NLS-1$ } } };
public <T extends Enum<?> & ModelUpdate> void update(T... changed) { if (!BindingContext.isOn(ons, changed)) { return; } try { updateListModel(list, (List<?>)mutator.get()); } catch (Exception ex) { Wiring.logger.error("exception in JList binding", ex); } } };
public void itemStateChanged(ItemEvent e) { try { Object current = mutator.get(); Object newValue = combo.getSelectedItem(); if (newValue != null && newValue.equals(nullValue)) { newValue = null; } if (!Objects.equal(current, newValue)) { mutator.set(newValue); } } catch (Exception ex) { logger.error("could not invoke JComboBox binding", ex); } } });
public <T extends Enum<?> & ModelUpdate> void update(T... changed) { try { Integer val = (Integer)mutator.get(); if (val == null) { val = -1; } if (!val.equals(slider.getValue())) { slider.removeChangeListener(changeListener); slider.setValue(val); slider.addChangeListener(changeListener); } } catch (Exception ex) { Wiring.logger.error("exception in JSlider binding", ex); } } };
Object[] selVals = list.getSelectedValues(); ImmutableList<Object> listCurrent = ImmutableList.copyOf(selVals); Collection<?> current = (Collection<?>)mutator.get(); if (current == null) { current = ImmutableList.of(); Object current = mutator.get(); Object listCurrent = list.getSelectedValue(); if (!Objects.equal(current, listCurrent)) {