org.peace_tools.views
Class ServerListView

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

public class ServerListView
extends javax.swing.JPanel

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

See Also:
Serialized Form

Nested Class Summary
private  class ServerListView.ServerNameStatusRenderer
          A simple renderer that uses a JLabel to render server name and icon indicating job status.
 
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  MainFrame mainFrame
          The main frame that logically owns this job list view.
private  ServerListTableModel model
          The model that we are using to render the information in the tabular view of servers in the workspace.
private  javax.swing.JPopupMenu popupMenu
          The pop up menu that is displayed when the user left-clicks on an item in the server list view.
private static long serialVersionUID
          A generated serial version ID for serialization (more realistically to keep the compiler happy).
private  ServerListView.ServerNameStatusRenderer ServerNameRenderer
          An instance of the cell renderer that is used to render the first column in the table with a suitable status icon.
private static javax.swing.Icon[] ServerStatusIcons
          The list of icons that are used by this table cell renderer to provide visual cues about the current status of this server.
private  javax.swing.JTable serverTable
          The actual JTable that provides a graphical view of the list of servers currently configured on this workspace.
private  javax.swing.JToolBar toolbar
          The toolbar that contains some commonly used tools with the servers.
 
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
ServerListView(MainFrame mainFrame)
          The default constructor.
 
Method Summary
private  void addMouseAdapter(javax.swing.JComponent list)
          A refactored helper method to add a mouse adapter.
private  void createPopupMenu()
          This is a helper method to create the pop-up menu.
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.
 
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

model

private final ServerListTableModel model
The model that we are using to render the information in the tabular view of servers in the workspace.


toolbar

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


serverTable

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


ServerStatusIcons

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


mainFrame

private final MainFrame mainFrame
The main frame that logically owns this job list view.


ServerNameRenderer

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


popupMenu

private javax.swing.JPopupMenu popupMenu
The pop up menu that is displayed when the user left-clicks on an item in the server list 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

ServerListView

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

Parameters:
mainFrame - The main frame that logically owns this job list view. The main frame is primarily used as the job listener which receives notifications on job completion.
Method Detail

createPopupMenu

private void createPopupMenu()
This is a helper method to create the pop-up menu. This is a helper method that was introduced to streamline the code in the constructor. This method creates a popup menu that provides options for handling server entries.


addMouseAdapter

private void addMouseAdapter(javax.swing.JComponent list)
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:
list - The list 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 server table. This method checks to see if the entry is valid and if so, pops up a menu with valid operations for the selected server entry.

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 job list. This method checks to see if the entry is valid and if so, opens a tab with information about the job running on the server.

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