Package com.iizigo.project
Class ProjectManager
java.lang.Object
com.iizigo.project.ProjectManager
- All Implemented Interfaces:
- EventListener,- org.eclipse.core.resources.IResourceChangeListener
public class ProjectManager extends Object implements org.eclipse.core.resources.IResourceChangeListener
The Project Manager manages all IIZI projects, handles job scheduling, notification, referencing, etc.
- Author:
- Christopher Mindus
- Field SummaryFields- Fields inherited from interface org.eclipse.core.resources.IResourceChangeListener- PROPERTY_EVENT_MASK
- Method SummaryModifier and TypeMethodDescription- void- dispose()Disposes of the Project Manager.Gets the first project.- static ProjectManagerGets the single instance of the Project Manager.Gets the loaded Module models projects.- String[]Gets the names of all the loaded module projects.- getModuleModel- (GProp<?> gp) Gets the IIZI Module Model from a property.- getModuleModel- (String projectName) Gets a registered IIZI Module Model from a project name.- getModuleModel- (org.eclipse.core.resources.IProject project) Gets the IIZI Module Model from a project.- getModuleModel- (org.eclipse.core.resources.IResource resource) Gets the IIZI Module Model from a resource.- getOnClassPathModules- (org.eclipse.core.resources.IResource resource) Gets the Module projects that a resource is inside the classpath of.- org.eclipse.core.resources.IProject- getProject- (String name) Gets a project from a name.- isOnClassPath- (org.eclipse.core.resources.IResource resource) Checks if a resource is inside the classpath of the Module projects.- booleanChecks if the Project Manager is currently processing workspace modifications.- boolean- isRegistered- (String projectName) Checks if a project is registered with the Project Manager.- boolean- isRegistered- (org.eclipse.core.resources.IProject project) Checks if a project is registered with the Project Manager.- booleanChecks if the Project Manager is in Starting up state.- void- onBuildEnd- (org.eclipse.core.resources.IProject project) Informs the Project Manager that a build process has completed, with or without error.- void- onBuildStart- (org.eclipse.core.resources.IProject project) Informs the Project Manager that a build process is starting.- void- onPluginRegistered- (String pluginID) Called from the plug-in manager when a plug-in is registered.- void- onWorkspaceChange- (RefactoringOperation operation) Called for workspace changes, new/rename/remove file/folder when processing delta-changes for the workspace.- void- resourceChanged- (org.eclipse.core.resources.IResourceChangeEvent event) A resource event in the workspace occurred.- voidStart-up of the Project Manager.- void- triggerReferenceValidation- (org.eclipse.core.resources.IProject project, boolean onlyJava, boolean doReCheck) Triggers a project for reference validation.- voidTriggers all Java projects (i.e.- voidTriggers all projects for reference validation, e.g.- booleanValidates workspace files to see if there are references to "wild" properties.
- Field Details- PROJECT_JOBSThe Job family for IIZI project jobs.- See Also:
 
 
- Method Details- getInstanceGets the single instance of the Project Manager.- Returns:
- The Project Manager.
 
- disposepublic void dispose()Disposes of the Project Manager.- ONLY CALLED FROM - com.iizigo.Activator, no one else.
- isStartingUppublic boolean isStartingUp()Checks if the Project Manager is in Starting up state.
- startupStart-up of the Project Manager.- THIS METHOD SHOULD ONLY BE CALLED ONCE FROM THE PLUG-IN STARTUP CLASS. 
- onPluginRegisteredCalled from the plug-in manager when a plug-in is registered. All projects that are in open-pending state are checked for the possibility of being opened.- Parameters:
- pluginID- The plug-in ID.
 
- getFirstModuleModelProjectGets the first project.- Returns:
- null For none.
 
- getLoadedModuleProjectsGets the names of all the loaded module projects.
- getLoadedModuleModelsGets the loaded Module models projects.- Returns:
- An array of all loaded Module model projects.
 
- isOnClassPathChecks if a resource is inside the classpath of the Module projects.- Parameters:
- resource- The resource to check.
- Returns:
- The first found Module project it belongs to, null if it doesn't belong to any.
 
- getOnClassPathModulesGets the Module projects that a resource is inside the classpath of.- Parameters:
- resource- The resource to check.
- Returns:
- The list of Module project it belongs to, null if it doesn't belong to any.
 
- getProjectGets a project from a name.- Parameters:
- name- The project name.
- Returns:
- The project if name is valid and present and opened, null otherwise.
 
- resourceChangedpublic void resourceChanged- (org.eclipse.core.resources.IResourceChangeEvent event) A resource event in the workspace occurred.- Resource change events describe changes to resources. - There are currently five different types of resource change events: - Before-the-fact batch reports of arbitrary creations, deletions and modifications to one or more resources expressed as a hierarchical resource delta. Event type is PRE_BUILD, and getDelta returns the hierarchical delta rooted at the workspace root. The getBuildKind method returns the kind of build that is about to occur, and the getSource method returns the scope of the build (either the workspace or a single project). These events are broadcast to interested parties immediately before each build operation. If auto-building is not enabled, these events still occur at times when auto-build would have occurred. The workspace is open for change during notification of these events. The delta reported in this event cycle is identical across all listeners registered for this type of event. Resource changes attempted during a PRE_BUILD callback must be done in the thread doing the notification.
- After-the-fact batch reports of arbitrary creations, deletions and modifications to one or more resources expressed as a hierarchical resource delta. Event type is POST_BUILD, and getDelta returns the hierarchical delta rooted at the workspace root. The getBuildKind method returns the kind of build that occurred, and the getSource method returns the scope of the build (either the workspace or a single project). These events are broadcast to interested parties at the end of every build operation. If auto-building is not enabled, these events still occur at times when auto-build would have occurred. The workspace is open for change during notification of these events. The delta reported in this event cycle is identical across all listeners registered for this type of event. Resource changes attempted during a POST_BUILD callback must be done in the thread doing the notification.
- After-the-fact batch reports of arbitrary creations, deletions and modifications to one or more resources expressed as a hierarchical resource delta. Event type is POST_CHANGE, and getDelta returns the hierarchical delta. The resource delta is rooted at the workspace root. These events are broadcast to interested parties after a set of resource changes and happen whether or not auto-building is enabled. The workspace is closed for change during notification of these events. The delta reported in this event cycle is identical across all listeners registered for this type of event.
- Before-the-fact reports of the impending closure of a single project. Event type is PRE_CLOSE, and getResource returns the project being closed. The workspace is closed for change during notification of these events.
- Before-the-fact reports of the impending deletion of a single project. Event type is PRE_DELETE, and getResource returns the project being deleted. The workspace is closed for change during notification of these events.
- Before-the-fact reports of the impending refresh of a single project or the workspace. Event type is PRE_REFRESH and the getSource method returns the scope of the refresh (either the workspace or a single project). If the event is fired by a project refresh the getResource method returns the project being refreshed. The workspace is closed for changes during notification of these events.
- In order to handle additional event types that may be introduced in future releases of the platform, clients should do not write code that presumes the set of event types is closed.
 - Specified by:
- resourceChangedin interface- org.eclipse.core.resources.IResourceChangeListener
 
- isRegisteredpublic boolean isRegistered- (org.eclipse.core.resources.IProject project) Checks if a project is registered with the Project Manager.- Parameters:
- project- The project.
- Returns:
- true if this is a valid IIZI Module Model project, false otherwise.
 
- isRegisteredChecks if a project is registered with the Project Manager.- Parameters:
- projectName- The project.
- Returns:
- true if this is a valid IIZI Module Model project, false otherwise.
 
- getModuleModelGets a registered IIZI Module Model from a project name.- Parameters:
- projectName- The project name.
- Returns:
- The Module Model instance, or null if not registered/valid.
 
- onWorkspaceChangeCalled for workspace changes, new/rename/remove file/folder when processing delta-changes for the workspace. Do NOT call this method otherwise.
- validateWorkspaceFilespublic boolean validateWorkspaceFiles()Validates workspace files to see if there are references to "wild" properties. This is used for debugging and is VERY lengthy. Output to System.err and System.out is also performed.- Returns:
- true for success, false for failure.
 
- getModuleModelGets the IIZI Module Model from a resource.- Parameters:
- resource- Any resource (even null).
- Returns:
- The Module Model instance of the project; or, if the project is closed, doesn't have the IIZI Module Nature or is not registered with the ProjectManager, this method returns null.
 
- getModuleModelGets the IIZI Module Model from a property.- Parameters:
- gp- The property (or null for none).
- Returns:
- The Module Model instance, or null if not found.
 
- getModuleModelGets the IIZI Module Model from a project.- Parameters:
- project- The project (or null).
- Returns:
- The Module Model instance of the project; or, if the project is closed, doesn't have the IIZI Module Nature or is not registered with the ProjectManager, this method returns null.
 
- onBuildStartpublic void onBuildStart- (org.eclipse.core.resources.IProject project) Informs the Project Manager that a build process is starting. This should be called for full or incremental builds.- Parameters:
- project- The project build built, null for workspace.
 
- onBuildEndpublic void onBuildEnd- (org.eclipse.core.resources.IProject project) Informs the Project Manager that a build process has completed, with or without error. This should be called for full or incremental builds.- Parameters:
- project- The project build built, null for workspace.
 
- isProcessingWorkspaceModificationspublic boolean isProcessingWorkspaceModifications()Checks if the Project Manager is currently processing workspace modifications.
- triggerReferenceValidationAllProjectspublic void triggerReferenceValidationAllProjects()Triggers all projects for reference validation, e.g. at project open/close/rename.
- triggerReferenceValidationAllJavaProjectspublic void triggerReferenceValidationAllJavaProjects()Triggers all Java projects (i.e. not Module projects) for reference validation, e.g. at project open/close/rename.
- triggerReferenceValidationpublic void triggerReferenceValidation- (org.eclipse.core.resources.IProject project, boolean onlyJava, boolean doReCheck) Triggers a project for reference validation.- Parameters:
- project- The Module needing reference validation.
- onlyJava- Only if Java project(s).
- doReCheck- If a re-check of all references must be done.