|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectcom.cbse.jeasy.JEObject
com.cbse.jeasy.JETable
public class JETable
A class using a JTable. JEasy may use an internal last column for each Table called SYS_Status. - a deleted row will get the SYS_Status "D" - a updated ro will get the SYS_Status "U" - a new row inserted by setValueAt(row,column) will get the SYS_Status "N" Set this column by insertSystStatus. If sortable is set to true the left mouse at the table header sorts in ascending and descending order. If filterAllowed is set to true the right mouse at the table header will popup a filter menu. If markingCol is set to true a first col is inserted with a checkbox to mark several cols.
| Properties | ||
|---|---|---|
| name | values | comment |
| id | * | Id of the object. Let it begin with TL_ |
| drivername |   | JDBC Driver |
| url |   | Url of the JDBC connection |
| user |   | User of the JDBC connection |
| border |   | Id of a border. |
| background |   | Id of a color used as the background |
| foreground |   | Id of a color used as the foreground |
| headerBackground |   | Id of a color used as the header background |
| headerForeground |   | Id of a color used as the header foreground |
| selectionBackground |   | Id of a color used as the background |
| selectionForeground |   | Id of a color used as the foreground |
| alternateBackground |   | Id of a color used as the background for each second row |
| alternateForeground |   | Id of a color used as the foreground for each second row |
| alternateSelectionBackground |   | Id of a color used as the background for each second row |
| alternateSelectionForeground |   | Id of a color used as the foreground for each second row |
| filterForeground |   | Id of a color used as the foreground for the filter popup |
| filterBackground |   | Id of a color used as the background for the filter popup |
| sumForeground |   | Id of a color used as the foreground for the sum row |
| sumBackground |   | Id of a color used as the background for the sum row |
| sumText |   | Text shown in the first column of the sum row |
| gridColor |   | Id of a color used as the foreground |
| password |   | Password of the JDBC connection |
| query |   | Query on the JDBC connection |
| editable | true false |
Set true will make the table editable |
| markingCol | true false |
Insert a chechbox column to mark a row |
| mandatory | true false |
Defines an entry as mandatory |
| sortable | true false |
Set true will make the table sortable by click at a header |
| filterAllowed | true false |
Set true will open a menu by right mouse click on table header for filtering rows |
| reoderingAllowed | true false |
Sets whether the user can drag column headers to reorder columns. |
| slectionMode | SINGLE_SELECTION SINGLE_INTERVAL_SELECTION MULTIPLE_INTERVAL_SELECTION |
Determines whether single-item or multiple-item selections are allowed. The following selectionMode values are allowed: ListSelectionModel.SINGLE_SELECTION Only one list index can be selected at a time. In this mode the setSelectionInterval and addSelectionInterval methods are equivalent, and only the second index argument is used. ListSelectionModel.SINGLE_INTERVAL_SELECTION One contiguous index interval can be selected at a time. In this mode setSelectionInterval and addSelectionInterval are equivalent. ListSelectionModel.MULTIPLE_INTERVAL_SELECTION In this mode, there's no restriction on what can be selected. This is the default. |
| elements |   | Columns of the table defined by JEObjects like Datafields, Panels, ... |
| numRows | int value | Number of rows in the table. |
* = property you have to set; bold = default value
| Field Summary | |
|---|---|
static int |
NO_FILTER
Used as a parameter for setCustomizing if filter settings should not be set |
| Fields inherited from class com.cbse.jeasy.JEObject |
|---|
DEVELOPPING, INPUT_ERROR_DATE, INPUT_ERROR_LENGTH, INPUT_ERROR_MANDATORY, INPUT_ERROR_PARSE, INPUT_ERROR_RANGE, INPUT_ERROR_TIME, INPUT_ERRORS, NO_INPUT_ERROR, RUNNING |
| Constructor Summary | |
|---|---|
JETable()
|
|
JETable(java.lang.String s)
Reads the properties from a string. |
|
| Method Summary | |
|---|---|
void |
actionPerformed(java.awt.event.ActionEvent e)
Action from popup filter |
void |
addMessage(java.lang.String message)
Adds the entrys of an xml String as a row of the table. |
void |
addSumColumn(int column)
Builds the sum for this column and shows the result in the sum row. |
void |
addSumColumn(int column,
int columnIndicator,
java.lang.Object value)
Builds the sum for this column and shows the result in the sum row. |
void |
addSumRow()
Adds a sum row to the table |
void |
backupEntry()
The current selected item will be stored internal to check against changes |
void |
clear()
Clears the entries but not the columns of a table and performs a repaint of the table |
void |
clear(boolean repaint)
Clears the entries but not the columns of a table and performs a repaint if true |
void |
clearSelection()
|
void |
clearTable()
Clears the entries and columns of a table |
void |
connect()
Connect to JDBC |
void |
createTable(java.lang.String sXML)
Builds a table with columns and rows out of an XML-String. |
void |
editingCanceled(javax.swing.event.ChangeEvent e)
|
void |
editingStopped(javax.swing.event.ChangeEvent e)
|
int |
examine()
Checks if an entry is mandatoy |
void |
executeQuery()
Execute a JDBC query and builds a table from the ResultSet |
void |
fillTable(java.lang.String rowsXML)
Fills a table created with createTable with rows out of an XML-String. |
void |
filterData()
Creates a new data array for the TableDataModel using only rows with filtered entries of columns The origin data array will be stored. |
void |
focusGained(java.awt.event.FocusEvent e)
|
void |
focusLost(java.awt.event.FocusEvent e)
|
java.awt.Color |
getAlternateBackground()
|
java.awt.Color |
getAlternateForeground()
|
java.awt.Color |
getAlternateSelectionBackground()
|
java.awt.Color |
getAlternateSelectionForeground()
|
java.awt.Color |
getBackground()
|
java.util.Vector |
getBackupEntry()
Gets the backuped Vector that holds the tables rows and columns Each element of the Vector is a Vector of the row data |
javax.swing.border.Border |
getBorder()
Get the border |
javax.swing.table.TableColumn |
getColumn(int col)
Gets the TableColumn of the column wih the given JEasy id |
int |
getColumnByJEId(java.lang.String colname)
Gets the columnnumber of the DataModel for a given colname given as a jeasy id for JEasy tables |
int |
getColumnByName(java.lang.String colname)
Gets the columnnumber of the DataModel for a given colname |
java.lang.Class |
getColumnClass(int col)
Gets the class of the given column |
int |
getColumnCount()
Returns the number of columns of this table model If a table was defined in the JEasyRepository each colum has a name and corresponding JEasy Id (the Id of a JEDatafield, JECheckbox,...) |
javax.swing.table.TableColumn |
getColumnFromJEID(java.lang.String id)
Gets the TableColumn of the column with the given JEasy id |
java.lang.String |
getColumnJEID(int col)
If a table was defined in the JEasyRepository each colum has a name and corresponding JEasy Id (the Id of a JEDatafield, JECheckbox,...) |
java.lang.String |
getColumnName(int col)
Gets the name of the column shown at the table |
int |
getColumnWidth(int col)
Gets the width of a column |
javax.swing.JComponent |
getComponent()
Gets the JComponent based on this JEasy Object |
java.lang.String |
getCSVData()
Returns a StringBuffer in CSV format. |
java.lang.String |
getCSVData(java.lang.String separator)
Returns a String in CSV format. |
java.lang.String |
getCustomizing()
Gets a string in xml format to store informations about column size, sorting and filter |
java.lang.String |
getDeletedMessage(int row)
Get a message out of the deleted row of a table |
int |
getDeletedRowCount()
Returns the number of deleted rows of this table |
java.lang.String |
getDetailDialog()
Sets the dialog to show the details of a row |
java.lang.String |
getDetailPanel()
Sets the panel to show the details of a row |
java.lang.String |
getElementAt(int n)
Gets the component of element n |
int |
getElementSize()
Gets the number of elements |
java.awt.Color |
getFilterBackground()
|
java.awt.Color |
getFilterForeground()
|
java.awt.Color |
getForeground()
|
java.awt.Color |
getGridColor()
|
java.awt.Color |
getHeaderBackground()
|
java.awt.Color |
getHeaderFilterBackground()
|
java.awt.Color |
getHeaderFilterForeground()
|
java.awt.Color |
getHeaderForeground()
|
java.awt.Dimension |
getIntercellSpace()
|
java.lang.String |
getMessage(int row)
Get a message out of the table row |
int |
getRowCount()
Returns the number of rows of this table model |
javax.swing.JScrollPane |
getScrollPane()
|
java.awt.Color |
getSelectionBackground()
|
java.awt.Color |
getSelectionForeground()
|
java.awt.Color |
getSumBackground()
|
java.awt.Color |
getSumForeground()
|
javax.swing.JTable |
getTable()
|
java.awt.Font |
getTableFont()
|
java.awt.Font |
getTableHeaderFont()
|
javax.swing.table.DefaultTableModel |
getTableModel()
|
java.lang.Object |
getValueAt(int row,
int col)
Gets value of the given cell |
java.lang.String |
getXMLData()
Returns a StringBuffer in XML format. |
boolean |
isMandatory()
Return if an entry is mandatory |
boolean |
isMarked(int row)
Returns true if the the row is marked |
boolean |
isMultipleFiltersPerRow()
Returns whether multiple filters are allowed on one column |
boolean |
isSumRowAdded()
|
void |
JEadd(java.awt.Container co)
Adds the JEObject to the Container |
void |
JEadd(java.awt.Container co,
java.awt.LayoutManager lm)
Adds the JEObject to the Container and the Containers LayoutManager |
void |
JEadd(java.lang.String border,
java.awt.Container co)
Adds the JEObject to a Container with a BorderLayout |
void |
keyPressed(java.awt.event.KeyEvent e)
|
void |
keyReleased(java.awt.event.KeyEvent e)
|
void |
keyTyped(java.awt.event.KeyEvent e)
|
void |
mark(int row)
Marks a rows when markingCol is set |
void |
markAll()
Marks all rows when markingCol is set |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
|
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
removeAllFilter()
Restores the data array for the TableDataModel |
void |
removeRow(int row)
|
void |
removeSumRow()
Removes the sum row from the table |
void |
repaint()
|
void |
restoreEntry()
Selects the item that was backuped before |
void |
setAlternateBackground(java.lang.String bg)
Set Color |
void |
setAlternateForeground(java.lang.String bg)
Set Color |
void |
setAlternateSelectionBackground(java.lang.String bg)
Set Color |
void |
setAlternateSelectionForeground(java.lang.String bg)
Set Color |
void |
setBackground(java.lang.String bg)
Set Color |
void |
setColumnWidth(int col,
int width)
Sets the fix width of a column |
void |
setCustomizing(java.lang.String xml)
Sets column size, sorting and filter by an xml string get from getCustomizing() |
void |
setCustomizing(java.lang.String xml,
int options)
Sets column size, sorting and filter by an xml string get from getCustomizing() |
void |
setDataVector(java.util.Vector v)
Sets the data Vector that holds the tables rows and columns. |
void |
setDetailDialog(java.lang.String s)
Sets the dialog to show the details of a row |
void |
setDetailPanel(java.lang.String s)
Sets the panel to show the details of a row |
void |
setDriverName(java.lang.String s)
|
void |
setEditable(boolean b)
Enables or disables the inputfield for editing |
void |
setFilter(java.lang.String colName,
java.util.Hashtable hs)
Sets a filter to that column. |
void |
setFilterBackground(java.lang.String s)
Sets the background color of filter popup menu |
void |
setFilterForeground(java.lang.String s)
Sets the foreground color of filter popup menu |
boolean |
setFocus()
Requests the focus to the table |
void |
setForeground(java.lang.String bg)
Set Color |
void |
setHeaderBackground(java.lang.String s)
Sets the background color of all column headers. |
void |
setHeaderFilterBackground(java.lang.String s)
Sets the background color of all filtered column headers. |
void |
setHeaderFilterForeground(java.lang.String s)
Sets the foreground color of all filtered column headers. |
void |
setHeaderForeground(java.lang.String s)
Sets the foreground color of all column headers. |
void |
setMandatory(boolean b)
Sets the entry mandatory or not |
void |
setMarkcolVisisble(boolean b)
Marks a rows when markingCol is set |
void |
setMultipleFiltersPerRow(boolean multipleFiltersPerRow)
If true, more than one selection in a filter for one column is allowed |
void |
setPassword(java.lang.String s)
|
void |
setPreferredColumnWidth(int col,
int width)
Sets the preferred width of a column |
void |
setQuery(java.lang.String s)
|
void |
setReorderingAllowed(boolean b)
|
void |
setSelectionBackground(java.lang.String bg)
Set Color |
void |
setSelectionForeground(java.lang.String bg)
Set Color |
void |
setSortable(boolean b)
|
void |
setSumBackground(java.lang.String bg)
Set Color |
void |
setSumForeground(java.lang.String bg)
Set Color |
void |
setSumRowVisible(boolean b)
Shows or hides the sum row |
void |
setUrl(java.lang.String s)
|
void |
setUser(java.lang.String s)
|
void |
setValueAt(java.lang.Object aValue,
int row,
int col)
Sets the value of the given cell |
void |
sortByColumn(int column,
boolean ascending)
Sorts the table rows in order of the given column If ascending is true sorting is ascending. |
void |
start()
Creates the jfc components using the properties |
void |
stopCellEditing()
Tell the editor to stop editing and accept any partially edited value as the value of the editor |
void |
tableChanged(javax.swing.event.TableModelEvent e)
TableModelListener |
void |
unmark(int row)
Removes mark of a row when markingCol is set |
void |
unmarkAll()
Removes mark of all row when markingCol is set |
void |
valueChanged(javax.swing.event.ListSelectionEvent e)
ListSelectionListener |
boolean |
wasEntryChanged()
The components compares the current entry with the data stored by backupEntry() |
| Methods inherited from class com.cbse.jeasy.JEObject |
|---|
deserializeValue, getApplet, getApplLocale, getCenter, getEast, getId, getJCallBack, getJClass, getLabel, getMode, getName, getNorth, getObjLocale, getParentId, getPreview, getProjectDirectory, getProperty, getRegisterText, getSouth, getStarted, getTitle, getType, getWest, getXMLtag, isEditable, isEnabled, isEnterprise, isProfessional, isStandard, isVisible, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEadd, JEaddTab, removeProperties, removeProperty, serializeValue, setApplet, setApplLocale, setEditable, setEnabled, setEnabled, setJCallBack, setMarkable, setMarkable, setMode, setObjLocale, setParentId, setPreview, setProjectDirectory, setProperty, setStarted, setVisible, setVisible |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int NO_FILTER
| Constructor Detail |
|---|
public JETable()
public JETable(java.lang.String s)
s - contains properties and valuesJE#PropertyString| Method Detail |
|---|
public void actionPerformed(java.awt.event.ActionEvent e)
actionPerformed in interface java.awt.event.ActionListenerpublic void addMessage(java.lang.String message)
message - public void addSumColumn(int column)
column - column to build the sum from
public void addSumColumn(int column,
int columnIndicator,
java.lang.Object value)
column - column to build the sum frompublic void addSumRow()
public void backupEntry()
backupEntry in class JEObjectpublic void clear()
clear in class JEObjectpublic void clear(boolean repaint)
repaint - whether to perform a repaint after clearpublic void clearSelection()
public void clearTable()
public void connect()
throws java.lang.Exception
java.lang.Exception
public void fillTable(java.lang.String rowsXML)
throws java.lang.Exception
XML-String -
java.lang.Exception
public void createTable(java.lang.String sXML)
throws java.lang.Exception
XML-String -
java.lang.Exceptionpublic void editingCanceled(javax.swing.event.ChangeEvent e)
editingCanceled in interface javax.swing.event.CellEditorListenerpublic void editingStopped(javax.swing.event.ChangeEvent e)
editingStopped in interface javax.swing.event.CellEditorListenerpublic int examine()
public void executeQuery()
throws java.lang.Exception
message -
java.lang.Exceptionpublic void filterData()
b - public void focusGained(java.awt.event.FocusEvent e)
focusGained in interface java.awt.event.FocusListenerpublic void focusLost(java.awt.event.FocusEvent e)
focusLost in interface java.awt.event.FocusListenerpublic java.awt.Color getAlternateBackground()
public java.awt.Color getAlternateForeground()
public java.awt.Color getAlternateSelectionBackground()
public java.awt.Color getAlternateSelectionForeground()
public java.awt.Color getBackground()
public java.util.Vector getBackupEntry()
public javax.swing.border.Border getBorder()
public javax.swing.table.TableColumn getColumn(int col)
id - the id of the JEasy object or null if not foundpublic int getColumnByJEId(java.lang.String colname)
colname - name of the column
public int getColumnByName(java.lang.String colname)
colname - name of the column
public java.lang.Class getColumnClass(int col)
col - columnpublic int getColumnCount()
public javax.swing.table.TableColumn getColumnFromJEID(java.lang.String id)
id - the id of the JEasy object or null if not foundpublic java.lang.String getColumnJEID(int col)
col - column of the tables datamodelpublic java.lang.String getColumnName(int col)
col - columnpublic int getColumnWidth(int col)
public javax.swing.JComponent getComponent()
getComponent in class JEObjectpublic java.lang.String getCSVData()
public java.lang.String getCSVData(java.lang.String separator)
public java.lang.String getDeletedMessage(int row)
row - begins with 0 for the first deleted rowpublic int getDeletedRowCount()
public java.lang.String getDetailDialog()
public java.lang.String getDetailPanel()
public java.lang.String getElementAt(int n)
JEObject
getElementAt in class JEObjectpublic int getElementSize()
JEObject
getElementSize in class JEObjectpublic java.awt.Color getFilterBackground()
public java.awt.Color getFilterForeground()
public java.awt.Color getForeground()
public java.awt.Color getGridColor()
public java.awt.Color getHeaderBackground()
public java.awt.Color getHeaderFilterBackground()
public java.awt.Color getHeaderFilterForeground()
public java.awt.Color getHeaderForeground()
public java.awt.Dimension getIntercellSpace()
public java.lang.String getMessage(int row)
row - public int getRowCount()
public javax.swing.JScrollPane getScrollPane()
public java.awt.Color getSelectionBackground()
public java.awt.Color getSelectionForeground()
public java.awt.Color getSumBackground()
public java.awt.Color getSumForeground()
public javax.swing.JTable getTable()
public java.awt.Font getTableFont()
public java.awt.Font getTableHeaderFont()
public javax.swing.table.DefaultTableModel getTableModel()
public java.lang.Object getValueAt(int row,
int col)
row - row of the tablecol - column of the table
public java.lang.String getXMLData()
public boolean isMandatory()
public boolean isMarked(int row)
b - public boolean isMultipleFiltersPerRow()
public boolean isSumRowAdded()
public void JEadd(java.awt.Container co)
JEObject
JEadd in class JEObject
public void JEadd(java.awt.Container co,
java.awt.LayoutManager lm)
JEObject
JEadd in class JEObject
public void JEadd(java.lang.String border,
java.awt.Container co)
JEObject
JEadd in class JEObjectpublic void keyPressed(java.awt.event.KeyEvent e)
keyPressed in interface java.awt.event.KeyListenerpublic void keyReleased(java.awt.event.KeyEvent e)
keyReleased in interface java.awt.event.KeyListenerpublic void keyTyped(java.awt.event.KeyEvent e)
keyTyped in interface java.awt.event.KeyListenerpublic void mark(int row)
b - public void markAll()
b - public void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic void removeAllFilter()
b - public void removeRow(int row)
public void removeSumRow()
public void repaint()
public void restoreEntry()
restoreEntry in class JEObjectpublic void setAlternateBackground(java.lang.String bg)
id - of JEColorpublic void setAlternateForeground(java.lang.String bg)
id - of JEColorpublic void setAlternateSelectionBackground(java.lang.String bg)
id - of JEColorpublic void setAlternateSelectionForeground(java.lang.String bg)
id - of JEColorpublic void setBackground(java.lang.String bg)
id - of JEColor
public void setColumnWidth(int col,
int width)
public void setDataVector(java.util.Vector v)
public void setDetailDialog(java.lang.String s)
public void setDetailPanel(java.lang.String s)
public void setDriverName(java.lang.String s)
public void setEditable(boolean b)
JEObject
setEditable in class JEObject
public void setFilter(java.lang.String colName,
java.util.Hashtable hs)
col - hs - public void setFilterBackground(java.lang.String s)
s - the JEasy id of a JEColorpublic void setFilterForeground(java.lang.String s)
s - the JEasy id of a JEColorpublic boolean setFocus()
setFocus in class JEObjectpublic void setForeground(java.lang.String bg)
id - of JEColorpublic void setHeaderBackground(java.lang.String s)
s - the JEasy id of a JEColorpublic void setHeaderFilterBackground(java.lang.String s)
s - the JEasy id of a JEColorpublic void setHeaderFilterForeground(java.lang.String s)
s - the JEasy id of a JEColorpublic void setHeaderForeground(java.lang.String s)
s - the JEasy id of a JEColorpublic void setMandatory(boolean b)
public void setMarkcolVisisble(boolean b)
b - public void setMultipleFiltersPerRow(boolean multipleFiltersPerRow)
multipleFiltersPerRow - public void setPassword(java.lang.String s)
public void setPreferredColumnWidth(int col,
int width)
public void setQuery(java.lang.String s)
public void setReorderingAllowed(boolean b)
public void setSelectionBackground(java.lang.String bg)
id - of JEColorpublic void setSelectionForeground(java.lang.String bg)
id - of JEColorpublic void setSortable(boolean b)
public void setSumBackground(java.lang.String bg)
id - of JEColorpublic void setSumForeground(java.lang.String bg)
id - of JEColorpublic void setSumRowVisible(boolean b)
b - public void setUrl(java.lang.String s)
public void setUser(java.lang.String s)
public void setValueAt(java.lang.Object aValue,
int row,
int col)
aValue - row - col -
public void sortByColumn(int column,
boolean ascending)
public void start()
start in class JEObjectJE#startpublic java.lang.String getCustomizing()
public void setCustomizing(java.lang.String xml)
public void setCustomizing(java.lang.String xml,
int options)
public void stopCellEditing()
public void tableChanged(javax.swing.event.TableModelEvent e)
tableChanged in interface javax.swing.event.TableModelListenerpublic void unmark(int row)
b - public void unmarkAll()
b - public void valueChanged(javax.swing.event.ListSelectionEvent e)
valueChanged in interface javax.swing.event.ListSelectionListenerpublic boolean wasEntryChanged()
wasEntryChanged in class JEObject
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||