qflib 0.99

de.qfs.lib.option
Class TableOptionEdit.Table

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JTable
                  extended byde.qfs.lib.option.TableOptionEdit.Table
All Implemented Interfaces:
javax.accessibility.Accessible, javax.swing.event.CellEditorListener, java.util.EventListener, java.awt.image.ImageObserver, javax.swing.event.ListSelectionListener, java.awt.MenuContainer, javax.swing.Scrollable, java.io.Serializable, javax.swing.event.TableColumnModelListener, javax.swing.event.TableModelListener
Enclosing class:
TableOptionEdit

protected class TableOptionEdit.Table
extends javax.swing.JTable

See Also:
Serialized Form

Nested Class Summary
protected  class TableOptionEdit.Table.ActionHandler
          Action listener for the table row actions.
 
Nested classes inherited from class javax.swing.JTable
javax.swing.JTable.AccessibleJTable
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  javax.swing.Box buttonBox
          The box with the buttons.
protected  javax.swing.JButton downButton
          The "move row down" button.
protected  javax.swing.JButton editButton
          The "edit row" button.
protected  OptionDialog editDialog
          The dialog for the row edit.
protected  TableOptionEdit.Table.ActionHandler handler
          The handler for the new/del/up/down actions.
protected  javax.swing.JButton newButton
          The "insert new row" button.
protected  javax.swing.JButton removeButton
          The "remove row" button.
protected  OptionSet rowOptions
          The OptionSet for the dialog.
protected  javax.swing.JButton upButton
          The "move row up" button.
 
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
TableOptionEdit.Table()
          Create a new Table.
 
Method Summary
protected  void copy()
          Copy the selected rows to the clipboard.
protected  java.lang.Object[] copyRow(int row)
          Copy the data of a single row for storage on the clibborad.
protected  void ctrlDown()
          Move the focus down without changing the selection.
protected  void ctrlLeft()
          Move the focus left without changing the selection.
protected  void ctrlRight()
          Move the focus right without changing the selection.
protected  void ctrlUp()
          Move the focus up without changing the selection.
protected  void cut()
          Delete the selected rows and copy them to the clipboard.
protected  void editRow()
          Bring up a dialog for the selected row.
 int getAnchorRow()
          Get the row with the focus.
 java.awt.Component getButtons()
          Get the component with the buttons.
protected  void initDialog(int row)
           
protected  void insertRow()
          Create and insert a new row.
 boolean isCellEditable(int row, int column)
           
 boolean isFocusTraversable()
           
 boolean isManagingFocus()
           
 boolean isRequestFocusEnabled()
           
protected  void moveDown()
          Move the selected row down by one.
protected  void moveUp()
          Move the selected row up by one.
protected  void paste()
          Paste rows from the clipboard.
protected  java.lang.Object[] pasteRow(java.lang.Object[] data)
          Copy (and optionally transform) the data for one row pasted from the clipboard.
protected  void removeRow()
          Remove the selected row.
 void setEnabled(boolean enabled)
          Set the enabled state of the table.
protected  void toggleSelection()
          Toggle the selection of the focus row.
 
Methods inherited from class javax.swing.JTable
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createDefaultSelectionModel, createDefaultTableHeader, createScrollPaneForTable, doLayout, editCellAt, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoResizeMode, getCellEditor, getCellEditor, getCellRect, getCellRenderer, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getEditingColumn, getEditingRow, getEditorComponent, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getToolTipText, getUI, getUIClassID, getValueAt, initializeLocalVars, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setEditingColumn, setEditingRow, setGridColor, setIntercellSpacing, setModel, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, setValueAt, sizeColumnsToFit, sizeColumnsToFit, tableChanged, unconfigureEnclosingScrollPane, updateUI, valueChanged
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFont, setForeground, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, 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, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFontSet, isForegroundSet, isLightweight, 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, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, 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
 

Field Detail

handler

protected TableOptionEdit.Table.ActionHandler handler
The handler for the new/del/up/down actions.


editButton

protected javax.swing.JButton editButton
The "edit row" button.


newButton

protected javax.swing.JButton newButton
The "insert new row" button.


removeButton

protected javax.swing.JButton removeButton
The "remove row" button.


upButton

protected javax.swing.JButton upButton
The "move row up" button.


downButton

protected javax.swing.JButton downButton
The "move row down" button.


buttonBox

protected javax.swing.Box buttonBox
The box with the buttons.


editDialog

protected OptionDialog editDialog
The dialog for the row edit.


rowOptions

protected OptionSet rowOptions
The OptionSet for the dialog.

Constructor Detail

TableOptionEdit.Table

public TableOptionEdit.Table()
Create a new Table.

Method Detail

getButtons

public java.awt.Component getButtons()
Get the component with the buttons.

Returns:
The button box.

moveUp

protected void moveUp()
Move the selected row up by one.


moveDown

protected void moveDown()
Move the selected row down by one.


insertRow

protected void insertRow()
Create and insert a new row.


removeRow

protected void removeRow()
Remove the selected row.


editRow

protected void editRow()
Bring up a dialog for the selected row.


ctrlUp

protected void ctrlUp()
Move the focus up without changing the selection.

Since:
0.99.0

ctrlDown

protected void ctrlDown()
Move the focus down without changing the selection.

Since:
0.99.0

ctrlLeft

protected void ctrlLeft()
Move the focus left without changing the selection.

Since:
0.99.0

ctrlRight

protected void ctrlRight()
Move the focus right without changing the selection.

Since:
0.99.0

toggleSelection

protected void toggleSelection()
Toggle the selection of the focus row.

Since:
0.99.0

cut

protected void cut()
Delete the selected rows and copy them to the clipboard.

Since:
0.99.0

copy

protected void copy()
Copy the selected rows to the clipboard.

Since:
0.99.0

paste

protected void paste()
Paste rows from the clipboard.

Since:
0.99.0

isManagingFocus

public boolean isManagingFocus()

isFocusTraversable

public boolean isFocusTraversable()

isRequestFocusEnabled

public boolean isRequestFocusEnabled()

isCellEditable

public boolean isCellEditable(int row,
                              int column)

setEnabled

public void setEnabled(boolean enabled)
Set the enabled state of the table. Also changes the buttons.

Parameters:
enabled - The new enabled state.

initDialog

protected void initDialog(int row)

getAnchorRow

public int getAnchorRow()
Get the row with the focus.

Returns:
The row with the focus.
Since:
0.99.0

copyRow

protected java.lang.Object[] copyRow(int row)
Copy the data of a single row for storage on the clibborad.

Parameters:
row - The row index.
Returns:
The data to store.
Since:
0.99.0

pasteRow

protected java.lang.Object[] pasteRow(java.lang.Object[] data)
Copy (and optionally transform) the data for one row pasted from the clipboard.

Parameters:
data - The pasted row data.
Returns:
The transformed data or null if incompatible.
Since:
0.99.0

qflib 0.99