org.gudy.azureus2.pluginsimpl.local.ui.config
Class ParameterImpl

java.lang.Object
  extended by org.gudy.azureus2.pluginsimpl.local.ui.config.ParameterImpl
All Implemented Interfaces:
ParameterListener, ConfigParameter, EnablerParameter, Parameter
Direct Known Subclasses:
ActionParameterImpl, BooleanParameterImpl, ColorParameter, ColorParameterImpl, DirectoryParameterImpl, FileParameter, InfoParameterImpl, IntParameterImpl, IntsParameter, LabelParameterImpl, ParameterGroupImpl, ParameterTabFolderImpl, PasswordParameterImpl, StringListParameterImpl, StringParameterImpl, UIParameterImpl, UITextAreaImpl

public class ParameterImpl
extends Object
implements EnablerParameter, ParameterListener

Author:
epall

Field Summary
protected  PluginConfigImpl config
           
 
Fields inherited from interface org.gudy.azureus2.plugins.ui.config.Parameter
MODE_ADVANCED, MODE_BEGINNER, MODE_INTERMEDIATE
 
Constructor Summary
ParameterImpl(PluginConfigImpl _config, String _key, String _labelKey)
           
 
Method Summary
 void addConfigParameterListener(ConfigParameterListener l)
           
 void addDisabledOnSelection(Parameter parameter)
          disables parameter when EnablerParameter is selected.
parameter is enabled is EnablerParameter isn't selected.
 void addEnabledOnSelection(Parameter parameter)
          enables parameter when EnablerParameter is selected.
parameter is disabled is EnablerParameter isn't selected.
 void addImplListener(ParameterImplListener l)
           
 void addListener(ParameterListener l)
          Adds a listener triggered when the parameter is changed by the user
 void destroy()
           
protected  void fireParameterChanged()
           
 String getConfigKeyName()
           
 List getDisabledOnSelectionParameters()
           
 List getEnabledOnSelectionParameters()
           
 boolean getGenerateIntermediateEvents()
           
 ParameterGroupImpl getGroup()
           
 String getKey()
           
 String getLabelKey()
          Retrieve the language bundle key for the label associated with this parameter.
 String getLabelText()
          Retrieve the actual text of the label associated with this parameter.
 int getMinimumRequiredUserMode()
          Gets the lowest user mode required for this parameter to be displayed.
 boolean hasBeenSet()
           
 boolean isEnabled()
          Retrieves the enabled state for the UI object for this parameter
 boolean isVisible()
          Retrieves the visiblility state for the UI object for this parameter
 void parameterChanged(String key)
          Called, when a parameter has changed.
 void removeConfigParameterListener(ConfigParameterListener l)
           
 void removeImplListener(ParameterImplListener l)
           
 void removeListener(ParameterListener l)
          Removes a previously added listener
 void setEnabled(boolean e)
          Sets whether the UI object for this parameter is enabled (changeable) or disabled (not changeable, and usually grayed out)
 void setGenerateIntermediateEvents(boolean b)
          Controls whether or not 'parameter change' events are fired for each incremental value change
 void setGroup(ParameterGroupImpl _group)
           
 void setLabelKey(String sLabelKey)
          Set the label to use the supplied language bundle key for the label associated with this parameter
 void setLabelText(String sText)
          Set the text of the label associated to with this parameter to the literal text supplied.
 void setMinimumRequiredUserMode(int _mode)
          Sets the lowest user mode required for this parameter to be displayed.
 void setVisible(boolean _visible)
          Sets whether the UI object for this parameter is visible to the user
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

config

protected PluginConfigImpl config
Constructor Detail

ParameterImpl

public ParameterImpl(PluginConfigImpl _config,
                     String _key,
                     String _labelKey)
Method Detail

getKey

public String getKey()
Returns:
Returns the key.

addDisabledOnSelection

public void addDisabledOnSelection(Parameter parameter)
Description copied from interface: EnablerParameter
disables parameter when EnablerParameter is selected.
parameter is enabled is EnablerParameter isn't selected.

Specified by:
addDisabledOnSelection in interface EnablerParameter
Parameters:
parameter - the Parameter to act on

addEnabledOnSelection

public void addEnabledOnSelection(Parameter parameter)
Description copied from interface: EnablerParameter
enables parameter when EnablerParameter is selected.
parameter is disabled is EnablerParameter isn't selected.

Specified by:
addEnabledOnSelection in interface EnablerParameter
Parameters:
parameter - the Parameter to act on

getDisabledOnSelectionParameters

public List getDisabledOnSelectionParameters()

getEnabledOnSelectionParameters

public List getEnabledOnSelectionParameters()

parameterChanged

public void parameterChanged(String key)
Description copied from interface: ParameterListener
Called, when a parameter has changed. The listener could only react if the parameter name is relevant. Or the listener can just read all parameters again.

Specified by:
parameterChanged in interface ParameterListener
Parameters:
key - the name of the parameter that has changed

fireParameterChanged

protected void fireParameterChanged()

setEnabled

public void setEnabled(boolean e)
Description copied from interface: Parameter
Sets whether the UI object for this parameter is enabled (changeable) or disabled (not changeable, and usually grayed out)

Specified by:
setEnabled in interface Parameter
Parameters:
e - The new enabled state

isEnabled

public boolean isEnabled()
Description copied from interface: Parameter
Retrieves the enabled state for the UI object for this parameter

Specified by:
isEnabled in interface Parameter
Returns:
The enabled state

getMinimumRequiredUserMode

public int getMinimumRequiredUserMode()
Description copied from interface: Parameter
Gets the lowest user mode required for this parameter to be displayed.

Specified by:
getMinimumRequiredUserMode in interface Parameter
Returns:
MODE_ constants above

setMinimumRequiredUserMode

public void setMinimumRequiredUserMode(int _mode)
Description copied from interface: Parameter
Sets the lowest user mode required for this parameter to be displayed.

Specified by:
setMinimumRequiredUserMode in interface Parameter
Parameters:
_mode - see MODE_ constants defined above

setVisible

public void setVisible(boolean _visible)
Description copied from interface: Parameter
Sets whether the UI object for this parameter is visible to the user

Specified by:
setVisible in interface Parameter
Parameters:
_visible - The new visibility state

isVisible

public boolean isVisible()
Description copied from interface: Parameter
Retrieves the visiblility state for the UI object for this parameter

Specified by:
isVisible in interface Parameter
Returns:
The visibility state

setGenerateIntermediateEvents

public void setGenerateIntermediateEvents(boolean b)
Description copied from interface: Parameter
Controls whether or not 'parameter change' events are fired for each incremental value change

Specified by:
setGenerateIntermediateEvents in interface Parameter

getGenerateIntermediateEvents

public boolean getGenerateIntermediateEvents()
Specified by:
getGenerateIntermediateEvents in interface Parameter
Returns:

setGroup

public void setGroup(ParameterGroupImpl _group)

getGroup

public ParameterGroupImpl getGroup()

addListener

public void addListener(ParameterListener l)
Description copied from interface: Parameter
Adds a listener triggered when the parameter is changed by the user

Specified by:
addListener in interface Parameter
Parameters:
l - Listener to add

removeListener

public void removeListener(ParameterListener l)
Description copied from interface: Parameter
Removes a previously added listener

Specified by:
removeListener in interface Parameter
Parameters:
l - Listener to remove.

addImplListener

public void addImplListener(ParameterImplListener l)

removeImplListener

public void removeImplListener(ParameterImplListener l)

addConfigParameterListener

public void addConfigParameterListener(ConfigParameterListener l)
Specified by:
addConfigParameterListener in interface ConfigParameter

removeConfigParameterListener

public void removeConfigParameterListener(ConfigParameterListener l)
Specified by:
removeConfigParameterListener in interface ConfigParameter

getLabelText

public String getLabelText()
Description copied from interface: Parameter
Retrieve the actual text of the label associated with this parameter. This is the text after it has been looked up in the language bundle.

Specified by:
getLabelText in interface Parameter
Returns:
The label's text

setLabelText

public void setLabelText(String sText)
Description copied from interface: Parameter
Set the text of the label associated to with this parameter to the literal text supplied.

Specified by:
setLabelText in interface Parameter
Parameters:
sText - The actual text to assign to the label

getLabelKey

public String getLabelKey()
Description copied from interface: Parameter
Retrieve the language bundle key for the label associated with this parameter.

Specified by:
getLabelKey in interface Parameter
Returns:
The language bundle key, or null if the label is using literal text

setLabelKey

public void setLabelKey(String sLabelKey)
Description copied from interface: Parameter
Set the label to use the supplied language bundle key for the label associated with this parameter

Specified by:
setLabelKey in interface Parameter
Parameters:
sLabelKey - The language bundle key to use.

getConfigKeyName

public String getConfigKeyName()
Specified by:
getConfigKeyName in interface Parameter

hasBeenSet

public boolean hasBeenSet()
Specified by:
hasBeenSet in interface Parameter

destroy

public void destroy()