org.peace_tools.views
Class DataSetFileListView

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.peace_tools.views.DataSetFileListView
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible

public class DataSetFileListView
extends javax.swing.JPanel

This class provides a tabular view of the list of files that are currently configured in this work space. This table uses the DataSetTableModel class that provides the file data from the work space in a form that is easily displayed in a table.

See Also:
Serialized Form

Nested Class Summary
private  class DataSetFileListView.ServerNameStatusRenderer
          A inner class to serve as a special renderer that puts file names along with a suitable icon.
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
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
 
Field Summary
private  DataSetFileListView.ServerNameStatusRenderer FileNameRenderer
          An instance of the cell renderer that is used to render the first column in the table with a suitable status icon.
private  javax.swing.JTable fileTable
          The actual JTable that provides a graphical view of the list of servers currently configured on this work space.
private static javax.swing.Icon[] FileTypeIcons
          The list of icons that are used by this table cell renderer to provide visual cues about the current status of this server.
private  MainFrame mainFrame
          Convenient reference to the main frame class that logically owns this menu in its JMenuBar.
(package private)  DataSetPopupMenu popupMenu
          This is a pop-up menu that is displayed whenever the user clicks the left mouse button on a table entry.
private static long serialVersionUID
          A generated serial version ID for serialization (more realistically to keep the compiler happy).
private  DataSetTableModel tableModel
          The table model that provides the data for display in the file table.
private  javax.swing.JToolBar toolbar
          The tool bar that contains some commonly used tools with the servers.
private  DataSetTreeView treeView
          The actual tree view that provides a graphical view of the data sets in the form of a tree.
 
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
DataSetFileListView(MainFrame frame)
          The default constructor.
 
Method Summary
private  void addMouseAdapter(javax.swing.JComponent tree)
          A refactored helper method to add a mouse adapter.
private  void handleDoubleClick(java.awt.event.MouseEvent me)
          Helper method to handle double click of the mouse on a list item.
 void handlePopup(java.awt.event.MouseEvent me)
          Helper method to left mouse click on a table item.
 void setDataSetTreeView(DataSetTreeView treeView)
          Set the reference to the data set tree view to be synchronized with this table.
 void setSelectedEntry(java.lang.Object entry)
          Method to select entry in the data set table view This is a helper method that is primarily used by the DataSetTreeView to update the selected entry when when the user clicks on a given entry.
 
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, 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, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, 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, 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, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

toolbar

private javax.swing.JToolBar toolbar
The tool bar that contains some commonly used tools with the servers.


fileTable

private javax.swing.JTable fileTable
The actual JTable that provides a graphical view of the list of servers currently configured on this work space.


tableModel

private DataSetTableModel tableModel
The table model that provides the data for display in the file table. This object is used to directly obtain the object at a given row.


FileTypeIcons

private static final javax.swing.Icon[] FileTypeIcons
The list of icons that are used by this table cell renderer to provide visual cues about the current status of this server.


popupMenu

DataSetPopupMenu popupMenu
This is a pop-up menu that is displayed whenever the user clicks the left mouse button on a table entry. This menu is created with a static set of menu items and appropriate entries are enabled and disabled.


mainFrame

private final MainFrame mainFrame
Convenient reference to the main frame class that logically owns this menu in its JMenuBar. This value is set in the constructor and is never changed.


FileNameRenderer

private final DataSetFileListView.ServerNameStatusRenderer FileNameRenderer
An instance of the cell renderer that is used to render the first column in the table with a suitable status icon.


treeView

private DataSetTreeView treeView
The actual tree view that provides a graphical view of the data sets in the form of a tree. This reference is used to synchronize the selected entries in the tree and this tabular view.


serialVersionUID

private static final long serialVersionUID
A generated serial version ID for serialization (more realistically to keep the compiler happy).

See Also:
Constant Field Values
Constructor Detail

DataSetFileListView

public DataSetFileListView(MainFrame frame)
The default constructor. The default constructor sets up the server list table and configures the table to the default configuration.

Parameters:
frame - The main frame that ultimately owns all the views
Method Detail

addMouseAdapter

private void addMouseAdapter(javax.swing.JComponent tree)
A refactored helper method to add a mouse adapter. This method adds a mouse adapter to intercept certain mouse events occurring on the data set tree to trigger various operations. The mouse adapter simply delegates the actual operations to other methods in this class.

Parameters:
tree - The tree object to which the mouse adapter is to be added.

handlePopup

public void handlePopup(java.awt.event.MouseEvent me)
Helper method to left mouse click on a table item. This method is invoked whenever the user clicks on the left mouse button on a item in the table. This method checks to see if the entry is valid and if so, pops up a menu with valid operations for the selected item.

Parameters:
me - The mouse event associated with the mouse click.

handleDoubleClick

private void handleDoubleClick(java.awt.event.MouseEvent me)
Helper method to handle double click of the mouse on a list item. This method is invoked whenever the user double clicks on a row in the set tree. This method checks to see if the entry is valid and if so, opens a view of the specified data file.

Parameters:
me - The mouse event associated with the double click.

setSelectedEntry

public void setSelectedEntry(java.lang.Object entry)
Method to select entry in the data set table view This is a helper method that is primarily used by the DataSetTreeView to update the selected entry when when the user clicks on a given entry.

Parameters:
entry - The entry to be selected. If this value is null or if the entry could not be found then selections are cleared.

setDataSetTreeView

public void setDataSetTreeView(DataSetTreeView treeView)
Set the reference to the data set tree view to be synchronized with this table. This method is used by the ViewFactory to setup cross reference between the tree view and the data set file list view.

Parameters:
treeView - The tree view whose selected entry is to be synchronized with that of this table.