plugins.adufour.vars.lang
Class VarFileArray

java.lang.Object
  extended by plugins.adufour.vars.lang.Var<A>
      extended by plugins.adufour.vars.lang.VarGenericArray<java.io.File[]>
          extended by plugins.adufour.vars.lang.VarFileArray
All Implemented Interfaces:
icy.file.xml.XMLPersistent, ArrayType, VarListener<java.io.File[]>

public class VarFileArray
extends VarGenericArray<java.io.File[]>

Specialized implementation of Var to manipulate file arrays

Author:
Alexandre Dufour

Field Summary
 
Fields inherited from class plugins.adufour.vars.lang.Var
listeners, NO_VALUE, type, XML_KEY_ID
 
Constructor Summary
VarFileArray(java.lang.String name, java.io.File[] defaultValues)
           
 
Method Summary
 VarEditor<java.io.File[]> createVarEditor()
          Creates a new VarEditor object that allows the user to graphically adjust the value of this variable.
 java.lang.String getSeparator(int dimension)
           
 java.lang.Object parseComponent(java.lang.String s)
          Parse a string representing an element of the underlying array.
 boolean saveToXML(org.w3c.dom.Node node)
          Saves the current variable to the specified node
 
Methods inherited from class plugins.adufour.vars.lang.VarGenericArray
getDimensions, getInnerType, getValue, isAssignableFrom, parse, size, size
 
Methods inherited from class plugins.adufour.vars.lang.Var
addListener, createVarViewer, fireVariableChanged, fireVariableChanged, getDefaultEditorModel, getDefaultValue, getIterableReferrers, getName, getReference, getReferencingPolicy, getReferrers, getType, getTypeAsString, getValue, getValueAsString, getValueAsString, isEnabled, isOptional, isReferenced, loadFromXML, prettyPrint, referenceChanged, removeListener, removeListeners, 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
 

Constructor Detail

VarFileArray

public VarFileArray(java.lang.String name,
                    java.io.File[] defaultValues)
Method Detail

getSeparator

public java.lang.String getSeparator(int dimension)
Specified by:
getSeparator in interface ArrayType
Overrides:
getSeparator in class VarGenericArray<java.io.File[]>
Parameters:
dimension - the dimension for which the separator is wanted
Returns:
The character used to separate array values when displaying the value as a String

saveToXML

public boolean saveToXML(org.w3c.dom.Node node)
                  throws java.lang.UnsupportedOperationException
Saves the current variable to the specified node

Specified by:
saveToXML in interface icy.file.xml.XMLPersistent
Overrides:
saveToXML in class Var<java.io.File[]>
Throws:
java.lang.UnsupportedOperationException - if the functionality is not supported by the current variable type

createVarEditor

public VarEditor<java.io.File[]> 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<java.io.File[]>
Returns:
the variable editor embarking the graphical component

parseComponent

public java.lang.Object parseComponent(java.lang.String s)
Description copied from class: VarGenericArray
Parse a string representing an element of the underlying array. Note that this method throws an UnsupportedOperationException by default, therefore the implementation must be provided by overriding classes

Specified by:
parseComponent in interface ArrayType
Overrides:
parseComponent in class VarGenericArray<java.io.File[]>
Parameters:
s - the string to parse
Returns:
a primitive type representing the given string