|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.groiss.gui.table.Table |
---|
Table.ToolbarShape |
Field Summary | |
---|---|
protected boolean |
asc
|
protected java.util.List<ColumnDescription> |
columns
|
protected java.lang.String |
defaultAction
|
protected java.lang.String |
editTarget
|
protected java.lang.String |
editTargetProps
|
protected java.lang.String |
editUrl
|
protected java.lang.String |
fieldname
|
protected java.lang.String |
id
|
protected javax.swing.table.TableModel |
model
|
protected boolean |
oidOnly
|
protected javax.servlet.http.HttpServletRequest |
request
The HTTP request is set in the init method |
protected Resource |
resource
|
protected java.util.List<java.lang.String> |
selected
|
protected int |
selection
|
protected boolean |
showCounter
|
protected boolean |
sortable
|
protected int |
sortColumn
|
protected java.lang.String |
tableTarget
|
protected java.lang.String |
title
|
protected java.lang.String |
toolbarActions
|
protected boolean |
toolbarIcons
|
protected Table.ToolbarShape |
toolbarShape
|
protected java.lang.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(javax.swing.table.TableModel m,
java.lang.String id)
|
Method Summary | |
---|---|
java.util.List<ColumnDescription> |
getColumns()
Return a list of column descriptions. |
java.lang.String |
getDefaultAction()
Returns the action that is executed on doubleclick on a row. |
java.lang.String |
getEditTarget()
The default target for toolbar functions |
java.lang.String |
getEditTargetProps()
Return the window properties for the edit target |
java.lang.String |
getEditUrl()
Returns an url used as link for toolbar functions |
java.lang.String |
getFieldName()
Return the name of the checkbox or radio buttons |
java.lang.String |
getFilterId()
Returns the id that is used when column filters are stored. |
java.lang.String |
getId()
Returns the id of this table |
Page |
getPage()
Define the page the table uses. |
int |
getPagesize()
The default implementation reads the table.pagesize property as default and the user property avw.table.pagesize. |
java.util.List<java.lang.String> |
getSelectedItems()
|
int |
getSelectionMode()
Return the mode for selection. |
int |
getSortColumn()
Return the sort column. |
java.lang.String |
getTableFrameName()
Returns the name of the frame where the table resides. |
javax.swing.table.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. |
java.lang.Object |
getTitle()
Return a string or Component for table title |
java.lang.String |
getToolbarActions()
Return a comma separated list of action ids for the toolbar. |
java.lang.String |
getToolbarFrameName()
Returns the name of the frame where the toolbar resides. |
Table.ToolbarShape |
getToolbarShape()
Returns the desired mode of the toolbar. |
boolean |
hasVerticalToolbar()
Returns true if the toolbar is vertical, false for horizontal. |
void |
init(javax.servlet.http.HttpServletRequest req)
Init the tablemodel (determine data to be displayed). |
boolean |
isSortable()
Is the table sortable. |
java.lang.String |
lineStyle(int i,
java.lang.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(java.util.List<ColumnDescription> cols,
boolean useFilter,
boolean useColumnPicker)
Set the column properties. |
TableAdapter |
setDefaultAction(java.lang.String action)
Set the default action. |
TableAdapter |
setEditProps(java.lang.String editUrl,
java.lang.String editTarget,
java.lang.String winProps,
java.lang.String toolbarActions,
java.lang.String toolbarTarget)
Set the edit properties. |
TableAdapter |
setSelection(int selection,
java.lang.String fieldname,
boolean oidOnly,
java.util.List<java.lang.String> selected)
Set the selection properties. |
TableAdapter |
setSortable(boolean isSortable,
int col,
boolean asc)
Set the sort properties. |
TableAdapter |
setTitle(java.lang.String title)
Set the title of the table. |
void |
setToolbarShape(java.lang.String s)
|
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 javax.servlet.http.HttpServletRequest request
protected javax.swing.table.TableModel model
protected java.lang.String id
protected java.lang.String title
protected Resource resource
protected boolean sortable
protected int sortColumn
protected boolean asc
protected int selection
protected java.util.List<java.lang.String> selected
protected java.lang.String fieldname
protected boolean oidOnly
protected java.lang.String editUrl
protected java.lang.String editTarget
protected java.lang.String editTargetProps
protected java.lang.String toolbarActions
protected java.lang.String toolbarTarget
protected java.lang.String tableTarget
protected boolean verticalToolbar
protected boolean toolbarIcons
protected Table.ToolbarShape toolbarShape
protected java.lang.String defaultAction
protected boolean showCounter
protected java.util.List<ColumnDescription> columns
protected boolean useFilter
protected boolean useColumnPicker
protected boolean usePaging
Constructor Detail |
---|
public TableAdapter()
public TableAdapter(javax.swing.table.TableModel m, java.lang.String id)
Method Detail |
---|
public void init(javax.servlet.http.HttpServletRequest req)
init
in interface Table
public int getTableSize()
getTableSize
in interface Table
public javax.swing.table.TableModel getTableModel()
getTableModel
in interface Table
public java.lang.Object getTitle()
getTitle
in interface Table
public java.lang.String getId()
getId
in interface Table
public Page getPage()
getPage
in interface Table
public java.lang.String lineStyle(int i, java.lang.String style)
lineStyle
in interface Table
i
- the row indexstyle
- the css class that is set by the table renderer
public boolean isSortable()
isSortable
in interface Table
public boolean sortAscending()
sortAscending
in interface Table
public int getSortColumn()
getSortColumn
in interface Table
public int getSelectionMode()
getSelectionMode
in interface Table
public java.lang.String getFieldName()
getFieldName
in interface Table
public boolean oidOnly()
oidOnly
in interface Table
public java.lang.String getEditUrl()
getEditUrl
in interface Table
public java.lang.String getEditTarget()
getEditTarget
in interface Table
public java.lang.String getEditTargetProps()
getEditTargetProps
in interface Table
public java.lang.String getToolbarActions()
getToolbarActions
in interface Table
public java.lang.String getTableFrameName()
getTableFrameName
in interface Table
public java.lang.String getToolbarFrameName()
getToolbarFrameName
in interface Table
public boolean hasVerticalToolbar()
hasVerticalToolbar
in interface Table
public boolean showToolbarIcons()
showToolbarIcons
in interface Table
public Table.ToolbarShape getToolbarShape()
Table
getToolbarShape
in interface Table
public void setToolbarShape(java.lang.String s)
public java.lang.String getDefaultAction()
Table.getToolbarActions()
for a description of allowed values
getDefaultAction
in interface Table
public boolean useFilter()
useFilter
in interface Table
public boolean useColumnPicker()
useColumnPicker
in interface Table
public boolean usePaging()
usePaging
in interface Table
public boolean showCounter()
showCounter
in interface Table
public java.util.List<ColumnDescription> getColumns()
getColumns
in interface Table
public java.lang.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, java.lang.String fieldname, boolean oidOnly, java.util.List<java.lang.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(java.lang.String editUrl, java.lang.String editTarget, java.lang.String winProps, java.lang.String toolbarActions, java.lang.String toolbarTarget)
editUrl
- editTarget
- winProps
- toolbarActions
- toolbarTarget
-
public TableAdapter showCounter(boolean show)
show
- true if a counter is wanted.public TableAdapter setTitle(java.lang.String title)
public TableAdapter setColumns(java.util.List<ColumnDescription> cols, boolean useFilter, boolean useColumnPicker)
cols
- useFilter
- useColumnPicker
- public TableAdapter setDefaultAction(java.lang.String action)
public java.util.List<java.lang.String> getSelectedItems()
getSelectedItems
in interface Table
public int getPagesize()
getPagesize
in interface Table
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |