edu.rice.cs.drjava.project
Class ProjectProfile

java.lang.Object
  extended by edu.rice.cs.drjava.project.ProjectProfile
All Implemented Interfaces:
ProjectFileIR

public class ProjectProfile
extends Object
implements ProjectFileIR

The internal representation of a project; it is the internal analog of a project file. Includes support for writing corresponding project file.


Constructor Summary
ProjectProfile(File f)
          Creates new ProjectProfiles with specifed project file name and project root that is parent folder of the project file.
ProjectProfile(String fileName)
          Constructs a File for fileName and forwards this call to the main constructor.
 
Method Summary
 void addAuxiliaryFile(DocFile df)
           
 void addAuxiliaryFile(DocumentInfoGetter getter)
           
 void addClassPathFile(File cp)
           
 void addCollapsedPath(String cp)
           
 void addExcludedFile(DocFile df)
           
 void addExcludedFile(DocumentInfoGetter getter)
           
 void addExcludedFile(File f)
           
 void addSourceFile(DocFile df)
          Public setters, modifiers
 void addSourceFile(DocumentInfoGetter getter)
           
 boolean getAutoRefreshStatus()
           
 DocFile[] getAuxiliaryFiles()
          These files are the files outside of the project tree that are saved in the project file so that they are opened as well as the project files.
 FileRegion[] getBookmarks()
           
 DebugBreakpointData[] getBreakpoints()
           
 File getBuildDirectory()
           
 Iterable<File> getClassPaths()
           
 String[] getCollapsedPaths()
           
 File getCreateJarFile()
           
 int getCreateJarFlags()
           
 DocFile[] getExcludedFiles()
          These files are in the project source tree, but have been explicitly excluded from the project.
 File getMainClass()
           
 File getProjectFile()
           
 File getProjectRoot()
           
 DocFile[] getSourceFiles()
           
 DebugWatchData[] getWatches()
           
 File getWorkingDirectory()
           
 void setAutoRefreshStatus(boolean status)
           
 void setAuxiliaryFiles(List<DocFile> af)
           
 void setBookmarks(List<? extends FileRegion> bms)
           
 void setBreakpoints(List<? extends DebugBreakpointData> bps)
           
 void setBuildDirectory(File dir)
           
 void setClassPaths(Iterable<? extends File> cpf)
           
 void setCollapsedPaths(List<String> cp)
           
 void setCreateJarFile(File createJarFile)
           
 void setCreateJarFlags(int createJarFlags)
           
 void setExcludedFiles(List<DocFile> ef)
           
 void setMainClass(File main)
           
 void setProjectRoot(File root)
          Assumes that root.getParentFile != null
 void setSourceFiles(List<DocFile> sf)
           
 void setWatches(List<? extends DebugWatchData> ws)
           
 void setWorkingDirectory(File dir)
           
 String toString()
           
 void write()
          Write project file in XML format.
 void write(OutputStream os)
           
 void writeOld()
          This method writes what information has been passed to this builder so far to disk in s-expression format.
 void writeOld(Writer fw)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ProjectProfile

public ProjectProfile(String fileName)
               throws IOException
Constructs a File for fileName and forwards this call to the main constructor.

Throws:
IOException

ProjectProfile

public ProjectProfile(File f)
               throws IOException
Creates new ProjectProfiles with specifed project file name and project root that is parent folder of the project file. The project file presumably may not exist yet, but its parent folder is assumed to exist. Assumes that the File f is not a null reference.

Throws:
IOException - parent directory of project file does not exist.
Method Detail

getSourceFiles

public DocFile[] getSourceFiles()
Specified by:
getSourceFiles in interface ProjectFileIR
Returns:
an array of the source files in this project.

getAuxiliaryFiles

public DocFile[] getAuxiliaryFiles()
Description copied from interface: ProjectFileIR
These files are the files outside of the project tree that are saved in the project file so that they are opened as well as the project files.

Specified by:
getAuxiliaryFiles in interface ProjectFileIR
Returns:
an array full of all the aux files (project outside source tree) in this project.

getExcludedFiles

public DocFile[] getExcludedFiles()
Description copied from interface: ProjectFileIR
These files are in the project source tree, but have been explicitly excluded from the project.

Specified by:
getExcludedFiles in interface ProjectFileIR
Returns:
an array chock partially full of most of the excluded files

getProjectFile

public File getProjectFile()
Specified by:
getProjectFile in interface ProjectFileIR
Returns:
project file.

getBuildDirectory

public File getBuildDirectory()
Specified by:
getBuildDirectory in interface ProjectFileIR
Returns:
the build directory stored in this project file

getWorkingDirectory

public File getWorkingDirectory()
Specified by:
getWorkingDirectory in interface ProjectFileIR
Returns:
the working directory stored in this project profile

getCollapsedPaths

public String[] getCollapsedPaths()
Specified by:
getCollapsedPaths in interface ProjectFileIR
Returns:
an array of path strings correspond to which folders in the tree should not be shown. Any paths not in this list will be expanded when the project is opened.

getClassPaths

public Iterable<File> getClassPaths()
Specified by:
getClassPaths in interface ProjectFileIR
Returns:
an array full of all the classpath path elements in the classpath for this project file

getMainClass

public File getMainClass()
Specified by:
getMainClass in interface ProjectFileIR
Returns:
the name of the file that holds the Jar main class associated with this project

getProjectRoot

public File getProjectRoot()
Specified by:
getProjectRoot in interface ProjectFileIR
Returns:
the project root directory which must exist.

getCreateJarFile

public File getCreateJarFile()
Specified by:
getCreateJarFile in interface ProjectFileIR
Returns:
the output file used in the "Create Jar" dialog.

getCreateJarFlags

public int getCreateJarFlags()
Specified by:
getCreateJarFlags in interface ProjectFileIR
Returns:
the output file used in the "Create Jar" dialog.

getBookmarks

public FileRegion[] getBookmarks()
Specified by:
getBookmarks in interface ProjectFileIR
Returns:
an array of the bookmarks in this project.

getBreakpoints

public DebugBreakpointData[] getBreakpoints()
Specified by:
getBreakpoints in interface ProjectFileIR
Returns:
an array of the breakpoints in this project.

getWatches

public DebugWatchData[] getWatches()
Specified by:
getWatches in interface ProjectFileIR
Returns:
an array of the watches in this project.

getAutoRefreshStatus

public boolean getAutoRefreshStatus()
Specified by:
getAutoRefreshStatus in interface ProjectFileIR

addSourceFile

public void addSourceFile(DocFile df)
Public setters, modifiers


addSourceFile

public void addSourceFile(DocumentInfoGetter getter)

addAuxiliaryFile

public void addAuxiliaryFile(DocFile df)

addAuxiliaryFile

public void addAuxiliaryFile(DocumentInfoGetter getter)

addExcludedFile

public void addExcludedFile(DocFile df)

addExcludedFile

public void addExcludedFile(File f)

addExcludedFile

public void addExcludedFile(DocumentInfoGetter getter)

addClassPathFile

public void addClassPathFile(File cp)

addCollapsedPath

public void addCollapsedPath(String cp)

setBuildDirectory

public void setBuildDirectory(File dir)
Specified by:
setBuildDirectory in interface ProjectFileIR

setWorkingDirectory

public void setWorkingDirectory(File dir)
Specified by:
setWorkingDirectory in interface ProjectFileIR

setMainClass

public void setMainClass(File main)
Specified by:
setMainClass in interface ProjectFileIR

setSourceFiles

public void setSourceFiles(List<DocFile> sf)
Specified by:
setSourceFiles in interface ProjectFileIR

setClassPaths

public void setClassPaths(Iterable<? extends File> cpf)
Specified by:
setClassPaths in interface ProjectFileIR

setCollapsedPaths

public void setCollapsedPaths(List<String> cp)
Specified by:
setCollapsedPaths in interface ProjectFileIR

setAuxiliaryFiles

public void setAuxiliaryFiles(List<DocFile> af)
Specified by:
setAuxiliaryFiles in interface ProjectFileIR

setExcludedFiles

public void setExcludedFiles(List<DocFile> ef)
Specified by:
setExcludedFiles in interface ProjectFileIR

setProjectRoot

public void setProjectRoot(File root)
Assumes that root.getParentFile != null

Specified by:
setProjectRoot in interface ProjectFileIR

setCreateJarFile

public void setCreateJarFile(File createJarFile)
Specified by:
setCreateJarFile in interface ProjectFileIR

setCreateJarFlags

public void setCreateJarFlags(int createJarFlags)
Specified by:
setCreateJarFlags in interface ProjectFileIR

setBookmarks

public void setBookmarks(List<? extends FileRegion> bms)
Specified by:
setBookmarks in interface ProjectFileIR

setBreakpoints

public void setBreakpoints(List<? extends DebugBreakpointData> bps)
Specified by:
setBreakpoints in interface ProjectFileIR

setWatches

public void setWatches(List<? extends DebugWatchData> ws)
Specified by:
setWatches in interface ProjectFileIR

setAutoRefreshStatus

public void setAutoRefreshStatus(boolean status)
Specified by:
setAutoRefreshStatus in interface ProjectFileIR

write

public void write()
           throws IOException
Write project file in XML format.

Throws:
IOException

write

public void write(OutputStream os)
           throws IOException
Throws:
IOException

writeOld

public void writeOld()
              throws IOException
This method writes what information has been passed to this builder so far to disk in s-expression format.

Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object

writeOld

public void writeOld(Writer fw)
              throws IOException
Throws:
IOException