org.jppf.ui.options
Class AbstractOptionElement

java.lang.Object
  extended by org.jppf.ui.options.AbstractOptionProperties
      extended by org.jppf.ui.options.AbstractOptionElement
All Implemented Interfaces:
Serializable, OptionElement, OptionProperties
Direct Known Subclasses:
AbstractOption, OptionPanel, SplitPaneOption, TabbedPaneOption, ToolbarOption

public abstract class AbstractOptionElement
extends AbstractOptionProperties
implements OptionElement

Default abstract implementation of the OptionElement interface.

Author:
Laurent Cohen
See Also:
Serialized Form

Field Summary
protected  OptionElement parent
          The parent panel for this option element.
protected  OptionElement root
          The root of the option tree this option belongs to.
 
Fields inherited from class org.jppf.ui.options.AbstractOptionProperties
bordered, componentConstraints, eventsEnabled, finalizer, iconPath, initializer, label, layoutConstraints, name, scripts, scrollable, toolTipText, UIComponent
 
Constructor Summary
protected AbstractOptionElement()
          Constructor provided as a convenience to facilitate the creation of option elements through reflexion.
 
Method Summary
protected  void findAll(String name, List<OptionElement> list)
          Find all the elements with the specified name in the subtree of which this element is the root.
 List<OptionElement> findAllWithName(String name)
          Find all the elements with the specified name in the subtree of which this element is the root.
 OptionElement findElement(String path)
          Find the element with the specified path in the options tree.
 OptionElement findFirstWithName(String name)
          Find the first element with the specified name in the subtree of which this element is the root.
 OptionElement findLastWithName(String name)
          Find the last element with the specified name in the subtree of which this element is the root.
protected  OptionElement getChildForName(String childName)
          Find the child element of this option element with the specified name.
 OptionElement getParent()
          Get the parent panel for this option.
 TreePath getPath()
          Get the path of this element in the option tree.
 OptionElement getRoot()
          Get the root of the option tree this option belongs to.
 String getStringPath()
          Get the path of this element in the option tree.
 void setParent(OptionElement parent)
          Set the parent panel for this option.
 String toString()
          Get a string representation of this element.
 
Methods inherited from class org.jppf.ui.options.AbstractOptionProperties
createUI, getComponentConstraints, getFinalizer, getIconPath, getInitializer, getLabel, getLayoutConstraints, getName, getScripts, getToolTipText, getUIComponent, isBordered, isEventsEnabled, isScrollable, setBordered, setComponentConstraints, setEditable, setEventsEnabled, setFinalizer, setIconPath, setInitializer, setLabel, setLayoutConstraints, setName, setScrollable, setToolTipText, setUIComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jppf.ui.options.OptionProperties
getComponentConstraints, getFinalizer, getIconPath, getInitializer, getLabel, getLayoutConstraints, getName, getScripts, getToolTipText, getUIComponent, isBordered, isEventsEnabled, isScrollable, setComponentConstraints, setEditable, setEnabled, setEventsEnabled, setLayoutConstraints
 

Field Detail

parent

protected OptionElement parent
The parent panel for this option element.


root

protected OptionElement root
The root of the option tree this option belongs to.

Constructor Detail

AbstractOptionElement

protected AbstractOptionElement()
Constructor provided as a convenience to facilitate the creation of option elements through reflexion.

Method Detail

getParent

public OptionElement getParent()
Get the parent panel for this option.

Specified by:
getParent in interface OptionElement
Returns:
an ElementOption instance.
See Also:
OptionElement.getParent()

setParent

public void setParent(OptionElement parent)
Set the parent panel for this option.

Parameters:
parent - an ElementOption instance.

getRoot

public OptionElement getRoot()
Get the root of the option tree this option belongs to.

Specified by:
getRoot in interface OptionElement
Specified by:
getRoot in interface OptionProperties
Returns:
a OptionElement instance.
See Also:
OptionElement.getRoot()

getPath

public TreePath getPath()
Get the path of this element in the option tree.

Specified by:
getPath in interface OptionElement
Returns:
a TreePath whose components are OptionElement instances.
See Also:
OptionElement.getPath()

getStringPath

public String getStringPath()
Get the path of this element in the option tree.

Specified by:
getStringPath in interface OptionElement
Returns:
a TreePath whose components are OptionElement instances.
See Also:
OptionElement.getPath()

findElement

public OptionElement findElement(String path)
Find the element with the specified path in the options tree. The path can be absolute, in which case it starts with a "e;/"e, otherwise it is considered relative to the requesting element.

Specified by:
findElement in interface OptionElement
Parameters:
path - the path of the element to find.
Returns:
an OptionElement instance, or null if no element could be found with the specfied path.
See Also:
OptionElement.findElement(java.lang.String)

getChildForName

protected OptionElement getChildForName(String childName)
Find the child element of this option element with the specified name.

Parameters:
childName - the name of the child to find.
Returns:
the child with the specified name, or null if this element is not an option page, or if no child was found with the given name.

toString

public String toString()
Get a string representation of this element.

Overrides:
toString in class Object
Returns:
a strign providing information about this option element.
See Also:
Object.toString()

findAllWithName

public List<OptionElement> findAllWithName(String name)
Find all the elements with the specified name in the subtree of which this element is the root.

Specified by:
findAllWithName in interface OptionElement
Parameters:
name - the name of the elements to find.
Returns:
a list of OptionElement instances, or null if no element could be found with the specfied name. The resulting list can be empty, but never null.
See Also:
OptionElement.findAllWithName(java.lang.String)

findFirstWithName

public OptionElement findFirstWithName(String name)
Find the first element with the specified name in the subtree of which this element is the root.

Specified by:
findFirstWithName in interface OptionElement
Parameters:
name - the name of the element to find.
Returns:
an OptionElement instance, or null if no element could be found with the specfied name.
See Also:
OptionElement.findFirstWithName(java.lang.String)

findLastWithName

public OptionElement findLastWithName(String name)
Find the last element with the specified name in the subtree of which this element is the root. The notion of last element relates to a depth-first search in the tree.

Specified by:
findLastWithName in interface OptionElement
Parameters:
name - the name of the element to find.
Returns:
an OptionElement instance, or null if no element could be found with the specfied name.
See Also:
OptionElement.findLastWithName(java.lang.String)

findAll

protected void findAll(String name,
                       List<OptionElement> list)
Find all the elements with the specified name in the subtree of which this element is the root.

Parameters:
name - the name of the elements to find.
list - a list of OptionElement instances, to fill with the elements found. could be found with the specfied name. The resulting list can be empty, but never null.


Copyright © 2005-2010 JPPF Team.