com.intel.gpe.gridbeans.plugins
Class GridBeanPlugin

java.lang.Object
  extended by com.intel.gpe.gridbeans.plugins.GridBeanPlugin
All Implemented Interfaces:
IDataSet, IGridBeanPlugin

public class GridBeanPlugin
extends java.lang.Object
implements IGridBeanPlugin

The default implementation of GridBean plugin. The plugin is responsible for the user interface of the GridBean.

Version:
$Id: GridBeanPlugin.java,v 1.3 2005/12/22 09:20:32 lukichev Exp $
Author:
Alexander Lukichev

Constructor Summary
GridBeanPlugin(java.lang.String name)
          Create the plugin.
 
Method Summary
 void addInputPanel(IGridBeanPanel panel)
          Add an input panel
 void addOutputPanel(IGridBeanPanel panel)
          Add an output panel
 java.lang.String getDescription(javax.xml.namespace.QName key)
          Get the description of the component.
 boolean getEnabled(javax.xml.namespace.QName key)
          Get the state of the component.
 IGridBeanPanel[] getInputPanels()
          Get the input panels
 java.lang.String getName()
          Get the name of the plugin.
 IGridBeanPanel[] getOutputPanels()
          Get the output panels
 java.lang.Object getValue(javax.xml.namespace.QName key)
          Get the translated value of the component.
 boolean isValid(javax.xml.namespace.QName key, java.lang.StringBuffer buf)
          Check if the value of the component is valid.
 java.util.Set keySet()
          Get the set of the component names.
 void load(IGridBeanModel model, com.intel.gpe.client.application.Client client)
          Load data set component values from the GridBean model and the client object.
 void loadInput(IGridBeanModel model, com.intel.gpe.client.application.Client client)
          Load the values of input panels from the GridBean model
 void loadOutput(IGridBeanModel model, com.intel.gpe.client.application.Client client)
          Load the values of output panels from the GridBean model
 void setDescription(javax.xml.namespace.QName key, java.lang.String descr)
          Set the description of the specified component
 void setEnabled(javax.xml.namespace.QName key, boolean enabled)
          Set the enabled state of the component
 void setPossibleValues(javax.xml.namespace.QName key, java.util.List values)
          Set the possible values for the specified component
 void setValue(javax.xml.namespace.QName key, java.lang.Object value)
          Set the value of the component.
 void setValueTranslator(javax.xml.namespace.QName key, IValueTranslator translator)
          Set the translator for the specified component
 void setValueValidator(javax.xml.namespace.QName key, IValueValidator validator)
          Set the validator for the specified component
 void store(IGridBeanModel model)
          Store the component values in the GridBean model.
 void storeInput(IGridBeanModel model)
          Store the values of input panels in the GridBean model
 void storeOutput(IGridBeanModel model)
          Store the values of output panels in the GridBean model
 void validateInput(ErrorSet errors)
          Validate the values in the input panels
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GridBeanPlugin

public GridBeanPlugin(java.lang.String name)
Create the plugin.

Parameters:
name - The name of the plugin
Method Detail

addInputPanel

public void addInputPanel(IGridBeanPanel panel)
Add an input panel

Parameters:
panel - The panel

addOutputPanel

public void addOutputPanel(IGridBeanPanel panel)
Add an output panel

Parameters:
panel - The output panel

getInputPanels

public IGridBeanPanel[] getInputPanels()
Description copied from interface: IGridBeanPlugin
Get the input panels

Specified by:
getInputPanels in interface IGridBeanPlugin
Returns:
The array of input panels

getOutputPanels

public IGridBeanPanel[] getOutputPanels()
Description copied from interface: IGridBeanPlugin
Get the output panels

Specified by:
getOutputPanels in interface IGridBeanPlugin
Returns:
The array of output panels

getEnabled

public boolean getEnabled(javax.xml.namespace.QName key)
                   throws DataSetException
Description copied from interface: IDataSet
Get the state of the component.

Specified by:
getEnabled in interface IDataSet
Parameters:
key - The name of the component
Returns:
The enabled state of the component
Throws:
DataSetException

setEnabled

public void setEnabled(javax.xml.namespace.QName key,
                       boolean enabled)
                throws DataSetException
Description copied from interface: IDataSet
Set the enabled state of the component

Specified by:
setEnabled in interface IDataSet
Parameters:
key - The name of the component
enabled - The enabled state of the component
Throws:
DataSetException

keySet

public java.util.Set keySet()
Description copied from interface: IDataSet
Get the set of the component names.

Specified by:
keySet in interface IDataSet
Returns:
The set of the component names

getValue

public java.lang.Object getValue(javax.xml.namespace.QName key)
                          throws DataSetException,
                                 TranslationException
Description copied from interface: IDataSet
Get the translated value of the component.

Specified by:
getValue in interface IDataSet
Parameters:
key - The name of the component
Returns:
The translated value
Throws:
DataSetException
TranslationException - If translation failed

setValue

public void setValue(javax.xml.namespace.QName key,
                     java.lang.Object value)
              throws DataSetException,
                     TranslationException
Description copied from interface: IDataSet
Set the value of the component. The value is translated to the user's representation and then the GUI component is assigned with it.

Specified by:
setValue in interface IDataSet
Parameters:
key - The name of the component
value - The value
Throws:
DataSetException
TranslationException - If translation failed

setValueTranslator

public void setValueTranslator(javax.xml.namespace.QName key,
                               IValueTranslator translator)
                        throws DataSetException
Description copied from interface: IDataSet
Set the translator for the specified component

Specified by:
setValueTranslator in interface IDataSet
Parameters:
key - The name of the component
translator - The translator
Throws:
DataSetException

setValueValidator

public void setValueValidator(javax.xml.namespace.QName key,
                              IValueValidator validator)
                       throws DataSetException
Description copied from interface: IDataSet
Set the validator for the specified component

Specified by:
setValueValidator in interface IDataSet
Parameters:
key - The name of the component
validator - The validator
Throws:
DataSetException

setDescription

public void setDescription(javax.xml.namespace.QName key,
                           java.lang.String descr)
                    throws DataSetException
Description copied from interface: IDataSet
Set the description of the specified component

Specified by:
setDescription in interface IDataSet
Parameters:
key - The name of the component
descr - The description
Throws:
DataSetException

setPossibleValues

public void setPossibleValues(javax.xml.namespace.QName key,
                              java.util.List values)
                       throws DataSetException,
                              TranslationException
Description copied from interface: IDataSet
Set the possible values for the specified component

Specified by:
setPossibleValues in interface IDataSet
Parameters:
key - The name of the component
values - The list of the possible values
Throws:
DataSetException
TranslationException

getName

public java.lang.String getName()
Get the name of the plugin.

Returns:
The name of the plugin

load

public void load(IGridBeanModel model,
                 com.intel.gpe.client.application.Client client)
          throws DataSetException,
                 TranslationException
Description copied from interface: IDataSet
Load data set component values from the GridBean model and the client object.

Specified by:
load in interface IDataSet
Parameters:
model - The GridBean model
client - The client
Throws:
DataSetException
TranslationException - If translation of any value failed

store

public void store(IGridBeanModel model)
           throws DataSetException,
                  TranslationException
Description copied from interface: IDataSet
Store the component values in the GridBean model.

Specified by:
store in interface IDataSet
Parameters:
model - The GridBean model
Throws:
DataSetException
TranslationException - If translation of any value failed

loadInput

public void loadInput(IGridBeanModel model,
                      com.intel.gpe.client.application.Client client)
               throws DataSetException,
                      TranslationException
Description copied from interface: IGridBeanPlugin
Load the values of input panels from the GridBean model

Specified by:
loadInput in interface IGridBeanPlugin
Parameters:
model - The GridBean model
client - The client object
Throws:
DataSetException
TranslationException

loadOutput

public void loadOutput(IGridBeanModel model,
                       com.intel.gpe.client.application.Client client)
                throws DataSetException,
                       TranslationException
Description copied from interface: IGridBeanPlugin
Load the values of output panels from the GridBean model

Specified by:
loadOutput in interface IGridBeanPlugin
Parameters:
model - The GridBean model
client - The client object
Throws:
DataSetException
TranslationException

storeInput

public void storeInput(IGridBeanModel model)
                throws DataSetException,
                       TranslationException
Description copied from interface: IGridBeanPlugin
Store the values of input panels in the GridBean model

Specified by:
storeInput in interface IGridBeanPlugin
Parameters:
model - The GridBean model
Throws:
DataSetException
TranslationException

storeOutput

public void storeOutput(IGridBeanModel model)
                 throws DataSetException,
                        TranslationException
Description copied from interface: IGridBeanPlugin
Store the values of output panels in the GridBean model

Specified by:
storeOutput in interface IGridBeanPlugin
Parameters:
model - The GridBean model
Throws:
DataSetException
TranslationException

validateInput

public void validateInput(ErrorSet errors)
Description copied from interface: IGridBeanPlugin
Validate the values in the input panels

Specified by:
validateInput in interface IGridBeanPlugin
Parameters:
errors - The set of the errors

isValid

public boolean isValid(javax.xml.namespace.QName key,
                       java.lang.StringBuffer buf)
                throws DataSetException
Description copied from interface: IDataSet
Check if the value of the component is valid.

Specified by:
isValid in interface IDataSet
Parameters:
key - The name of the component
buf - The reason of the failure of validation check is appended here
Returns:
true if the value of the specified component is valid
Throws:
DataSetException

getDescription

public java.lang.String getDescription(javax.xml.namespace.QName key)
                                throws DataSetException
Description copied from interface: IDataSet
Get the description of the component.

Specified by:
getDescription in interface IDataSet
Parameters:
key - The name of the component
Returns:
The description of the specified component
Throws:
DataSetException