plugins.adufour.vars.lang
Class VarPlugin<P extends icy.plugin.abstract_.Plugin>

java.lang.Object
  extended by plugins.adufour.vars.lang.Var<icy.plugin.PluginDescriptor>
      extended by plugins.adufour.vars.lang.VarPlugin<P>
All Implemented Interfaces:
icy.file.xml.XMLPersistent, VarListener<icy.plugin.PluginDescriptor>

public class VarPlugin<P extends icy.plugin.abstract_.Plugin>
extends Var<icy.plugin.PluginDescriptor>

Variable that manipulates a plug-in definition

Author:
Alexandre Dufour

Field Summary
 java.lang.Class<P> pluginType
           
 
Fields inherited from class plugins.adufour.vars.lang.Var
listeners, NO_VALUE, type, XML_KEY_ID
 
Constructor Summary
VarPlugin(java.lang.String name, java.lang.Class<P> pluginType)
           
 
Method Summary
 VarEditor<icy.plugin.PluginDescriptor> createVarEditor()
          Creates a new VarEditor object that allows the user to graphically adjust the value of this variable.
 java.lang.String getValueAsString()
           
 P newInstance()
           
 icy.plugin.PluginDescriptor parse(java.lang.String text)
          Parses the given String into the current type
 
Methods inherited from class plugins.adufour.vars.lang.Var
addListener, createVarViewer, fireVariableChanged, fireVariableChanged, getDefaultEditorModel, getDefaultValue, getIterableReferrers, getName, getReference, getReferencingPolicy, getReferrers, getType, getTypeAsString, getValue, getValue, getValueAsString, isAssignableFrom, isEnabled, isOptional, isReferenced, loadFromXML, prettyPrint, referenceChanged, removeListener, removeListeners, saveToXML, setDefaultEditorModel, setEnabled, setOptional, setReference, setReferencingPolicy, setValue, toString, valueChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

pluginType

public final java.lang.Class<P extends icy.plugin.abstract_.Plugin> pluginType
Constructor Detail

VarPlugin

public VarPlugin(java.lang.String name,
                 java.lang.Class<P> pluginType)
Method Detail

createVarEditor

public VarEditor<icy.plugin.PluginDescriptor> createVarEditor()
Description copied from class: Var
Creates a new VarEditor object that allows the user to graphically adjust the value of this variable. By default this editor is an empty label for generic types, but this method can be overridden to provide a custom editor.

Overrides:
createVarEditor in class Var<icy.plugin.PluginDescriptor>
Returns:
the variable editor embarking the graphical component

newInstance

public P newInstance()

getValueAsString

public java.lang.String getValueAsString()
Overrides:
getValueAsString in class Var<icy.plugin.PluginDescriptor>
Returns:
a pretty-printed text representation of the variable's local value (referenced variables are not followed). This text is used to display the value (e.g. in a graphical interface) or store the value into XML files. Overriding implementations should make sure that the result of this method is compatible with the Var.parse(String) method to ensure proper reloading from XML files.

parse

public icy.plugin.PluginDescriptor parse(java.lang.String text)
Description copied from class: Var
Parses the given String into the current type

Overrides:
parse in class Var<icy.plugin.PluginDescriptor>
Returns:
The variable value corresponding to the given string