pt.moredata.dataentry.component.swing
Class FieldComponent

java.lang.Object
  extended bypt.moredata.dataentry.component.AbstractDataEntryComponent
      extended bypt.moredata.dataentry.component.FormDataEntryComponent
          extended bypt.moredata.dataentry.component.swing.FieldComponent
All Implemented Interfaces:
DataEntryComponent, java.io.Serializable

public class FieldComponent
extends FormDataEntryComponent

Implementacao de um campo visual baseado num Field.

Version:
$Revision: 1.11 $ XXX : Esta classe podia extender a classe JTextFieldComponent.
Author:
pcarmo
See Also:
Serialized Form

Field Summary
 
Fields inherited from class pt.moredata.dataentry.component.AbstractDataEntryComponent
_columnName, _tableAlias, _tableName
 
Constructor Summary
FieldComponent(Field field)
          Cria um novo campo visual a partir de um Field.
FieldComponent(java.lang.String name, java.lang.String tableName, java.lang.String tableAlias, java.lang.String columnName, Field field)
          Constructor for the FieldComponent object
 
Method Summary
 void cleanUp()
          Clean up the component, removing all listeners added to other objects.
 java.lang.String getColumnName()
          Devolve o nome da coluna da tabela a que este campo visual esta associado.
 java.lang.Object getFieldValue()
          Devolve o valor guardado no Field.
 java.lang.String getTableName()
          Devolve o nome da tabela a que este campo visual esta associado.
 void setAllowedCharacters(java.lang.String allowedCharacters)
          Change the list of allowed characters to be used in the widget represeted by the component during a query only.
 void setEditable(boolean editable)
          Torna o componente editavel ou nao.
 void setFieldValue(java.lang.Object value)
          Altera o valor guardado no componente.
 
Methods inherited from class pt.moredata.dataentry.component.FormDataEntryComponent
getCurrentRow, getRows
 
Methods inherited from class pt.moredata.dataentry.component.AbstractDataEntryComponent
addComponentModifiedListener, fireComponentEvent, getName, getTableAlias, getTableNameOrAlias, isDataBaseComponent, isEditableForInsert, isEditableForQuery, isEditableForUpdate, removeComponentModifiedListener, setDataBaseComponent, setEditableForInsert, setEditableForQuery, setEditableForUpdate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldComponent

public FieldComponent(Field field)
               throws NullTableNameException,
                      NullColumnNameException,
                      java.lang.NullPointerException
Cria um novo campo visual a partir de um Field.

Parameters:
field - Field onde sao introduzidos os dados.
Throws:
NullTableNameException - If the table name is null.
NullColumnNameException - Se o nome da coluna for nulo.
java.lang.NullPointerException - Se o field for nulo.

FieldComponent

public FieldComponent(java.lang.String name,
                      java.lang.String tableName,
                      java.lang.String tableAlias,
                      java.lang.String columnName,
                      Field field)
               throws NullTableNameException,
                      NullColumnNameException,
                      java.lang.NullPointerException
Constructor for the FieldComponent object

Parameters:
name - The component name. This name will be used to identify the component, if the name is null, the columnName is used.
tableName - The table name.
tableAlias - The table alias.
columnName - The column name of the component.
field - Field onde sao introduzidos os dados.
Throws:
NullTableNameException - If the table name is null.
NullColumnNameException - If the column name is null.
java.lang.NullPointerException - Se o obj for nulo.
Method Detail

getFieldValue

public java.lang.Object getFieldValue()
Devolve o valor guardado no Field.

Returns:
O valor do campo visual associado a coluna da tabela.

setFieldValue

public void setFieldValue(java.lang.Object value)
Altera o valor guardado no componente.

Parameters:
value - O valor a guardar no componente.

getTableName

public java.lang.String getTableName()
Devolve o nome da tabela a que este campo visual esta associado.

Specified by:
getTableName in interface DataEntryComponent
Overrides:
getTableName in class AbstractDataEntryComponent
Returns:
The tableName value

getColumnName

public java.lang.String getColumnName()
Devolve o nome da coluna da tabela a que este campo visual esta associado.

Specified by:
getColumnName in interface DataEntryComponent
Overrides:
getColumnName in class AbstractDataEntryComponent
Returns:
The columnName value

setEditable

public void setEditable(boolean editable)
Torna o componente editavel ou nao.

Parameters:
editable - Se for true o componente fica editavel, caso contrario o componente deixa de poder ser editado.

cleanUp

public void cleanUp()
Clean up the component, removing all listeners added to other objects. This operation is necessary for making this object free of references so the GC can collect it.


setAllowedCharacters

public void setAllowedCharacters(java.lang.String allowedCharacters)
Change the list of allowed characters to be used in the widget represeted by the component during a query only.

Specified by:
setAllowedCharacters in interface DataEntryComponent
Overrides:
setAllowedCharacters in class AbstractDataEntryComponent