|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.gudy.azureus2.pluginsimpl.local.PluginConfigImpl
public class PluginConfigImpl
Field Summary | |
---|---|
protected static Map<String,String> |
external_to_internal_key_map
|
Constructor Summary | |
---|---|
PluginConfigImpl(PluginInterface _plugin_interface,
String _key)
|
Method Summary | |
---|---|
void |
addListener(PluginConfigListener l)
|
void |
checkValidCoreParam(String name)
|
PluginConfigSource |
enableExternalConfigSource()
Enable the plugin to store configuration parameters into a separate external configuration file. |
boolean |
getBooleanParameter(String name)
Deprecated. |
boolean |
getBooleanParameter(String name,
boolean default_value)
Deprecated. |
byte[] |
getByteParameter(String name)
Deprecated. |
byte[] |
getByteParameter(String name,
byte[] default_value)
Deprecated. |
boolean |
getCoreBooleanParameter(String name)
Returns the value of a core boolean parameter. |
boolean |
getCoreBooleanParameter(String name,
boolean default_value)
Returns the value of a core boolean parameter. |
byte[] |
getCoreByteParameter(String name)
Returns the value of a core byte array parameter. |
byte[] |
getCoreByteParameter(String name,
byte[] default_value)
Returns the value of a core byte array parameter. |
int[] |
getCoreColorParameter(String name)
Returns the value of a core color parameter. |
int[] |
getCoreColorParameter(String name,
int[] default_value)
Returns the value of a core color parameter. |
float |
getCoreFloatParameter(String name)
Returns the value of a core float parameter. |
float |
getCoreFloatParameter(String name,
float default_value)
Returns the value of a core float parameter. |
int |
getCoreIntParameter(String name)
Returns the value of a core int parameter. |
int |
getCoreIntParameter(String name,
int default_value)
Returns the value of a core int parameter. |
long |
getCoreLongParameter(String name)
Returns the value of a core long parameter. |
long |
getCoreLongParameter(String name,
long default_value)
Returns the value of a core long parameter. |
String |
getCoreStringParameter(String name)
Returns the value of a core string parameter. |
String |
getCoreStringParameter(String name,
String default_value)
Returns the value of a core string parameter. |
float |
getFloatParameter(String name)
Deprecated. |
float |
getFloatParameter(String name,
float default_value)
Deprecated. |
int |
getIntParameter(String name)
Deprecated. |
int |
getIntParameter(String name,
int default_value)
Deprecated. |
long |
getLongParameter(String name)
Deprecated. |
long |
getLongParameter(String name,
long default_value)
Deprecated. |
ConfigParameter |
getParameter(String key)
|
boolean |
getPluginBooleanParameter(String name)
Returns the value of a plugin boolean parameter. |
boolean |
getPluginBooleanParameter(String name,
boolean default_value)
Returns the value of a plugin boolean parameter. |
byte[] |
getPluginByteParameter(String name)
Returns the value of a plugin byte array parameter. |
byte[] |
getPluginByteParameter(String name,
byte[] default_value)
Returns the value of a plugin byte array parameter. |
int[] |
getPluginColorParameter(String name)
Returns the value of a plugin color parameter. |
int[] |
getPluginColorParameter(String name,
int[] default_value)
Returns the value of a plugin color parameter. |
String |
getPluginConfigKeyPrefix()
|
PluginConfigSource |
getPluginConfigSource()
Returns the PluginConfigSource object used for this plugin configuration (or null if an external configuration object isn't used). |
float |
getPluginFloatParameter(String name)
Returns the value of a plugin float parameter. |
float |
getPluginFloatParameter(String name,
float default_value)
Returns the value of a plugin float parameter. |
int |
getPluginIntParameter(String name)
Returns the value of a plugin int parameter. |
int |
getPluginIntParameter(String name,
int default_value)
Returns the value of a plugin int parameter. |
List |
getPluginListParameter(String key,
List default_value)
Returns the value of a plugin list parameter. |
long |
getPluginLongParameter(String name)
Returns the value of a plugin long parameter. |
long |
getPluginLongParameter(String name,
long default_value)
Returns the value of a plugin long parameter. |
Map |
getPluginMapParameter(String key,
Map default_value)
Returns the value of a plugin map parameter. |
ConfigParameter |
getPluginParameter(String key)
|
String[] |
getPluginStringListParameter(String key)
Returns the value of a plugin string-list parameter. |
String |
getPluginStringParameter(String name)
Returns the value of a plugin string parameter. |
String |
getPluginStringParameter(String name,
String default_value)
Returns the value of a plugin string parameter. |
File |
getPluginUserFile(String name)
Returns a file that can be used by the plugin to save user-specific state. |
String |
getStringParameter(String name)
Deprecated. |
String |
getStringParameter(String name,
String default_value)
Deprecated. |
boolean |
getUnsafeBooleanParameter(String name)
Returns the value of a core boolean parameter. |
boolean |
getUnsafeBooleanParameter(String name,
boolean default_value)
Returns the value of a core boolean parameter. |
byte[] |
getUnsafeByteParameter(String name)
Returns the value of a core byte array parameter. |
byte[] |
getUnsafeByteParameter(String name,
byte[] default_value)
Returns the value of a core byte array parameter. |
int[] |
getUnsafeColorParameter(String name)
Returns the value of a core color parameter. |
int[] |
getUnsafeColorParameter(String name,
int[] default_value)
Returns the value of a core color parameter. |
float |
getUnsafeFloatParameter(String name)
Returns the value of a core float parameter. |
float |
getUnsafeFloatParameter(String name,
float default_value)
Returns the value of a core float parameter. |
int |
getUnsafeIntParameter(String name)
Returns the value of a core int parameter. |
int |
getUnsafeIntParameter(String name,
int default_value)
Returns the value of a core int parameter. |
long |
getUnsafeLongParameter(String name)
Returns the value of a core long parameter. |
long |
getUnsafeLongParameter(String name,
long default_value)
Returns the value of a core long parameter. |
Map |
getUnsafeParameterList()
Returns a map |
String |
getUnsafeStringParameter(String name)
Returns the value of a core string parameter. |
String |
getUnsafeStringParameter(String name,
String default_value)
Returns the value of a core string parameter. |
boolean |
hasParameter(String param_name)
Returns true if a core parameter with the given name exists. |
boolean |
hasPluginParameter(String param_name)
Returns true if a plugin parameter with the given name exists. |
boolean |
isNewInstall()
|
void |
notifyParamExists(String param)
|
void |
notifyRGBParamExists(String param)
|
boolean |
removePluginColorParameter(String key)
Removes the plugin color parameter with the given name. |
boolean |
removePluginParameter(String key)
Removes the plugin parameter with the given name. |
void |
save()
make sure you save it after making changes! |
void |
setBooleanParameter(String name,
boolean value)
Sets the value of a core boolean parameter. |
void |
setByteParameter(String name,
byte[] value)
Sets the value of a core byte array parameter. |
void |
setColorParameter(String name,
int[] value)
|
void |
setColorParameter(String name,
int[] value,
boolean override)
|
void |
setCoreBooleanParameter(String name,
boolean value)
Sets the value of a core boolean parameter. |
void |
setCoreByteParameter(String name,
byte[] value)
Sets the value of a core byte array parameter. |
void |
setCoreColorParameter(String name,
int[] value)
Sets the value of a core byte array parameter. |
void |
setCoreColorParameter(String name,
int[] value,
boolean override)
Sets the value of a core byte array parameter. |
void |
setCoreFloatParameter(String name,
float value)
Sets the value of a core float parameter. |
void |
setCoreIntParameter(String name,
int value)
Sets the value of a core int parameter. |
void |
setCoreLongParameter(String name,
long value)
Sets the value of a core long parameter. |
void |
setCoreStringParameter(String name,
String value)
Sets the value of a core string parameter. |
static void |
setEnablePluginCoreConfigChange(boolean enabled)
|
void |
setFloatParameter(String name,
float value)
Sets the value of a core float parameter. |
void |
setIntParameter(String name,
int value)
Sets the value of a core int parameter. |
void |
setLongParameter(String name,
long value)
Sets the value of a core long parameter. |
void |
setPluginColorParameter(String name,
int[] value)
Sets the value of a plugin color parameter. |
void |
setPluginColorParameter(String name,
int[] value,
boolean override)
Sets the value of a plugin color parameter. |
void |
setPluginConfigKeyPrefix(String _key)
|
void |
setPluginConfigSource(PluginConfigSource source)
Sets the plugin configuration source object to use for storing parameters for this plugin config object. |
void |
setPluginListParameter(String key,
List value)
Sets the value of a plugin list parameter. |
void |
setPluginMapParameter(String key,
Map value)
Sets the value of a plugin map parameter. |
void |
setPluginParameter(String name,
boolean value)
Sets the value of a plugin boolean parameter. |
void |
setPluginParameter(String name,
byte[] value)
Sets the value of a plugin byte array parameter. |
void |
setPluginParameter(String name,
float value)
Sets the value of a plugin float parameter. |
void |
setPluginParameter(String name,
int value)
Sets the value of a plugin int parameter. |
void |
setPluginParameter(String key,
int value,
boolean global)
Sets the value of a plugin int parameter. |
void |
setPluginParameter(String name,
long value)
Sets the value of a plugin long parameter. |
void |
setPluginParameter(String name,
String value)
Sets the value of a plugin string parameter. |
void |
setPluginStringListParameter(String key,
String[] value)
Sets the value of a plugin string-list parameter. |
void |
setStringParameter(String name,
String value)
Sets the value of a core string parameter. |
void |
setUnsafeBooleanParameter(String name,
boolean value)
Sets the value of a core boolean parameter. |
void |
setUnsafeByteParameter(String name,
byte[] value)
Sets the value of a core byte array parameter. |
void |
setUnsafeColorParameter(String name,
int[] value)
Returns the value of a core color parameter. |
void |
setUnsafeColorParameter(String name,
int[] value,
boolean override)
Returns the value of a core color parameter. |
void |
setUnsafeFloatParameter(String name,
float value)
Sets the value of a core float parameter. |
void |
setUnsafeIntParameter(String name,
int value)
Sets the value of a core int parameter. |
void |
setUnsafeLongParameter(String name,
long value)
Sets the value of a core long parameter. |
void |
setUnsafeStringParameter(String name,
String value)
Sets the value of a core string parameter. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static Map<String,String> external_to_internal_key_map
Constructor Detail |
---|
public PluginConfigImpl(PluginInterface _plugin_interface, String _key)
Method Detail |
---|
public void checkValidCoreParam(String name)
public static void setEnablePluginCoreConfigChange(boolean enabled)
public boolean isNewInstall()
isNewInstall
in interface PluginConfig
public String getPluginConfigKeyPrefix()
getPluginConfigKeyPrefix
in interface PluginConfig
public void setPluginConfigKeyPrefix(String _key)
setPluginConfigKeyPrefix
in interface PluginConfig
public boolean getBooleanParameter(String name)
PluginConfig
getBooleanParameter
in interface PluginConfig
name
- The parameter name.
public boolean getBooleanParameter(String name, boolean default_value)
PluginConfig
getBooleanParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public byte[] getByteParameter(String name)
PluginConfig
getByteParameter
in interface PluginConfig
name
- The parameter name.
public byte[] getByteParameter(String name, byte[] default_value)
PluginConfig
getByteParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public float getFloatParameter(String name)
PluginConfig
getFloatParameter
in interface PluginConfig
name
- The parameter name.
public float getFloatParameter(String name, float default_value)
PluginConfig
getFloatParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public int getIntParameter(String name)
PluginConfig
getIntParameter
in interface PluginConfig
name
- The parameter name.
public int getIntParameter(String name, int default_value)
PluginConfig
getIntParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public long getLongParameter(String name)
PluginConfig
getLongParameter
in interface PluginConfig
name
- The parameter name.
public long getLongParameter(String name, long default_value)
PluginConfig
getLongParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public String getStringParameter(String name)
PluginConfig
getStringParameter
in interface PluginConfig
name
- The parameter name.
public String getStringParameter(String name, String default_value)
PluginConfig
getStringParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public boolean getCoreBooleanParameter(String name)
PluginConfig
getCoreBooleanParameter
in interface PluginConfig
name
- The parameter name.
public boolean getCoreBooleanParameter(String name, boolean default_value)
PluginConfig
getCoreBooleanParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public byte[] getCoreByteParameter(String name)
PluginConfig
getCoreByteParameter
in interface PluginConfig
name
- The parameter name.
public byte[] getCoreByteParameter(String name, byte[] default_value)
PluginConfig
getCoreByteParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public int[] getCoreColorParameter(String name)
PluginConfig
It will return null if no color parameter is stored, or an integer array of size 4 representing the red, green and blue values, and a flag indicating if the color is an override of the default or not (0 indicates no override, 1 means it is overridden).
In many cases, the override flag can just be ignored.
getCoreColorParameter
in interface PluginConfig
name
- The parameter name.
public int[] getCoreColorParameter(String name, int[] default_value)
PluginConfig
It will return null if no color parameter is stored, or an integer array of size 4 representing the red, green and blue values, and a flag indicating if the color is an override of the default or not (0 indicates no override, 1 means it is overridden).
In many cases, the override flag can just be ignored.
getCoreColorParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public float getCoreFloatParameter(String name)
PluginConfig
getCoreFloatParameter
in interface PluginConfig
name
- The parameter name.
public float getCoreFloatParameter(String name, float default_value)
PluginConfig
getCoreFloatParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public int getCoreIntParameter(String name)
PluginConfig
getCoreIntParameter
in interface PluginConfig
name
- The parameter name.
public int getCoreIntParameter(String name, int default_value)
PluginConfig
getCoreIntParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public long getCoreLongParameter(String name)
PluginConfig
getCoreLongParameter
in interface PluginConfig
name
- The parameter name.
public long getCoreLongParameter(String name, long default_value)
PluginConfig
getCoreLongParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public String getCoreStringParameter(String name)
PluginConfig
getCoreStringParameter
in interface PluginConfig
name
- The parameter name.
public String getCoreStringParameter(String name, String default_value)
PluginConfig
getCoreStringParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public void setBooleanParameter(String name, boolean value)
PluginConfig
setBooleanParameter
in interface PluginConfig
name
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.public void setByteParameter(String name, byte[] value)
PluginConfig
setByteParameter
in interface PluginConfig
name
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.public void setColorParameter(String name, int[] value)
public void setColorParameter(String name, int[] value, boolean override)
public void setFloatParameter(String name, float value)
PluginConfig
setFloatParameter
in interface PluginConfig
name
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.public void setIntParameter(String name, int value)
PluginConfig
setIntParameter
in interface PluginConfig
name
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.public void setLongParameter(String name, long value)
PluginConfig
setLongParameter
in interface PluginConfig
name
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.public void setStringParameter(String name, String value)
PluginConfig
setStringParameter
in interface PluginConfig
name
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.public void setCoreBooleanParameter(String name, boolean value)
PluginConfig
setCoreBooleanParameter
in interface PluginConfig
name
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.public void setCoreByteParameter(String name, byte[] value)
PluginConfig
setCoreByteParameter
in interface PluginConfig
name
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.public void setCoreColorParameter(String name, int[] value)
PluginConfig
The value should be an integer array of size 3 representing the red, green and blue values - or null to disable it.
setCoreColorParameter
in interface PluginConfig
name
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.public void setCoreColorParameter(String name, int[] value, boolean override)
PluginConfig
The value should be an integer array of size 3 representing the red, green and blue values - or null to disable it.
The override flag is used to indicate if the value being set is overriding the default value. This is mainly used for interface purposes.
setCoreColorParameter
in interface PluginConfig
name
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.override
- true if the value is overridden from the default.public void setCoreFloatParameter(String name, float value)
PluginConfig
setCoreFloatParameter
in interface PluginConfig
name
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.public void setCoreIntParameter(String name, int value)
PluginConfig
setCoreIntParameter
in interface PluginConfig
name
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.public void setCoreLongParameter(String name, long value)
PluginConfig
setCoreLongParameter
in interface PluginConfig
name
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.public void setCoreStringParameter(String name, String value)
PluginConfig
setCoreStringParameter
in interface PluginConfig
name
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.public boolean getPluginBooleanParameter(String name)
PluginConfig
getPluginBooleanParameter
in interface PluginConfig
name
- The parameter name.
public boolean getPluginBooleanParameter(String name, boolean default_value)
PluginConfig
getPluginBooleanParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public byte[] getPluginByteParameter(String name)
PluginConfig
getPluginByteParameter
in interface PluginConfig
name
- The parameter name.
public byte[] getPluginByteParameter(String name, byte[] default_value)
PluginConfig
getPluginByteParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public int[] getPluginColorParameter(String name)
PluginConfig
It will return null if no color parameter is stored, or an integer array of size 4 representing the red, green and blue values, and a flag indicating if the color is an override of the default or not (0 indicates no override, 1 means it is overridden).
In many cases, the override flag can just be ignored.
getPluginColorParameter
in interface PluginConfig
name
- The parameter name.
public int[] getPluginColorParameter(String name, int[] default_value)
PluginConfig
It will return null if no color parameter is stored, or an integer array of size 4 representing the red, green and blue values, and a flag indicating if the color is an override of the default or not (0 indicates no override, 1 means it is overridden).
In many cases, the override flag can just be ignored.
getPluginColorParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public float getPluginFloatParameter(String name)
PluginConfig
getPluginFloatParameter
in interface PluginConfig
name
- The parameter name.
public float getPluginFloatParameter(String name, float default_value)
PluginConfig
getPluginFloatParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public int getPluginIntParameter(String name)
PluginConfig
getPluginIntParameter
in interface PluginConfig
name
- The parameter name.
public int getPluginIntParameter(String name, int default_value)
PluginConfig
getPluginIntParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public long getPluginLongParameter(String name)
PluginConfig
getPluginLongParameter
in interface PluginConfig
name
- The parameter name.
public long getPluginLongParameter(String name, long default_value)
PluginConfig
getPluginLongParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public String getPluginStringParameter(String name)
PluginConfig
getPluginStringParameter
in interface PluginConfig
name
- The parameter name.
public String getPluginStringParameter(String name, String default_value)
PluginConfig
getPluginStringParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public void setPluginParameter(String name, boolean value)
PluginConfig
setPluginParameter
in interface PluginConfig
name
- The parameter name.value
- The new value for the parameter.public void setPluginParameter(String name, byte[] value)
PluginConfig
setPluginParameter
in interface PluginConfig
name
- The parameter name.value
- The new value for the parameter.public void setPluginParameter(String name, float value)
PluginConfig
setPluginParameter
in interface PluginConfig
name
- The parameter name.value
- The new value for the parameter.public void setPluginParameter(String name, int value)
PluginConfig
setPluginParameter
in interface PluginConfig
name
- The parameter name.value
- The new value for the parameter.public void setPluginParameter(String name, long value)
PluginConfig
setPluginParameter
in interface PluginConfig
name
- The parameter name.value
- The new value for the parameter.public void setPluginParameter(String name, String value)
PluginConfig
setPluginParameter
in interface PluginConfig
name
- The parameter name.value
- The new value for the parameter.public void setPluginColorParameter(String name, int[] value)
PluginConfig
The value should be an integer array of size 3 representing the red, green and blue values - or null to disable it.
setPluginColorParameter
in interface PluginConfig
name
- The parameter name.value
- The new value for the parameter.public void setPluginColorParameter(String name, int[] value, boolean override)
PluginConfig
The value should be an integer array of size 3 representing the red, green and blue values - or null to disable it.
The override flag is used to indicate if the value being set is overriding the default value. This is mainly used for interface purposes.
setPluginColorParameter
in interface PluginConfig
name
- The parameter name.value
- The new value for the parameter.override
- true if the value is overridden from the default.public boolean getUnsafeBooleanParameter(String name)
PluginConfig
getUnsafeBooleanParameter
in interface PluginConfig
name
- The parameter name.
public boolean getUnsafeBooleanParameter(String name, boolean default_value)
PluginConfig
getUnsafeBooleanParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public byte[] getUnsafeByteParameter(String name)
PluginConfig
getUnsafeByteParameter
in interface PluginConfig
name
- The parameter name.
public byte[] getUnsafeByteParameter(String name, byte[] default_value)
PluginConfig
getUnsafeByteParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public int[] getUnsafeColorParameter(String name)
PluginConfig
It will return null if no color parameter is stored, or an integer array of size 4 representing the red, green and blue values, and a flag indicating if the color is an override of the default or not (0 indicates no override, 1 means it is overridden).
In many cases, the override flag can just be ignored.
getUnsafeColorParameter
in interface PluginConfig
name
- The parameter name.
public int[] getUnsafeColorParameter(String name, int[] default_value)
PluginConfig
It will return null if no color parameter is stored, or an integer array of size 4 representing the red, green and blue values, and a flag indicating if the color is an override of the default or not (0 indicates no override, 1 means it is overridden).
In many cases, the override flag can just be ignored.
getUnsafeColorParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public float getUnsafeFloatParameter(String name)
PluginConfig
getUnsafeFloatParameter
in interface PluginConfig
name
- The parameter name.
public float getUnsafeFloatParameter(String name, float default_value)
PluginConfig
getUnsafeFloatParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public int getUnsafeIntParameter(String name)
PluginConfig
getUnsafeIntParameter
in interface PluginConfig
name
- The parameter name.
public int getUnsafeIntParameter(String name, int default_value)
PluginConfig
getUnsafeIntParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public long getUnsafeLongParameter(String name)
PluginConfig
getUnsafeLongParameter
in interface PluginConfig
name
- The parameter name.
public long getUnsafeLongParameter(String name, long default_value)
PluginConfig
getUnsafeLongParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public String getUnsafeStringParameter(String name)
PluginConfig
getUnsafeStringParameter
in interface PluginConfig
name
- The parameter name.
public String getUnsafeStringParameter(String name, String default_value)
PluginConfig
getUnsafeStringParameter
in interface PluginConfig
name
- The parameter name.default_value
- The default value to return if one is not defined.
public void setUnsafeBooleanParameter(String name, boolean value)
PluginConfig
setUnsafeBooleanParameter
in interface PluginConfig
name
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.public void setUnsafeByteParameter(String name, byte[] value)
PluginConfig
setUnsafeByteParameter
in interface PluginConfig
name
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.public void setUnsafeColorParameter(String name, int[] value)
PluginConfig
The value should be an integer array of size 3 representing the red, green and blue values - or null to disable it.
setUnsafeColorParameter
in interface PluginConfig
name
- The parameter name.value
- The new value for the parameter.public void setUnsafeColorParameter(String name, int[] value, boolean override)
PluginConfig
The value should be an integer array of size 3 representing the red, green and blue values - or null to disable it.
The override flag is used to indicate if the value being set is overriding the default value. This is mainly used for interface purposes.
setUnsafeColorParameter
in interface PluginConfig
name
- The parameter name.value
- The default value to return if one is not defined.override
- true if the value is overridden from the default.public void setUnsafeFloatParameter(String name, float value)
PluginConfig
setUnsafeFloatParameter
in interface PluginConfig
name
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.public void setUnsafeIntParameter(String name, int value)
PluginConfig
setUnsafeIntParameter
in interface PluginConfig
name
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.public void setUnsafeLongParameter(String name, long value)
PluginConfig
setUnsafeLongParameter
in interface PluginConfig
name
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.public void setUnsafeStringParameter(String name, String value)
PluginConfig
setUnsafeStringParameter
in interface PluginConfig
name
- The parameter name, which must be one defined from the above core constants.value
- The new value for the parameter.public String[] getPluginStringListParameter(String key)
PluginConfig
getPluginStringListParameter
in interface PluginConfig
key
- The parameter name.
public void setPluginStringListParameter(String key, String[] value)
PluginConfig
setPluginStringListParameter
in interface PluginConfig
key
- The parameter name.value
- The new value of the parameter.public List getPluginListParameter(String key, List default_value)
PluginConfig
getPluginListParameter
in interface PluginConfig
key
- The parameter name.default_value
- The default value to return if one is not defined.
public void setPluginListParameter(String key, List value)
PluginConfig
setPluginListParameter
in interface PluginConfig
key
- The parameter name.value
- The new value for the parameter.public Map getPluginMapParameter(String key, Map default_value)
PluginConfig
getPluginMapParameter
in interface PluginConfig
key
- The parameter name.default_value
- The default value to return if one is not defined.
public void setPluginMapParameter(String key, Map value)
PluginConfig
setPluginMapParameter
in interface PluginConfig
key
- The parameter name.value
- The new value for the parameter.public void setPluginParameter(String key, int value, boolean global)
PluginConfig
setPluginParameter
in interface PluginConfig
key
- The parameter name.value
- The new value for the parameter.global
- Whether or not this parameter should be made externally accessible.public ConfigParameter getParameter(String key)
getParameter
in interface PluginConfig
public ConfigParameter getPluginParameter(String key)
getPluginParameter
in interface PluginConfig
public boolean removePluginParameter(String key)
PluginConfig
removePluginParameter
in interface PluginConfig
key
- Name of the parameter.
public boolean removePluginColorParameter(String key)
PluginConfig
removePluginColorParameter
in interface PluginConfig
key
- Name of the parameter.
public Map getUnsafeParameterList()
PluginConfig
getUnsafeParameterList
in interface PluginConfig
public void save()
PluginConfig
save
in interface PluginConfig
public File getPluginUserFile(String name)
PluginConfig
This will be azureus-user-dir/plugins/plugin-name/name.
getPluginUserFile
in interface PluginConfig
public void addListener(PluginConfigListener l)
addListener
in interface PluginConfig
public boolean hasParameter(String param_name)
PluginConfig
hasParameter
in interface PluginConfig
public boolean hasPluginParameter(String param_name)
PluginConfig
hasPluginParameter
in interface PluginConfig
public void notifyRGBParamExists(String param)
public void notifyParamExists(String param)
public PluginConfigSource enableExternalConfigSource()
PluginConfig
PluginConfigSource.initialize()
for the
external configuration file to be properly integrated with Azureus.
When a plugin is first initialised, it should call this method as soon as possible during the initialization stage. This then configures the PluginConfig object to store any parameter values into an external configuration file (rather than storing it directly with the main configuration file used by Azureus).
When this method is invoked, it will return an object which allows the filename to be chosen - it allows a limited amount of manipulation of the configuration file. This method only needs to be invoked once.
All methods which get and set plugin parameters on this object will store
data in the external configuration file. The use of classes like
BasicPluginConfigModel
will automatically integrate parameters to the external configuration
source.
However, if you use any other mechanism to store parameter data, you may need to call
the registerParameter
to integrate the parameter properly.
enableExternalConfigSource
in interface PluginConfig
public PluginConfigSource getPluginConfigSource()
PluginConfig
getPluginConfigSource
in interface PluginConfig
public void setPluginConfigSource(PluginConfigSource source)
PluginConfig
This method should only be used as an alternative to PluginConfig.enableExternalConfigSource()
.
You will only need to use this method if you use the
getLocalPluginInterface
method to store data in a separate namespace, but want to use the same configuration file to
store data in.
setPluginConfigSource
in interface PluginConfig
source
- The PluginConfigSource object to use.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |