com.enderak.procol.client.model
Class ProColClientProject

java.lang.Object
  |
  +--java.util.Observable
        |
        +--com.enderak.procol.common.util.EnhancedObservable
              |
              +--com.enderak.procol.common.model.ProColProject
                    |
                    +--com.enderak.procol.client.model.ProColClientProject

public class ProColClientProject
extends ProColProject

The project representation on the client side, namely, it keeps track of files and buffers that are currently open by the client

Author:
Justin Dieters

Field Summary
 
Fields inherited from class com.enderak.procol.common.model.ProColProject
downloadingFiles, j, name, NUM_VERSIONS, projectDir, projectFilesDir, projectFilesRootNode, projectFilesURI, projectURI
 
Constructor Summary
ProColClientProject(java.net.URI projectURIIn, java.lang.String name)
          Create a new project
 
Method Summary
 void addBuffer(org.gjt.sp.jedit.Buffer bufferIn)
          Adds a buffer to the open buffers list
 void addModifiedBuffer(org.gjt.sp.jedit.Buffer bufferIn)
          Adds a buffer to the modified buffers list
 void addToTree(byte[] dataIn)
          Adds a file or directory to the tree
 void addTree(byte[] dataIn)
          Creates a complete tree based on data from the server
 void close()
          Closes the project - closes all open buffers, initiating check-in of files
 ProColFile getFileForBuffer(org.gjt.sp.jedit.Buffer bufferIn)
          Returns the ProColFile associated with a buffer
 boolean isModifiedBuffer(org.gjt.sp.jedit.Buffer bufferIn)
          Checks if a buffer that is checked out has been modified by the client
 boolean isOpenBuffer(org.gjt.sp.jedit.Buffer bufferIn)
          Checks if a buffer that is checked out is currently opened by the client
 void readyForDownload(java.net.URI fileURI, java.net.URI destURI)
          Gets a file ready to be downloaded by the client
 void removeBuffer(org.gjt.sp.jedit.Buffer bufferIn)
          Removes a buffer from both the open buffers and modified buffers lists
 void updateFileInfo(byte[] dataIn)
          Updates the info for a file
 void writeAndOpenFile(java.lang.String filePath, byte[] dataIn)
          Writes a file to the disk and opens it in jEdit
 
Methods inherited from class com.enderak.procol.common.model.ProColProject
createFile, createFile, getFileInTree, getFileInTree, getName, getNodeForFile, getNodeForFile, getProjectFilesRootNode, getProjectFilesURI, getProjectURI, printTree, writeFile
 
Methods inherited from class com.enderak.procol.common.util.EnhancedObservable
forceNotify, forceNotify
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProColClientProject

public ProColClientProject(java.net.URI projectURIIn,
                           java.lang.String name)
Create a new project

Parameters:
projectURIIn - The base URI for the project
name - The name of the project
Method Detail

isOpenBuffer

public boolean isOpenBuffer(org.gjt.sp.jedit.Buffer bufferIn)
Checks if a buffer that is checked out is currently opened by the client

Parameters:
bufferIn - The buffer to check
Returns:
true if buffer is open, false otherwise

isModifiedBuffer

public boolean isModifiedBuffer(org.gjt.sp.jedit.Buffer bufferIn)
Checks if a buffer that is checked out has been modified by the client

Parameters:
bufferIn - The buffer to check
Returns:
true if buffer has been modified, false otherwise

addTree

public void addTree(byte[] dataIn)
Creates a complete tree based on data from the server

Parameters:
dataIn - The tree information

addBuffer

public void addBuffer(org.gjt.sp.jedit.Buffer bufferIn)
Adds a buffer to the open buffers list

Parameters:
bufferIn - The buffer

addModifiedBuffer

public void addModifiedBuffer(org.gjt.sp.jedit.Buffer bufferIn)
Adds a buffer to the modified buffers list

Parameters:
bufferIn - The buffer

updateFileInfo

public void updateFileInfo(byte[] dataIn)
Updates the info for a file

Parameters:
dataIn - the updated data from the server

close

public void close()
Closes the project - closes all open buffers, initiating check-in of files


getFileForBuffer

public ProColFile getFileForBuffer(org.gjt.sp.jedit.Buffer bufferIn)
Returns the ProColFile associated with a buffer

Parameters:
bufferIn - The buffer
Returns:
The File associated with the buffer

removeBuffer

public void removeBuffer(org.gjt.sp.jedit.Buffer bufferIn)
Removes a buffer from both the open buffers and modified buffers lists

Parameters:
bufferIn - Description of the Parameter

readyForDownload

public void readyForDownload(java.net.URI fileURI,
                             java.net.URI destURI)
Gets a file ready to be downloaded by the client

Parameters:
fileURI - The path of the file within the ProCol Tree
destURI - The path to store the file on the hard drive

writeAndOpenFile

public void writeAndOpenFile(java.lang.String filePath,
                             byte[] dataIn)
Writes a file to the disk and opens it in jEdit

Parameters:
dataIn - The file data
filePath - the file path to write the data to

addToTree

public void addToTree(byte[] dataIn)
Adds a file or directory to the tree

Parameters:
dataIn -