Class ColorSwtParameter
java.lang.Object
com.biglybt.ui.swt.config.BaseSwtParameter<ColorSwtParameter, int[]>
com.biglybt.ui.swt.config.ColorSwtParameter
- All Implemented Interfaces:
SwtParameter<int[]>
SWT Parameter representing a color (r, g, b) value.
Button with color opting a color choosing dialog.
Will always use 2 horizontal spaces in GridLayout
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class BaseSwtParameter
BaseSwtParameter.IndentPaintListener -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.eclipse.swt.widgets.Buttonprivate org.eclipse.swt.graphics.Imageprivate org.eclipse.swt.widgets.Labelprivate org.eclipse.swt.widgets.ButtonFields inherited from class BaseSwtParameter
change_listeners, paramID, pluginParam, validating, valueProcessorFields inherited from interface SwtParameter
DEBUG -
Constructor Summary
ConstructorsConstructorDescriptionColorSwtParameter(org.eclipse.swt.widgets.Composite composite, ColorParameter param) ColorSwtParameter(org.eclipse.swt.widgets.Composite composite, String paramID, String labelKey, String suffixLabelKey, boolean showResetButton, SwtParameterValueProcessor<ColorSwtParameter, int[]> valueProcessor) Make a color selecting button. -
Method Summary
Modifier and TypeMethodDescriptionorg.eclipse.swt.widgets.Control[]voidvoidsetColor(int _r, int _g, int _b) private voidupdateButtonColor(org.eclipse.swt.widgets.Display display, int[] rgb) Methods inherited from class BaseSwtParameter
addAndFireChangeListener, addChangeListener, addLabelContextMenus, addValidator, createStandardLabel, debug, dispose, doGridData, getIndent, getMainControl, getParamID, getRelatedControl, getValue, getValueProcessor, informChanged, isDefaultValue, isDisposed, isEnabled, isIndentFancy, refreshSuffixControl, removeChangeListener, removeValidator, resetToDefault, setConfigValueProcessor, setEnabled, setIndent, setLabelKey, setLabelText, setLayoutData, setMainControl, setPluginParameter, setRelatedControl, setValue, setValueProcessor, setVisible, triggerChangeListeners, triggerSubClassChangeListeners, updateControl, validate
-
Field Details
-
colorChooser
private final org.eclipse.swt.widgets.Button colorChooser -
resetButton
private org.eclipse.swt.widgets.Button resetButton -
lblSuffix
private org.eclipse.swt.widgets.Label lblSuffix -
img
private org.eclipse.swt.graphics.Image img
-
-
Constructor Details
-
ColorSwtParameter
-
ColorSwtParameter
public ColorSwtParameter(org.eclipse.swt.widgets.Composite composite, String paramID, String labelKey, String suffixLabelKey, boolean showResetButton, SwtParameterValueProcessor<ColorSwtParameter, int[]> valueProcessor) Make a color selecting button. When parent is of GridLayout, resulting new widgets will take 2 columns- Parameters:
composite- Where widgets will be placed. Composite is not alteredparamID- ID of the parameter (usually config id)labelKey- Messagebundle key for the text shown before the color buttonsuffixLabelKey- Messagebundle key for text shown after the color button (same row)showResetButton- Whether to display a rest button next to the color buttonvalueProcessor- null if you want to use COConfigurationManager
-
-
Method Details
-
refreshControl
public void refreshControl()- Overrides:
refreshControlin classBaseSwtParameter<ColorSwtParameter, int[]>
-
updateButtonColor
private void updateButtonColor(org.eclipse.swt.widgets.Display display, int[] rgb) -
getControls
public org.eclipse.swt.widgets.Control[] getControls()- Specified by:
getControlsin interfaceSwtParameter<int[]>- Overrides:
getControlsin classBaseSwtParameter<ColorSwtParameter, int[]>
-
setColor
public void setColor(int _r, int _g, int _b)
-