pt.moredata.dataentry.component
Class AbstractDataEntryComponent

java.lang.Object
  extended bypt.moredata.dataentry.component.AbstractDataEntryComponent
All Implemented Interfaces:
DataEntryComponent, java.io.Serializable
Direct Known Subclasses:
FormDataEntryComponent, GridDataEntryComponent

public abstract class AbstractDataEntryComponent
extends java.lang.Object
implements DataEntryComponent, java.io.Serializable

Company MoreData

Version:
$Revision: 1.8 $
Author:
pcarmo
See Also:
Serialized Form

Field Summary
protected  java.lang.String _columnName
          Nome da coluna na tabela a que este componente esta associado.
protected  java.lang.String _tableAlias
          The table alias
protected  java.lang.String _tableName
          The table name.
 
Constructor Summary
AbstractDataEntryComponent(java.lang.String tableName, java.lang.String columnName)
          Constructor for the AbstractDataEntryComponent object
AbstractDataEntryComponent(java.lang.String name, java.lang.String tableName, java.lang.String tableAlias, java.lang.String columnName)
          Constructor for the AbstractDataEntryComponent object
 
Method Summary
 void addComponentModifiedListener(ComponentModifiedListener listener)
          Adiciona um listener, para detectar alterações ao componente.
protected  void fireComponentEvent(ComponentEvent event, int type)
          Gera um evento para cada um dos listeneres registados no componente.
 java.lang.String getColumnName()
          Devolve o nome da coluna da tabela a que este campo visual esta associado.
 java.lang.String getName()
          Getter for the component name.
 java.lang.String getTableAlias()
          Return the table alias of the table name.
 java.lang.String getTableName()
          Devolve o nome da tabela a que este campo visual esta associado.
 java.lang.String getTableNameOrAlias()
          Return the table alias or the table name if the alias is null.
 boolean isDataBaseComponent()
          Check if the component is a database component.
 boolean isEditableForInsert()
          Check if the component should be editable when the DataEntry is INSERT_MODE.
 boolean isEditableForQuery()
          Check if the component should be editable when the DataEntry is QUERY_MODE.
 boolean isEditableForUpdate()
          Check if the component should be editable when the DataEntry is UPDATE_MODE.
 void removeComponentModifiedListener(ComponentModifiedListener listener)
          Remove um listener, para detectar alterações ao componente.
 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 setDataBaseComponent(boolean dataBaseComponent)
          Setter for property dataBaseComponent.
 void setEditableForInsert(boolean editable)
          Change the component editable state when the DataEntry is INSERT_MODE.
 void setEditableForQuery(boolean editable)
          Change the component editable state when the DataEntry is QUERY_MODE.
 void setEditableForUpdate(boolean editable)
          Change the component editable state when the DataEntry is UPDATE_MODE.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface pt.moredata.dataentry.component.DataEntryComponent
cleanUp, getCurrentRow, getFieldValue, getRows, setEditable, setFieldValue
 

Field Detail

_tableName

protected java.lang.String _tableName
The table name.


_tableAlias

protected java.lang.String _tableAlias
The table alias


_columnName

protected java.lang.String _columnName
Nome da coluna na tabela a que este componente esta associado.

Constructor Detail

AbstractDataEntryComponent

public AbstractDataEntryComponent(java.lang.String tableName,
                                  java.lang.String columnName)
                           throws NullTableNameException,
                                  NullColumnNameException
Constructor for the AbstractDataEntryComponent object

Parameters:
tableName - Description of the Parameter
columnName - The column name of the component.
Throws:
NullTableNameException - If the table name is null.
NullColumnNameException - If the column name is null.

AbstractDataEntryComponent

public AbstractDataEntryComponent(java.lang.String name,
                                  java.lang.String tableName,
                                  java.lang.String tableAlias,
                                  java.lang.String columnName)
                           throws NullTableNameException,
                                  NullColumnNameException
Constructor for the AbstractDataEntryComponent 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.
Throws:
NullTableNameException - If the table name is null.
NullColumnNameException - If the column name is null.
Method Detail

fireComponentEvent

protected void fireComponentEvent(ComponentEvent event,
                                  int type)
Gera um evento para cada um dos listeneres registados no componente.

Parameters:
event - Evento que deve ser gerado.
type - Tipo de evento que deve ser gerado.

getName

public java.lang.String getName()
Getter for the component name. If the component name has not especified in the object creation, the columnName is returned.

Specified by:
getName in interface DataEntryComponent
Returns:
The component name or columnName if the component name is not defined.

getTableName

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

Specified by:
getTableName in interface DataEntryComponent
Returns:
The tableName value

getTableAlias

public java.lang.String getTableAlias()
Return the table alias of the table name.

Specified by:
getTableAlias in interface DataEntryComponent
Returns:
Value of property tableAlias.

getTableNameOrAlias

public java.lang.String getTableNameOrAlias()
Return the table alias or the table name if the alias is null.

Specified by:
getTableNameOrAlias in interface DataEntryComponent
Returns:
The table alias or the table name.

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
Returns:
The columnName value

addComponentModifiedListener

public void addComponentModifiedListener(ComponentModifiedListener listener)
Adiciona um listener, para detectar alterações ao componente.

Specified by:
addComponentModifiedListener in interface DataEntryComponent
Parameters:
listener - Listener a adicionar ao DataEntry.

removeComponentModifiedListener

public void removeComponentModifiedListener(ComponentModifiedListener listener)
Remove um listener, para detectar alterações ao componente.

Specified by:
removeComponentModifiedListener in interface DataEntryComponent
Parameters:
listener - Listener a remover do DataEntry.

isEditableForInsert

public boolean isEditableForInsert()
Check if the component should be editable when the DataEntry is INSERT_MODE.

Specified by:
isEditableForInsert in interface DataEntryComponent
Returns:
True if the component should be editable, false otherwise.

isEditableForQuery

public boolean isEditableForQuery()
Check if the component should be editable when the DataEntry is QUERY_MODE.

Specified by:
isEditableForQuery in interface DataEntryComponent
Returns:
True if the component should be editable, false otherwise.

isEditableForUpdate

public boolean isEditableForUpdate()
Check if the component should be editable when the DataEntry is UPDATE_MODE.

Specified by:
isEditableForUpdate in interface DataEntryComponent
Returns:
True if the component should be editable, false otherwise.

setEditableForInsert

public void setEditableForInsert(boolean editable)
Change the component editable state when the DataEntry is INSERT_MODE.

Specified by:
setEditableForInsert in interface DataEntryComponent
Parameters:
editable - The Component editable state.

setEditableForQuery

public void setEditableForQuery(boolean editable)
Change the component editable state when the DataEntry is QUERY_MODE.

Specified by:
setEditableForQuery in interface DataEntryComponent
Parameters:
editable - The Component editable state.

setEditableForUpdate

public void setEditableForUpdate(boolean editable)
Change the component editable state when the DataEntry is UPDATE_MODE.

Specified by:
setEditableForUpdate in interface DataEntryComponent
Parameters:
editable - The Component editable state.

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

isDataBaseComponent

public boolean isDataBaseComponent()
Check if the component is a database component. A database component is associated with a column of a database table.

Specified by:
isDataBaseComponent in interface DataEntryComponent
Returns:
Value of property dataBaseComponent.

setDataBaseComponent

public void setDataBaseComponent(boolean dataBaseComponent)
Setter for property dataBaseComponent. If true the component is associated with a column of a database table.

Specified by:
setDataBaseComponent in interface DataEntryComponent
Parameters:
dataBaseComponent - New value of property dataBaseComponent.