de.cbse.jeasy
Class JETable
java.lang.Object
de.cbse.jeasy.JEObject
de.cbse.jeasy.JEComponent
de.cbse.jeasy.JEParentComponent
de.cbse.jeasy.JETable
- All Implemented Interfaces:
- java.awt.event.ActionListener, java.awt.event.ComponentListener, java.awt.event.FocusListener, java.awt.event.InputMethodListener, java.awt.event.ItemListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.awt.event.MouseWheelListener, java.awt.event.WindowFocusListener, java.awt.event.WindowListener, java.beans.PropertyChangeListener, java.util.EventListener, javax.swing.event.CaretListener, javax.swing.event.ChangeListener, javax.swing.event.DocumentListener, javax.swing.event.ListSelectionListener, javax.swing.event.MenuKeyListener, javax.swing.event.PopupMenuListener, javax.swing.event.TableModelListener, javax.swing.event.TreeExpansionListener, javax.swing.event.TreeModelListener, javax.swing.event.TreeSelectionListener
public class JETable
- extends JEParentComponent
Implements a JTable and enhances it functionality.
Columns of JETables are sortable and filterable by click left or right mouse
at the header.
The sort algorithm depends on the entries of the column and is choosen
automaticly.
See a demonstration in the program JEasyExample tab
"Table sum and sort".
Properties :
- id
The unique id of the root object.
- referenceId
A reference for this jeasy object used to identify this type of jeasy object
even if it was cloned. It is used for locale properties of the object and may
be used for identification in messages. If no reference is set, the jeasy id
will be set as default.
- rows
Sets the number of rows.
- layout (possible values [ , GridBagLayout, BorderLayout,
BorderLayout([hgap],[vgap]), FlowLayout, CardLayout,
GridLayout([rows],[cols]), BoxLayout_X_AXIS, BoxLayout_Y_AXIS,
BoxLayout_LINE_AXIS, BoxLayout_PAGE_AXIS, null])
The layout manager for this container. In BorderLayout hgap and vgap gives
the gap between components.
- scrollPane
Optional vertical and horizontal scroll bars.
- border (reference to JEBorder)
The border of this component.
- constraints (reference to JEConstraints)
The contraints for this component used for GridBagLayout Manager.
- foreground (reference to JEColor)
Id of a color used as the foreground of the component.
- background (reference to JEColor)
Id of a color used as the background of the component.
- enabled
Sets whether or not this component is enabled.
- editable
Sets whether or not this component can be edited.
- mandatory
Sets whether or not this component is mandatory. A mandatory component must
have a value before serializing.
- rowAddedIcon (reference to JEImageIcon)
Icon to be set in the processing column of a table, when the row was added.
- rowDeleteIcon (reference to JEImageIcon)
Icon to be set in the processing column of a table, if the row was deleted.
- rowEditIcon (reference to JEImageIcon)
Icon to be set in the processing column of a table, when the row was edited.
- elements (possible values [JEButton, JECheckBox, JEComboBox,
JEComboList, JEDataField, JEEditorPane, JELabel, JEList, JEPanel, JEMenuBar,
JERadioButton, JESpinner, JESplitPane, JETabbedPane, JETable, JEToolBar,
JETreeNode, JETree, JEWindow])
Specifies the list of child components when using other LayoutManager than
BorderLayout.
- alternateForeground (reference to JEColor)
Id of a color used for every second row.
- alternateBackground (reference to JEColor)
Id of a color used for every second row.
- selectionForeground (reference to JEColor)
Id of a color used for every seelected row.
- selectionBackground (reference to JEColor)
Id of a color used for every seelected row.
- alternateSelectionForeground (reference to JEColor)
Id of a color used for every second selected row.
- alternateSelectionBackground (reference to JEColor)
Id of a color used for every second selected row.
- reorderingAllowed
Sets whether the user may drag column headers to reorder columns.
- selectionMode (possible values [ , SINGLE_SELECTION,
SINGLE_INTERVAL_SELECTION, MULTIPLE_INTERVAL_SELECTION])
Determines whether single-item or multiple-item selections are allowed. The
following selectionMode values are allowed: SINGLE_SELECTION Only one list
index can be selected at a time. SINGLE_INTERVAL_SELECTION One contiguous
index interval can be selected at a time. MULTIPLE_INTERVAL_SELECTION In this
mode, there's no restriction on what can be selected. This is the default.
- sumable
Sets whether an optional sum row is added at the last row of the table.
- filterAllowed
Sets whether a popup is shown to filter rows by selecting columns data. The
popup is activated by right mouse click.
- processingCol
Insert a column to mark rows as been edited or deleted. Only useful when the
table is editable.
- detailPopUpAllowed
If true and the user double clicks left on a cell, a popup will appear, that
shows all data of a row in a panel.
- headerForeground (reference to JEColor)
Id of a color used for the table header.
- headerBackground (reference to JEColor)
Id of a color used for the table header.
- sumForeground (reference to JEColor)
Id of a color used for the sum row.
- sumBackground (reference to JEColor)
Id of a color used for the sum row.
- filterForeground (reference to JEColor)
Id of a color used for the filter popup.
- filterBackground (reference to JEColor)
Id of a color used for the filter popup.
- sumText
A text shown in the first column of the sum row.
- gridColor (reference to JEColor)
Id of a color used for the grid.
- columnMargin
Sets the columnMargin, the width of the space between cells.
- viewportHeight
Sets the preferred size of the viewport for this table.
Properties :
- id
The unique id of the root object.
- referenceId
A reference for this jeasy object used to identify this type of jeasy object even if it was cloned. It is used for locale properties of the object and may be used for identification in messages. If no reference is set, the jeasy id will be set as default.
- rows
Sets the number of rows.
- layout (possible values [ , GridBagLayout, BorderLayout, BorderLayout([hgap],[vgap]), FlowLayout, CardLayout, GridLayout([rows],[cols]), BoxLayout_X_AXIS, BoxLayout_Y_AXIS, BoxLayout_LINE_AXIS, BoxLayout_PAGE_AXIS, null])
The layout manager for this container. In BorderLayout hgap and vgap gives the gap between components.
- scrollPane
Optional vertical and horizontal scroll bars.
- border (reference to JEBorder)
The border of this component.
- constraints (reference to JEConstraints)
The contraints for this component used for GridBagLayout Manager.
- foreground (reference to JEColor)
Id of a color used as the foreground of the component.
- background (reference to JEColor)
Id of a color used as the background of the component.
- visible
Sets whether or not this component is visible.
- enabled
Sets whether or not this component is enabled.
- editable
Sets whether or not this component can be edited.
- mandatory
Sets whether or not this component is mandatory. A mandatory component must have a value before serializing.
- rowAddedIcon (reference to JEImageIcon)
Icon to be set in the processing column of a table, when the row was added.
- rowDeleteIcon (reference to JEImageIcon)
Icon to be set in the processing column of a table, if the row was deleted.
- rowEditIcon (reference to JEImageIcon)
Icon to be set in the processing column of a table, when the row was edited.
- elements (possible values [JEButton, JECheckBox, JEComboBox, JEComboList, JEDataField, JEEditorPane, JELabel, JEList, JEPanel, JEMenuBar, JERadioButton, JESpinner, JESplitPane, JETabbedPane, JETable, JETaskPane, JEToolBar, JETreeNode, JETree, JEWindow])
Specifies the list of child components when using other LayoutManager than BorderLayout.
- alternateForeground (reference to JEColor)
Id of a color used for every second row.
- alternateBackground (reference to JEColor)
Id of a color used for every second row.
- selectionForeground (reference to JEColor)
Id of a color used for every seelected row.
- selectionBackground (reference to JEColor)
Id of a color used for every seelected row.
- alternateSelectionForeground (reference to JEColor)
Id of a color used for every second selected row.
- alternateSelectionBackground (reference to JEColor)
Id of a color used for every second selected row.
- reorderingAllowed
Sets whether the user may drag column headers to reorder columns.
- selectionMode (possible values [ , SINGLE_SELECTION, SINGLE_INTERVAL_SELECTION, MULTIPLE_INTERVAL_SELECTION])
Determines whether single-item or multiple-item selections are allowed. The following selectionMode values are allowed: SINGLE_SELECTION Only one list index can be selected at a time. SINGLE_INTERVAL_SELECTION One contiguous index interval can be selected at a time. MULTIPLE_INTERVAL_SELECTION In this mode, there's no restriction on what can be selected. This is the default.
- sortable
Sets whether the user may sort the column by clicking left mouse on an header.
- sumable
Sets whether an optional sum row is added at the last row of the table.
- filterAllowed
Sets whether a popup is shown to filter rows by selecting columns data. The popup is activated by right mouse click.
- markingCol
Insert a checkbox column to mark rows.
- processingCol
Insert a column to mark rows as been edited or deleted. Only useful when the table is editable.
- detailPopUpAllowed
If true and the user double clicks left on a cell, a popup will appear, that shows all data of a row in a panel.
- headerForeground (reference to JEColor)
Id of a color used for the table header.
- headerBackground (reference to JEColor)
Id of a color used for the table header.
- headerGradientPaint (reference to JEGradientPaint)
The id of the gradientPaint used as a background for a table header.
- headerTexturePaint (reference to JETexturePaint)
The id of the JETexturePaint used as a background for table header.
- sumForeground (reference to JEColor)
Id of a color used for the sum row.
- sumBackground (reference to JEColor)
Id of a color used for the sum row.
- filterForeground (reference to JEColor)
Id of a color used for the filter popup.
- filterBackground (reference to JEColor)
Id of a color used for the filter popup.
- sumText
A text shown in the first column of the sum row.
- gridColor (reference to JEColor)
Id of a color used for the grid.
- rowMargin
Sets the rowMargin, the height of the space between cells.
- columnMargin
Sets the columnMargin, the width of the space between cells.
- viewportWidth
Sets the preferred size of the viewport for this table.
- viewportHeight
Sets the preferred size of the viewport for this table.
- animation (reference to JEAnimation)
The animation used for this object and, if it is defined for parentobjects, for all children.
- Author:
- Harry Pfohl
| Fields inherited from class de.cbse.jeasy.JEComponent |
animated, backup, buttonBehind, caretPosition, component, endMarkPosition, enterPressed, isPressed, jeButtonBehind, label, labelBehind, labelText, parentId, scrollPane, tree, treeNode, window |
| Fields inherited from class de.cbse.jeasy.JEObject |
aaa, ACTIVITYBAR, ANIMATION, BORDER, BUSINESSOBJECT_NAME, BUTTON, BUTTONGROUP, CHECKBOX, CHECKBOXMENUITEM, COLOR, COMBOBOX, ComboBoxButtonWidth, COMBOLIST, CONSTRAINTS, CONTEXT_HELP_FOCUS_GAINED, CONTEXT_HELP_FOCUS_LOST, CONTEXT_HELP_MOUSE_ENTERED, CONTEXT_HELP_MOUSE_EXITED, DATAFIELD, DATATYPE, DESKTOPPANE, DIALOG, EDITORPANE, FONT, FORMAT, FRAME, GANTTGRID, GLOBAL, GRADIENTPAINT, HELP, ICON, ID_JESTART, INPUT_ERROR_DATE, INPUT_ERROR_LENGTH, INPUT_ERROR_MANDATORY, INPUT_ERROR_PARSE, INPUT_ERROR_RANGE, INPUT_ERROR_REGULAREXPRESSION, INPUT_ERROR_TIME, INPUT_ERRORS, INSETS, INTERNALFRAME, intType, LABEL, LIST, LOCALE, MENU, MENUBAR, MENUITEM, MESSAGE, METHODINVOCATION, NO_CONSTANT, NO_INPUT_ERROR, OPTIONPANE, PANEL, POPUP, PROGRESSBAR, PROPERTIE_NAME, propertyHashMap, RADIOBUTTON, RADIOBUTTONMENUITEM, refresh, SPINNER, SPLITPANE, START, STORE, STRING, TABBEDPANE, TABLE, TASKPANE, TEXTUREPAINT, THEME, TIPS, TOOLBAR, TREE, TREENODE, type, WINDOW |
|
Method Summary |
void |
actionPerformed(java.awt.event.ActionEvent e)
Action from popup filter |
JEColumnIdentifier |
addColumn(JEComponent jeo)
Inserts a TableColumn with properties out of the JEasy object. |
JEColumnIdentifier |
addColumn(java.lang.String s)
Inserts a TableColumn with the string as columnname. |
void |
addColumns(java.util.Vector v)
Inserts TableColumns with the vector containig strings. |
void |
addMessage(JENode jen)
Adds the entrys of an XML String as a row of the table. |
void |
addMessage(JENode jen,
int row)
Adds the entrys of an XML String as a row of the table. |
void |
addMessage(java.lang.String message)
Adds the entrys of an XML String as a row of the table. |
void |
addMessage(java.lang.String message,
int row)
Adds the entrys of an XML String as a row of the table. |
void |
addSumColumn(int column)
Adds a sum in the sum row for the given column. |
void |
addSumColumn(int column,
int columnIndicator,
java.lang.Object value)
Adds a sum in the sum row for the given column if the value of the
columnIndicator is equals the given value. |
void |
addSumRow()
Adds a sum row to show sums of columns. |
void |
clear()
Clears all rows, sorts and filters of the table |
void |
createTable(java.lang.String xml)
Builds a table with columns and rows out of an XML-String. |
void |
executeQuery(java.lang.String driverName,
java.lang.String url,
java.lang.String user,
java.lang.String password,
java.lang.String query)
Execute a JDBC query and builds a table from the ResultSet |
JETableCellRenderer |
getCellRenderer(int col)
Gets the CellRenderer of a column. |
javax.swing.table.TableColumn |
getColumn(int col)
Gets the TableColumn of the column |
int |
getColumnByIdentifier(JEColumnIdentifier columnIdentifier)
Gets the columnnumber of the DataModel for a given column identifierr |
javax.swing.table.TableColumn |
getColumnByJEasyId(java.lang.String jeasyId)
Gets the TableColumn of the TableColumnModel for a given JEasy id. |
int |
getColumnByName(java.lang.String colname)
Gets the columnnumber of the DataModel for a given column name |
int |
getColumnCount()
Gets the number of columns of the table column model. |
JEColumnIdentifier |
getColumnIdentifier(int col)
Gets the columnnumber of the DataModel for a given column identifier |
javax.swing.table.TableColumnModel |
getColumnModel()
|
java.lang.String |
getColumnName(int col)
Gets the title of a column. |
int |
getColumnNumByJEasyId(java.lang.String jeasyId)
Gets the columnnumber of the DataModel for a given JEasy id. |
java.lang.String |
getColumnTagName(int col)
Gets the tag for this columns used by getMessage. |
int |
getColumnWidth(int col)
Gets the width of a column. |
java.lang.String |
getCSVData()
Returns a StringBuffer in CSV format. |
java.lang.String |
getCSVData(java.lang.String separator)
Returns a String in CSV format. |
javax.swing.JTable |
getJTable()
Gets the swing JTable |
java.lang.String |
getMessage(int row)
Returns the values of a row in XML format. |
int |
getRowCount()
Gets the number of rows in the table. |
int |
getSelectedRow()
Gets the selected row of the table. |
JETableModel |
getTableModel()
|
java.lang.Object |
getValueAt(int row,
int col)
Gets the value of a cell. |
boolean |
hasMarkingCol()
Checks wether the table has a marking column |
boolean |
hasProcessingCol()
Checks wether the table has a processing column |
void |
init()
Creates jfc-Objects with the given properties. |
boolean |
isMarked(int row)
|
void |
mark(int row)
If the table has a marker col, the checkbox of this row and column will
be selected. |
void |
markAll()
Marks all rows. |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
Performs mouse event action like rollover text and color |
void |
mouseExited(java.awt.event.MouseEvent e)
|
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
moveRow(int row,
int i)
Moves the given row up or down and selects the row. |
void |
moveRows(int startRow,
int endRow,
int i)
Moves the given rows up or down and select them. |
void |
removeColumns()
Clears the table and removes all columns from the table |
void |
removeRow(int row)
Removes a row from the table. |
void |
removeSumRow()
Removes the sum row. |
void |
repaint()
Sets the entry of the component to the backuped value |
void |
setColumnWidth(int col,
int width)
Sets the width of a column. |
void |
setDataVector(java.util.Vector rows)
Sets the data vector of the table model. |
void |
setFixWidth(int col,
int width)
Sets the fix width of a column by setting the min, max and preferred size
of a column |
void |
setHorizontalAlignment(int col,
int alignment)
Sets the horizontal alignments of a column. |
void |
setSelectedRow(int row)
Sets the selected row of the table. |
void |
setupComponent()
Set the property values to the component |
void |
setValueAt(java.lang.Object o,
int row,
int col)
Sets the value of a cell. |
void |
unmark(int row)
If the table has a marker col, the checkbox of this row and column will
be selected. |
void |
unmarkAll()
Unmarks all rows. |
| Methods inherited from class de.cbse.jeasy.JEParentComponent |
addElement, backupEntry, cloneAll, getChilds, getLayoutManager, invokeAll, invokeAll, invokeAll, invokeAll, invokeAll, removeAll, removeId, restoreEntry, setEnabledAll, setEnabledAll, setVisibleAll, setVisibleAll, wasEntryChanged |
| Methods inherited from class de.cbse.jeasy.JEComponent |
add, add, add, add, add, add, add, add, add, add, add, add, add, add, add, addListeners, caretPositionChanged, caretUpdate, changedUpdate, componentHidden, componentMoved, componentResized, componentShown, examine, examine, focusGained, focusLost, getAddableComponent, getAnimation, getBackupEntry, getButtonBehind, getClosedIcon, getColumns, getComponent, getDataType, getIcon, getJEButtonBehind, getJLabel, getJScrollpane, getLabel, getLabelBehind, getLabelText, getLeafIcon, getMandatory, getName, getOpenIcon, getParentId, getToolTipText, getTreeNode, getValue, getValueBeforeFocus, getValueNotNull, getValues, getWindow, inputMethodTextChanged, insertUpdate, isAnimated, isEditable, isExiting, isListening, isShowing, isVerified, isVisible, itemStateChanged, jCallBackInputVerifier, keyPressed, keyReleased, keyTyped, menuKeyPressed, menuKeyReleased, menuKeyTyped, mouseDragged, mouseMoved, mouseWheelMoved, popupMenuCanceled, popupMenuWillBecomeInvisible, popupMenuWillBecomeVisible, propertyChange, refresh, remove, removeActionListeners, removeUpdate, restoreValueBeforeFocus, setAnimated, setBackground, setBackground, setEnabled, setEnabled, setExiting, setFocus, setForeground, setForeground, setIcon, setListening, setMandatory, setParentId, setProperties, setText, setToolTipText, setTreeNode, setValue, setValueBeforeFocus, setValues, setVerified, setVisible, setVisible, stateChanged, tableChanged, textUpdate, timerTask, transferFocus, transferFocusBackward, treeCollapsed, treeExpanded, treeNodesChanged, treeNodesInserted, treeNodesRemoved, treeStructureChanged, valueChanged, valueChanged, windowActivated, windowClosed, windowClosing, windowDeactivated, windowDeiconified, windowGainedFocus, windowIconified, windowLostFocus, windowOpened |
| Methods inherited from class de.cbse.jeasy.JEObject |
clearPreview, clone, getApplLocale, getBorderConstantProperty, getBorderProperty, getCharGProperty, getCharProperty, getColorProperty, getConstraintsProperty, getFontProperty, getGProperty, getGradientPaintProperty, getId, getImageConstantProperty, getImageIconProperty, getInsetsProperty, getJEGlobal, getJETexturePaintProperty, getLayoutProperty, getLocaleProperties, getObjectsHashMap, getObjectsNonPreviewHashMap, getPreviewHashMap, getPreviewObject, getProjectDirectory, getPropertieHashMap, getProperty, getProperty, getPropertyAsArray, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsInteger, getPropertyAsObject, getPropertyAsObject, getPropertyAsVector, getPropertyAsVector, getReferenceButtonBehind, getReferenceId, getRegisterText, getResourceUrl, getRootPane, getRootPaneId, getSwingConstantProperty, getTabbedPaneConstantProperty, getTexturePaintProperty, getType, getUniqueNumber, hasSuperclass, invoke, invoke, invoke, invoke, isApplet, isEnterprise, isGlobalAnimation, isGlobalListening, isInited, isPreview, isPreviewMember, isProfessional, isRefresh, isSetuped, isStandard, registerJEObject, removeProperties, removeProperty, removeProperty, setApplet, setApplLocale, setGlobalAnimation, setGlobalListening, setInited, setJeGlobal, setLocaleProperties, setPreview, setPreviewHashMap, setPreviewMember, setPreviewObject, setProjectDirectory, setPropertieHashMap, setProperties, setProperties, setProperty, setProperty, setRefresh, setRootPane, setRootPaneId, setSetuped, setType, show |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
JETable
public JETable(JELocaleProperties hm)
- Reads the properties from a HashMap
- Parameters:
hm - HashMap
JETable
public JETable(JENode jen)
- Constructor based on a XML file parsed to a TreeNode.
- Parameters:
jen - - See Also:
JESaxParser
actionPerformed
public void actionPerformed(java.awt.event.ActionEvent e)
- Action from popup filter
- Specified by:
actionPerformed in interface java.awt.event.ActionListener- Overrides:
actionPerformed in class JEComponent
createTable
public void createTable(java.lang.String xml)
- 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 :
- Parameters:
XML - -String
executeQuery
public void executeQuery(java.lang.String driverName,
java.lang.String url,
java.lang.String user,
java.lang.String password,
java.lang.String query)
throws java.lang.Exception
- Execute a JDBC query and builds a table from the ResultSet
- Parameters:
message -
- Throws:
java.lang.Exception
addColumn
public JEColumnIdentifier addColumn(JEComponent jeo)
- Inserts a TableColumn with properties out of the JEasy object. If no
column was added jet, the processing column and the marking column are
insert first if these table properties are set.
- Parameters:
jeo - jeasy component e.g. JEDataField
- Returns:
addColumn
public JEColumnIdentifier addColumn(java.lang.String s)
- Inserts a TableColumn with the string as columnname.
- Parameters:
s -
- Returns:
addColumns
public void addColumns(java.util.Vector v)
- Inserts TableColumns with the vector containig strings.
- Parameters:
v -
addMessage
public void addMessage(JENode jen,
int row)
- 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 -
addMessage
public void addMessage(java.lang.String message,
int row)
- 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 -
addMessage
public void addMessage(JENode jen)
- 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 -
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 -
getMessage
public java.lang.String getMessage(int row)
- Returns the values of a row in XML format. The tag is column name or the
XMLTag of the corresponding jeasyid.
- Parameters:
row - data in XML format
addSumColumn
public void addSumColumn(int column)
- Adds a sum in the sum row for the given column.
- Parameters:
column - columnIndicator - value -
addSumRow
public void addSumRow()
- Adds a sum row to show sums of columns.
removeSumRow
public void removeSumRow()
- Removes the sum row.
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:
addSumColumn
public void addSumColumn(int column,
int columnIndicator,
java.lang.Object value)
- Adds a sum in the sum row for the given column if the value of the
columnIndicator is equals the given value. This method is used to sum
only marked rows.
- Parameters:
column - column to build a sumcolumnIndicator - the column to check for the valuevalue - value to be checked
clear
public void clear()
- Clears all rows, sorts and filters of the table
- Overrides:
clear in class JEParentComponent
getCellRenderer
public JETableCellRenderer getCellRenderer(int col)
- Gets the CellRenderer of a column.
getColumnByIdentifier
public int getColumnByIdentifier(JEColumnIdentifier columnIdentifier)
- Gets the columnnumber of the DataModel for a given column identifierr
- Parameters:
columnIdentifier -
- Returns:
- the number of the column or -1 of non column was found
getColumnByJEasyId
public javax.swing.table.TableColumn getColumnByJEasyId(java.lang.String jeasyId)
- Gets the TableColumn of the TableColumnModel for a given JEasy id.
Usefull when the table columns are built out of jeasy datafields
- Parameters:
jeasyId -
- Returns:
- the TableColumn or null if non column was found
getColumnByName
public int getColumnByName(java.lang.String colname)
- Gets the columnnumber of the DataModel for a given column name
- Parameters:
column - name name of the column
- Returns:
- the colnumber of the column or -1 of no column was found
getColumnCount
public int getColumnCount()
- Gets the number of columns of the table column model.
- Returns:
getSelectedRow
public int getSelectedRow()
- Gets the selected row of the table.
- Returns:
setSelectedRow
public void setSelectedRow(int row)
- Sets the selected row of the table.
getColumnIdentifier
public JEColumnIdentifier getColumnIdentifier(int col)
- Gets the columnnumber of the DataModel for a given column identifier
- Parameters:
columnIdentifier -
- Returns:
- the number of the column or -1 of non column was found
getColumn
public javax.swing.table.TableColumn getColumn(int col)
- Gets the TableColumn of the column
- Parameters:
col -
- Returns:
getColumnModel
public javax.swing.table.TableColumnModel getColumnModel()
- Returns:
getColumnName
public java.lang.String getColumnName(int col)
- Gets the title of a column.
- Returns:
getColumnNumByJEasyId
public int getColumnNumByJEasyId(java.lang.String jeasyId)
- Gets the columnnumber of the DataModel for a given JEasy id. Usefull whne
the table columns are built out of jeasy datafields
- Parameters:
jeasyId -
- Returns:
- the number of the column or -1 of non column was found
getColumnTagName
public java.lang.String getColumnTagName(int col)
- Gets the tag for this columns used by getMessage. It is the XMLTag of the
jeasy id of the column or the jeasyid of the column or the header value
of the column.
- Parameters:
jeasyId -
- Returns:
- the number of the column or -1 of non column was found
getColumnWidth
public int getColumnWidth(int col)
- Gets the width of a column.
setColumnWidth
public void setColumnWidth(int col,
int width)
- Sets the width of a column.
getJTable
public javax.swing.JTable getJTable()
- Gets the swing JTable
- Returns:
getRowCount
public int getRowCount()
- Gets the number of rows in the table. If a sum row is added it is
unaccounted.
- Returns:
getTableModel
public JETableModel getTableModel()
- Returns:
getValueAt
public java.lang.Object getValueAt(int row,
int col)
- Gets the value of a cell.
- Parameters:
row - col -
- Returns:
hasMarkingCol
public boolean hasMarkingCol()
- Checks wether the table has a marking column
- Returns:
hasProcessingCol
public boolean hasProcessingCol()
- Checks wether the table has a processing column
- Returns:
init
public void init()
- Creates jfc-Objects with the given properties. The font of the text is
set to global.labelFont.
- Overrides:
init in class JEParentComponent
isMarked
public boolean isMarked(int row)
- Parameters:
row -
- Returns:
mark
public void mark(int row)
- If the table has a marker col, the checkbox of this row and column will
be selected.
- Parameters:
row -
markAll
public void markAll()
- Marks all rows.
mouseClicked
public void mouseClicked(java.awt.event.MouseEvent e)
- Specified by:
mouseClicked in interface java.awt.event.MouseListener- Overrides:
mouseClicked in class JEComponent
mouseEntered
public void mouseEntered(java.awt.event.MouseEvent e)
- Description copied from class:
JEComponent
- Performs mouse event action like rollover text and color
- Specified by:
mouseEntered in interface java.awt.event.MouseListener- Overrides:
mouseEntered in class JEComponent
mouseExited
public void mouseExited(java.awt.event.MouseEvent e)
- Specified by:
mouseExited in interface java.awt.event.MouseListener- Overrides:
mouseExited in class JEComponent
mousePressed
public void mousePressed(java.awt.event.MouseEvent e)
- Specified by:
mousePressed in interface java.awt.event.MouseListener- Overrides:
mousePressed in class JEComponent
mouseReleased
public void mouseReleased(java.awt.event.MouseEvent e)
- Specified by:
mouseReleased in interface java.awt.event.MouseListener- Overrides:
mouseReleased in class JEComponent
removeColumns
public void removeColumns()
- Clears the table and removes all columns from the table
repaint
public void repaint()
- Description copied from class:
JEComponent
- Sets the entry of the component to the backuped value
- Overrides:
repaint in class JEComponent
setDataVector
public void setDataVector(java.util.Vector rows)
- Sets the data vector of the table model. Each vector element is a row
vector with one element for each column.
- Parameters:
rows -
setHorizontalAlignment
public void setHorizontalAlignment(int col,
int alignment)
- Sets the horizontal alignments of a column. Use the SwingConstants LEFT
CENTER RIGHT for alignments
setupComponent
public void setupComponent()
- Description copied from class:
JEParentComponent
- Set the property values to the component
- Overrides:
setupComponent in class JEParentComponent
setFixWidth
public void setFixWidth(int col,
int width)
- Sets the fix width of a column by setting the min, max and preferred size
of a column
- Parameters:
col - column numberwidth - width in pixel
setValueAt
public void setValueAt(java.lang.Object o,
int row,
int col)
- Sets the value of a cell.
- Parameters:
o - row - col -
unmark
public void unmark(int row)
- If the table has a marker col, the checkbox of this row and column will
be selected.
- Parameters:
row -
unmarkAll
public void unmarkAll()
- Unmarks all rows.
moveRow
public void moveRow(int row,
int i)
- Moves the given row up or down and selects the row.
- Parameters:
row - i -
moveRows
public void moveRows(int startRow,
int endRow,
int i)
- Moves the given rows up or down and select them.
- Parameters:
row - i -
removeRow
public void removeRow(int row)
- Removes a row from the table.
- Parameters:
row -