vc.gui.client.handling
Class TablePopupHandler

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JPopupMenu
                          |
                          +--vc.gui.client.handling.TablePopupHandler
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.MenuElement, java.io.Serializable

public class TablePopupHandler
extends javax.swing.JPopupMenu

TablePopupHandler is the mediator(pattern) class that creates the GUI for popup menu for the files(in a table), then set the event handlers and finally doing the actual event handling processing.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JPopupMenu
javax.swing.JPopupMenu.AccessibleJPopupMenu, javax.swing.JPopupMenu.Separator
 
Inner classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Inner classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent
 
Field Summary
 FileTableManipulator fileTableManipulator
          Deals with the visual presentation of the file data of a directory into the table
 
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
TablePopupHandler(ProjectDBManager projectDBManager, FileVersionManager fileVersionManager, FileTableManipulator fileTableManipulator)
          Construct and Initializes the TablePopupHandler object from the parameters
 
Method Summary
 void addEventHandlers()
          adds the event handlers to the menu items related to the popup menu hendler for the files
 void popupSelected(java.awt.event.ActionEvent event)
          Registered Event Handler method whch will be invoked when ever the popup menuitem is clicked/selected.
 void selected_AddLabel()
          Handles the request to add labels for the files .
 void selected_CheckInFile()
          Handles the request to check in the files .
 void selected_CheckOutFile()
          Handles the request to check out the files .
 void selected_GetLatestFileVersion()
          Handles the request to get the latest version of the files .
 void selected_History()
          Handles the request to show the versions and labels of the files .
 void selected_MapToDirectory()
          Handles the request to map the directory to the files .
 void selected_RemoveFile()
          Handles the request to remove the files.
 void selected_RenameFile()
          Handles the request to rename a file.
 void selected_UndoCheckOutFile()
          Handles the request to undo check out the files .
 void setCheckingOptions(File[] selectedFiles)
          Sets the checking options to the files when checking dialog is shown to get the options for checking in/out/undo the files.
 void setSelectionMode(boolean forMultiple)
          sets the selection mode for the files i.e if multiple files are selected or if a single file is selected.
 
Methods inherited from class javax.swing.JPopupMenu
add, add, add, addPopupMenuListener, addSeparator, createActionChangeListener, createActionComponent, firePopupMenuCanceled, firePopupMenuWillBecomeInvisible, firePopupMenuWillBecomeVisible, getAccessibleContext, getComponent, getComponentAtIndex, getComponentIndex, getDefaultLightWeightPopupEnabled, getInvoker, getLabel, getMargin, getSelectionModel, getSubElements, getUI, getUIClassID, insert, insert, isBorderPainted, isLightWeightPopupEnabled, isPopupTrigger, isVisible, menuSelectionChanged, pack, paintBorder, paramString, processKeyEvent, processKeyEvent, processMouseEvent, remove, removePopupMenuListener, setBorderPainted, setDefaultLightWeightPopupEnabled, setInvoker, setLabel, setLightWeightPopupEnabled, setLocation, setPopupSize, setPopupSize, setSelected, setSelectionModel, setUI, setVisible, show, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getVerifyInputWhenFocusTarget, getVisibleRect, getWidth, getX, getY, grabFocus, hasFocus, hide, isDoubleBuffered, isFocusCycleRoot, isFocusTraversable, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processFocusEvent, processKeyBinding, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getLayout, insets, invalidate, isAncestorOf, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setLayout, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocationOnScreen, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, imageUpdate, inside, isDisplayable, isEnabled, isLightweight, isShowing, isValid, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setLocale, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

fileTableManipulator

public FileTableManipulator fileTableManipulator
Deals with the visual presentation of the file data of a directory into the table
Constructor Detail

TablePopupHandler

public TablePopupHandler(ProjectDBManager projectDBManager,
                         FileVersionManager fileVersionManager,
                         FileTableManipulator fileTableManipulator)
Construct and Initializes the TablePopupHandler object from the parameters
Parameters:
projectDBManager - to initialize the field projectDBManager
fileVersionManager - to initialize the field fileVersionManager
fileTableManipulator - to initialize the field fileTableManipulator
Method Detail

setSelectionMode

public void setSelectionMode(boolean forMultiple)
sets the selection mode for the files i.e if multiple files are selected or if a single file is selected. Accordingly it will show and hide some of the menu items.
Parameters:
forMultiple - holds true if multiple files are selected or else false.

setCheckingOptions

public void setCheckingOptions(File[] selectedFiles)
Sets the checking options to the files when checking dialog is shown to get the options for checking in/out/undo the files. It will show and hide some of the GUI components showing the checking options according to the number of files etc.
Parameters:
selectedFiles - All the files for which the checking options are shown

addEventHandlers

public void addEventHandlers()
adds the event handlers to the menu items related to the popup menu hendler for the files

popupSelected

public void popupSelected(java.awt.event.ActionEvent event)
Registered Event Handler method whch will be invoked when ever the popup menuitem is clicked/selected. It delegates to diffrent methods based upon the menuitem on which the action happened.
Parameters:
e - ActionEvent which represents the information abou the action, target component, location etc.

selected_RenameFile

public void selected_RenameFile()
Handles the request to rename a file. Shows a simple message box asking for the new name for the file and renames it.

selected_RemoveFile

public void selected_RemoveFile()
Handles the request to remove the files. Shows a simple message box asking to to confirm if the files are to be deleated really.

selected_MapToDirectory

public void selected_MapToDirectory()
Handles the request to map the directory to the files . Shows a simple dialog that takes the file system directory to which the files are to be mapped.

selected_CheckOutFile

public void selected_CheckOutFile()
Handles the request to check out the files . Shows a simple dialog that takes the options for checking out the files.

selected_CheckInFile

public void selected_CheckInFile()
Handles the request to check in the files . Shows a simple dialog that takes the options for checking in the files.

selected_UndoCheckOutFile

public void selected_UndoCheckOutFile()
Handles the request to undo check out the files . Shows a simple dialog that takes the options for undo checking out the files.

selected_GetLatestFileVersion

public void selected_GetLatestFileVersion()
Handles the request to get the latest version of the files . Shows a simple dialog that takes the options for getting the latest version of the files.

selected_AddLabel

public void selected_AddLabel()
Handles the request to add labels for the files . Shows a simple message asking the label name for adding label for the files.

selected_History

public void selected_History()
Handles the request to show the versions and labels of the files . Shows a simple dialog that takes the options for for showing the the versions and labels of the files.