Package com.biglybt.ui.swt.config
Class BaseSwtParameter<PARAMTYPE extends SwtParameter<VALUETYPE>,VALUETYPE>
- java.lang.Object
-
- com.biglybt.ui.swt.config.BaseSwtParameter<PARAMTYPE,VALUETYPE>
-
- All Implemented Interfaces:
SwtParameter<VALUETYPE>
- Direct Known Subclasses:
BaseSwtStringParameter
,BooleanSwtParameter
,ButtonSwtParameter
,ColorSwtParameter
,FloatSwtParameter
,IconSwtParameter
,InfoSwtParameter
,IntListSwtParameter
,IntRadioListSwtParameter
,IntSwtParameter
,LinkSwtParameter
,PasswordSwtParameter
,StringAreaSwtParameter
,StringListSwtParameter
,TextAreaSwtParameter
,UISWTParameter
public abstract class BaseSwtParameter<PARAMTYPE extends SwtParameter<VALUETYPE>,VALUETYPE> extends java.lang.Object implements SwtParameter<VALUETYPE>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
BaseSwtParameter.IndentPaintListener
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<ParameterChangeListener<PARAMTYPE>>
change_listeners
private static AEMonitor
class_mon
private boolean
enabled
private BaseSwtParameter.IndentPaintListener
fancyPaintListener
private int
indent
static java.lang.String
KEY_LABEL_ADDCOPYTOCLIPMENU
private ParameterValidator.ValidationInfo
lastValidationInfo
private org.eclipse.swt.widgets.Control
mainControl
private java.lang.String
oldTooltip
protected java.lang.String
paramID
protected Parameter
pluginParam
private org.eclipse.swt.widgets.Control
relatedControl
private PARAMTYPE
thisTyped
(package private) boolean
validating
private java.util.List<SwtParameterValidator<PARAMTYPE,VALUETYPE>>
validators
protected SwtParameterValueProcessor<PARAMTYPE,VALUETYPE>
valueProcessor
-
Fields inherited from interface com.biglybt.ui.swt.config.SwtParameter
DEBUG
-
-
Constructor Summary
Constructors Constructor Description BaseSwtParameter(java.lang.String paramID)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addAndFireChangeListener(ParameterChangeListener<PARAMTYPE> l)
void
addChangeListener(ParameterChangeListener<PARAMTYPE> l)
Note: Change Listener may be triggered off SWT Threadprotected void
addLabelContextMenus(org.eclipse.swt.widgets.Control curControl, org.eclipse.swt.widgets.Menu menu)
void
addValidator(SwtParameterValidator<PARAMTYPE,VALUETYPE> validator)
(package private) org.eclipse.swt.widgets.Control
createStandardLabel(org.eclipse.swt.widgets.Composite parent, java.lang.String labelKey)
void
debug(java.lang.String s)
void
dispose()
protected boolean
doGridData(org.eclipse.swt.widgets.Composite composite)
org.eclipse.swt.widgets.Control[]
getControls()
int
getIndent()
org.eclipse.swt.widgets.Control
getMainControl()
java.lang.String
getParamID()
org.eclipse.swt.widgets.Control
getRelatedControl()
VALUETYPE
getValue()
SwtParameterValueProcessor<PARAMTYPE,VALUETYPE>
getValueProcessor()
void
informChanged()
Parameter has changed.boolean
isDefaultValue()
boolean
isDisposed()
boolean
isEnabled()
boolean
isIndentFancy()
void
refreshControl()
protected void
refreshSuffixControl(org.eclipse.swt.widgets.Control suffixControl)
void
removeChangeListener(ParameterChangeListener<PARAMTYPE> l)
void
removeValidator(SwtParameterValidator<PARAMTYPE,VALUETYPE> validator)
boolean
resetToDefault()
protected void
setConfigValueProcessor(java.lang.Class<VALUETYPE> type)
void
setEnabled(boolean enabled)
void
setIndent(int i, boolean fancy)
void
setLabelKey(java.lang.String labelKey)
void
setLabelText(java.lang.String text)
void
setLayoutData(java.lang.Object layoutData)
Deprecated.void
setMainControl(org.eclipse.swt.widgets.Control mainControl)
protected void
setPluginParameter(Parameter pluginParam)
protected void
setRelatedControl(org.eclipse.swt.widgets.Control control)
void
setValue(VALUETYPE value)
void
setValueProcessor(SwtParameterValueProcessor<PARAMTYPE,VALUETYPE> valueProcessor)
void
setVisible(boolean visible)
protected void
triggerChangeListeners(boolean doRefresh)
protected void
triggerSubClassChangeListeners()
protected void
updateControl(ParameterValidator.ValidationInfo validationInfo)
ParameterValidator.ValidationInfo
validate(VALUETYPE newValue)
-
-
-
Field Detail
-
KEY_LABEL_ADDCOPYTOCLIPMENU
public static final java.lang.String KEY_LABEL_ADDCOPYTOCLIPMENU
- See Also:
- Constant Field Values
-
paramID
protected final java.lang.String paramID
-
relatedControl
private org.eclipse.swt.widgets.Control relatedControl
-
valueProcessor
protected SwtParameterValueProcessor<PARAMTYPE extends SwtParameter<VALUETYPE>,VALUETYPE> valueProcessor
-
change_listeners
protected java.util.List<ParameterChangeListener<PARAMTYPE extends SwtParameter<VALUETYPE>>> change_listeners
-
validators
private final java.util.List<SwtParameterValidator<PARAMTYPE extends SwtParameter<VALUETYPE>,VALUETYPE>> validators
-
class_mon
private static final AEMonitor class_mon
-
thisTyped
private final PARAMTYPE extends SwtParameter<VALUETYPE> thisTyped
-
oldTooltip
private java.lang.String oldTooltip
-
pluginParam
protected Parameter pluginParam
-
fancyPaintListener
private BaseSwtParameter.IndentPaintListener fancyPaintListener
-
lastValidationInfo
private ParameterValidator.ValidationInfo lastValidationInfo
-
enabled
private boolean enabled
-
indent
private int indent
-
mainControl
private org.eclipse.swt.widgets.Control mainControl
-
validating
boolean validating
-
-
Method Detail
-
getParamID
public java.lang.String getParamID()
- Specified by:
getParamID
in interfaceSwtParameter<PARAMTYPE extends SwtParameter<VALUETYPE>>
-
setMainControl
public void setMainControl(org.eclipse.swt.widgets.Control mainControl)
-
getMainControl
public final org.eclipse.swt.widgets.Control getMainControl()
- Specified by:
getMainControl
in interfaceSwtParameter<PARAMTYPE extends SwtParameter<VALUETYPE>>
-
getControls
public org.eclipse.swt.widgets.Control[] getControls()
- Specified by:
getControls
in interfaceSwtParameter<PARAMTYPE extends SwtParameter<VALUETYPE>>
-
addValidator
public void addValidator(SwtParameterValidator<PARAMTYPE,VALUETYPE> validator)
-
removeValidator
public void removeValidator(SwtParameterValidator<PARAMTYPE,VALUETYPE> validator)
-
validate
public ParameterValidator.ValidationInfo validate(VALUETYPE newValue)
-
updateControl
protected void updateControl(ParameterValidator.ValidationInfo validationInfo)
-
addAndFireChangeListener
public void addAndFireChangeListener(ParameterChangeListener<PARAMTYPE> l)
-
addChangeListener
public void addChangeListener(ParameterChangeListener<PARAMTYPE> l)
Note: Change Listener may be triggered off SWT Thread
-
removeChangeListener
public void removeChangeListener(ParameterChangeListener<PARAMTYPE> l)
-
setEnabled
public void setEnabled(boolean enabled)
- Specified by:
setEnabled
in interfaceSwtParameter<PARAMTYPE extends SwtParameter<VALUETYPE>>
-
isDisposed
public boolean isDisposed()
- Specified by:
isDisposed
in interfaceSwtParameter<PARAMTYPE extends SwtParameter<VALUETYPE>>
-
setValue
public final void setValue(VALUETYPE value)
- Specified by:
setValue
in interfaceSwtParameter<PARAMTYPE extends SwtParameter<VALUETYPE>>
-
doGridData
protected boolean doGridData(org.eclipse.swt.widgets.Composite composite)
-
refreshControl
public void refreshControl()
-
refreshSuffixControl
protected void refreshSuffixControl(org.eclipse.swt.widgets.Control suffixControl)
-
setLayoutData
@Deprecated public void setLayoutData(java.lang.Object layoutData)
Deprecated.- Specified by:
setLayoutData
in interfaceSwtParameter<PARAMTYPE extends SwtParameter<VALUETYPE>>
-
getValue
public VALUETYPE getValue()
- Specified by:
getValue
in interfaceSwtParameter<PARAMTYPE extends SwtParameter<VALUETYPE>>
-
informChanged
public void informChanged()
Description copied from interface:SwtParameter
Parameter has changed. Should probably refreshControl any UI components- Specified by:
informChanged
in interfaceSwtParameter<PARAMTYPE extends SwtParameter<VALUETYPE>>
-
triggerChangeListeners
protected final void triggerChangeListeners(boolean doRefresh)
-
triggerSubClassChangeListeners
protected void triggerSubClassChangeListeners()
-
getRelatedControl
public org.eclipse.swt.widgets.Control getRelatedControl()
-
setRelatedControl
protected void setRelatedControl(org.eclipse.swt.widgets.Control control)
-
addLabelContextMenus
protected void addLabelContextMenus(org.eclipse.swt.widgets.Control curControl, org.eclipse.swt.widgets.Menu menu)
-
resetToDefault
public boolean resetToDefault()
-
isDefaultValue
public boolean isDefaultValue()
-
setPluginParameter
protected void setPluginParameter(Parameter pluginParam)
-
setValueProcessor
public void setValueProcessor(SwtParameterValueProcessor<PARAMTYPE,VALUETYPE> valueProcessor)
-
setConfigValueProcessor
protected void setConfigValueProcessor(java.lang.Class<VALUETYPE> type)
-
getValueProcessor
public SwtParameterValueProcessor<PARAMTYPE,VALUETYPE> getValueProcessor()
-
setVisible
public void setVisible(boolean visible)
- Specified by:
setVisible
in interfaceSwtParameter<PARAMTYPE extends SwtParameter<VALUETYPE>>
-
debug
public void debug(java.lang.String s)
- Specified by:
debug
in interfaceSwtParameter<PARAMTYPE extends SwtParameter<VALUETYPE>>
-
getIndent
public int getIndent()
-
isIndentFancy
public boolean isIndentFancy()
-
setIndent
public void setIndent(int i, boolean fancy)
-
isEnabled
public boolean isEnabled()
-
dispose
public void dispose()
-
createStandardLabel
org.eclipse.swt.widgets.Control createStandardLabel(org.eclipse.swt.widgets.Composite parent, java.lang.String labelKey)
-
setLabelKey
public void setLabelKey(java.lang.String labelKey)
-
setLabelText
public void setLabelText(java.lang.String text)
-
-