/** * Activate the editor for this selector. This causes the color selection * dialog to appear and wait for user input. * * @since 1.0 */ public void open() { ColorDialog colorDialog = new ColorDialog(fButton.getShell()); colorDialog.setRGB(fColorValue); RGB newColor = colorDialog.open(); if (newColor != null) { RGB oldValue = fColorValue; fColorValue = newColor; final Object[] finalListeners = getListeners(); if (finalListeners.length > 0) { PropertyChangeEvent pEvent = new PropertyChangeEvent( this, PROP_COLORCHANGE, oldValue, newColor); for (int i = 0; i < finalListeners.length; ++i) { IPropertyChangeListener listener = (IPropertyChangeListener) finalListeners[i]; listener.propertyChange(pEvent); } } updateColorImage(); } } }
/** * Activate the editor for this selector. This causes the color selection * dialog to appear and wait for user input. * * @since 3.2 */ public void open() { ColorDialog colorDialog = new ColorDialog(fButton.getShell()); colorDialog.setRGB(fColorValue); RGB newColor = colorDialog.open(); if (newColor != null) { RGB oldValue = fColorValue; fColorValue = newColor; final Object[] finalListeners = getListeners(); if (finalListeners.length > 0) { PropertyChangeEvent pEvent = new PropertyChangeEvent( this, PROP_COLORCHANGE, oldValue, newColor); for (Object finalListener : finalListeners) { IPropertyChangeListener listener = (IPropertyChangeListener) finalListener; listener.propertyChange(pEvent); } } updateColorImage(); } } }
/** * Activate the editor for this selector. This causes the color selection * dialog to appear and wait for user input. * * @since 3.2 */ public void open() { ColorDialog colorDialog = new ColorDialog(fButton.getShell()); colorDialog.setRGB(fColorValue); RGB newColor = colorDialog.open(); if (newColor != null) { RGB oldValue = fColorValue; fColorValue = newColor; final Object[] finalListeners = getListeners(); if (finalListeners.length > 0) { PropertyChangeEvent pEvent = new PropertyChangeEvent( this, PROP_COLORCHANGE, oldValue, newColor); for (int i = 0; i < finalListeners.length; ++i) { IPropertyChangeListener listener = (IPropertyChangeListener) finalListeners[i]; listener.propertyChange(pEvent); } } updateColorImage(); } } }