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

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

public class ComboBoxDataControl
extends DataControl
implements IDataControl

The data control for JComboBox. Use setPossibleValues to set the elements in the list. Then the value of the list control is the selected element.

Version:
$Id: ComboBoxDataControl.java,v 1.3 2007/02/27 11:03:35 vashorin Exp $
Author:
Alexander Lukichev

Constructor Summary
ComboBoxDataControl(javax.swing.JComboBox comboBox)
           
 
Method Summary
 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 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.
 
Methods inherited from class com.intel.gpe.gridbeans.plugins.controls.DataControl
getDescription, isValid, setDescription, setValueTranslator, setValueValidator, translateFrom, translateTo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.intel.gpe.gridbeans.plugins.IDataControl
getDescription, setDescription, setValueTranslator, setValueValidator
 

Constructor Detail

ComboBoxDataControl

public ComboBoxDataControl(javax.swing.JComboBox comboBox)
Method Detail

setEnabled

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

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

getEnabled

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

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

setValue

public void setValue(java.lang.Object value)
              throws TranslationException
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

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
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

setPossibleValues

public void setPossibleValues(java.util.List values)
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


Copyright © 2008. All Rights Reserved.