|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groiss.gui.table.TableAdapter
public class TableAdapter
Adapter class for the table interface. It is recommended to make subclasses of
this class or use is directly instead of implementing the table interface with
another class.
The class has several protected fields that can be set by subclasses for defining the
behaviour of the table.
| Field Summary | |
|---|---|
protected boolean |
asc
|
protected List<ColumnDescription> |
columns
|
protected String |
defaultAction
|
protected String |
editTarget
|
protected String |
editTargetProps
|
protected String |
editUrl
|
protected String |
fieldname
|
protected String |
id
|
protected TableModel |
model
|
protected boolean |
oidOnly
|
protected HttpServletRequest |
request
The HTTP request is set in the init method |
protected Resource |
resource
|
protected List<String> |
selected
|
protected int |
selection
|
protected boolean |
showCounter
|
protected boolean |
sortable
|
protected int |
sortColumn
|
protected String |
tableTarget
|
protected String |
title
|
protected String |
toolbarActions
|
protected boolean |
toolbarIcons
|
protected String |
toolbarTarget
|
protected boolean |
useColumnPicker
|
protected boolean |
useFilter
|
protected boolean |
usePaging
|
protected boolean |
verticalToolbar
|
| Fields inherited from interface com.groiss.gui.table.Table |
|---|
SELECTION_HIDDEN, SELECTION_LINK, SELECTION_MULTIPLE, SELECTION_NONE, SELECTION_ROW_MULTIPLE, SELECTION_ROW_SINGLE, SELECTION_SINGLE |
| Constructor Summary | |
|---|---|
TableAdapter()
|
|
TableAdapter(TableModel m,
String id)
|
|
| Method Summary | |
|---|---|
List<ColumnDescription> |
getColumns()
Return a list of column descriptions. |
String |
getDefaultAction()
Returns the action that is executed on doubleclick on a row. |
String |
getEditTarget()
The default target for toolbar functions |
String |
getEditTargetProps()
Return the window properties for the edit target |
String |
getEditUrl()
Returns an url used as link for toolbar functions |
String |
getFieldName()
Return the name of the checkbox or radio buttons |
String |
getFilterId()
Returns the id that is used when column filters are stored. |
String |
getId()
Returns the id of this table |
Page |
getPage()
Define the page the table uses. |
List<String> |
getSelectedItems()
|
int |
getSelectionMode()
Return the mode for selection. |
int |
getSortColumn()
Return the sort column. |
String |
getTableFrameName()
Returns the name of the frame where the table resides. |
TableModel |
getTableModel()
Builds the final tablemodel containing all data displayed in the table. |
int |
getTableSize()
Determines the tablesize of the tablemodel without reading all the objects. |
Object |
getTitle()
Return a string or Component for table title |
String |
getToolbarActions()
Return a comma separated list of action ids for the toolbar. |
String |
getToolbarFrameName()
Returns the name of the frame where the toolbar resides. |
boolean |
hasVerticalToolbar()
Returns true if the toolbar is vertical, false for horizontal. |
void |
init(HttpServletRequest req)
Init the tablemodel (determine data to be displayed). |
boolean |
isSortable()
Is the table sortable. |
String |
lineStyle(int i,
String style)
Use this method for defining a row specific css-class. |
boolean |
oidOnly()
If true the value of the checkbox or radio button contains only the oid, otherwise it contains classname:oid |
TableAdapter |
setColumns(List<ColumnDescription> cols,
boolean useFilter,
boolean useColumnPicker)
Set the column properties. |
TableAdapter |
setDefaultAction(String action)
Set the default action. |
TableAdapter |
setEditProps(String editUrl,
String editTarget,
String winProps,
String toolbarActions,
String toolbarTarget)
Set the edit properties. |
TableAdapter |
setSelection(int selection,
String fieldname,
boolean oidOnly,
List<String> selected)
Set the selection properties. |
TableAdapter |
setSortable(boolean isSortable,
int col,
boolean asc)
Set the sort properties. |
TableAdapter |
setTitle(String title)
Set the title of the table. |
boolean |
showCounter()
Returns true if a counter is shown below the table. |
TableAdapter |
showCounter(boolean show)
Define whether a counter should be shown. |
boolean |
showToolbarIcons()
Returns true if the toolbar shows the icons, false for text toolbar. |
boolean |
sortAscending()
Is the table sorted ascending. |
boolean |
useColumnPicker()
Returns true if column picker should be shown. |
boolean |
useFilter()
Returns true if column filters are enabled. |
boolean |
usePaging()
Returns true if paging is enabled. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected HttpServletRequest request
protected TableModel model
protected String id
protected String title
protected Resource resource
protected boolean sortable
protected int sortColumn
protected boolean asc
protected int selection
protected List<String> selected
protected String fieldname
protected boolean oidOnly
protected String editUrl
protected String editTarget
protected String editTargetProps
protected String toolbarActions
protected String toolbarTarget
protected String tableTarget
protected boolean verticalToolbar
protected boolean toolbarIcons
protected String defaultAction
protected boolean showCounter
protected List<ColumnDescription> columns
protected boolean useFilter
protected boolean useColumnPicker
protected boolean usePaging
| Constructor Detail |
|---|
public TableAdapter()
public TableAdapter(TableModel m,
String id)
| Method Detail |
|---|
public void init(HttpServletRequest req)
init in interface Tablepublic int getTableSize()
getTableSize in interface Tablepublic TableModel getTableModel()
getTableModel in interface Tablepublic Object getTitle()
getTitle in interface Tablepublic String getId()
getId in interface Tablepublic Page getPage()
getPage in interface Table
public String lineStyle(int i,
String style)
lineStyle in interface Tablei - the row indexstyle - the css class that is set by the table renderer
public boolean isSortable()
isSortable in interface Tablepublic boolean sortAscending()
sortAscending in interface Tablepublic int getSortColumn()
getSortColumn in interface Tablepublic int getSelectionMode()
getSelectionMode in interface Tablepublic String getFieldName()
getFieldName in interface Tablepublic boolean oidOnly()
oidOnly in interface Tablepublic String getEditUrl()
getEditUrl in interface Tablepublic String getEditTarget()
getEditTarget in interface Tablepublic String getEditTargetProps()
getEditTargetProps in interface Tablepublic String getToolbarActions()
getToolbarActions in interface Tablepublic String getTableFrameName()
getTableFrameName in interface Tablepublic String getToolbarFrameName()
getToolbarFrameName in interface Tablepublic boolean hasVerticalToolbar()
hasVerticalToolbar in interface Tablepublic boolean showToolbarIcons()
showToolbarIcons in interface Tablepublic String getDefaultAction()
Table.getToolbarActions()
for a description of allowed values
getDefaultAction in interface Tablepublic boolean useFilter()
useFilter in interface Tablepublic boolean useColumnPicker()
useColumnPicker in interface Tablepublic boolean usePaging()
usePaging in interface Tablepublic boolean showCounter()
showCounter in interface Tablepublic List<ColumnDescription> getColumns()
getColumns in interface Tablepublic String getFilterId()
Table
getFilterId in interface Table
public TableAdapter setSortable(boolean isSortable,
int col,
boolean asc)
isSortable - true if sortable.col - the sort columnasc - the sort order (true = ascending)
public TableAdapter setSelection(int selection,
String fieldname,
boolean oidOnly,
List<String> selected)
selection - see Table.getSelectionMode() for valuesfieldname - see Table.getFieldName()()oidOnly - see Table.oidOnly()selected - a list of already selected values
public TableAdapter setEditProps(String editUrl,
String editTarget,
String winProps,
String toolbarActions,
String toolbarTarget)
editUrl - editTarget - winProps - toolbarActions - toolbarTarget -
public TableAdapter showCounter(boolean show)
show - true if a counter is wanted.public TableAdapter setTitle(String title)
public TableAdapter setColumns(List<ColumnDescription> cols,
boolean useFilter,
boolean useColumnPicker)
cols - useFilter - useColumnPicker - public TableAdapter setDefaultAction(String action)
public List<String> getSelectedItems()
getSelectedItems in interface Table
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||