org.vizzini.ui.database
Class TablePanel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by org.vizzini.ui.database.TablePanel
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class TablePanel
extends JPanel

Provides a panel for interaction with a database table.

Since:
v0.3
Version:
v0.3
Author:
Jeffrey M. Thompson
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected static int COUNT_AREA
           
protected static int SELECTED_COUNT_AREA
           
protected static int STATUS_AREA
           
 
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
TablePanel(Frame frame, IDatabase database, String tableName, String tableDisplayName, String linkColumnName, String searchColumnName, List columnDescriptorList)
          Construct this object.
 
Method Summary
 void addEntryActionPerformed(ActionEvent event)
          Callback for the add entry button.
 void associateEntryActionPerformed(ActionEvent event)
          Callback for the associate entry button.
 void checkActions()
          Check the enable state of the actions.
 void copyEntryActionPerformed(ActionEvent event)
          Callback for the copy entry button.
protected  JPopupMenu createPopupMenu()
          Create the tool bar.
protected  JToolBar createToolBar()
          Create the tool bar.
 void deleteEntryActionPerformed(ActionEvent event)
          Callback for the delete entry action.
 void disassociateEntryActionPerformed(ActionEvent event)
          Callback for the disassociate entry button.
protected  Action getAddEntryAction()
          Return the add entry action.
protected  Action getAssociateEntryAction()
          Return the associate entry action.
protected  Action getCopyEntryAction()
          Return the copy entry action.
protected  int getDeleteConfirmation(boolean onlyOne)
          Show a dialog requesting confirmation of the delete action.
protected  Action getDeleteEntryAction()
          Return the delete entry action.
protected  Action getDisassociateEntryAction()
          Return the disassociate entry action.
 PropertyChangeListener getEditModeListener()
          Return a listener for the edit mode property.
protected  Action getLookUpEntryAction()
          Return the look up entry action.
protected  IRecord getSelectedItem()
          Return the first selected item.
 Object[] getSelectedValues()
          Return the selected values in the table.
protected  Action getShowAssociatedEntriesAction()
          Return the show associated entries action.
 PropertyChangeListener getSubjectPropertyListener()
           
 String getTableName()
          Return the table name.
 boolean isEditMode()
           
 void lookUpEntryActionPerformed(ActionEvent event)
          Callback for the lookup entry action.
 void setCursorBusy(boolean busy)
          Set the cursor to busy depending upon the given state.
 void setEditMode(boolean editMode)
          Set the edit mode.
 void setShowAssociatedItems(boolean showAssociatedItems)
          Set the flag which determines whether to show only associated items or show all items excluding associated items.
 void setSubject(IRecord subject)
          Set the subject IRecord.
 void setToolBarVisible(boolean visible)
          Set the tool bar visible.
protected  void showAllEntries()
          Callback for the show all entries button.
protected  void showAllExceptAssociatedEntries(IRecord subject)
          Show all items excluding those associated to subject.
protected  void showAssociatedEntries(IRecord subject)
          Show only items associated to subject.
 void showAssociatedEntriesActionPerformed(ActionEvent event)
          Callback for the show associated entries button.
protected  void showEntriesAssociatedTo(IRecord subject)
          Show entries associated to the given object.
protected  void showSubjectOnly(IRecord subject)
          Just show the subject.
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, 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, 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, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, 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, doLayout, 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

STATUS_AREA

protected static final int STATUS_AREA
See Also:
Constant Field Values

COUNT_AREA

protected static final int COUNT_AREA
See Also:
Constant Field Values

SELECTED_COUNT_AREA

protected static final int SELECTED_COUNT_AREA
See Also:
Constant Field Values
Constructor Detail

TablePanel

public TablePanel(Frame frame,
                  IDatabase database,
                  String tableName,
                  String tableDisplayName,
                  String linkColumnName,
                  String searchColumnName,
                  List columnDescriptorList)
Construct this object.

Parameters:
frame - The owning frame (can be null).
database - The database.
tableName - The name of the table represented by this object.
tableDisplayName - The table display name.
linkColumnName - The name of the column to use to look up an entry through a link.
searchColumnName - The name of the column to use to lookup an entry through a search.
columnDescriptorList - List of column descriptors.
Since:
v0.3
Method Detail

addEntryActionPerformed

public void addEntryActionPerformed(ActionEvent event)
Callback for the add entry button.

Since:
v0.3

associateEntryActionPerformed

public void associateEntryActionPerformed(ActionEvent event)
Callback for the associate entry button.

Since:
v0.3

checkActions

public void checkActions()
Check the enable state of the actions.

Since:
v0.3

copyEntryActionPerformed

public void copyEntryActionPerformed(ActionEvent event)
Callback for the copy entry button.

Since:
v0.3

deleteEntryActionPerformed

public void deleteEntryActionPerformed(ActionEvent event)
Callback for the delete entry action.

Since:
v0.3

disassociateEntryActionPerformed

public void disassociateEntryActionPerformed(ActionEvent event)
Callback for the disassociate entry button.

Since:
v0.3

getEditModeListener

public PropertyChangeListener getEditModeListener()
Return a listener for the edit mode property.

Since:
v0.3

getSelectedValues

public Object[] getSelectedValues()
Return the selected values in the table.

Since:
v0.3

getSubjectPropertyListener

public PropertyChangeListener getSubjectPropertyListener()
Since:
v0.3

getTableName

public String getTableName()
Return the table name.

Since:
v0.3

isEditMode

public boolean isEditMode()
Since:
v0.3

lookUpEntryActionPerformed

public void lookUpEntryActionPerformed(ActionEvent event)
Callback for the lookup entry action.

Since:
v0.3

setCursorBusy

public void setCursorBusy(boolean busy)
Set the cursor to busy depending upon the given state.

Since:
v0.3

setEditMode

public void setEditMode(boolean editMode)
Set the edit mode.

Since:
v0.3

setShowAssociatedItems

public void setShowAssociatedItems(boolean showAssociatedItems)
Set the flag which determines whether to show only associated items or show all items excluding associated items.

Since:
v0.3

setSubject

public void setSubject(IRecord subject)
Set the subject IRecord.

Since:
v0.3

setToolBarVisible

public void setToolBarVisible(boolean visible)
Set the tool bar visible.

Since:
v0.3

showAssociatedEntriesActionPerformed

public void showAssociatedEntriesActionPerformed(ActionEvent event)
Callback for the show associated entries button.

Since:
v0.3

createPopupMenu

protected JPopupMenu createPopupMenu()
Create the tool bar.

Since:
v0.3

createToolBar

protected JToolBar createToolBar()
Create the tool bar.

Since:
v0.3

getAddEntryAction

protected Action getAddEntryAction()
Return the add entry action.

Since:
v0.3

getAssociateEntryAction

protected Action getAssociateEntryAction()
Return the associate entry action.

Since:
v0.3

getCopyEntryAction

protected Action getCopyEntryAction()
Return the copy entry action.

Since:
v0.3

getDeleteConfirmation

protected int getDeleteConfirmation(boolean onlyOne)
Show a dialog requesting confirmation of the delete action.

Returns:
JOptionPane.YES_OPTION or JOptionPane.NO_OPTION
Since:
v0.3

getDeleteEntryAction

protected Action getDeleteEntryAction()
Return the delete entry action.

Since:
v0.3

getDisassociateEntryAction

protected Action getDisassociateEntryAction()
Return the disassociate entry action.

Since:
v0.3

getLookUpEntryAction

protected Action getLookUpEntryAction()
Return the look up entry action.

Since:
v0.3

getSelectedItem

protected IRecord getSelectedItem()
Return the first selected item.

Since:
v0.3

getShowAssociatedEntriesAction

protected Action getShowAssociatedEntriesAction()
Return the show associated entries action.

Since:
v0.3

showAllEntries

protected void showAllEntries()
                       throws SQLException
Callback for the show all entries button.

Throws:
SQLException
Since:
v0.3

showAllExceptAssociatedEntries

protected void showAllExceptAssociatedEntries(IRecord subject)
                                       throws SQLException
Show all items excluding those associated to subject. Filter out the items already associated to subject.

Throws:
SQLException
Since:
v0.3

showAssociatedEntries

protected void showAssociatedEntries(IRecord subject)
                              throws SQLException
Show only items associated to subject.

Throws:
SQLException
Since:
v0.3

showEntriesAssociatedTo

protected void showEntriesAssociatedTo(IRecord subject)
                                throws SQLException
Show entries associated to the given object.

Throws:
SQLException
Since:
v0.3

showSubjectOnly

protected void showSubjectOnly(IRecord subject)
Just show the subject.

Since:
v0.3


Copyright 2007 Vizzini.org. All Rights Reserved. 2007.12.25.03.00.02