|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JTable org.bibalex.daf.commongui.controls.ExternalIDsTable
public class ExternalIDsTable
A custom table that extends JTable to display External IDs of a job.
The table consist of 3 columns: 'Type', 'Value' and 'Is Default'.
The table is either editable or not.
The table provides customs editors and rendereres for columns:
'Type' column has a JComboBox editor.
'Is Default' column has a JCheckBox renderer and editor.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JTable |
---|
javax.swing.JTable.AccessibleJTable, 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.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
private ExternalID[] |
fillingInfo
Holds the ExternalID[] that was used to fill this JTable. |
private int |
isDefaultColumn
|
private boolean |
isEditable
Determines whether the Table is editable or not. |
private int |
typeColumn
|
private javax.swing.JComboBox |
typeCombo
The JComboBox used to edit the type column. |
private java.lang.String |
UNKNOWN_TYPE
|
private int |
valueColumn
|
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 | |
---|---|
ExternalIDsTable(boolean isEditable)
Creates a new instance of ExternalIDsTable. |
Method Summary | |
---|---|
void |
fill(ExternalID[] information)
Fills in the table with the given FileLevelInfo[]. Note: All the values will be displayed even if they are not consistent, e.g. |
void |
fill(java.lang.String[] information)
Fills in the table with the given String[]. |
javax.swing.table.TableCellEditor |
getCellEditor(int row,
int col)
Gets the editor for the given cell. |
java.lang.Class<?> |
getColumnClass(int column)
Gets the Class of the given column. |
ExternalID[] |
getData(Holder<java.lang.Boolean> rowsSkipped)
Converts the valid rows of the table into an array of ExternalID. |
private boolean |
getDefault(javax.swing.table.DefaultTableModel model,
int row)
Gets the isDefault value. |
private int |
getIndex(javax.swing.JComboBox combo,
java.lang.String value)
Gets the index of the given value. |
private javax.swing.table.TableCellEditor |
getTypeCellEditor(java.lang.Object cellValue)
Gets the CellEditor used to edit the Type column. |
private javax.swing.JComboBox |
getTypeComboBox()
Gets a JComboBox that contains all the types of the external IDs. |
private int |
getTypeID(javax.swing.table.DefaultTableModel model,
int row)
Gets the ID of the given type. |
private java.lang.String |
getTypeName(int typeID)
Gets the name of the given type. |
private java.lang.String |
getValue(javax.swing.table.DefaultTableModel model,
int row)
Gets the Comment value. |
boolean |
isCellEditable(int row,
int column)
Determine whether the cell at the specified row and column is editable or not. |
private boolean |
typeExists(java.lang.String type)
Determines wheter the given type exists in the database or not. |
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, getCellRect, getCellRenderer, getCellSelectionEnabled, getColumn, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getEditingColumn, getEditingRow, getEditorComponent, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getPrintable, 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, print, print, print, print, 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, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, 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, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, 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 |
Field Detail |
---|
private int typeColumn
private int valueColumn
private int isDefaultColumn
private final java.lang.String UNKNOWN_TYPE
private boolean isEditable
private javax.swing.JComboBox typeCombo
private ExternalID[] fillingInfo
Constructor Detail |
---|
public ExternalIDsTable(boolean isEditable) throws java.lang.InstantiationException
isEditable
- Whether the table is editable or not.
java.lang.InstantiationException
- If the database couldn't be queried.Method Detail |
---|
private javax.swing.JComboBox getTypeComboBox() throws java.lang.InstantiationException
java.lang.InstantiationException
- If the database couldn't be queried.public java.lang.Class<?> getColumnClass(int column)
getColumnClass
in class javax.swing.JTable
column
- The column to get its Class.
public boolean isCellEditable(int row, int column)
isCellEditable
in class javax.swing.JTable
row
- The row of the cell in question.column
- The column of the cell in question.
public javax.swing.table.TableCellEditor getCellEditor(int row, int col)
getCellEditor
in class javax.swing.JTable
row
- The row to get its editor.col
- The columns to get its editor.
private javax.swing.table.TableCellEditor getTypeCellEditor(java.lang.Object cellValue)
cellValue
- The current value of the cell.
private int getIndex(javax.swing.JComboBox combo, java.lang.String value)
combo
- The JComboBox to search for the value in.value
- The value to search for.
public void fill(java.lang.String[] information)
information
- An array holding the type and the ID on the form Type=ID.private boolean typeExists(java.lang.String type)
type
- the type to search for.
public void fill(ExternalID[] information)
information
- An ExternalID[] to fill the table with.private java.lang.String getTypeName(int typeID)
typeID
- The ID of the type.
public ExternalID[] getData(Holder<java.lang.Boolean> rowsSkipped)
rowsSkipped
- Whether 1 or more rows have been skipped while converting the table to an Array.
private java.lang.String getValue(javax.swing.table.DefaultTableModel model, int row)
model
- The model to extract data from.row
- The row to retrieve its data.
private int getTypeID(javax.swing.table.DefaultTableModel model, int row) throws java.security.InvalidParameterException
model
- The model to extract data from.row
- The row to retrieve its data.
java.security.InvalidParameterException
- If the given type name doesn't correspond to a phase.
java.lang.NumberFormatException
- If the type ID couldn't be parsed.private boolean getDefault(javax.swing.table.DefaultTableModel model, int row)
model
- The model to extract data from.row
- The row to retrieve its data.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |