/** * {@inheritDoc} */ @Override public void valueChange(ValueChangeEvent evt) { updateCell(computeCoordinates((IValueConnector) evt.getSource())); }
@Override public void run() { Collection<?> oldCollection = (Collection<?>) evt.getOldValue(); Collection<?> newCollection = (Collection<?>) evt.getNewValue(); int oldCollectionSize = 0; int newCollectionSize = 0; if (oldCollection != null) { oldCollectionSize = oldCollection.size(); } if (newCollection != null) { newCollectionSize = newCollection.size(); } if (newCollectionSize > oldCollectionSize) { fireIntervalAdded(CollectionConnectorListModel.this, oldCollectionSize, newCollectionSize); for (int index = oldCollectionSize; index < newCollectionSize; index++) { bindChildConnector(index); } } else if (newCollectionSize < oldCollectionSize) { fireIntervalRemoved(CollectionConnectorListModel.this, oldCollectionSize, newCollectionSize); } } });
/** * Gives a chance to the connector to create a specific subclass of connector * value change event. * * @param oldValue * the old connector value. * @param newValue * the new connector value. * @return the created change event. */ protected ValueChangeEvent createChangeEvent(Object oldValue, Object newValue) { return new ValueChangeEvent(this, oldValue, newValue); }
@Override public void run() { IValueConnector connector = (IValueConnector) evt.getSource(); if (connector == rootConnector) { fireTreeStructureChanged(ConnectorHierarchyTreeModel.this, Collection<?> oldCollection = (Collection<?>) evt.getOldValue(); Collection<?> newCollection = (Collection<?>) evt.getNewValue(); int oldCollectionSize = 0; int newCollectionSize = 0;
/** * {@inheritDoc} */ @Override public void valueChange(ValueChangeEvent evt) { gate.setModel(evt.getNewValue()); }
valueChangeSupport = new ValueChangeSupport(this); valueChangeSupport.addInhibitedListener((IValueConnector) evt.getSource()); try { setConnectorValue(evt.getNewValue()); if (evt.getSource() != getModelConnector()) { Object potentiallyChangedValue = getConnectorValue(); if (!ObjectUtils.equals(potentiallyChangedValue, evt.getNewValue())) { ((IValueConnector) evt.getSource()) .setConnectorValue(potentiallyChangedValue); .getSource());
if (getModelConnector() != null) { ValueChangeEvent evt = new ValueChangeEvent(getModelConnector(), getConnectorValue(), getModelConnector().getConnectorValue()); if (evt.needsFiring()) { valueChange(evt);
/** * The event needs firing if any connector removal need to be notified even if * oldValue and newValue are equal. * <p> * {@inheritDoc} */ @Override public boolean needsFiring() { return super.needsFiring() || (removedChildrenConnectors != null && !removedChildrenConnectors .isEmpty()); } }
IValueConnector connector = (IValueConnector) evt.getSource(); if (connector == rootConnector) { fireTreeStructureChanged(ConnectorHierarchyTreeModel.this, Collection<?> oldCollection = (Collection<?>) evt.getOldValue(); Collection<?> newCollection = (Collection<?>) evt.getNewValue(); int oldCollectionSize = 0; int newCollectionSize = 0;
@Override public void valueChange(ValueChangeEvent evt) { if (evt.getNewValue() != null) { viewComponent.setToolTipText(evt.getNewValue().toString()); } else { viewComponent.setToolTipText(null); } } });
/** * {@inheritDoc} */ @Override public void valueChange(ValueChangeEvent evt) { updateRow(computeRow((IValueConnector) evt.getSource())); }
/** * {@inheritDoc} */ public void valueChange(final ValueChangeEvent evt) { Collection<?> oldCollection = (Collection<?>) evt.getOldValue(); Collection<?> newCollection = (Collection<?>) evt.getNewValue(); int oldCollectionSize = 0; int newCollectionSize = 0; if (oldCollection != null) { oldCollectionSize = oldCollection.size(); } if (newCollection != null) { newCollectionSize = newCollection.size(); } if (newCollectionSize > oldCollectionSize) { fireIntervalAdded(CollectionConnectorListModel.this, oldCollectionSize, newCollectionSize); for (int index = oldCollectionSize; index < newCollectionSize; index++) { bindChildConnector(index); } } else if (newCollectionSize < oldCollectionSize) { fireIntervalRemoved(CollectionConnectorListModel.this, oldCollectionSize, newCollectionSize); } } }
@Override public void valueChange(ValueChangeEvent evt) { if (evt.getNewValue() != null) { ((TitledBorder) border).setTitle(evt.getNewValue().toString()); } else { ((TitledBorder) border).setTitle(""); } } });
/** * {@inheritDoc} */ @Override protected void propagateRollback() { Object badValue = getConnectorValue(); super.propagateRollback(); if (badValue == null) { IValueConnector renderingConnector = getRenderingConnector(); if (renderingConnector instanceof AbstractValueConnector) { ((AbstractValueConnector) renderingConnector) .fireValueChange(new ValueChangeEvent(renderingConnector, null, renderingConnector.getConnectorValue())); } } }
@Override public void valueChange(ValueChangeEvent evt) { ICollectionConnector connector = (ICollectionConnector) evt.getSource(); int targetCount = connector.getChildConnectorCount(); List<RComponent> extraSections = new ArrayList<>(); for (int i = 0; i < targetCount; i++) { IValueConnector elementConnector = connector.getChildConnector(i); int childId = System.identityHashCode(elementConnector); if (!childIds.containsKey(childId)) { IView<RComponent> extraSection = createView(viewDescriptor.getRepeatedViewDescriptor(), actionHandler, locale); extraSection.setParent(repeaterView); RComponent peer = extraSection.getPeer(); RemoteValueState state = ((IRemoteStateOwner) elementConnector).getState(); peer.setState(state); extraSections.add(peer); getMvcBinder().bind(extraSection.getConnector(), elementConnector); childIds.put(childId, extraSection); } } if (!extraSections.isEmpty()) { addRepeatedSections(repeater, extraSections); } } });
/** * {@inheritDoc} */ public void valueChange(ValueChangeEvent evt) { Collection<?> oldCollection = null; if (evt.getOldValue() instanceof Collection<?>) { oldCollection = (Collection<?>) evt.getOldValue(); } Collection<?> newCollection = (Collection<?>) evt.getNewValue(); int oldCollectionSize = 0; int newCollectionSize = 0; if (oldCollection != null) { oldCollectionSize = oldCollection.size(); } if (newCollection != null) { newCollectionSize = newCollection.size(); } if (newCollectionSize > oldCollectionSize) { fireTableRowsInserted(oldCollectionSize, newCollectionSize - 1); for (int row = oldCollectionSize; row < newCollectionSize; row++) { bindChildRowConnector(row); } } else if (newCollectionSize < oldCollectionSize) { fireTableRowsDeleted(newCollectionSize, oldCollectionSize - 1); } } }
@Override public void valueChange(ValueChangeEvent evt) { if (evt.getNewValue() instanceof byte[]) { getConnectedJComponent().setDecorated( ((byte[]) evt.getNewValue()).length > 0); } else { getConnectedJComponent().setDecorated(evt.getNewValue() != null); } } });
/** * Sets the connector value using the formatted value representation. * * @param formattedValue * the formatted value, generally the string representation string * representation. */ @Override public void setFormattedValue(Object formattedValue) { try { Object parsedValue = getFormatter().parse(formattedValue); setConnectorValue(parsedValue); } catch (ParseException ex) { // To force resetting the view fireValueChange(new ValueChangeEvent(this, IPropertyChangeCapable.UNKNOWN, getConnecteeValue())); Object[] i18nParams = { formattedValue }; handleException(new ParsingException(formattedValue + " cannot be parsed.", "error.parsing", i18nParams)); } }
@Override public void valueChange(ValueChangeEvent evt) { IValueConnector connector = (IValueConnector) evt.getSource(); if (!isRecycling(connector)) { RemoteFormattedValueState state = (RemoteFormattedValueState) ((IRemoteStateOwner) connector).getState(); RemoteValueCommand command = new RemoteValueCommand(); command.setTargetPeerGuid(state.getGuid()); command.setValue(state.getValue()); command.setValueAsObject(state.getValueAsObject()); remoteCommandHandler.registerCommand(command); } } };
@Override public void run() { List<?> oldCollection = new ArrayList<Object>(); if (evt.getOldValue() instanceof Collection<?>) { oldCollection = new ArrayList<Object>((Collection<?>) evt .getOldValue()); if (evt.getNewValue() instanceof Collection<?>) { newCollection = new ArrayList<Object>((Collection<?>) evt .getNewValue());