com.intel.gpe.gridbeans.plugins
Class GridBeanPlugin

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

public abstract 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.19 2007/02/22 14:40:10 dizhigul Exp $
Author:
Alexander Lukichev

Field Summary
protected  Client client
           
protected  javax.swing.Icon icon
           
 
Constructor Summary
GridBeanPlugin()
           
GridBeanPlugin(java.lang.String name)
          Deprecated. 
 
Method Summary
 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.
 javax.swing.Icon getIcon()
          Get the icon for a GridBean (to be displayed in the workflow).
static javax.swing.Icon getIcon(java.lang.Class clazz, java.lang.String path)
           
protected  javax.swing.Icon getOrCreateIcon(java.lang.Class clazz, java.lang.String iconPath)
           
 java.lang.Object getValue(javax.xml.namespace.QName key)
          Get the translated value of the component.
 void initialize(Client client)
          Initialize GridBean.
protected abstract  IGridBeanPanel inputPanel(int i)
           
protected abstract  int inputPanelsListSize()
           
 boolean isValid(javax.xml.namespace.QName key, java.lang.StringBuffer buf)
          Check if the value of the component is valid.
 java.util.Set<javax.xml.namespace.QName> keySet()
          Get the set of the component names.
 void load(IGridBeanModel model, Client client)
          Load data set component values from the GridBean model and the client object.
 void loadInput(IGridBeanModel model, Client client)
          Load the values of input panels from the GridBean model.
 void loadOutput(IGridBeanModel model, Client client)
          Load the values of output panels from the GridBean model Experimental code.
protected abstract  IGridBeanPanel outputPanel(int i)
           
protected abstract  int outputPanelsListSize()
           
 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
 

Field Detail

client

protected Client client

icon

protected javax.swing.Icon icon
Constructor Detail

GridBeanPlugin

@Deprecated
public GridBeanPlugin(java.lang.String name)
Deprecated. 


GridBeanPlugin

public GridBeanPlugin()
Method Detail

inputPanelsListSize

protected abstract int inputPanelsListSize()

inputPanel

protected abstract IGridBeanPanel inputPanel(int i)

outputPanelsListSize

protected abstract int outputPanelsListSize()

outputPanel

protected abstract IGridBeanPanel outputPanel(int i)

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<javax.xml.namespace.QName> 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

load

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

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,
                      Client client)
               throws DataSetException,
                      TranslationException
Description copied from interface: IGridBeanPlugin
Load the values of input panels from the GridBean model. Experimental code.

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

loadOutput

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

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

getIcon

public static javax.swing.Icon getIcon(java.lang.Class clazz,
                                       java.lang.String path)

getOrCreateIcon

protected javax.swing.Icon getOrCreateIcon(java.lang.Class clazz,
                                           java.lang.String iconPath)

getIcon

public javax.swing.Icon getIcon()
Description copied from interface: IGridBeanPlugin
Get the icon for a GridBean (to be displayed in the workflow).

Specified by:
getIcon in interface IGridBeanPlugin
Returns:
The GridBean icon

initialize

public void initialize(Client client)
Description copied from interface: IGridBeanPlugin
Initialize GridBean.

Specified by:
initialize in interface IGridBeanPlugin
Parameters:
client - The client instance


Copyright © 2008. All Rights Reserved.