|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwt.clients.beans.table.WTTableModel
This model manage all the informations to construct a table. This table would be created by using a subset of attributes that the model is managing.
Nested Class Summary | |
class |
WTTableModel.GroupTableModel
Provide a table model compatible with Swing that display the data based on the filtering, grouping and sorting parameters set in the WTTableModel. |
class |
WTTableModel.GroupTreeModel
|
class |
WTTableModel.TableRowModel
The table row model provide a table view of the data used for the grouping mechanism. |
Field Summary | |
protected Hashtable |
columnHashtable
List all the column description |
protected Hashtable |
dataHashtable
List all the item available |
protected Vector |
filterVector
Vector that keep track of the filtering criteria |
protected Vector |
groupByVector
Vector that keep track of the attributes that should be used for grouping |
protected WTTableModel.GroupTableModel |
groupTableModel
Model of the table presenting the filtered and grouped items |
protected WTTableModel.GroupTreeModel |
groupTreeModel
Model of the table presenting the different value of attributes used for grouping. |
protected Vector |
itemDisplayed
List of item that should be displayed. |
private String |
itemIdentifier
Identifier used to discriminate the key of an item |
private static ResourceBundle |
rb
|
private static String |
RESOURCE
Resources for localizing message text |
protected Vector |
sortByVector
Vector that keep track of the attributes that should be used for sorting |
protected WTTableModel.TableRowModel |
tableRowModel
Model of the tree presenting the different value of attributes used for grouping. |
private static boolean |
VERBOSE
Used for debugging |
Constructor Summary | |
WTTableModel()
Construct a new Table Model. |
|
WTTableModel(String pItemIdentifier)
Construct a new Table Model |
Method Summary | |
void |
addColumnDescription(String pColumnKey,
TableColumn pTableColumn)
Add a column description to the hashtable. |
void |
addColumnDescription(TableColumn pTableColumn)
Add a column description to the hashtable using the identifier for the column as the key. |
void |
addDisplayColumn(String pColumnKey)
Add a column to the list of column that should be displayed. |
void |
addDisplayColumns(Vector pColumnKeyList)
Add a list column to the list of columns that should be displayed. |
void |
addItem(Hashtable pItem)
Add an item to the list of items for the model. |
Enumeration |
allColumnDescription()
Answer all the column descriptions available in the model |
Enumeration |
allColumnDescriptionKey()
Answer all the column description keys available in the model |
boolean |
columnInFilter(String pColumnKey)
Check if pColumnKey is a column used for filtering |
boolean |
columnInGroup(String pColumnKey)
Check if pColumnKey is a column used for grouping |
boolean |
columnInSort(String pColumnKey)
Check if pColumnKey is a column used for sorting |
boolean |
columnIsDisplayed(String pColumnKey)
Check if pColumnKey is displayed |
Enumeration |
getAttributeList()
Answer the list of all the item currently displayed |
TableColumn |
getColumnDescription(String pColumnKey)
Answer the column description associated to the specified key. |
Vector |
getFilter()
Answer the set of filter criteria used for the current model. |
Vector |
getGroupBy()
Answer the list of attributes used for grouping |
WTTableModel.GroupTableModel |
getGroupTableModel()
Answer a table model that contains the items matching the filter and group criteria. |
TreeModel |
getGroupTreeModel()
Answer a tree model representing all the items that match the filter criteria. |
String |
getItemIdentifier()
Answer the attribute key used for discriminating the items. |
String |
getItemIdentifierValueAt(int row)
Retrieve the value of the item identifier for the specified row .The number of row is based on the displayed list. |
Vector |
getSortBy()
Answer the list of attributes used in the sorting mechanism of the current model. |
WTTableModel.TableRowModel |
getTableRowModel()
Answer a table model where the columns are the one specified for grouping |
private boolean |
matchFilter(Hashtable pItem)
Evaluate the item to know if it should be used for the tree. |
void |
refreshModel()
Regenerate the different model and warned the different listener who have subscribed to the different model. |
void |
removeAllDisplayColumns()
Remove all the columns from the list of column that should be displayed. |
void |
removeColumnDescription(String pColumnKey)
Remove the column description associated to the key from the column list. |
void |
removeColumnFromFilter(String pColumnKey)
Remove pColumnKey from the group of column that should be used for filtering. |
void |
removeColumnFromGroup(String pColumnKey)
Remove pColumnKey from the group of column that should be used for grouping. |
void |
removeColumnFromSort(String pColumnKey)
Remove pColumnKey from the sort of column that should be used for sorting. |
void |
removeDisplayColumn(String pColumnKey)
Remove a column to the list of column that should be displayed. |
void |
removeDisplayColumn(TableColumn pColumn)
Remove a column to the list of column that should be displayed. |
void |
removeItem(Hashtable pItem)
Remove the item from the model. |
void |
removeItem(String pItemKey)
Remove the item with specified key from the model. |
void |
setDisplayColumns(String[] pColumns)
Set the columns that should be displayed in the system. |
void |
setDisplayColumns(Vector pColumns)
Remove the previous column available and replace with the new set of column specified in pColumns . |
void |
setFilter(Vector pFilterVector)
Set the filtering mechanism using an ordered list of filter criteria |
void |
setGroupBy(Vector pGroupByVector)
Set the Grouping for the current model. |
void |
setItemIdentifier(String pItemIdentifier)
Set the attribute key that would be used for discrimating an item. |
private void |
setItemIdentifier(String pItemIdentifier,
boolean bRefreshRequired)
Set the attribute key that would be used for discrimating an item. |
void |
setSortBy(Vector pSortByVector)
Set the column used for sorting the attributes. |
private void |
validateColumnExistence(String pColumnKey)
Validate if a column in the model have its key equal to pColumnKey . |
private void |
validateColumnExistence(TableColumn pColumn)
Validate if pColumn exists in the model. |
private void |
validateColumnListExistence(Enumeration pColumnKeyEnumeration)
Validate that the set of column provided exist in the model. |
private void |
validateFilter(Vector pFilterVector)
Validate the filter pFilterVector . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private String itemIdentifier
protected Vector groupByVector
protected Vector sortByVector
protected Vector filterVector
protected Vector itemDisplayed
protected WTTableModel.GroupTableModel groupTableModel
protected WTTableModel.TableRowModel tableRowModel
protected WTTableModel.GroupTreeModel groupTreeModel
protected Hashtable columnHashtable
protected Hashtable dataHashtable
private static final String RESOURCE
private static ResourceBundle rb
private static boolean VERBOSE
Constructor Detail |
public WTTableModel()
You MUST set an identifier before using an instance created by that operation.
setItemIdentifier()
public WTTableModel(String pItemIdentifier)
Method Detail |
public void refreshModel()
private void setItemIdentifier(String pItemIdentifier, boolean bRefreshRequired)
pItemIdentifier
- the attribute keypublic void setItemIdentifier(String pItemIdentifier)
pItemIdentifier
- the attribute keypublic String getItemIdentifier()
public void addColumnDescription(TableColumn pTableColumn)
pTableColumn
- TableColumn.getIdentifier()
public void addColumnDescription(String pColumnKey, TableColumn pTableColumn)
pColumnKey
- pTableColumn
- public TableColumn getColumnDescription(String pColumnKey)
pColumnKey
-
public void removeColumnDescription(String pColumnKey) throws PropertyVetoException
pColumnKey
- the key of the column that should be removed.
PropertyVetoException
- if pColumnKey
is not a valid key.public Enumeration allColumnDescription()
TableColumn
availablepublic Enumeration allColumnDescriptionKey()
private void validateColumnListExistence(Enumeration pColumnKeyEnumeration) throws PropertyVetoException
pColumnKeyEnumeration
- an enumeration of columns key
PropertyVetoException
- if one of the column does not existprivate void validateColumnExistence(String pColumnKey) throws PropertyVetoException
pColumnKey
.
pColumnKey
- the key of the column
PropertyVetoException
- if the column does not existprivate void validateColumnExistence(TableColumn pColumn) throws PropertyVetoException
pColumn
exists in the model.
pColumn
- the column to be tested
PropertyVetoException
- if the column does not existpublic void setGroupBy(Vector pGroupByVector) throws PropertyVetoException
pGroupByVector
- the ordered set of attributes used for grouping
PropertyVetoException
- if one column specified doesn't existpublic Vector getGroupBy()
public boolean columnInGroup(String pColumnKey) throws PropertyVetoException
pColumnKey
is a column used for grouping
pColumnKey
- the key of the column that should be tested
true
if the column is used in the current group criteria,
PrpertyVetoException
- if pColumnKey
is not a valid key.
PropertyVetoException
public void removeColumnFromGroup(String pColumnKey) throws PropertyVetoException
pColumnKey
from the group of column that should be used for grouping.
pColumnKey
- the column to remove from the group
PropertyVetoException
- if pColumnKey
is not a valid key.public void setSortBy(Vector pSortByVector) throws PropertyVetoException
pSortByVector
- the ordered list of key attributes used for sorting
PropertyVetoException
- if one column specified doesn't existpublic Vector getSortBy()
public boolean columnInSort(String pColumnKey) throws PropertyVetoException
pColumnKey
is a column used for sorting
pColumnKey
- the key of the column that should be tested
true
if the column is used in the current sort criteria,
PrpertyVetoException
- if pColumnKey
is not a valid key.
PropertyVetoException
public void removeColumnFromSort(String pColumnKey) throws PropertyVetoException
pColumnKey
from the sort of column that should be used for sorting.
pColumnKey
- the column to remove from the sort
PropertyVetoException
- if pColumnKey
is not a valid key.public void setFilter(Vector pFilterVector) throws PropertyVetoException
pFilterVector
- the ordered list of filter
PropertyVetoExecption
- if the filter is not valid for this model
PropertyVetoException
public Vector getFilter()
public boolean columnInFilter(String pColumnKey) throws PropertyVetoException
pColumnKey
is a column used for filtering
pColumnKey
- the key of the column that should be tested
true
if the column is used in the current filter,
PropertyVetoException
- if pColumnKey
is not a valid key.public void removeColumnFromFilter(String pColumnKey) throws PropertyVetoException
pColumnKey
from the group of column that should be used for filtering.
pColumnKey
- the column to remove from the filter
PropertyVetoException
- if pColumnKey
is not a valid key.private void validateFilter(Vector pFilterVector) throws PropertyVetoException
pFilterVector
.
pFilterVector
- the filter vector to be checked
PropertyVetoException
- if the filter is not valid.private boolean matchFilter(Hashtable pItem)
pItem
- the item that has to be tested
true
if the item matchs the filter criterias#setFilter()
public void addItem(Hashtable pItem) throws PropertyVetoException
pItem
- hashtable of value with the key as the hashcode of the data
PropertyVetoException
- if the item does not contain the identifier key
PropertyVetoException
- if the identifier already existspublic void removeItem(String pItemKey)
pItemKey
- key of the item to remove from the modelpublic void removeItem(Hashtable pItem)
pItem
- item to remove from the modelpublic String getItemIdentifierValueAt(int row)
row
.
itemIdentifier
public Enumeration getAttributeList()
public WTTableModel.GroupTableModel getGroupTableModel()
#addDisplayColumns()
,
#addDisplayColumn()
public WTTableModel.TableRowModel getTableRowModel()
#setGroupBy()
public TreeModel getGroupTreeModel()
#setGroupBy()
,
#setFilter()
public void addDisplayColumns(Vector pColumnKeyList) throws PropertyVetoException
pColumnKeyList
- the list of keys of the column to be displayed
PropertyVetoException
- if one key does not match with any defined columnpublic void addDisplayColumn(String pColumnKey) throws PropertyVetoException
pColumnKey
- the key of the column to be displayed
PropertyVetoException
- if the key does not match with any defined columnpublic void removeDisplayColumn(String pColumnKey) throws PropertyVetoException
pColumnKey
- the key of the column to be removed from the display
PropertyVetoException
- if the key does not match with any defined columnpublic void removeDisplayColumn(TableColumn pColumn) throws PropertyVetoException
pColumn
- the column to be removed from the display
PropertyVetoException
- if the column does not exist in the modelpublic void removeAllDisplayColumns()
public void setDisplayColumns(Vector pColumns) throws PropertyVetoException
pColumns
.
pColumns
- the new set of columns that should be used for the display
PropertyVetoException
- if one of the column specified doesn't existpublic void setDisplayColumns(String[] pColumns) throws PropertyVetoException
pColumns
- array of column key
PropertyVetoException
- if one of the columns specified doesn't existpublic boolean columnIsDisplayed(String pColumnKey) throws PropertyVetoException
pColumnKey
is displayed
pColumnKey
- the key of the column that should be tested
true
if the column is currently displayed
PropertyVetoException
- if pColumnKey
is not a valid key.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |