edu.rice.cs.drjava.model
Interface FileGroupingState


public interface FileGroupingState

This state pattern is used by the global model to store any information pertaining to the currently open project. The state pattern is used because most project information is not needed in list view. (Elspeth Rocks) Hint: if you're looking for the instances of this interface, look in DefaultGlobalModel where they are defined as anonymous inner classes.


Method Summary
 void addAuxFile(File f)
          Adds file to list of auxiliary files in project
 void addExcludedFile(File f)
          Excludes file from the project.
 void cleanBuildDirectory()
          Cleans the build directory.
 boolean getAutoRefreshStatus()
           
 File getBuildDirectory()
          Returns the directory in which to put the class files after compilation
 List<File> getClassFiles()
           
 File getCreateJarFile()
          Return the create jar file for the project.
 int getCreateJarFlags()
          Return the create jar flags for the project.
 File[] getExclFiles()
          Return an array of the files excluded from the current project
 Iterable<File> getExtraClassPath()
          Returns a collection of classpath entries specific to the current project.
 File getMainClass()
          Returns the source file that has the main method of the project
 File getProjectFile()
          Returns the current project file
 File[] getProjectFiles()
          Return all files saved as source files in the project file.
 File getProjectRoot()
          Returns the project source root
 File getWorkingDirectory()
          Returns the working directory for the slave (interactions pane) JVM.
 boolean inProject(File f)
          Returns true the given file is in the current project file.
 boolean inProjectPath(File f)
           
 boolean inProjectPath(OpenDefinitionsDocument doc)
           
 boolean isAuxiliaryFile(File f)
           
 boolean isExcludedFile(File f)
          Returns true if the file is excluded from the current project
 boolean isProjectActive()
           
 boolean isProjectChanged()
          Returns true if in project mode and the current project file has changed.
 void remAuxFile(File f)
          Removes file to list of auxiliary files in project.
 void removeExcludedFile(File f)
          Remove the specified file from the files excluded from the current project
 void setAutoRefreshStatus(boolean b)
           
 void setBuildDirectory(File f)
          Sets the current build directory.
 void setCreateJarFile(File f)
          Sets the create jar file of the project.
 void setCreateJarFlags(int f)
          Sets the create jar flags of the project.
 void setExcludedFiles(File[] fs)
          Sets the array of files excluded from the current project
 void setExtraClassPath(Iterable<File> cp)
          Sets the list of project-specific classpath entries.
 void setMainClass(File f)
          Sets the file that has the main method of the project (Note: should point to the sourcefile of the document, not the class file)
 void setProjectChanged(boolean changed)
          Sets that the project state is no longer a snapshot of the open project.
 void setProjectFile(File f)
          Sets project file to specifed value; used in "Save Project As ..." command in MainFrame.
 void setProjectRoot(File f)
          Sets the current project root.
 void setWorkingDirectory(File f)
          Sets the current working directory for the interactions pane.
 

Method Detail

isProjectActive

boolean isProjectActive()
Returns:
true if the model is in project mode, false otherwi

inProjectPath

boolean inProjectPath(OpenDefinitionsDocument doc)
Returns:
true if the document is part of the active project (in the project path), or false if it is not (or the model is not in project mode)

inProjectPath

boolean inProjectPath(File f)
Returns:
true if the file is part of the active project (in the project path), or false if it is not (or the model is not in project mode)

getProjectFile

File getProjectFile()
Returns the current project file

Returns:
null if not currently in a project

getProjectRoot

File getProjectRoot()
Returns the project source root

Returns:
null if no build directory is specified

setProjectFile

void setProjectFile(File f)
Sets project file to specifed value; used in "Save Project As ..." command in MainFrame.


setProjectRoot

void setProjectRoot(File f)
Sets the current project root.


addAuxFile

void addAuxFile(File f)
Adds file to list of auxiliary files in project


remAuxFile

void remAuxFile(File f)
Removes file to list of auxiliary files in project. Throws an UnexpectedException if auxFiles does not contain exactly one instance of f.


getBuildDirectory

File getBuildDirectory()
Returns the directory in which to put the class files after compilation

Returns:
null if no build directory is specified

setBuildDirectory

void setBuildDirectory(File f)
Sets the current build directory.


getWorkingDirectory

File getWorkingDirectory()
Returns the working directory for the slave (interactions pane) JVM.


setWorkingDirectory

void setWorkingDirectory(File f)
Sets the current working directory for the interactions pane.


getMainClass

File getMainClass()
Returns the source file that has the main method of the project

Returns:
null if no build directory is specified

setMainClass

void setMainClass(File f)
Sets the file that has the main method of the project (Note: should point to the sourcefile of the document, not the class file)


setCreateJarFile

void setCreateJarFile(File f)
Sets the create jar file of the project.


getCreateJarFile

File getCreateJarFile()
Return the create jar file for the project. If not in project mode, returns 0.


setCreateJarFlags

void setCreateJarFlags(int f)
Sets the create jar flags of the project.


getCreateJarFlags

int getCreateJarFlags()
Return the create jar flags for the project. If not in project mode, returns null.


getProjectFiles

File[] getProjectFiles()
Return all files saved as source files in the project file. If not in project mode, returns null.


inProject

boolean inProject(File f)
Returns true the given file is in the current project file.


isAuxiliaryFile

boolean isAuxiliaryFile(File f)
Returns:
true if the file is a project auxiliary file

isProjectChanged

boolean isProjectChanged()
Returns true if in project mode and the current project file has changed.


setProjectChanged

void setProjectChanged(boolean changed)
Sets that the project state is no longer a snapshot of the open project.


cleanBuildDirectory

void cleanBuildDirectory()
Cleans the build directory.


getClassFiles

List<File> getClassFiles()
Returns:
a list of class files.

getExtraClassPath

Iterable<File> getExtraClassPath()
Returns a collection of classpath entries specific to the current project.

Returns:
the project's extra classpath

setExtraClassPath

void setExtraClassPath(Iterable<File> cp)
Sets the list of project-specific classpath entries.


addExcludedFile

void addExcludedFile(File f)
Excludes file from the project.


isExcludedFile

boolean isExcludedFile(File f)
Returns true if the file is excluded from the current project


getExclFiles

File[] getExclFiles()
Return an array of the files excluded from the current project


removeExcludedFile

void removeExcludedFile(File f)
Remove the specified file from the files excluded from the current project


setExcludedFiles

void setExcludedFiles(File[] fs)
Sets the array of files excluded from the current project


getAutoRefreshStatus

boolean getAutoRefreshStatus()

setAutoRefreshStatus

void setAutoRefreshStatus(boolean b)