edu.rice.cs.drjava.model
Interface FileGroupingState

All Known Implementing Classes:
AbstractGlobalModel.FlatFileGroupingState, AbstractGlobalModel.ProjectFileGroupingState

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 AbstractGlobalModel where they are defined as anonymous inner classes.


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

java.io.File getProjectFile()
Returns the current project file

Returns:
null if not currently in a project

getProjectRoot

java.io.File getProjectRoot()
Returns the project source root

Returns:
null if no build directory is specified

setProjectFile

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


setProjectRoot

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


addAuxFile

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


remAuxFile

void remAuxFile(java.io.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

java.io.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(java.io.File f)
Sets the current build directory.


getWorkingDirectory

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


setWorkingDirectory

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


getMainClass

java.lang.String getMainClass()
Returns the name of the class that has the main method of the project

Returns:
null if no build directory is specified

setMainClass

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


setCreateJarFile

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


getCreateJarFile

java.io.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

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


inProject

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


isAuxiliaryFile

boolean isAuxiliaryFile(java.io.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

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

getExtraClassPath

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

Returns:
the project's extra classpath

setExtraClassPath

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


addExcludedFile

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


isExcludedFile

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


getExclFiles

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


removeExcludedFile

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


setExcludedFiles

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


getAutoRefreshStatus

boolean getAutoRefreshStatus()

setAutoRefreshStatus

void setAutoRefreshStatus(boolean b)

getPreferencesStoredInProject

java.util.Map<OptionParser<?>,java.lang.String> getPreferencesStoredInProject()
Returns:
the stored preferences.

setPreferencesStoredInProject

void setPreferencesStoredInProject(java.util.Map<OptionParser<?>,java.lang.String> sp)

setCustomManifest

void setCustomManifest(java.lang.String manifest)
Sets the custom manifest on the project


getCustomManifest

java.lang.String getCustomManifest()
Gets the custom manifest on the project