com.cbse.jeasy
Class JETable

java.lang.Object
  extended by com.cbse.jeasy.JEObject
      extended by com.cbse.jeasy.JETable
All Implemented Interfaces:
java.awt.event.ActionListener, java.awt.event.FocusListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.util.EventListener, javax.swing.event.CellEditorListener, javax.swing.event.ListSelectionListener, javax.swing.event.TableModelListener

public class JETable
extends JEObject
implements javax.swing.event.TableModelListener, javax.swing.event.ListSelectionListener, java.awt.event.MouseListener, java.awt.event.ActionListener, java.awt.event.KeyListener, javax.swing.event.CellEditorListener, java.awt.event.FocusListener

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

Version:
%I%, %G% Changes: hpl: 28.6.2005 Sorting mit compareIgnoreCase
Author:
H.Pfohl

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

NO_FILTER

public static final int NO_FILTER
Used as a parameter for setCustomizing if filter settings should not be set

See Also:
Constant Field Values
Constructor Detail

JETable

public JETable()

JETable

public JETable(java.lang.String s)
Reads the properties from a string.

Parameters:
s - contains properties and values
See Also:
JE#PropertyString
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Action from popup filter

Specified by:
actionPerformed in interface java.awt.event.ActionListener

addMessage

public void addMessage(java.lang.String message)
Adds the entrys of an xml String as a row of the table. The tagnames should correspond to the JEasy id of the column or the XMLTag

Parameters:
message -

addSumColumn

public void addSumColumn(int column)
Builds the sum for this column and shows the result in the sum row.

Parameters:
column - column to build the sum from

addSumColumn

public void addSumColumn(int column,
                         int columnIndicator,
                         java.lang.Object value)
Builds the sum for this column and shows the result in the sum row. Only these rows are added where the value of the columnIndicatur is equals the given value For example use this method to sum only columns that are marked.

Parameters:
column - column to build the sum from

addSumRow

public void addSumRow()
Adds a sum row to the table


backupEntry

public void backupEntry()
The current selected item will be stored internal to check against changes

Overrides:
backupEntry in class JEObject

clear

public void clear()
Clears the entries but not the columns of a table and performs a repaint of the table

Overrides:
clear in class JEObject

clear

public void clear(boolean repaint)
Clears the entries but not the columns of a table and performs a repaint if true

Parameters:
repaint - whether to perform a repaint after clear

clearSelection

public void clearSelection()

clearTable

public void clearTable()
Clears the entries and columns of a table


connect

public void connect()
             throws java.lang.Exception
Connect to JDBC

Throws:
java.lang.Exception

fillTable

public void fillTable(java.lang.String rowsXML)
               throws java.lang.Exception
Fills a table created with createTable with rows out of an XML-String. See createTable Format : <row> <CustomerId>22344442</CustomerId> <CustomerName>Miller</CustomerName> </row> <row> <CustomerId>007</CustomerId> <CustomerName>Bond</CustomerName> </row> <row> <InternalKey>11223344</InternalKey> </row>

Parameters:
XML-String -
Throws:
java.lang.Exception

createTable

public void createTable(java.lang.String sXML)
                 throws java.lang.Exception
Builds a table with columns and rows out of an XML-String. In metadata is a tag column with a tag name inside. The name is the columnName. To hide columns set the width to zero. Alignments are LEFT or RIGHT or CENTER. The class is a String as default, use Boolean to see a checkbox. In data are rows where the tagnames are the columnNames. The entries of these tags are cells of the table. Format : <table> <metadata> <column> <name>CustomerId alias="Customer Number" </name> <width>50</width> <class>Boolean</class> </column> <column> <alignment>RIGHT</alignement> </column> <column> <name>CustomerName</name> <width>150</width> <alignment>LEFT</alignement> </column> <column> <name>InternalKey</name> <width>0</width> </column> </metadata> <data> <row> <CustomerId>22344442</CustomerId> <CustomerName>Miller</CustomerName> </row> <row> <CustomerId>007</CustomerId> <CustomerName>Bond</CustomerName> </row> <row> <InternalKey>11223344</InternalKey> </row> </data> </table>

Parameters:
XML-String -
Throws:
java.lang.Exception

editingCanceled

public void editingCanceled(javax.swing.event.ChangeEvent e)
Specified by:
editingCanceled in interface javax.swing.event.CellEditorListener

editingStopped

public void editingStopped(javax.swing.event.ChangeEvent e)
Specified by:
editingStopped in interface javax.swing.event.CellEditorListener

examine

public int examine()
Checks if an entry is mandatoy

Returns:
0 if an entry is set or mandatory is false else JEObject.INPUT_ERROR_MANDATORY

executeQuery

public void executeQuery()
                  throws java.lang.Exception
Execute a JDBC query and builds a table from the ResultSet

Parameters:
message -
Throws:
java.lang.Exception

filterData

public 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.

Parameters:
b -

focusGained

public void focusGained(java.awt.event.FocusEvent e)
Specified by:
focusGained in interface java.awt.event.FocusListener

focusLost

public void focusLost(java.awt.event.FocusEvent e)
Specified by:
focusLost in interface java.awt.event.FocusListener

getAlternateBackground

public java.awt.Color getAlternateBackground()

getAlternateForeground

public java.awt.Color getAlternateForeground()

getAlternateSelectionBackground

public java.awt.Color getAlternateSelectionBackground()

getAlternateSelectionForeground

public java.awt.Color getAlternateSelectionForeground()

getBackground

public java.awt.Color getBackground()

getBackupEntry

public 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

Returns:
String

getBorder

public javax.swing.border.Border getBorder()
Get the border

Returns:
Border

getColumn

public javax.swing.table.TableColumn getColumn(int col)
Gets the TableColumn of the column wih the given JEasy id

Parameters:
id - the id of the JEasy object or null if not found

getColumnByJEId

public int getColumnByJEId(java.lang.String colname)
Gets the columnnumber of the DataModel for a given colname given as a jeasy id for JEasy tables

Parameters:
colname - name of the column
Returns:
the colnamber of the column or -1 of non column was found

getColumnByName

public int getColumnByName(java.lang.String colname)
Gets the columnnumber of the DataModel for a given colname

Parameters:
colname - name of the column
Returns:
the colnamber of the column or -1 of non column was found

getColumnClass

public java.lang.Class getColumnClass(int col)
Gets the class of the given column

Parameters:
col - column

getColumnCount

public 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,...) If one of these Id's non visible, you will get more columns as you see in the TableModel


getColumnFromJEID

public javax.swing.table.TableColumn getColumnFromJEID(java.lang.String id)
Gets the TableColumn of the column with the given JEasy id

Parameters:
id - the id of the JEasy object or null if not found

getColumnJEID

public 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,...) This Id is used by getMessage out of a table. If non visible components are used, you will have more columns as you see in the TableModel

Parameters:
col - column of the tables datamodel

getColumnName

public java.lang.String getColumnName(int col)
Gets the name of the column shown at the table

Parameters:
col - column

getColumnWidth

public int getColumnWidth(int col)
Gets the width of a column


getComponent

public javax.swing.JComponent getComponent()
Gets the JComponent based on this JEasy Object

Overrides:
getComponent in class JEObject
Returns:
JComponent

getCSVData

public java.lang.String getCSVData()
Returns a StringBuffer in CSV format. Every line ends with '\n'. Alle entries are separated by ';' The first line contains the column header followed by the rows where each row is a line

Returns:

getCSVData

public java.lang.String getCSVData(java.lang.String separator)
Returns a String in CSV format. Every line ends with '\n'. Alle entries are separated by the separator. The first line contains the column header followed by the rows where each row is a line

Returns:

getDeletedMessage

public java.lang.String getDeletedMessage(int row)
Get a message out of the deleted row of a table

Parameters:
row - begins with 0 for the first deleted row

getDeletedRowCount

public int getDeletedRowCount()
Returns the number of deleted rows of this table


getDetailDialog

public java.lang.String getDetailDialog()
Sets the dialog to show the details of a row


getDetailPanel

public java.lang.String getDetailPanel()
Sets the panel to show the details of a row


getElementAt

public java.lang.String getElementAt(int n)
Description copied from class: JEObject
Gets the component of element n

Overrides:
getElementAt in class JEObject
Returns:
id of the JEObject or null

getElementSize

public int getElementSize()
Description copied from class: JEObject
Gets the number of elements

Overrides:
getElementSize in class JEObject
Returns:
id of the JEObject or null

getFilterBackground

public java.awt.Color getFilterBackground()

getFilterForeground

public java.awt.Color getFilterForeground()

getForeground

public java.awt.Color getForeground()

getGridColor

public java.awt.Color getGridColor()

getHeaderBackground

public java.awt.Color getHeaderBackground()

getHeaderFilterBackground

public java.awt.Color getHeaderFilterBackground()

getHeaderFilterForeground

public java.awt.Color getHeaderFilterForeground()

getHeaderForeground

public java.awt.Color getHeaderForeground()

getIntercellSpace

public java.awt.Dimension getIntercellSpace()

getMessage

public java.lang.String getMessage(int row)
Get a message out of the table row

Parameters:
row -

getRowCount

public int getRowCount()
Returns the number of rows of this table model


getScrollPane

public javax.swing.JScrollPane getScrollPane()

getSelectionBackground

public java.awt.Color getSelectionBackground()

getSelectionForeground

public java.awt.Color getSelectionForeground()

getSumBackground

public java.awt.Color getSumBackground()

getSumForeground

public java.awt.Color getSumForeground()

getTable

public javax.swing.JTable getTable()

getTableFont

public java.awt.Font getTableFont()

getTableHeaderFont

public java.awt.Font getTableHeaderFont()

getTableModel

public javax.swing.table.DefaultTableModel getTableModel()

getValueAt

public java.lang.Object getValueAt(int row,
                                   int col)
Gets value of the given cell

Parameters:
row - row of the table
col - column of the table
Returns:

getXMLData

public java.lang.String getXMLData()
Returns a StringBuffer in XML format.

Returns:

isMandatory

public boolean isMandatory()
Return if an entry is mandatory


isMarked

public boolean isMarked(int row)
Returns true if the the row is marked

Parameters:
b -

isMultipleFiltersPerRow

public boolean isMultipleFiltersPerRow()
Returns whether multiple filters are allowed on one column

Returns:

isSumRowAdded

public boolean isSumRowAdded()

JEadd

public void JEadd(java.awt.Container co)
Description copied from class: JEObject
Adds the JEObject to the Container

Overrides:
JEadd in class JEObject

JEadd

public void JEadd(java.awt.Container co,
                  java.awt.LayoutManager lm)
Description copied from class: JEObject
Adds the JEObject to the Container and the Containers LayoutManager

Overrides:
JEadd in class JEObject

JEadd

public void JEadd(java.lang.String border,
                  java.awt.Container co)
Description copied from class: JEObject
Adds the JEObject to a Container with a BorderLayout

Overrides:
JEadd in class JEObject

keyPressed

public void keyPressed(java.awt.event.KeyEvent e)
Specified by:
keyPressed in interface java.awt.event.KeyListener

keyReleased

public void keyReleased(java.awt.event.KeyEvent e)
Specified by:
keyReleased in interface java.awt.event.KeyListener

keyTyped

public void keyTyped(java.awt.event.KeyEvent e)
Specified by:
keyTyped in interface java.awt.event.KeyListener

mark

public void mark(int row)
Marks a rows when markingCol is set

Parameters:
b -

markAll

public void markAll()
Marks all rows when markingCol is set

Parameters:
b -

mouseClicked

public void mouseClicked(java.awt.event.MouseEvent e)
Specified by:
mouseClicked in interface java.awt.event.MouseListener

mouseEntered

public void mouseEntered(java.awt.event.MouseEvent e)
Specified by:
mouseEntered in interface java.awt.event.MouseListener

mouseExited

public void mouseExited(java.awt.event.MouseEvent e)
Specified by:
mouseExited in interface java.awt.event.MouseListener

mousePressed

public void mousePressed(java.awt.event.MouseEvent e)
Specified by:
mousePressed in interface java.awt.event.MouseListener

mouseReleased

public void mouseReleased(java.awt.event.MouseEvent e)
Specified by:
mouseReleased in interface java.awt.event.MouseListener

removeAllFilter

public void removeAllFilter()
Restores the data array for the TableDataModel

Parameters:
b -

removeRow

public void removeRow(int row)

removeSumRow

public void removeSumRow()
Removes the sum row from the table


repaint

public void repaint()

restoreEntry

public void restoreEntry()
Selects the item that was backuped before

Overrides:
restoreEntry in class JEObject

setAlternateBackground

public void setAlternateBackground(java.lang.String bg)
Set Color

Parameters:
id - of JEColor

setAlternateForeground

public void setAlternateForeground(java.lang.String bg)
Set Color

Parameters:
id - of JEColor

setAlternateSelectionBackground

public void setAlternateSelectionBackground(java.lang.String bg)
Set Color

Parameters:
id - of JEColor

setAlternateSelectionForeground

public void setAlternateSelectionForeground(java.lang.String bg)
Set Color

Parameters:
id - of JEColor

setBackground

public void setBackground(java.lang.String bg)
Set Color

Parameters:
id - of JEColor

setColumnWidth

public void setColumnWidth(int col,
                           int width)
Sets the fix width of a column


setDataVector

public void setDataVector(java.util.Vector v)
Sets the data Vector that holds the tables rows and columns. Each element of the Vector is a Vector of the rows data. Each row must have one empty String element more for holding the SYS_Status. If bmarkingCol is set the first entry of each vector element must be Boolean(false)


setDetailDialog

public void setDetailDialog(java.lang.String s)
Sets the dialog to show the details of a row


setDetailPanel

public void setDetailPanel(java.lang.String s)
Sets the panel to show the details of a row


setDriverName

public void setDriverName(java.lang.String s)

setEditable

public void setEditable(boolean b)
Description copied from class: JEObject
Enables or disables the inputfield for editing

Overrides:
setEditable in class JEObject

setFilter

public void setFilter(java.lang.String colName,
                      java.util.Hashtable hs)
Sets a filter to that column. Only the row of the table will be shown, where the entry of the column matches with one of the entries of the Hashtable.

Parameters:
col -
hs -

setFilterBackground

public void setFilterBackground(java.lang.String s)
Sets the background color of filter popup menu

Parameters:
s - the JEasy id of a JEColor

setFilterForeground

public void setFilterForeground(java.lang.String s)
Sets the foreground color of filter popup menu

Parameters:
s - the JEasy id of a JEColor

setFocus

public boolean setFocus()
Requests the focus to the table

Overrides:
setFocus in class JEObject

setForeground

public void setForeground(java.lang.String bg)
Set Color

Parameters:
id - of JEColor

setHeaderBackground

public void setHeaderBackground(java.lang.String s)
Sets the background color of all column headers.

Parameters:
s - the JEasy id of a JEColor

setHeaderFilterBackground

public void setHeaderFilterBackground(java.lang.String s)
Sets the background color of all filtered column headers.

Parameters:
s - the JEasy id of a JEColor

setHeaderFilterForeground

public void setHeaderFilterForeground(java.lang.String s)
Sets the foreground color of all filtered column headers.

Parameters:
s - the JEasy id of a JEColor

setHeaderForeground

public void setHeaderForeground(java.lang.String s)
Sets the foreground color of all column headers.

Parameters:
s - the JEasy id of a JEColor

setMandatory

public void setMandatory(boolean b)
Sets the entry mandatory or not


setMarkcolVisisble

public void setMarkcolVisisble(boolean b)
Marks a rows when markingCol is set

Parameters:
b -

setMultipleFiltersPerRow

public void setMultipleFiltersPerRow(boolean multipleFiltersPerRow)
If true, more than one selection in a filter for one column is allowed

Parameters:
multipleFiltersPerRow -

setPassword

public void setPassword(java.lang.String s)

setPreferredColumnWidth

public void setPreferredColumnWidth(int col,
                                    int width)
Sets the preferred width of a column


setQuery

public void setQuery(java.lang.String s)

setReorderingAllowed

public void setReorderingAllowed(boolean b)

setSelectionBackground

public void setSelectionBackground(java.lang.String bg)
Set Color

Parameters:
id - of JEColor

setSelectionForeground

public void setSelectionForeground(java.lang.String bg)
Set Color

Parameters:
id - of JEColor

setSortable

public void setSortable(boolean b)

setSumBackground

public void setSumBackground(java.lang.String bg)
Set Color

Parameters:
id - of JEColor

setSumForeground

public void setSumForeground(java.lang.String bg)
Set Color

Parameters:
id - of JEColor

setSumRowVisible

public void setSumRowVisible(boolean b)
Shows or hides the sum row

Parameters:
b -

setUrl

public void setUrl(java.lang.String s)

setUser

public void setUser(java.lang.String s)

setValueAt

public void setValueAt(java.lang.Object aValue,
                       int row,
                       int col)
Sets the value of the given cell

Parameters:
aValue -
row -
col -

sortByColumn

public void sortByColumn(int column,
                         boolean ascending)
Sorts the table rows in order of the given column If ascending is true sorting is ascending. Descending otherwise


start

public void start()
Creates the jfc components using the properties

Overrides:
start in class JEObject
See Also:
JE#start

getCustomizing

public java.lang.String getCustomizing()
Gets a string in xml format to store informations about column size, sorting and filter

Returns:
xml string with column data

setCustomizing

public void setCustomizing(java.lang.String xml)
Sets column size, sorting and filter by an xml string get from getCustomizing()


setCustomizing

public void setCustomizing(java.lang.String xml,
                           int options)
Sets column size, sorting and filter by an xml string get from getCustomizing()


stopCellEditing

public void stopCellEditing()
Tell the editor to stop editing and accept any partially edited value as the value of the editor


tableChanged

public void tableChanged(javax.swing.event.TableModelEvent e)
TableModelListener

Specified by:
tableChanged in interface javax.swing.event.TableModelListener

unmark

public void unmark(int row)
Removes mark of a row when markingCol is set

Parameters:
b -

unmarkAll

public void unmarkAll()
Removes mark of all row when markingCol is set

Parameters:
b -

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent e)
ListSelectionListener

Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener

wasEntryChanged

public boolean wasEntryChanged()
The components compares the current entry with the data stored by backupEntry()

Overrides:
wasEntryChanged in class JEObject
Returns:
true data was changed false current data is equal backup data