org.prorefactor.refactor
Class RefactorSession

java.lang.Object
  extended by org.prorefactor.refactor.RefactorSession

public class RefactorSession
extends java.lang.Object

This "Singleton" class provides an interface to an org.prorefactor.refactor session.


Method Summary
 void disableParserListing()
           
 void enableParserListing()
           
 ApplicationSettings getAppSettings()
           
static java.lang.String getAppSettingsFilename()
           
static java.lang.String getContextDirName()
          The directory that the "prorefactor" config and data files directory is to be found in.
 IDE getIDE()
           
 java.lang.String getIndentString()
          Get a string for the indent for the current project.
static RefactorSession getInstance()
          Get the Singleton instance.
static java.lang.String getListingFileName()
          Get the listing file name, makes sure the directory exists.
static java.lang.String getMessagesFileName()
           
 ProgressProjectSettings getProgressSettings()
           
static java.lang.String getProgressSettingsFilename(java.lang.String projectName)
           
 java.lang.String getProjectName()
          Returns the name of the currently loaded project
static java.lang.String getProjectsDirName()
          Returns instance context directory plus "prorefactor/projects/".
 ProparseProjectSettings getProparseSettings()
          Returns the Settings for the currently loaded project
static java.lang.String getProparseSettingsFilename(java.lang.String projectName)
           
static java.lang.String getProrefactorDirName()
          Returns the instance context directory plus "prorefactor/"
 java.lang.String getProRefactorProjectDir()
           
 java.lang.String getProRefactorProjectDir(java.lang.String inputProjectName)
           
 java.io.File getRollbackDir()
          Get the rollback directory, creates it if it doesn't exist.
static java.lang.String getRollbackDirName()
          Get the name of the rollback directory, creates it if it doesn't exist.
 java.io.File getTempDir()
          Get the temp directory, creates it if it doesn't exist.
static void invalidateCurrentSettings()
          Make sure that Proparse's configuration gets reloaded
 void loadProject(java.lang.String nameToLoad)
          Only loads the project's settings if it's not already the current project
 void loadProjectForced(java.lang.String nameToLoad)
          Loads the project, whether it's already loaded or not
 void loadProjectForFile(java.io.File file)
          If you don't know what project a file is in, then use this.
 void setContextDirName(java.lang.String contextDirName)
          The directory that the "prorefactor" config and data files directory is to be found in.
 RefactorSession setIDE(IDE ide)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

disableParserListing

public void disableParserListing()

enableParserListing

public void enableParserListing()

getAppSettings

public ApplicationSettings getAppSettings()

getAppSettingsFilename

public static java.lang.String getAppSettingsFilename()

getContextDirName

public static java.lang.String getContextDirName()
The directory that the "prorefactor" config and data files directory is to be found in. This static method checks to see if the RefactorSession Singleton has been instantiated, and returns the context dir from that if so, otherwise it returns an empty string. Any application which assigned the contextDirName should have done so with a trailing slash.


getIDE

public IDE getIDE()

getIndentString

public java.lang.String getIndentString()
Get a string for the indent for the current project. Returns a tab or some number of spaces (ex: " ").


getInstance

public static RefactorSession getInstance()
Get the Singleton instance.


getListingFileName

public static java.lang.String getListingFileName()
Get the listing file name, makes sure the directory exists.


getMessagesFileName

public static java.lang.String getMessagesFileName()

getProjectsDirName

public static java.lang.String getProjectsDirName()
Returns instance context directory plus "prorefactor/projects/".


getProgressSettings

public ProgressProjectSettings getProgressSettings()

getProgressSettingsFilename

public static java.lang.String getProgressSettingsFilename(java.lang.String projectName)

getProjectName

public java.lang.String getProjectName()
Returns the name of the currently loaded project


getProparseSettings

public ProparseProjectSettings getProparseSettings()
Returns the Settings for the currently loaded project


getProparseSettingsFilename

public static java.lang.String getProparseSettingsFilename(java.lang.String projectName)

getProrefactorDirName

public static java.lang.String getProrefactorDirName()
Returns the instance context directory plus "prorefactor/"


getProRefactorProjectDir

public java.lang.String getProRefactorProjectDir()

getProRefactorProjectDir

public java.lang.String getProRefactorProjectDir(java.lang.String inputProjectName)

getRollbackDir

public java.io.File getRollbackDir()
Get the rollback directory, creates it if it doesn't exist.


getRollbackDirName

public static java.lang.String getRollbackDirName()
Get the name of the rollback directory, creates it if it doesn't exist.


getTempDir

public java.io.File getTempDir()
Get the temp directory, creates it if it doesn't exist.


invalidateCurrentSettings

public static void invalidateCurrentSettings()
Make sure that Proparse's configuration gets reloaded


loadProject

public void loadProject(java.lang.String nameToLoad)
                 throws java.lang.Exception
Only loads the project's settings if it's not already the current project

Throws:
java.lang.Exception

loadProjectForced

public void loadProjectForced(java.lang.String nameToLoad)
                       throws java.lang.Exception
Loads the project, whether it's already loaded or not

Throws:
java.lang.Exception

loadProjectForFile

public void loadProjectForFile(java.io.File file)
                        throws java.lang.Exception
If you don't know what project a file is in, then use this. Will continue to use the current project if the file is in it, otherwise the first project found to contain the file will be loaded.

Throws:
java.lang.Exception

setContextDirName

public void setContextDirName(java.lang.String contextDirName)
The directory that the "prorefactor" config and data files directory is to be found in. Should never be null. Important: Calling application is responsible for appending a trailing slash on the string.


setIDE

public RefactorSession setIDE(IDE ide)


Copyright © 2008 Joanju Software. All Rights Reserved.