|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.groiss.gui.AbstractComponent com.groiss.gui.AbstractContainer com.groiss.gui.component.TableContainer
public class TableContainer
TableContainer component
Field Summary | |
---|---|
protected boolean |
colouredRows
|
protected int |
counter
|
protected java.util.List |
headerNames
|
protected javax.swing.table.TableModel |
tm
|
Fields inherited from class com.groiss.gui.AbstractContainer |
---|
components |
Fields inherited from class com.groiss.gui.AbstractComponent |
---|
actions, 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, outputter, parent, parentElem, READONLY, root, viewMode |
Constructor Summary | |
---|---|
TableContainer()
constructs a new empty tablecontainer |
|
TableContainer(java.util.List headers,
javax.swing.table.TableModel t)
constructs a new tablecontainer |
|
TableContainer(java.lang.String id)
Constructs a new empty table-container. |
|
TableContainer(java.lang.String className,
java.lang.String width,
boolean colored)
|
|
TableContainer(java.lang.String id,
javax.swing.table.TableModel t)
constructs a new tablecontainer |
|
TableContainer(javax.swing.table.TableModel t)
constructs a new tablecontainer |
Method Summary | |
---|---|
void |
addColspanRow(java.util.List rowData,
boolean add,
int from,
int length)
adds a new row with colspan |
void |
addHeader(java.util.List rowData)
|
void |
addRow(java.util.List rowData)
adds a new row at the end of the table with the content of the vector |
void |
addRow(java.util.List rowData,
boolean isHeader)
|
void |
addRow(java.util.List rowData,
java.util.List dataprops)
adds a new row with the specified dataproperties |
void |
addRow(java.util.List rowData,
java.util.List rowprops,
java.util.List 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(java.util.List rowData,
java.lang.String id,
java.util.List rowprops,
java.util.List dataprops)
Adds a new Row with a row id. |
void |
addRow(java.util.List rowData,
java.lang.String id,
java.util.List rowprops,
java.util.List dataprops,
boolean isHeader)
Add a row to the table. |
void |
addRow(java.lang.Object[] row)
|
void |
addRow(java.lang.Object[] row,
java.lang.String id,
java.util.List rowprops,
java.util.List dataprops,
boolean isHeader)
|
protected void |
addRow(javax.swing.table.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(javax.swing.table.TableModel src)
builds the tree in a new order (moveRow) |
java.util.List |
getCellAttributes(int rowIndex,
int colIndex)
returns a vector of attributes of the chosen cell |
java.util.List |
getColumnAttributes(int colIndex)
|
int |
getColumnWidth(int colIndex)
returns the width of a specified column |
Component |
getComponentAt(int rowIndex,
int colIndex)
returns the component at the specified position |
java.lang.Object |
getContent()
Returns null. |
java.util.List |
getHeaderContent()
returns the content of the column header (first row) |
java.util.List |
getHeaderNames()
returns the names of the columns |
javax.swing.table.TableModel |
getModel()
|
java.util.List |
getRows(boolean isHeader)
|
java.util.List |
getTableAttributes()
returns a vector of pairs (names, attributes) of the table element |
java.lang.String |
getValueAt(int rowIndex,
int colIndex)
returns a string representation of the component at the specified position |
protected java.lang.Object |
removeRow(int index)
removes the rows at the specified position INDEX from the table |
void |
setCellAttribute(int rowIndex,
int colIndex,
java.lang.String name,
java.lang.String value)
sets the attribute in the specified cell |
protected void |
setCellValue(org.jdom.Element cell,
java.lang.Object data,
java.util.List 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,
java.lang.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,
java.lang.String name,
java.lang.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,
java.lang.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,
java.lang.Class 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(java.lang.Object o)
Initialize the table with the given tabel model. |
void |
setHeaderAttribute(java.lang.String name,
java.lang.String value)
sets an attribute of the column header (first row) |
void |
setHeaderName(int index,
java.lang.String name)
sets the columnname of a specified column |
void |
setModel(javax.swing.table.TableModel t)
|
void |
setRowAttribute(int rowIndex,
java.lang.String name,
java.lang.String value)
sets the specified attribute in the whole row |
void |
setUseTableBody(boolean use)
|
void |
setValueAt(java.lang.Object o,
int rowIndex,
int colIndex)
sets a new value (a new component) to the specified position in the table |
java.lang.String |
showRows()
|
void |
tableChanged(javax.swing.event.TableModelEvent event)
method which handles the incoming events |
Methods inherited from class com.groiss.gui.AbstractContainer |
---|
add, get, getAll, getAll, getAllDeep, getByName, getComponents, getWithParent, init, remove, setBrowserMode, substitute |
Methods inherited from class com.groiss.gui.AbstractComponent |
---|
clone, create, getActionListener, getAttribute, getBrowserMode, getId, getLabel, getName, getParent, getParentElement, getRoot, getRootName, getStyle, getViewMode, init, init, removeAttribute, setActionListener, setAttribute, setEncoding, setExpandEmptyElements, setId, setIndenting, setLabel, setName, setNewLines, setParent, setParentElement, setRootName, setStyle, setViewMode, show, show, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.groiss.gui.Component |
---|
clone, getActionListener, getAttribute, getBrowserMode, getId, getLabel, getName, getParent, getParentElement, getRoot, getStyle, getViewMode, init, removeAttribute, setActionListener, setAttribute, setId, setLabel, setName, setParent, setParentElement, setStyle, setViewMode, show, show, toString |
Field Detail |
---|
protected javax.swing.table.TableModel tm
protected java.util.List headerNames
protected boolean colouredRows
protected int counter
Constructor Detail |
---|
public TableContainer()
public TableContainer(java.lang.String id)
id
- id of the table elementpublic TableContainer(java.lang.String className, java.lang.String width, boolean colored)
public TableContainer(java.lang.String id, javax.swing.table.TableModel t)
id
- - the idt
- - the tablemodelpublic TableContainer(javax.swing.table.TableModel t)
t
- - the tablemodelpublic TableContainer(java.util.List headers, javax.swing.table.TableModel t)
t
- - the tablemodelMethod Detail |
---|
public void setUseTableBody(boolean use)
public void tableChanged(javax.swing.event.TableModelEvent event)
tableChanged
in interface javax.swing.event.TableModelListener
event
- - the event (-1, 0, 1)public void setModel(javax.swing.table.TableModel t)
protected void dataChanged(javax.swing.table.TableModel src)
src
- - the new sorted TableModelpublic void setValueAt(java.lang.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(java.util.List rowData)
rowData
- public void addRow(java.util.List rowData, boolean isHeader)
public void addRow(java.util.List rowData, java.util.List dataprops)
rowData
- the data of the new rowdataprops
- the properties of each data in the rowpublic void addRow(java.util.List rowData, java.util.List rowprops, java.util.List 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(java.util.List rowData, java.lang.String id, java.util.List rowprops, java.util.List 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(java.util.List rowData)
public java.util.List getRows(boolean isHeader)
public void addRow(java.lang.Object[] row)
public void addRow(java.lang.Object[] row, java.lang.String id, java.util.List rowprops, java.util.List dataprops, boolean isHeader)
public void addRow(java.util.List rowData, java.lang.String id, java.util.List rowprops, java.util.List 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(org.jdom.Element cell, java.lang.Object data, java.util.List cellprops, int colindex)
protected void addRow(javax.swing.table.TableModel src, int first, int last)
src
- - the tablemodelfirst
- - the rowindex of the first changed rowlast
- - the rowindex of the last changed rowprotected java.lang.Object removeRow(int index)
index
- - the index of the first row
public java.util.List getTableAttributes()
public java.util.List getHeaderContent()
public void setHeaderName(int index, java.lang.String name)
index
- - the specified columnname
- - the new name of the columnpublic java.util.List getHeaderNames()
public void setHeaderAttribute(java.lang.String name, java.lang.String value)
name
- - the attribute namevalue
- - the attribute valuepublic void setCellAttribute(int rowIndex, int colIndex, java.lang.String name, java.lang.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 java.util.List 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, java.lang.String align)
colIndex
- - the specified columnalign
- - center, left or rightpublic void setColumnValign(int colIndex, java.lang.String valign)
colIndex
- - the specified columnvalign
- - top, middle, bottom or baselinepublic int getColumnWidth(int colIndex) throws org.jdom.DataConversionException
colIndex
- - the column index
org.jdom.DataConversionException
public void setColumnAttribute(int colIndex, java.lang.String name, java.lang.String value)
colIndex
- - the columnname
- - the attribute namevalue
- - the attribute valuepublic void setRowAttribute(int rowIndex, java.lang.String name, java.lang.String value)
rowIndex
- - the rowname
- - the attribute namevalue
- - the attribute valuepublic java.util.List getColumnAttributes(int colIndex)
public void setComponent(int colIndex, java.lang.Class cl)
colIndex
- - the columncl
- - the specified component as classpublic Component getComponentAt(int rowIndex, int colIndex)
rowIndex
- - the row indexcolIndex
- - the column index
public java.lang.String getValueAt(int rowIndex, int colIndex)
rowIndex
- - the row indexcolIndex
- - the column index
protected void build()
public javax.swing.table.TableModel getModel()
public void setContent(java.lang.Object o)
setContent
in interface Component
setContent
in class AbstractComponent
o
- a table modelpublic java.lang.Object getContent()
getContent
in interface Component
getContent
in class AbstractComponent
public java.lang.String showRows()
public void setColouredRows(boolean coloured)
coloured
- public void addColspanRow(java.util.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
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |