public class TableContainer extends AbstractContainer implements TableModelListener
Modifier and Type | Field and Description |
---|---|
protected boolean |
colouredRows |
protected int |
counter |
protected List<Serializable> |
headerNames |
protected TableModel |
tm |
components
ACTIVE, browserMode, DEFAULT, ID, IE, INVISIBLE, isSensitive, label, NS, ON_BLUR, ON_CHANGE, ON_CLICK, ON_DBLCLICK, ON_FOCUS, ON_KEY_DOWN, ON_KEY_PRESS, ON_KEY_UP, ON_LOAD, ON_MOUSE_DOWN, ON_MOUSE_MOVE, ON_MOUSE_OUT, ON_MOUSE_UP, ON_RESET, ON_SELECT, ON_SUBMIT, ON_UNLOAD, parent, parentElem, READONLY, root, viewMode
LABELLEDBY
Constructor and Description |
---|
TableContainer()
constructs a new empty tablecontainer
|
TableContainer(List<Object> headers,
TableModel t)
constructs a new tablecontainer
|
TableContainer(String id)
Constructs a new empty table-container.
|
TableContainer(String className,
String width,
boolean colored) |
TableContainer(String id,
TableModel t)
constructs a new tablecontainer
|
TableContainer(TableModel t)
constructs a new tablecontainer
|
Modifier and Type | Method and Description |
---|---|
void |
addColspanRow(List<?> rowData,
boolean add,
int from,
int length)
adds a new row with colspan
|
void |
addHeader(List<?> rowData) |
void |
addRow(List<?> rowData)
adds a new row at the end of the table with the content of the vector
|
void |
addRow(List<?> rowData,
boolean isHeader) |
void |
addRow(List<?> rowData,
List<Pair<String,String>> dataprops)
adds a new row with the specified dataproperties
|
void |
addRow(List<?> rowData,
List<Pair<String,String>> rowprops,
List<Pair<String,String>> dataprops)
adds a new row with the properties in the vector
if the row is a systemstep row, the row is always red!!
|
void |
addRow(List<?> rowData,
String id,
List<Pair<String,String>> rowprops,
List<Pair<String,String>> dataprops)
Adds a new Row with a row id.
|
void |
addRow(List<?> rowData,
String id,
List<Pair<String,String>> rowprops,
List<Pair<String,String>> dataprops,
boolean isHeader)
Add a row to the table.
|
void |
addRow(Object... row) |
void |
addRow(Object[] row,
String id,
List<Pair<String,String>> rowprops,
List<Pair<String,String>> dataprops,
boolean isHeader) |
protected void |
addRow(TableModel src,
int first,
int last)
adds a new row with the content of tablemodel
|
protected void |
build()
builds the table with the elements of the TableModel.
|
protected void |
dataChanged(TableModel src)
builds the tree in a new order (moveRow)
|
List<Attribute> |
getCellAttributes(int rowIndex,
int colIndex)
returns a vector of attributes of the chosen cell
|
List<?> |
getColumnAttributes(int colIndex)
Deprecated.
since 10.0
|
int |
getColumnWidth(int colIndex)
returns the width of a specified column
|
Component |
getComponentAt(int rowIndex,
int colIndex)
returns the component at the specified position
|
Object |
getContent()
Returns null.
|
List<Object> |
getHeaderContent()
returns the content of the column header (first row)
|
List<Serializable> |
getHeaderNames()
returns the names of the columns
|
TableModel |
getModel() |
List<Element> |
getRows(boolean isHeader) |
List<Pair<String,String>> |
getTableAttributes()
returns a vector of pairs (names, attributes) of the table element
|
String |
getValueAt(int rowIndex,
int colIndex)
returns a string representation of the component at the specified position
|
protected List<Element> |
removeRow(int index)
removes the rows at the specified position INDEX from the table
|
void |
setCellAttribute(int rowIndex,
int colIndex,
String name,
String value)
sets the attribute in the specified cell
|
protected void |
setCellValue(Element cell,
Object data,
List<Pair<String,String>> cellprops,
int colindex) |
void |
setColouredRows(boolean coloured)
sets whether every second row is coloured or not
sets the counter for counting the number of rows 0
|
void |
setColumnAlign(int colIndex,
String align)
sets the attribute, which controls whether the text is aligned to the left
to the right or in the center
|
void |
setColumnAttribute(int colIndex,
String name,
String value)
sets the specified attribute in the whole column
|
void |
setColumnHeight(int colIndex,
int height)
sets the height of a specified column
|
void |
setColumnValign(int colIndex,
String valign)
sets the attribute, which controls whether the text is vertical aligned to the
to the top, middle bottom or in the baseline
|
void |
setColumnWidth(int colIndex,
int width)
sets the width of a specified column
|
void |
setComponent(int colIndex,
Class<? extends Component> cl)
sets a specified component in the chosen column
sets the component for all elements except the first one (row 0 -
header column!!!)
|
void |
setContent(Object o)
Initialize the table with the given tabel model.
|
void |
setHeaderAttribute(String name,
String value)
sets an attribute of the column header (first row)
|
void |
setHeaderName(int index,
String name)
sets the columnname of a specified column
|
void |
setModel(TableModel t) |
void |
setRowAttribute(int rowIndex,
String name,
String value)
sets the specified attribute in the whole row
|
void |
setUseTableBody(boolean use) |
void |
setValueAt(Object o,
int rowIndex,
int colIndex)
sets a new value (a new component) to the specified position in the table
|
String |
showRows() |
void |
tableChanged(TableModelEvent event)
method which handles the incoming events
|
add, get, getAll, getAll, getAllDeep, getByName, getComponents, getWithParent, init, remove, setBrowserMode, substitute
addClass, clone, create, getAttribute, getBrowserMode, getId, getLabel, getName, getParent, getParentElement, getRoot, getRootName, getStyle, getViewMode, init, init, removeAttribute, removeClass, setActionListener, setAttribute, setClass, setEncoding, setExpandEmptyElements, setId, setIndenting, setLabel, setName, setNewLines, setParent, setParentElement, setRootName, setStyle, setViewMode, show, show, toggleClass, toString
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
addClass, clone, getAttribute, getBrowserMode, getId, getLabel, getName, getParent, getParentElement, getRoot, getStyle, getViewMode, init, removeAttribute, removeClass, setActionListener, setAttribute, setClass, setId, setLabel, setName, setParent, setParentElement, setStyle, setViewMode, show, show, toggleClass, toString
protected TableModel tm
protected List<Serializable> headerNames
protected boolean colouredRows
protected int counter
public TableContainer()
public TableContainer(String id)
id
- id of the table elementpublic TableContainer(String id, TableModel t)
id
- - the idt
- - the tablemodelpublic TableContainer(TableModel t)
t
- - the tablemodelpublic TableContainer(List<Object> headers, TableModel t)
t
- - the tablemodelpublic void setUseTableBody(boolean use)
public void tableChanged(TableModelEvent event)
tableChanged
in interface TableModelListener
event
- - the event (-1, 0, 1)public void setModel(TableModel t)
protected void dataChanged(TableModel src)
src
- - the new sorted TableModelpublic void setValueAt(Object o, int rowIndex, int colIndex)
o
- - the new componentrowIndex
- - the row index of the new componentcolIndex
- - the column index of the new componentpublic void addRow(List<?> rowData)
rowData
- public void addRow(List<?> rowData, boolean isHeader)
public void addRow(List<?> rowData, List<Pair<String,String>> dataprops)
rowData
- the data of the new rowdataprops
- the properties of each data in the rowpublic void addRow(List<?> rowData, List<Pair<String,String>> rowprops, List<Pair<String,String>> dataprops)
rowData
- the data of the new rowrowprops
- the properties of the row (Pairs)dataprops
- the properties of each cell in the row (Pairs)public void addRow(List<?> rowData, String id, List<Pair<String,String>> rowprops, List<Pair<String,String>> dataprops)
rowData
- the data of the new rowid
- id of rowrowprops
- the properties of the row (Pairs)dataprops
- the properties of each cell in the row (Pairs)public void addHeader(List<?> rowData)
public void addRow(Object... row)
public void addRow(Object[] row, String id, List<Pair<String,String>> rowprops, List<Pair<String,String>> dataprops, boolean isHeader)
public void addRow(List<?> rowData, String id, List<Pair<String,String>> rowprops, List<Pair<String,String>> dataprops, boolean isHeader)
rowData
- a list of row dataid
- id of the rowrowprops
- list of row propertiesdataprops
- list of properties for each table cellisHeader
- true if the row is a header row (TH elements)protected void setCellValue(Element cell, Object data, List<Pair<String,String>> cellprops, int colindex)
protected void addRow(TableModel src, int first, int last)
src
- - the tablemodelfirst
- - the rowindex of the first changed rowlast
- - the rowindex of the last changed rowprotected List<Element> removeRow(int index)
index
- - the index of the first rowpublic List<Pair<String,String>> getTableAttributes()
public List<Object> getHeaderContent()
public void setHeaderName(int index, String name)
index
- - the specified columnname
- - the new name of the columnpublic List<Serializable> getHeaderNames()
public void setHeaderAttribute(String name, String value)
name
- - the attribute namevalue
- - the attribute valuepublic void setCellAttribute(int rowIndex, int colIndex, String name, String value)
rowIndex
- - the row index of the specified cellcolIndex
- - the column index of the specified cellname
- - the name of the attributevalue
- - the value of the attributepublic List<Attribute> getCellAttributes(int rowIndex, int colIndex)
rowIndex
- - the row index of the specified cellcolIndex
- - the column index of the specified cellpublic void setColumnWidth(int colIndex, int width)
colIndex
- - the column indexwidth
- - the widthpublic void setColumnHeight(int colIndex, int height)
colIndex
- - the column indexheight
- - the heightpublic void setColumnAlign(int colIndex, String align)
colIndex
- - the specified columnalign
- - center, left or rightpublic void setColumnValign(int colIndex, String valign)
colIndex
- - the specified columnvalign
- - top, middle, bottom or baselinepublic int getColumnWidth(int colIndex) throws DataConversionException
colIndex
- - the column indexDataConversionException
public void setColumnAttribute(int colIndex, String name, String value)
colIndex
- - the columnname
- - the attribute namevalue
- - the attribute valuepublic void setRowAttribute(int rowIndex, String name, String value)
rowIndex
- - the rowname
- - the attribute namevalue
- - the attribute value@Deprecated public List<?> getColumnAttributes(int colIndex)
public void setComponent(int colIndex, Class<? extends Component> cl)
colIndex
- - the columncl
- - the specified component as classpublic Component getComponentAt(int rowIndex, int colIndex)
rowIndex
- - the row indexcolIndex
- - the column indexpublic String getValueAt(int rowIndex, int colIndex)
rowIndex
- - the row indexcolIndex
- - the column indexprotected void build()
public TableModel getModel()
public void setContent(Object o)
setContent
in interface Component
setContent
in class AbstractComponent
o
- a table modelpublic Object getContent()
getContent
in interface Component
getContent
in class AbstractComponent
public String showRows()
public void setColouredRows(boolean coloured)
coloured
- public void addColspanRow(List<?> rowData, boolean add, int from, int length)
rowData
- the data of the rowadd
- specifies whether the row is an comment (true) or notfrom
- the number of the cell, where the colspan startslength
- the size of the colspan@enterprise 10.0.38375 Copyright © 2001-2024 Groiss Informatics GmbH. All Rights Reserved.