com.intel.gpe.gridbeans.plugins.controls
Class GroupControl

java.lang.Object
  extended by com.intel.gpe.gridbeans.plugins.controls.GroupControl
All Implemented Interfaces:
IDataControl

public class GroupControl
extends java.lang.Object
implements IDataControl

The group of controls. All the controls have the same enabled state. One of the controls is chosen as the main component and is used to perform IDataControl.setValue(Object) and IDataControl.getValue() operations on the group.

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

Constructor Summary
GroupControl(IDataSet dataSet, javax.xml.namespace.QName[] keys, javax.xml.namespace.QName mainComponent)
          Create the group control.
 
Method Summary
 java.lang.String getDescription()
          Get the control description.
 boolean getEnabled()
          Get the enabled state of the component
 java.lang.Object getValue()
          Get the translated value of the component.
 boolean isValid(java.lang.StringBuffer buf)
          Validate the value.
 void setDescription(java.lang.String descr)
          Set the description of the component.
 void setEnabled(boolean enabled)
          Set the enabled state of the component
 void setPossibleValues(java.util.List values)
          Set the list of the possible values of the component
 void setValue(java.lang.Object value)
          Set the value of the component.
 void setValueTranslator(IValueTranslator translator)
          Set the translator that translates the value to the user's representation and back.
 void setValueValidator(IValueValidator validator)
          Set the validator of the component value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GroupControl

public GroupControl(IDataSet dataSet,
                    javax.xml.namespace.QName[] keys,
                    javax.xml.namespace.QName mainComponent)
Create the group control.

Parameters:
dataSet - The target data set
keys - The array of names of the controls
mainComponent - The main component of the group
Method Detail

setEnabled

public void setEnabled(boolean enabled)
                throws DataSetException
Description copied from interface: IDataControl
Set the enabled state of the component

Specified by:
setEnabled in interface IDataControl
Parameters:
enabled - The state
Throws:
DataSetException

getEnabled

public boolean getEnabled()
                   throws DataSetException
Description copied from interface: IDataControl
Get the enabled state of the component

Specified by:
getEnabled in interface IDataControl
Returns:
The state of the component
Throws:
DataSetException

setValue

public void setValue(java.lang.Object value)
              throws TranslationException,
                     DataSetException
Description copied from interface: IDataControl
Set the value of the component. The value is first translated to its representation and then displayed at the component.

Specified by:
setValue in interface IDataControl
Parameters:
value - The internal representation of the value
Throws:
TranslationException - If the translation failed
DataSetException

isValid

public boolean isValid(java.lang.StringBuffer buf)
                throws DataSetException
Description copied from interface: IDataControl
Validate the value.

Specified by:
isValid in interface IDataControl
Parameters:
buf - The reason of validation failure is appended to this buffer.
Returns:
TRUE if validation was successful
Throws:
DataSetException

getValue

public java.lang.Object getValue()
                          throws TranslationException,
                                 DataSetException
Description copied from interface: IDataControl
Get the translated value of the component.

Specified by:
getValue in interface IDataControl
Returns:
The translated value of the component. The traslator is used to translate the user's representation of the value to the internal representation.
Throws:
TranslationException - If the translation failed
DataSetException

setPossibleValues

public void setPossibleValues(java.util.List values)
                       throws TranslationException,
                              DataSetException
Description copied from interface: IDataControl
Set the list of the possible values of the component

Specified by:
setPossibleValues in interface IDataControl
Parameters:
values - The possible values
Throws:
TranslationException - If translation of any value failed
DataSetException

setValueTranslator

public void setValueTranslator(IValueTranslator translator)
                        throws DataSetException
Description copied from interface: IDataControl
Set the translator that translates the value to the user's representation and back.

Specified by:
setValueTranslator in interface IDataControl
Parameters:
translator - The translator
Throws:
DataSetException

setValueValidator

public void setValueValidator(IValueValidator validator)
                       throws DataSetException
Description copied from interface: IDataControl
Set the validator of the component value. The value of the user's component is first translated using the translator to the internal representation and then is validated.

Specified by:
setValueValidator in interface IDataControl
Parameters:
validator - The validator
Throws:
DataSetException

setDescription

public void setDescription(java.lang.String descr)
                    throws DataSetException
Description copied from interface: IDataControl
Set the description of the component.

Specified by:
setDescription in interface IDataControl
Parameters:
descr - The description
Throws:
DataSetException

getDescription

public java.lang.String getDescription()
                                throws DataSetException
Description copied from interface: IDataControl
Get the control description.

Specified by:
getDescription in interface IDataControl
Returns:
The description of the component
Throws:
DataSetException