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

java.lang.Object
  extended by org.gudy.azureus2.pluginsimpl.local.ui.config.PluginConfigUIFactoryImpl
All Implemented Interfaces:
PluginConfigUIFactory

public class PluginConfigUIFactoryImpl
extends java.lang.Object
implements PluginConfigUIFactory

Author:
epall

Constructor Summary
PluginConfigUIFactoryImpl(PluginConfigImpl _config, java.lang.String _pluginKey)
           
 
Method Summary
 EnablerParameter createBooleanParameter(java.lang.String key, java.lang.String label, boolean defaultValue)
          Creates a boolean parameter.
The UI component used will be a checkBox.
The parameter can be accessed using the PluginConfig.getPluginBooleanParameter(String key).
The return object, and EnablerParameter, can be used to add dependency to other parameters.
 Parameter createColorParameter(java.lang.String key, java.lang.String label, int defaultValueRed, int defaultValueGreen, int defaultValueBlue)
          Creates a Color Parameter.
The UI component will be a button with a Color area.
The parameter is in fact separacted in 3 parameters:
key.red
key.green
key.blue
Each color component is stored as an int parameter and can be accessed using PluginConfig.getPluginIntParameter(String key.(red|green|blue)).
 Parameter createDirectoryParameter(java.lang.String key, java.lang.String label, java.lang.String defaultValue)
          Creates a Directory Parameter.
The UI component will be a Text field with a browse button.
The parameter can be accessed using the PluginConfig.getPluginStringParameter(String key).
 Parameter createFileParameter(java.lang.String key, java.lang.String label, java.lang.String defaultValue)
          Creates a File Parameter.
The UI component will be a Text field with a browse button.
The parameter can be accessed using the PluginConfig.getPluginStringParameter(String key).
 Parameter createIntParameter(java.lang.String key, java.lang.String label, int defaultValue)
          Creates an int parameter.
The UI component will be a Text field, but only accepting int values.
The parameter can be accessed using the PluginConfig.getPluginIntParameter(String key).
 Parameter createIntParameter(java.lang.String key, java.lang.String label, int defaultValue, int[] values, java.lang.String[] labels)
          Creates an int parameter.
The UI component will be a List.
The parameter can be accessed using the PluginConfig.getPluginIntParameter(String key).
 Parameter createStringParameter(java.lang.String key, java.lang.String label, java.lang.String defaultValue)
          Creates a String parameter.
The UI Component will be a Text field.
The parameter can be accessed using the PluginConfig.getPluginStringParameter(String key).
 Parameter createStringParameter(java.lang.String key, java.lang.String label, java.lang.String defaultValue, java.lang.String[] values, java.lang.String[] labels)
          Creates an String parameter.
The UI component will be a List.
The parameter can be accessed using the PluginConfig.getPluginStringParameter(String key).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PluginConfigUIFactoryImpl

public PluginConfigUIFactoryImpl(PluginConfigImpl _config,
                                 java.lang.String _pluginKey)
Method Detail

createIntParameter

public Parameter createIntParameter(java.lang.String key,
                                    java.lang.String label,
                                    int defaultValue,
                                    int[] values,
                                    java.lang.String[] labels)
Description copied from interface: PluginConfigUIFactory
Creates an int parameter.
The UI component will be a List.
The parameter can be accessed using the PluginConfig.getPluginIntParameter(String key).

Specified by:
createIntParameter in interface PluginConfigUIFactory
Parameters:
key - the parameter key
label - the label for this field (cf. i18n)
defaultValue - the default value of the parameter
values - the list of values
labels - the list of labels (no i18n here)
Returns:
a Parameter

createBooleanParameter

public EnablerParameter createBooleanParameter(java.lang.String key,
                                               java.lang.String label,
                                               boolean defaultValue)
Description copied from interface: PluginConfigUIFactory
Creates a boolean parameter.
The UI component used will be a checkBox.
The parameter can be accessed using the PluginConfig.getPluginBooleanParameter(String key).
The return object, and EnablerParameter, can be used to add dependency to other parameters. For example, you can use a boolean parameter to choose from logging or not, and a file parameter to choose the logging file. You can call the EnablerParameter.addEnabledOnSelection method with the file Parameter in argument, so that the file parameter will only be enabled if the 'logging' (boolean) one is.

Specified by:
createBooleanParameter in interface PluginConfigUIFactory
Parameters:
key - the parameter key
label - the label for this checkBox (cf. i18n)
defaultValue - the default value of the parameter
Returns:
an EnablerParameter

createIntParameter

public Parameter createIntParameter(java.lang.String key,
                                    java.lang.String label,
                                    int defaultValue)
Description copied from interface: PluginConfigUIFactory
Creates an int parameter.
The UI component will be a Text field, but only accepting int values.
The parameter can be accessed using the PluginConfig.getPluginIntParameter(String key).

Specified by:
createIntParameter in interface PluginConfigUIFactory
Parameters:
key - the parameter key
label - the label for this field (cf. i18n)
defaultValue - the default value of the parameter
Returns:
a Parameter

createStringParameter

public Parameter createStringParameter(java.lang.String key,
                                       java.lang.String label,
                                       java.lang.String defaultValue)
Description copied from interface: PluginConfigUIFactory
Creates a String parameter.
The UI Component will be a Text field.
The parameter can be accessed using the PluginConfig.getPluginStringParameter(String key).

Specified by:
createStringParameter in interface PluginConfigUIFactory
Parameters:
key - the parameter key
label - the label for this field (cf. i18n)
defaultValue - the default value of the parameter
Returns:
a Parameter

createStringParameter

public Parameter createStringParameter(java.lang.String key,
                                       java.lang.String label,
                                       java.lang.String defaultValue,
                                       java.lang.String[] values,
                                       java.lang.String[] labels)
Description copied from interface: PluginConfigUIFactory
Creates an String parameter.
The UI component will be a List.
The parameter can be accessed using the PluginConfig.getPluginStringParameter(String key).

Specified by:
createStringParameter in interface PluginConfigUIFactory
Parameters:
key - the parameter key
label - The label for this field (cf. i18n)
defaultValue - the default value of the parameter
values - the list of values
labels - the list of labels (no i18n here)
Returns:
a Parameter

createFileParameter

public Parameter createFileParameter(java.lang.String key,
                                     java.lang.String label,
                                     java.lang.String defaultValue)
Description copied from interface: PluginConfigUIFactory
Creates a File Parameter.
The UI component will be a Text field with a browse button.
The parameter can be accessed using the PluginConfig.getPluginStringParameter(String key).

Specified by:
createFileParameter in interface PluginConfigUIFactory
Parameters:
key - the parameter key
label - the label for this field (cf. i18n)
defaultValue - the default value of the parameter
Returns:
a File Parameter

createDirectoryParameter

public Parameter createDirectoryParameter(java.lang.String key,
                                          java.lang.String label,
                                          java.lang.String defaultValue)
Description copied from interface: PluginConfigUIFactory
Creates a Directory Parameter.
The UI component will be a Text field with a browse button.
The parameter can be accessed using the PluginConfig.getPluginStringParameter(String key).

Specified by:
createDirectoryParameter in interface PluginConfigUIFactory
Parameters:
key - the parameter key
label - the label for this field (cf. i18n)
defaultValue - the default value of the parameter
Returns:
a File Parameter

createColorParameter

public Parameter createColorParameter(java.lang.String key,
                                      java.lang.String label,
                                      int defaultValueRed,
                                      int defaultValueGreen,
                                      int defaultValueBlue)
Description copied from interface: PluginConfigUIFactory
Creates a Color Parameter.
The UI component will be a button with a Color area.
The parameter is in fact separacted in 3 parameters:
key.red
key.green
key.blue
Each color component is stored as an int parameter and can be accessed using PluginConfig.getPluginIntParameter(String key.(red|green|blue)).

Specified by:
createColorParameter in interface PluginConfigUIFactory
Parameters:
key - the parameter key
label - the label for this field (cf. i18n)
defaultValueRed - the red component of the default color (0-255)
defaultValueGreen - the green component of the default color (0-255)
defaultValueBlue - the blue component of the default color (0-255)
Returns:
a Color Parameter