org.jppf.ui.options.xml
Class OptionElementFactory

java.lang.Object
  extended by org.jppf.ui.options.xml.OptionElementFactory

public class OptionElementFactory
extends Object

Factory class used to build UI eleemnts from XML descriptors.

Author:
Laurent Cohen

Constructor Summary
OptionElementFactory(OptionsPageBuilder builder)
          Initialize this factory.
 
Method Summary
 void addDebugComp(OptionElement elt, String source, String location)
          Add an invisible component from which to get a popup menu to reload the page.
 Option buildBoolean(OptionDescriptor desc)
          Build a check box option from the specified option descriptor.
 Option buildButton(OptionDescriptor desc)
          Build a button option from the specified option descriptor.
 Option buildComboBox(OptionDescriptor desc)
          Build a combo box option from the specified option descriptor.
 Option buildCustomOption(OptionDescriptor desc)
          Build a custom option implemented as a Java class.
 Option buildFileChooser(OptionDescriptor desc)
          Build a file chooser option from the specified option descriptor.
 Option buildFiller(OptionDescriptor desc)
          Build a filler option from the specified option descriptor.
 Option buildFormattedNumber(OptionDescriptor desc)
          Build a formatted number option from the specified option descriptor.
 Option buildJavaOption(OptionDescriptor desc)
          Build an option with a UI component created from a Java class.
 Option buildJobDataPanel(OptionDescriptor desc)
          Build a JobDataPanel from the specified descriptor.
 Option buildLabel(OptionDescriptor desc)
          Build a label option from the specified option descriptor.
 Option buildList(OptionDescriptor desc)
          Build a list option from the specified option descriptor.
 Option buildNodeDataPanel(OptionDescriptor desc)
          Build a NodeDataPanel from the specified descriptor.
 OptionElement buildPage(OptionDescriptor desc)
          Build an option page from the specified option descriptor.
 Option buildPassword(OptionDescriptor desc)
          Build a password option from the specified option descriptor.
 Option buildPlainText(OptionDescriptor desc)
          Build a plain text option from the specified option descriptor.
 Option buildRadio(OptionDescriptor desc)
          Build a radsio button option from the specified option descriptor.
 Option buildSpinnerNumber(OptionDescriptor desc)
          Build a spinner number option from the specified option descriptor.
 OptionElement buildSplitPane(OptionDescriptor desc)
          Build a split pane option from the specified option descriptor.
 OptionElement buildTabbedPane(OptionDescriptor desc)
          Build a toolbar option from the specified option descriptor.
 Option buildTextArea(OptionDescriptor desc)
          Build a text area option from the specified option descriptor.
 OptionElement buildToolbar(OptionDescriptor desc)
          Build a toolbar option from the specified option descriptor.
 Option buildToolbarSeparator(OptionDescriptor desc)
          Build a toolbar separator option from the specified option descriptor.
 List<OptionElement> loadImport(OptionDescriptor desc)
          Build a toolbar option from the specified option descriptor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OptionElementFactory

public OptionElementFactory(OptionsPageBuilder builder)
Initialize this factory.

Parameters:
builder - the builder using this factory.
Method Detail

buildPage

public OptionElement buildPage(OptionDescriptor desc)
                        throws Exception
Build an option page from the specified option descriptor.

Parameters:
desc - the descriptor to get the page properties from.
Returns:
an OptionsPage instance, or null if the page could not be build.
Throws:
Exception - if an error was raised while building the page.

buildSplitPane

public OptionElement buildSplitPane(OptionDescriptor desc)
                             throws Exception
Build a split pane option from the specified option descriptor.

Parameters:
desc - the descriptor to get the properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.

buildToolbar

public OptionElement buildToolbar(OptionDescriptor desc)
                           throws Exception
Build a toolbar option from the specified option descriptor.

Parameters:
desc - the descriptor to get the properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.

buildTabbedPane

public OptionElement buildTabbedPane(OptionDescriptor desc)
                              throws Exception
Build a toolbar option from the specified option descriptor.

Parameters:
desc - the descriptor to get the properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.

buildButton

public Option buildButton(OptionDescriptor desc)
                   throws Exception
Build a button option from the specified option descriptor.

Parameters:
desc - the descriptor to get the page properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.

buildLabel

public Option buildLabel(OptionDescriptor desc)
                  throws Exception
Build a label option from the specified option descriptor.

Parameters:
desc - the descriptor to get the page properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.

buildTextArea

public Option buildTextArea(OptionDescriptor desc)
                     throws Exception
Build a text area option from the specified option descriptor.

Parameters:
desc - the descriptor to get the page properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.

buildPassword

public Option buildPassword(OptionDescriptor desc)
                     throws Exception
Build a password option from the specified option descriptor.

Parameters:
desc - the descriptor to get the page properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.

buildPlainText

public Option buildPlainText(OptionDescriptor desc)
                      throws Exception
Build a plain text option from the specified option descriptor.

Parameters:
desc - the descriptor to get the page properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.

buildFormattedNumber

public Option buildFormattedNumber(OptionDescriptor desc)
                            throws Exception
Build a formatted number option from the specified option descriptor.

Parameters:
desc - the descriptor to get the page properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.

buildSpinnerNumber

public Option buildSpinnerNumber(OptionDescriptor desc)
                          throws Exception
Build a spinner number option from the specified option descriptor.

Parameters:
desc - the descriptor to get the page properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.

buildBoolean

public Option buildBoolean(OptionDescriptor desc)
                    throws Exception
Build a check box option from the specified option descriptor.

Parameters:
desc - the descriptor to get the page properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.

buildRadio

public Option buildRadio(OptionDescriptor desc)
                  throws Exception
Build a radsio button option from the specified option descriptor.

Parameters:
desc - the descriptor to get the page properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.

buildComboBox

public Option buildComboBox(OptionDescriptor desc)
                     throws Exception
Build a combo box option from the specified option descriptor.

Parameters:
desc - the descriptor to get the page properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.

buildList

public Option buildList(OptionDescriptor desc)
                 throws Exception
Build a list option from the specified option descriptor.

Parameters:
desc - the descriptor to get the page properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.

buildFiller

public Option buildFiller(OptionDescriptor desc)
                   throws Exception
Build a filler option from the specified option descriptor.

Parameters:
desc - the descriptor to get the properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.

buildToolbarSeparator

public Option buildToolbarSeparator(OptionDescriptor desc)
                             throws Exception
Build a toolbar separator option from the specified option descriptor.

Parameters:
desc - the descriptor to get the properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.

buildFileChooser

public Option buildFileChooser(OptionDescriptor desc)
                        throws Exception
Build a file chooser option from the specified option descriptor.

Parameters:
desc - the descriptor to get the page properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.

loadImport

public List<OptionElement> loadImport(OptionDescriptor desc)
                               throws Exception
Build a toolbar option from the specified option descriptor.

Parameters:
desc - the descriptor to get the properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.

addDebugComp

public void addDebugComp(OptionElement elt,
                         String source,
                         String location)
Add an invisible component from which to get a popup menu to reload the page.

Parameters:
elt - - the option to debug.
source - - determines whether the XML is loaded from a url or file location.
location - - where to load the xml descriptor from.

buildJavaOption

public Option buildJavaOption(OptionDescriptor desc)
                       throws Exception
Build an option with a UI component created from a Java class.

Parameters:
desc - the descriptor to get the properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.

buildNodeDataPanel

public Option buildNodeDataPanel(OptionDescriptor desc)
                          throws Exception
Build a NodeDataPanel from the specified descriptor.

Parameters:
desc - the descriptor to get the properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.

buildJobDataPanel

public Option buildJobDataPanel(OptionDescriptor desc)
                         throws Exception
Build a JobDataPanel from the specified descriptor.

Parameters:
desc - the descriptor to get the properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.

buildCustomOption

public Option buildCustomOption(OptionDescriptor desc)
                         throws Exception
Build a custom option implemented as a Java class.

Parameters:
desc - the descriptor to get the properties from.
Returns:
an Option instance, or null if the option could not be build.
Throws:
Exception - if an error was raised while building the option.


Copyright © 2005-2010 JPPF Team.