/** * Adds a value change listener. * * @param listener * the listener to add. */ public void addValueChangedListener(IValueChangedListener listener) { internalAddListener(IUlcEventConstants.VALUE_CHANGED_EVENT, listener); }
/** * Removes a value change listener. * * @param listener * the listener to remove. */ public void removeValueChangedListener(IValueChangedListener listener) { internalRemoveListener(IUlcEventConstants.VALUE_CHANGED_EVENT, listener); }
/** * {@inheritDoc} */ @Override protected void saveState(Anything a) { super.saveState(a); valueToAnything(a); resetValueToAnything(a); }
/** * Sets the color picker value. * * @param value * the color picker value. */ public void setValue(Color value) { if (!ObjectUtils.equals(this.value, value)) { this.value = value; Anything valueAnything = new Anything(); valueToAnything(valueAnything); sendUI(ColorPickerConstants.SET_VALUE_REQUEST, valueAnything); } }
/** * Sets the color picker resetValue. * * @param resetValue * the color picker resetValue. */ public void setResetValue(Color resetValue) { if (!ObjectUtils.equals(this.resetValue, resetValue)) { this.resetValue = resetValue; Anything resetValueAnything = new Anything(); resetValueToAnything(resetValueAnything); sendUI(ColorPickerConstants.SET_RESETVALUE_REQUEST, resetValueAnything); } }
/** * {@inheritDoc} */ @Override protected void handleEvent(int listenerType, int eventId, Anything args) { if (listenerType == IUlcEventConstants.VALUE_CHANGED_EVENT) { distributeToListeners(new ValueChangedEvent(this)); } else { super.handleEvent(listenerType, eventId, args); } }
/** * {@inheritDoc} */ @Override public void handleRequest(String request, Anything args) { if (request.equals(ColorPickerConstants.SET_VALUE_REQUEST)) { handleSetValue(args); } else { super.handleRequest(request, args); } }
/** * Creates a color picker. * * @return the created color picker. */ protected ULCColorPicker createULCColorPicker() { return new ULCColorPicker(); }
/** * {@inheritDoc} */ @Override protected void bindULCComponent() { getConnectedULCComponent().addValueChangedListener( new IValueChangedListener() { private static final long serialVersionUID = -7747055134828532559L; public void valueChanged(@SuppressWarnings("unused") ValueChangedEvent event) { fireConnectorValueChange(); } }); }
/** * {@inheritDoc} */ @Override protected Object getConnecteeValue() { Color value = getConnectedULCComponent().getValue(); if (value != null) { return ColorHelper.toHexString(value.getRed(), value.getGreen(), value .getBlue(), value.getAlpha()); } return null; }
/** * Sets the color picker value. * * @param value * the color picker value. */ public void setValue(Color value) { if (!ObjectUtils.equals(this.value, value)) { this.value = value; Anything valueAnything = new Anything(); valueToAnything(valueAnything); sendUI(ColorPickerConstants.SET_VALUE_REQUEST, valueAnything); } }
/** * Sets the color picker resetValue. * * @param resetValue * the color picker resetValue. */ public void setResetValue(Color resetValue) { if (!ObjectUtils.equals(this.resetValue, resetValue)) { this.resetValue = resetValue; Anything resetValueAnything = new Anything(); resetValueToAnything(resetValueAnything); sendUI(ColorPickerConstants.SET_RESETVALUE_REQUEST, resetValueAnything); } }
/** * {@inheritDoc} */ @Override protected void handleEvent(int listenerType, int eventId, Anything args) { if (listenerType == IUlcEventConstants.VALUE_CHANGED_EVENT) { distributeToListeners(new ValueChangedEvent(this)); } else { super.handleEvent(listenerType, eventId, args); } }
/** * {@inheritDoc} */ @Override public void handleRequest(String request, Anything args) { if (request.equals(ColorPickerConstants.SET_VALUE_REQUEST)) { handleSetValue(args); } else { super.handleRequest(request, args); } }
/** * {@inheritDoc} */ @Override protected void saveState(Anything a) { super.saveState(a); valueToAnything(a); resetValueToAnything(a); }
/** * Adds a value change listener. * * @param listener * the listener to add. */ public void addValueChangedListener(IValueChangedListener listener) { internalAddListener(IUlcEventConstants.VALUE_CHANGED_EVENT, listener); }
/** * Removes a value change listener. * * @param listener * the listener to remove. */ public void removeValueChangedListener(IValueChangedListener listener) { internalRemoveListener(IUlcEventConstants.VALUE_CHANGED_EVENT, listener); }