Package com.biglybt.ui.swt.config
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 com.biglybt.ui.swt.config.BaseSwtParameter
BaseSwtParameter.IndentPaintListener
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final org.eclipse.swt.widgets.Button
private org.eclipse.swt.graphics.Image
private org.eclipse.swt.widgets.Label
private org.eclipse.swt.widgets.Button
Fields inherited from class com.biglybt.ui.swt.config.BaseSwtParameter
change_listeners, paramID, pluginParam, validating, valueProcessor
Fields inherited from interface com.biglybt.ui.swt.config.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[]
void
void
setColor
(int _r, int _g, int _b) private void
updateButtonColor
(org.eclipse.swt.widgets.Display display, int[] rgb) Methods inherited from class com.biglybt.ui.swt.config.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:
refreshControl
in 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:
getControls
in interfaceSwtParameter<int[]>
- Overrides:
getControls
in classBaseSwtParameter<ColorSwtParameter,
int[]>
-
setColor
public void setColor(int _r, int _g, int _b)
-