net.datacrow.console.components.tables
Class DcTable
java.lang.Object
java.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JTable
net.datacrow.console.components.tables.DcTable
- All Implemented Interfaces:
- java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.EventListener, javax.accessibility.Accessible, javax.swing.event.CellEditorListener, javax.swing.event.ListSelectionListener, javax.swing.event.RowSorterListener, javax.swing.event.TableColumnModelListener, javax.swing.event.TableModelListener, javax.swing.Scrollable, ISortableComponent, IViewComponent
public class DcTable
- extends javax.swing.JTable
- implements IViewComponent
- See Also:
- Serialized Form
Nested classes/interfaces inherited from class javax.swing.JTable |
javax.swing.JTable.AccessibleJTable, javax.swing.JTable.DropLocation, javax.swing.JTable.PrintMode |
Nested classes/interfaces inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Fields inherited from class javax.swing.JTable |
AUTO_RESIZE_ALL_COLUMNS, AUTO_RESIZE_LAST_COLUMN, AUTO_RESIZE_NEXT_COLUMN, AUTO_RESIZE_OFF, AUTO_RESIZE_SUBSEQUENT_COLUMNS, autoCreateColumnsFromModel, autoResizeMode, cellEditor, cellSelectionEnabled, columnModel, dataModel, defaultEditorsByColumnClass, defaultRenderersByColumnClass, editingColumn, editingRow, editorComp, gridColor, preferredViewportSize, rowHeight, rowMargin, rowSelectionAllowed, selectionBackground, selectionForeground, selectionModel, showHorizontalLines, showVerticalLines, tableHeader |
Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary |
DcTable(boolean readonly,
boolean caching)
|
DcTable(DcModule module,
boolean readonly,
boolean caching)
|
Method Summary |
void |
activate()
|
int |
add(DcObject dco)
|
void |
add(DcObject[] objects)
|
int |
add(DcObject dco,
boolean setSelected)
|
void |
add(java.util.List<? extends DcObject> objects)
|
void |
add(java.util.Map<java.lang.String,java.lang.Integer> keys)
|
int |
add(java.lang.String key)
|
void |
addRow(java.lang.Object[] row)
|
void |
addRowToCache(int row,
int column)
|
void |
addSelectionListener(javax.swing.event.ListSelectionListener lsl)
|
void |
afterUpdate()
|
boolean |
allowsHorizontalTraversel()
|
boolean |
allowsVerticalTraversel()
|
void |
applyHeaders()
|
void |
applySettings()
|
void |
cancelEdit()
|
void |
clear()
|
void |
clear(int row)
|
javax.swing.JToolTip |
createToolTip()
|
void |
deselect()
|
int[] |
getChangedIndices()
|
java.util.Collection<DcObject> |
getChangedObjects()
|
int |
getColumnIndexForField(int field)
|
DcTableModel |
getDcModel()
|
int |
getFirstVisibleIndex()
|
int |
getIndex(java.lang.String ID)
|
DcObject |
getItem(java.lang.String ID)
|
DcObject |
getItemAt(int row)
|
int |
getItemCount()
|
java.lang.String |
getItemKey(int row)
|
java.util.List<java.lang.String> |
getItemKeys()
|
java.util.List<DcObject> |
getItems()
|
int |
getLastVisibleIndex()
|
DcModule |
getModule()
|
int |
getModule(int idx)
|
DcModule |
getModuleForRow(int row)
|
int |
getRowNumberWithID(java.lang.String ID)
|
int |
getSelectedIndex()
|
int[] |
getSelectedIndices()
|
DcObject |
getSelectedItem()
|
java.util.List<java.lang.String> |
getSelectedItemKeys()
|
java.lang.Object |
getValueAt(int row,
int col,
boolean hidden)
|
View |
getView()
|
int |
getViewportBufferSize()
|
void |
ignoreEdit(boolean b)
|
boolean |
isChangesSaved()
|
boolean |
isIgnoringPaintRequests()
|
boolean |
isListeningForChanges()
|
boolean |
isReadOnly()
|
boolean |
load(int row)
|
int |
locationToIndex(java.awt.Point point)
|
void |
moveRowDown()
|
void |
moveRowToBottom()
|
void |
moveRowToTop()
|
void |
moveRowUp()
|
protected void |
paintComponent(java.awt.Graphics g)
|
void |
paintRegionChanged()
|
void |
remove(int[] rows)
|
boolean |
remove(java.lang.String[] keys)
|
void |
removeFields(int[] fields)
|
void |
removeFromCache(java.lang.String ID)
|
void |
removeRow(int row)
|
void |
removeSelectionListener(javax.swing.event.ListSelectionListener lsl)
|
void |
resetTable()
|
void |
saveSettings()
|
void |
setColumnCount(int count)
|
void |
setDynamicLoading(boolean b)
|
void |
setIgnorePaintRequests(boolean b)
|
void |
setIgnoreSettings(boolean b)
|
void |
setListeningForChanges(boolean b)
|
void |
setRowCount(int count)
|
void |
setSelected(int row)
|
int |
setValues(javax.swing.table.TableModel model,
DcObject dco,
boolean setSelected,
int position)
Adds a row to the table |
void |
setView(View view)
|
void |
setVisibleColumns(int[] fields)
|
void |
undoChanges()
|
int |
update(java.lang.String ID)
|
int |
update(java.lang.String ID,
DcObject dco)
|
void |
updateItemAt(int row,
DcObject dco)
|
Methods inherited from class javax.swing.JTable |
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createDefaultSelectionModel, createDefaultTableHeader, createScrollPaneForTable, doLayout, editCellAt, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoCreateRowSorter, getAutoResizeMode, getCellEditor, getCellEditor, getCellRect, getCellRenderer, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getDropLocation, getDropMode, getEditingColumn, getEditingRow, getEditorComponent, getFillsViewportHeight, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getPrintable, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getRowSorter, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getToolTipText, getUI, getUIClassID, getUpdateSelectionOnSort, getValueAt, initializeLocalVars, isCellEditable, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, print, print, print, print, print, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoCreateRowSorter, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setFillsViewportHeight, setGridColor, setIntercellSpacing, setModel, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setRowSorter, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, setUpdateSelectionOnSort, setValueAt, sizeColumnsToFit, sizeColumnsToFit, sorterChanged, tableChanged, unconfigureEnclosingScrollPane, updateUI, valueChanged |
Methods inherited from class javax.swing.JComponent |
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DcTable
public DcTable(boolean readonly,
boolean caching)
DcTable
public DcTable(DcModule module,
boolean readonly,
boolean caching)
setDynamicLoading
public void setDynamicLoading(boolean b)
activate
public void activate()
- Specified by:
activate
in interface IViewComponent
allowsHorizontalTraversel
public boolean allowsHorizontalTraversel()
- Specified by:
allowsHorizontalTraversel
in interface IViewComponent
allowsVerticalTraversel
public boolean allowsVerticalTraversel()
- Specified by:
allowsVerticalTraversel
in interface IViewComponent
getView
public View getView()
- Specified by:
getView
in interface IViewComponent
setIgnoreSettings
public void setIgnoreSettings(boolean b)
setView
public void setView(View view)
- Specified by:
setView
in interface IViewComponent
isChangesSaved
public boolean isChangesSaved()
- Specified by:
isChangesSaved
in interface IViewComponent
setIgnorePaintRequests
public void setIgnorePaintRequests(boolean b)
- Specified by:
setIgnorePaintRequests
in interface IViewComponent
isIgnoringPaintRequests
public boolean isIgnoringPaintRequests()
- Specified by:
isIgnoringPaintRequests
in interface IViewComponent
getDcModel
public DcTableModel getDcModel()
createToolTip
public javax.swing.JToolTip createToolTip()
- Overrides:
createToolTip
in class javax.swing.JComponent
getColumnIndexForField
public int getColumnIndexForField(int field)
getSelectedItemKeys
public java.util.List<java.lang.String> getSelectedItemKeys()
- Specified by:
getSelectedItemKeys
in interface IViewComponent
add
public int add(DcObject dco)
- Specified by:
add
in interface IViewComponent
add
public int add(DcObject dco,
boolean setSelected)
setValues
public int setValues(javax.swing.table.TableModel model,
DcObject dco,
boolean setSelected,
int position)
- Adds a row to the table
- Parameters:
model
- The modeldco
- setSelected
- position
-
add
public void add(java.util.List<? extends DcObject> objects)
- Specified by:
add
in interface IViewComponent
add
public void add(DcObject[] objects)
isReadOnly
public boolean isReadOnly()
ignoreEdit
public void ignoreEdit(boolean b)
- Specified by:
ignoreEdit
in interface IViewComponent
applyHeaders
public void applyHeaders()
moveRowToTop
public void moveRowToTop()
- Specified by:
moveRowToTop
in interface ISortableComponent
moveRowToBottom
public void moveRowToBottom()
- Specified by:
moveRowToBottom
in interface ISortableComponent
moveRowDown
public void moveRowDown()
- Specified by:
moveRowDown
in interface ISortableComponent
moveRowUp
public void moveRowUp()
- Specified by:
moveRowUp
in interface ISortableComponent
removeFields
public void removeFields(int[] fields)
undoChanges
public void undoChanges()
- Specified by:
undoChanges
in interface IViewComponent
removeFromCache
public void removeFromCache(java.lang.String ID)
getItems
public java.util.List<DcObject> getItems()
- Specified by:
getItems
in interface IViewComponent
getItemKeys
public java.util.List<java.lang.String> getItemKeys()
- Specified by:
getItemKeys
in interface IViewComponent
getItemAt
public DcObject getItemAt(int row)
- Specified by:
getItemAt
in interface IViewComponent
getModule
public int getModule(int idx)
- Specified by:
getModule
in interface IViewComponent
getModuleForRow
public DcModule getModuleForRow(int row)
getItemKey
public java.lang.String getItemKey(int row)
- Specified by:
getItemKey
in interface IViewComponent
getChangedObjects
public java.util.Collection<DcObject> getChangedObjects()
getChangedIndices
public int[] getChangedIndices()
- Specified by:
getChangedIndices
in interface IViewComponent
getValueAt
public java.lang.Object getValueAt(int row,
int col,
boolean hidden)
clear
public void clear()
- Specified by:
clear
in interface IViewComponent
getRowNumberWithID
public int getRowNumberWithID(java.lang.String ID)
setColumnCount
public void setColumnCount(int count)
remove
public void remove(int[] rows)
- Specified by:
remove
in interface IViewComponent
removeRow
public void removeRow(int row)
setRowCount
public void setRowCount(int count)
deselect
public void deselect()
- Specified by:
deselect
in interface IViewComponent
update
public int update(java.lang.String ID)
- Specified by:
update
in interface IViewComponent
setSelected
public void setSelected(int row)
- Specified by:
setSelected
in interface IViewComponent
update
public int update(java.lang.String ID,
DcObject dco)
- Specified by:
update
in interface IViewComponent
updateItemAt
public void updateItemAt(int row,
DcObject dco)
addRow
public void addRow(java.lang.Object[] row)
addRowToCache
public void addRowToCache(int row,
int column)
cancelEdit
public void cancelEdit()
- Specified by:
cancelEdit
in interface IViewComponent
saveSettings
public void saveSettings()
- Specified by:
saveSettings
in interface IViewComponent
applySettings
public void applySettings()
- Specified by:
applySettings
in interface IViewComponent
setVisibleColumns
public void setVisibleColumns(int[] fields)
resetTable
public void resetTable()
load
public boolean load(int row)
clear
public void clear(int row)
- Specified by:
clear
in interface IViewComponent
getFirstVisibleIndex
public int getFirstVisibleIndex()
- Specified by:
getFirstVisibleIndex
in interface IViewComponent
getLastVisibleIndex
public int getLastVisibleIndex()
- Specified by:
getLastVisibleIndex
in interface IViewComponent
getViewportBufferSize
public int getViewportBufferSize()
- Specified by:
getViewportBufferSize
in interface IViewComponent
paintRegionChanged
public void paintRegionChanged()
- Specified by:
paintRegionChanged
in interface IViewComponent
isListeningForChanges
public boolean isListeningForChanges()
setListeningForChanges
public void setListeningForChanges(boolean b)
afterUpdate
public void afterUpdate()
- Specified by:
afterUpdate
in interface IViewComponent
getItem
public DcObject getItem(java.lang.String ID)
- Specified by:
getItem
in interface IViewComponent
getIndex
public int getIndex(java.lang.String ID)
- Specified by:
getIndex
in interface IViewComponent
getItemCount
public int getItemCount()
- Specified by:
getItemCount
in interface IViewComponent
getModule
public DcModule getModule()
- Specified by:
getModule
in interface IViewComponent
getSelectedIndex
public int getSelectedIndex()
- Specified by:
getSelectedIndex
in interface IViewComponent
getSelectedIndices
public int[] getSelectedIndices()
- Specified by:
getSelectedIndices
in interface IViewComponent
getSelectedItem
public DcObject getSelectedItem()
- Specified by:
getSelectedItem
in interface IViewComponent
locationToIndex
public int locationToIndex(java.awt.Point point)
- Specified by:
locationToIndex
in interface IViewComponent
remove
public boolean remove(java.lang.String[] keys)
- Specified by:
remove
in interface IViewComponent
addSelectionListener
public void addSelectionListener(javax.swing.event.ListSelectionListener lsl)
- Specified by:
addSelectionListener
in interface IViewComponent
removeSelectionListener
public void removeSelectionListener(javax.swing.event.ListSelectionListener lsl)
- Specified by:
removeSelectionListener
in interface IViewComponent
paintComponent
protected void paintComponent(java.awt.Graphics g)
- Overrides:
paintComponent
in class javax.swing.JComponent
add
public int add(java.lang.String key)
- Specified by:
add
in interface IViewComponent
add
public void add(java.util.Map<java.lang.String,java.lang.Integer> keys)
- Specified by:
add
in interface IViewComponent