org.formaria.editor.project
Class EditorProjectManager

java.lang.Object
  extended by org.formaria.aria.ProjectManager
      extended by org.formaria.editor.project.EditorProjectManager

public class EditorProjectManager
extends ProjectManager

A central repository for EditorProjects. Several projects may be supported within a single instance of the Aria

Since:
1.03

Copyright (c) Formaria Ltd., 2002-2007

$Revision: 1.23 $

License: see License.txt


Field Summary
protected static java.util.HashMap<java.lang.String,CodeHelper> codeHelpers
           
protected static java.util.HashMap<java.lang.String,EditorProject> editorProjects
           
 
Fields inherited from class org.formaria.aria.ProjectManager
currentProject, globalObjects, projects
 
Constructor Summary
EditorProjectManager()
           
 
Method Summary
static void addProject(EditorProject cp)
           
static void addProjectListener(java.lang.String key, ProjectListener listener, boolean overwrite)
          Add a reference to a module that is interested in knowing a project has loaded.
static void checkProject(EditorProject cp)
           
static java.lang.ClassLoader getClassLoader(java.lang.String name)
          Get a class loader, such as a module class loader by name.
static java.util.HashMap<java.lang.String,CodeHelper> getCodeHelpers()
          Get a list of static objects/resources
static Project getCurrentProject()
          Get the current or active project
static Project getCurrentProject(java.lang.String path)
          Get the current or active project for the specified path
static java.lang.ClassLoader getDefaultClassLoader()
          Get a reference to teh default classloader
static IEditorUtility getEditorUtility()
           
static LicenseManager getLicenseManager()
           
static int getNumProjects()
          Get the number of loaded projects maintained by this manager.
static EditorProject getProject(java.lang.ClassLoader cl, java.lang.String ariaFile, java.lang.String startupFile, boolean openProject)
          Get the project on the specified path, opening the project if it is not already open.
static EditorProject getProject(java.lang.String pathName)
          Get the project on the specified path, opening the project if it is not already open.
static java.io.File getProjectFile(java.io.File f)
          Get the name of the project, recursing up through the directories to find a file with a .aria extension if possible
static java.util.HashMap<java.lang.String,EditorProject> getProjects()
          Get a list of projects
static boolean isUserRegistered(java.lang.ClassLoader cl, java.lang.String moduleName)
           
static boolean isUserRegistered(java.lang.String moduleName)
           
static void projectInitialized(EditorProject target)
          A project has just been created - inform any IDE modules of this event
static void projectLoaded(EditorProject cp)
          A project has just been loaded - inform any IDE modules of this event
static void projectUpdated(EditorProject cp)
           
static void resetProject(java.lang.String moduleName)
           
static void saveProject(EditorProject cp)
           
static void setClassLoader(java.lang.String name, java.lang.ClassLoader cl)
          Set a class loader, such as a module class loader by name.
static boolean setCurrentProject(java.lang.String path)
          Set the current or active project for the specified path
static void setDefaultClassLoader(java.lang.ClassLoader cl)
          Set the default class loader
static void setEditorUtility(IEditorUtility eu, boolean isEclipse)
           
static void setLicenseManager(LicenseManager licensManager)
           
 
Methods inherited from class org.formaria.aria.ProjectManager
addProject, getCurrentProject, getModel, getObject, getPageManager, getProjectNames, getStyleManager, getXmlParserFactory, removeObject, setCurrentProject, setObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

codeHelpers

protected static java.util.HashMap<java.lang.String,CodeHelper> codeHelpers

editorProjects

protected static java.util.HashMap<java.lang.String,EditorProject> editorProjects
Constructor Detail

EditorProjectManager

public EditorProjectManager()
Method Detail

getNumProjects

public static int getNumProjects()
Get the number of loaded projects maintained by this manager.


addProject

public static void addProject(EditorProject cp)

addProjectListener

public static void addProjectListener(java.lang.String key,
                                      ProjectListener listener,
                                      boolean overwrite)
Add a reference to a module that is interested in knowing a project has loaded.


checkProject

public static void checkProject(EditorProject cp)

saveProject

public static void saveProject(EditorProject cp)

projectUpdated

public static void projectUpdated(EditorProject cp)

projectInitialized

public static void projectInitialized(EditorProject target)
A project has just been created - inform any IDE modules of this event

Parameters:
cp - the project that has just been created

projectLoaded

public static void projectLoaded(EditorProject cp)
A project has just been loaded - inform any IDE modules of this event

Parameters:
cp - the project that has just been loaded

resetProject

public static void resetProject(java.lang.String moduleName)

getProject

public static EditorProject getProject(java.lang.String pathName)
Get the project on the specified path, opening the project if it is not already open.


getProjectFile

public static java.io.File getProjectFile(java.io.File f)
Get the name of the project, recursing up through the directories to find a file with a .aria extension if possible

Parameters:
f - the initial file

getProject

public static EditorProject getProject(java.lang.ClassLoader cl,
                                       java.lang.String ariaFile,
                                       java.lang.String startupFile,
                                       boolean openProject)
Get the project on the specified path, opening the project if it is not already open.


getCurrentProject

public static Project getCurrentProject()
Get the current or active project

Returns:
the current project

getCurrentProject

public static Project getCurrentProject(java.lang.String path)
Get the current or active project for the specified path

Parameters:
path - the path on which the project may be located
Returns:
the current project

setCurrentProject

public static boolean setCurrentProject(java.lang.String path)
Set the current or active project for the specified path

Parameters:
path - the path on which the project may be located

getProjects

public static java.util.HashMap<java.lang.String,EditorProject> getProjects()
Get a list of projects


getCodeHelpers

public static java.util.HashMap<java.lang.String,CodeHelper> getCodeHelpers()
Get a list of static objects/resources

Returns:
a static table of code helpers

getDefaultClassLoader

public static java.lang.ClassLoader getDefaultClassLoader()
Get a reference to teh default classloader


setDefaultClassLoader

public static void setDefaultClassLoader(java.lang.ClassLoader cl)
Set the default class loader


setClassLoader

public static void setClassLoader(java.lang.String name,
                                  java.lang.ClassLoader cl)
Set a class loader, such as a module class loader by name. When a project is later loaded each such classloader will be added to the project as a custom class loader

Parameters:
name - the name by which the loader is referenced
cl - the classloader

getClassLoader

public static java.lang.ClassLoader getClassLoader(java.lang.String name)
Get a class loader, such as a module class loader by name.

Parameters:
name - the name by which the loader is referenced
Returns:
cl the classloader

setEditorUtility

public static void setEditorUtility(IEditorUtility eu,
                                    boolean isEclipse)

getEditorUtility

public static IEditorUtility getEditorUtility()

isUserRegistered

public static boolean isUserRegistered(java.lang.ClassLoader cl,
                                       java.lang.String moduleName)

isUserRegistered

public static boolean isUserRegistered(java.lang.String moduleName)

getLicenseManager

public static LicenseManager getLicenseManager()

setLicenseManager

public static void setLicenseManager(LicenseManager licensManager)