org.bibalex.daf.commongui.controls
Class FileLevelInfoTable

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JTable
                  extended by org.bibalex.daf.commongui.controls.FileLevelInfoTable
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.TableColumnModelListener, javax.swing.event.TableModelListener, javax.swing.Scrollable

public class FileLevelInfoTable
extends javax.swing.JTable

A custom table that extends JTable to display FileLevelInfo.
The table consist primarily of 6 columns: 'Type', 'From', 'To', 'Phase', 'Reason' and 'Comment'.
2 optional columns can be added: 'User' and 'Done' column.
All the cells in the table are editable unless the 'Done' optional column is added. If the 'Done' optional column is added it will be the only editable column.

The table provides customs editors and rendereres for columns:
'Type', 'Phase' & 'Reason' columns have a JComboBox editor.
'Done' column has a JCheckBox renderer and editor.

Author:
Shehab.Kamal
See Also:
Serialized Form

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  int commentColumn
           
private  int doneColumn
           
private  FileLevelInfo[] fillingInfo
          Holds the FileLevelInfo[] that was used to fill this JTable.
private  int fromColumn
           
private  boolean haveDoneColumn
          Whether the 'Done' column exists or not.
private  boolean haveUserColumn
          Whether the 'User' column exists or not.
private  java.lang.String INFO
           
private  java.lang.String INST
           
private  int jobType
          Holds the job type of the job we are viewing its status data.
private  java.lang.String ORIGINATED_FROM
           
private  int phaseColumn
           
private  javax.swing.JComboBox phaseCombo
          The JComboBox used to edit the phase column.
private  java.util.Hashtable<java.lang.String,javax.swing.JComboBox> phaseReasonsCombos
          A Hashtable that holds a JComboBox for each available phase.
private  int reasonColumn
           
private  int toColumn
           
private  int typeColumn
           
private  javax.swing.JComboBox typeCombo
          The JComboBox used to edit the type column.
private  java.lang.String UNKNOWN_PHASE
           
private  java.lang.String UNKNOWN_REASON
           
private  java.lang.String UNKNOWN_USER
           
private  int userColumn
           
 
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
FileLevelInfoTable(int jobType, boolean addUserColumn, boolean addDoneColumn)
          Creates a new instance of FileLevelInfoTable.
 
Method Summary
private  void createEditingComboBoxes()
          This method creates the following JComboBoxes:
1) One that holds the types of the FileLevelInfo.
2) One that holds the phases for the current job type.
3) One for each phase to hold the reasons corresponding to that phase.
 void fill(FileLevelInfo[] information)
          Fills in the table with the given FileLevelInfo[].
 javax.swing.table.TableCellEditor getCellEditor(int row, int col)
          Gets the editor for the given cell.
 java.lang.Class<?> getColumnClass(int column)
          Gets the column class of the given column.
private  java.lang.String getComment(javax.swing.table.DefaultTableModel model, int row)
          Gets the Comment value.
private  boolean getDone(javax.swing.table.DefaultTableModel model, int row)
          Gets the Done value.
private  int getFrom(javax.swing.table.DefaultTableModel model, int row, boolean returnDefaultValue)
          Converts the given String into int.
private  int getIndex(javax.swing.JComboBox combo, java.lang.String value)
          Gets the index of the given value.
private  int getPhase(javax.swing.table.DefaultTableModel model, int row, boolean returnDefaultValue)
          Gets the ID of the given phase.
private  java.lang.String getPhase(int phaseID)
          Gets the name of the given phase.
private  javax.swing.table.TableCellEditor getPhaseCellEditor(java.lang.Object cellValue)
          Gets the CellEditor used to edit the Phase column.
private  javax.swing.JComboBox getPhaseComboBox(int jobTypeID)
          Gets a JComboBox that contains all the phases of a certain jobType.
private  int getReason(javax.swing.table.DefaultTableModel model, int row, java.lang.String phaseName, boolean returnDefaultValue)
          Gets the ID of the given reason.
private  java.lang.String getReason(int reasonID, java.lang.String phaseName)
          Gets the name of the given reason.
private  javax.swing.table.TableCellEditor getReasonCellEditor(java.lang.Object phaseValue, java.lang.Object cellValue)
          Gets the CellEditor used to edit the Reason column.
private  javax.swing.JComboBox getReasonComboBox(int phaseID)
          Gets a JComboBox that conatins all the reasons of a certain phase.
private  int getTo(javax.swing.table.DefaultTableModel model, int row, boolean returnDefaultValue)
          Converts the given String into int.
private  java.lang.String getType(javax.swing.table.DefaultTableModel model, int row)
          Gets the Type value.
private  java.lang.String getType(java.lang.String type)
          Gets the display name of the given type.
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 FileLevelInfo.
private  int getTypeIndex(java.lang.String value)
          Gets the index of the given value.
private  int getUser(javax.swing.table.DefaultTableModel model, int row)
          Gets the User ID value.
private  java.lang.String getUser(int userID)
          Gets the name of the given User.
 boolean isCellEditable(int row, int column)
          Determine whether the cell at the specified row and column is editable or not.
 java.util.ArrayList<FileLevelInfo> toFileLevelInfoArrayList(Holder<java.lang.Boolean> rowsSkipped)
          Converts the valid rows of the table into an array of FileLevelInfo.
 
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

typeColumn

private int typeColumn

fromColumn

private int fromColumn

toColumn

private int toColumn

phaseColumn

private int phaseColumn

reasonColumn

private int reasonColumn

userColumn

private int userColumn

doneColumn

private int doneColumn

commentColumn

private int commentColumn

INFO

private final java.lang.String INFO
See Also:
Constant Field Values

INST

private final java.lang.String INST
See Also:
Constant Field Values

UNKNOWN_PHASE

private final java.lang.String UNKNOWN_PHASE
See Also:
Constant Field Values

UNKNOWN_REASON

private final java.lang.String UNKNOWN_REASON
See Also:
Constant Field Values

UNKNOWN_USER

private final java.lang.String UNKNOWN_USER
See Also:
Constant Field Values

ORIGINATED_FROM

private final java.lang.String ORIGINATED_FROM
See Also:
Constant Field Values

typeCombo

private javax.swing.JComboBox typeCombo
The JComboBox used to edit the type column.


phaseCombo

private javax.swing.JComboBox phaseCombo
The JComboBox used to edit the phase column.


phaseReasonsCombos

private java.util.Hashtable<java.lang.String,javax.swing.JComboBox> phaseReasonsCombos
A Hashtable that holds a JComboBox for each available phase.


haveUserColumn

private boolean haveUserColumn
Whether the 'User' column exists or not.


haveDoneColumn

private boolean haveDoneColumn
Whether the 'Done' column exists or not. Adding the done coulmn will allow the user to only edit the 'Done' columns.


jobType

private int jobType
Holds the job type of the job we are viewing its status data.


fillingInfo

private FileLevelInfo[] fillingInfo
Holds the FileLevelInfo[] that was used to fill this JTable.

Constructor Detail

FileLevelInfoTable

public FileLevelInfoTable(int jobType,
                          boolean addUserColumn,
                          boolean addDoneColumn)
                   throws java.lang.InstantiationException
Creates a new instance of FileLevelInfoTable.

Parameters:
jobType - The job type ID, used to determine the phases to include and reasons.
addUserColumn - Whether to add a 'User' column to the table or not.
addDoneColumn - Whether to add a 'Done' column to the table or not. If true only to 'Done' column will be editable.
Throws:
java.lang.InstantiationException - If the database couldn't be queried.
Method Detail

createEditingComboBoxes

private void createEditingComboBoxes()
                              throws java.lang.InstantiationException
This method creates the following JComboBoxes:
1) One that holds the types of the FileLevelInfo.
2) One that holds the phases for the current job type.
3) One for each phase to hold the reasons corresponding to that phase.

Throws:
java.lang.InstantiationException - If the combo boxes cannot be created.

getTypeComboBox

private javax.swing.JComboBox getTypeComboBox()
Gets a JComboBox that contains all the types of the FileLevelInfo.

Returns:
A JComboBox.

getPhaseComboBox

private javax.swing.JComboBox getPhaseComboBox(int jobTypeID)
                                        throws java.lang.InstantiationException
Gets a JComboBox that contains all the phases of a certain jobType.

Parameters:
jobTypeID - The jobType ID.
Returns:
A JComboBox.
Throws:
java.lang.InstantiationException - If the database couldn't be queried.

getReasonComboBox

private javax.swing.JComboBox getReasonComboBox(int phaseID)
                                         throws java.lang.InstantiationException
Gets a JComboBox that conatins all the reasons of a certain phase.

Parameters:
phaseID - The phase ID.
Returns:
A JComboBox.
Throws:
java.lang.InstantiationException - If the database couldn't be queried.

getColumnClass

public java.lang.Class<?> getColumnClass(int column)
Gets the column class of the given column.

Overrides:
getColumnClass in class javax.swing.JTable
Parameters:
column - The column to get its type.
Returns:
The class of the column.

isCellEditable

public boolean isCellEditable(int row,
                              int column)
Determine whether the cell at the specified row and column is editable or not.

Overrides:
isCellEditable in class javax.swing.JTable
Parameters:
row - The row of the cell in question.
column - The column of the cell in question.
Returns:
True if the cell identified by the given row and column is eitable otherwise false.

getCellEditor

public javax.swing.table.TableCellEditor getCellEditor(int row,
                                                       int col)
Gets the editor for the given cell.

Overrides:
getCellEditor in class javax.swing.JTable
Parameters:
row - The row to get its editor.
col - The columns to get its editor.
Returns:
The editor of the cell.

getTypeCellEditor

private javax.swing.table.TableCellEditor getTypeCellEditor(java.lang.Object cellValue)
Gets the CellEditor used to edit the Type column.

Parameters:
cellValue - The current value of the cell.
Returns:
The CellEditor used to edit the Type column.

getPhaseCellEditor

private javax.swing.table.TableCellEditor getPhaseCellEditor(java.lang.Object cellValue)
Gets the CellEditor used to edit the Phase column.

Parameters:
cellValue - The current value of the cell.
Returns:
The CellEditor used to edit the Phase column.

getReasonCellEditor

private javax.swing.table.TableCellEditor getReasonCellEditor(java.lang.Object phaseValue,
                                                              java.lang.Object cellValue)
Gets the CellEditor used to edit the Reason column.

Parameters:
phaseValue - The value of the corresponding phase cell.
cellValue - The current value of the cell.
Returns:
The CellEditor used to edit the Type column.

getTypeIndex

private int getTypeIndex(java.lang.String value)
Gets the index of the given value.

Parameters:
value - The value to search for.
Returns:
The index of the given value or -1.

getIndex

private int getIndex(javax.swing.JComboBox combo,
                     java.lang.String value)
Gets the index of the given value.

Parameters:
combo - The JComboBox to search for the value in.
value - The value to search for.
Returns:
The index of the given value or -1.

fill

public void fill(FileLevelInfo[] information)
Fills in the table with the given FileLevelInfo[]. Note: All the values will be displayed even if they are not consistent, e.g. Reason ID doesn't correspond to a phase ID or invalid user ID.

Parameters:
information - A FileLevelInfo[] to fill the table with.

getType

private java.lang.String getType(java.lang.String type)
Gets the display name of the given type.

Parameters:
type - The type.
Returns:
The name of the phase. UNKNOWN PHASE is returned if the phase ID doesn't correspond to a record in the database.

getPhase

private java.lang.String getPhase(int phaseID)
Gets the name of the given phase.

Parameters:
phaseID - The ID of the phase.
Returns:
The name of the phase. UNKNOWN PHASE is returned if the phase ID doesn't correspond to a record in the database.

getReason

private java.lang.String getReason(int reasonID,
                                   java.lang.String phaseName)
Gets the name of the given reason.

Parameters:
reasonID - The ID of the reason.
phaseName - The name of the phase.
Returns:
The name of the reason. OR ORIGINATED FROM reasonName if the reason doen't belong to the given phase. OR UNKNOWN REASON if the given reason ID doesn't correspond to a record in the database.

getUser

private java.lang.String getUser(int userID)
                          throws java.security.InvalidParameterException
Gets the name of the given User.

Parameters:
userID - The ID of the user.
Returns:
The name of the user.
Throws:
java.security.InvalidParameterException - If the given user ID doesn't correspond to a user.

toFileLevelInfoArrayList

public java.util.ArrayList<FileLevelInfo> toFileLevelInfoArrayList(Holder<java.lang.Boolean> rowsSkipped)
Converts the valid rows of the table into an array of FileLevelInfo. A valid row is one that has all its values present and in a correct format.

Parameters:
rowsSkipped - Whether 1 or more rows have been skipped while converting the table to ArrayList.
Returns:
An ArrayList of type FileLevelInfo[] holding the rows of the valid table. If there is no valid rows an empty array is returned.

getType

private java.lang.String getType(javax.swing.table.DefaultTableModel model,
                                 int row)
                          throws java.security.InvalidParameterException
Gets the Type value.

Parameters:
model - The model to extract data from.
row - The row to retrieve its data.
Returns:
A String representing the value at model.getValueAt(row, 0).
Throws:
java.security.InvalidParameterException - If the strType doesn't correspond to a type.

getFrom

private int getFrom(javax.swing.table.DefaultTableModel model,
                    int row,
                    boolean returnDefaultValue)
             throws java.lang.NumberFormatException
Converts the given String into int.

Parameters:
model - The model to extract data from.
row - The row to retrieve its data.
returnDefaultValue - whether to return -1 as a default value instead of throwing exception.
Returns:
An integer representing the value at model.getValueAt(row, 1).
Throws:
java.lang.NumberFormatException - If the strForm is not in correct format.

getTo

private int getTo(javax.swing.table.DefaultTableModel model,
                  int row,
                  boolean returnDefaultValue)
           throws java.lang.NumberFormatException
Converts the given String into int.

Parameters:
model - The model to extract data from.
row - The row to retrieve its data.
returnDefaultValue - whether to return -1 as a default value instead of throwing exception.
Returns:
An integer representing the value at model.getValueAt(row, 2).
Throws:
java.lang.NumberFormatException - If the strTo is not in correct format.

getPhase

private int getPhase(javax.swing.table.DefaultTableModel model,
                     int row,
                     boolean returnDefaultValue)
              throws java.security.InvalidParameterException,
                     java.lang.NumberFormatException
Gets the ID of the given phase.

Parameters:
model - The model to extract data from.
row - The row to retrieve its data.
returnDefaultValue - whether to return -1 as a default value instead of throwing exception.
Returns:
The ID of the phase.
Throws:
java.security.InvalidParameterException - If the given phase name doesn't correspond to a phase.
java.lang.NumberFormatException - If the phase ID couldn't be parsed.

getReason

private int getReason(javax.swing.table.DefaultTableModel model,
                      int row,
                      java.lang.String phaseName,
                      boolean returnDefaultValue)
               throws java.security.InvalidParameterException,
                      java.lang.NumberFormatException
Gets the ID of the given reason.

Parameters:
model - The model to extract data from.
row - The row to retrieve its data.
phaseName - The name of the phase.
returnDefaultValue - whether to return -1 as a default value instead of throwing exception.
Returns:
The ID of the reason.
Throws:
java.security.InvalidParameterException - If the given reason name doesn't correspond to a reason.
java.lang.NumberFormatException - If the reason ID couldn't be parsed.

getUser

private int getUser(javax.swing.table.DefaultTableModel model,
                    int row)
             throws java.security.InvalidParameterException
Gets the User ID value.

Parameters:
model - The model to extract data from.
row - The row to retrieve its data.
Returns:
An int representing the value at model.getValueAt(row, 5) or the current user if no such column exists.
Throws:
java.security.InvalidParameterException - If the given user name doesn't correspond to a user.

getDone

private boolean getDone(javax.swing.table.DefaultTableModel model,
                        int row)
Gets the Done value.

Parameters:
model - The model to extract data from.
row - The row to retrieve its data.
Returns:
A boolean representing the value at model.getValueAt(row, 6) or false if no such column exists.

getComment

private java.lang.String getComment(javax.swing.table.DefaultTableModel model,
                                    int row)
Gets the Comment value.

Parameters:
model - The model to extract data from.
row - The row to retrieve its data.
Returns:
A String representing the value at model.getValueAt(row, 7).