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[]>
public class ColorSwtParameter extends BaseSwtParameter<ColorSwtParameter,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 Classes Modifier and Type Class Description private static class
ColorSwtParameter.ColorValueProcessor
-
Nested classes/interfaces inherited from class com.biglybt.ui.swt.config.BaseSwtParameter
BaseSwtParameter.IndentPaintListener
-
-
Field Summary
Fields Modifier and Type Field Description private org.eclipse.swt.widgets.Button
colorChooser
private org.eclipse.swt.graphics.Image
img
private org.eclipse.swt.widgets.Label
lblSuffix
private org.eclipse.swt.widgets.Button
resetButton
-
Fields inherited from class com.biglybt.ui.swt.config.BaseSwtParameter
change_listeners, KEY_LABEL_ADDCOPYTOCLIPMENU, paramID, pluginParam, validating, valueProcessor
-
Fields inherited from interface com.biglybt.ui.swt.config.SwtParameter
DEBUG
-
-
Constructor Summary
Constructors Constructor Description ColorSwtParameter(org.eclipse.swt.widgets.Composite composite, ColorParameter param)
ColorSwtParameter(org.eclipse.swt.widgets.Composite composite, java.lang.String paramID, java.lang.String labelKey, java.lang.String suffixLabelKey, boolean showResetButton, SwtParameterValueProcessor<ColorSwtParameter,int[]> valueProcessor)
Make a color selecting button.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.eclipse.swt.widgets.Control[]
getControls()
void
refreshControl()
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
-
-
-
-
Constructor Detail
-
ColorSwtParameter
public ColorSwtParameter(org.eclipse.swt.widgets.Composite composite, ColorParameter param)
-
ColorSwtParameter
public ColorSwtParameter(org.eclipse.swt.widgets.Composite composite, java.lang.String paramID, java.lang.String labelKey, java.lang.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 Detail
-
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)
-
-