vc.gui.client.handling
Class FileTableManipulator

java.lang.Object
  |
  +--vc.gui.client.handling.FileTableManipulator

public class FileTableManipulator
extends java.lang.Object

FileTableManipulator is the event handling class for VersionControl client GUI. It drives the actual GUI classes related to showing the files in a table. It has event handlers and other processing related to the GUI actions.


Field Summary
 Directory currentDirectory
          Instance of the directory whose files are being shown in the table
 
Constructor Summary
FileTableManipulator(ClientFrame clientFrame, javax.swing.JTable table_FileInfo, ProjectDBManager projectDBManager, javax.swing.JLabel selectionStatusLabel, FileVersionManager fileVersionManager, TreeManipulator treeManipulator)
          Constructs and Initializes FileTableManipulator object witht hte parameters passed.
 
Method Summary
 void addFileForCallback(java.lang.String parentID, File newFile)
          VersionControl client callback handler which will be called by Callback method when ever a file is added to a directory.
 void changeFileCheckingStatusForCallback(java.lang.String fileID, boolean ckeckedOut, java.lang.String checkOutUser)
          VersionControl client callback handler which will be called by Callback method when ever a files checking satus is changed.
 void deleteFileForCallback(java.lang.String fileID)
          VersionControl client callback handler which will be called by Callback method when ever a file is deleted .
 File getSelectedFile()
          Gets the information of the file that is selected from the table
 java.lang.String[] getSelectedFileIDs()
          Gets the IDs of the files that are selected from the table
 int getSelectedFileIndex()
          Gets the index of the file that is selected from the table
 File[] getSelectedFiles()
          Gets the information of the files that are selected from the table
 void initializeTable()
          Creates the objects like table modal object etc, sets the table properties and then adds the event listeners
 void reInitializeFilesInTable(Directory currentDirectory, java.lang.String selectionInfo)
          Updates the table with the files being shown.
 void reInitializeTableToEmpty()
          Updates the table by showing no files in the table i.e show the empty table.
 void resetSelectionStatus(java.lang.String selectionInfo)
          Updates the status bar with the new information.
 void unSelectFiles()
          Unselects the files that are selected in the table
 void updateFileForCallback(File newFile)
          VersionControl client callback handler which will be called by Callback method when ever a file is updated .
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

currentDirectory

public Directory currentDirectory
Instance of the directory whose files are being shown in the table
Constructor Detail

FileTableManipulator

public FileTableManipulator(ClientFrame clientFrame,
                            javax.swing.JTable table_FileInfo,
                            ProjectDBManager projectDBManager,
                            javax.swing.JLabel selectionStatusLabel,
                            FileVersionManager fileVersionManager,
                            TreeManipulator treeManipulator)
Constructs and Initializes FileTableManipulator object witht hte parameters passed. Also instatntiates TablePopupHandler object.
Parameters:
clientFrame - to initialize the field clientFrame
table_FileInfo - to initialize the field table_FileInfo
projectDBManager - to initialize the field projectDBManager
selectionStatusLabel - to initialize the field selectionStatusLabel
fileVersionManager - to initialize the field fileVersionManager
treeManipulator - to initialize the field treeManipulator
Method Detail

initializeTable

public void initializeTable()
Creates the objects like table modal object etc, sets the table properties and then adds the event listeners

reInitializeFilesInTable

public void reInitializeFilesInTable(Directory currentDirectory,
                                     java.lang.String selectionInfo)
                              throws java.lang.Throwable
Updates the table with the files being shown. It removes all files and shows the new files according to the previous operation.
Parameters:
currentDirectory - The directory whose files are to be shown by refreshing
selectionInfo - Information of the currentDirectory that is to be shown on the status bar. If it is null then the directory information string will be reconstructed

reInitializeTableToEmpty

public void reInitializeTableToEmpty()
                              throws java.lang.Throwable
Updates the table by showing no files in the table i.e show the empty table.

resetSelectionStatus

public void resetSelectionStatus(java.lang.String selectionInfo)
Updates the status bar with the new information.
Parameters:
selectionInfo - Information othat is to be shown on the status bar

getSelectedFile

public File getSelectedFile()
Gets the information of the file that is selected from the table
Returns:
Returns the information of the file that is selected from the table

getSelectedFileIndex

public int getSelectedFileIndex()
Gets the index of the file that is selected from the table
Returns:
Returns the index of the file that is selected from the table

getSelectedFiles

public File[] getSelectedFiles()
Gets the information of the files that are selected from the table
Returns:
Returns the information of the files that are selected from the table

getSelectedFileIDs

public java.lang.String[] getSelectedFileIDs()
Gets the IDs of the files that are selected from the table
Returns:
Returns the IDs of the files that are selected from the table

unSelectFiles

public void unSelectFiles()
Unselects the files that are selected in the table

addFileForCallback

public void addFileForCallback(java.lang.String parentID,
                               File newFile)
VersionControl client callback handler which will be called by Callback method when ever a file is added to a directory. If that directory is being shown then this method will refresh its display
Parameters:
parentID - ID of the directory to which the file is added by another client
newFile - Information of the new file is added by another client

updateFileForCallback

public void updateFileForCallback(File newFile)
VersionControl client callback handler which will be called by Callback method when ever a file is updated . If that file is being shown then this method will refresh its display
Parameters:
newFile - Information of the file that is updated by another client

deleteFileForCallback

public void deleteFileForCallback(java.lang.String fileID)
VersionControl client callback handler which will be called by Callback method when ever a file is deleted . If that file is being shown then this method will refresh its display
Parameters:
fileID - ID of the file that is deleted by another client

changeFileCheckingStatusForCallback

public void changeFileCheckingStatusForCallback(java.lang.String fileID,
                                                boolean ckeckedOut,
                                                java.lang.String checkOutUser)
VersionControl client callback handler which will be called by Callback method when ever a files checking satus is changed. If that file is being shown then this method will refresh its display
Parameters:
fileID - ID of the file whose checking satus is changed by another client
ckeckedOut - if true then it is understood that file is checked out, or else chcked in or undo check out.
checkOutUser - ID of the user doing the checking operation