Package com.iizigo.project
Class ModuleModel
java.lang.Object
com.iizigo.project.ModuleModel
The IIZI Module Model.
- Author:
- Christopher Mindus
- Field SummaryFieldsModifier and TypeFieldDescription- static final StringThe marker ID for load file problems.- static final StringThe marker ID for missing project resource problems.- static final StringThe "iiziModule" module directory name, where files are stored.- static final StringThe ".iiziModuleProject" file name containing all settings.- final IFileThe IIZI Module settings file, null when creating new model project.- static final StringThe marker ID for resource name problems.
- Method SummaryModifier and TypeMethodDescription- boolean- addCommitRefactoringListener- (ICommitRefactoring listener, RefactoringOperation... operations) Adds a listener for Commit Refactoring in this project.- void- addPlugin- (PluginDescriptor pd, boolean doCreateDir) Adds a plug-in to this Module project instance, without creating anything.- booleanAdds a new resource listener when a resource is added or removed.- voidCleans the property error markers from this project and rebuilds them.- voidClears the installed font map cache.- static ModuleModelGets the module model from a project if possible.Gets the application distribution file.Gets the module folder for assets.Gets the base module folder "iiziModule".Gets the Java projects that are included on the classpath of this project.- Object[]Gets the children (just one) for the root container for the Common Navigator.Gets the module folder for image definitions.Gets all the installed fonts in this project and all projects referenced.Gets the map of installed fonts.Gets the Java Project instance for this project.Gets the property container for a project.Gets a KStringInfoProvider initialized for the module model.Gets the module folder for a plug-in.- getModuleFolder- (String type) Gets the array of folders defined for the module project.Gets the array of folders defined for the module project.- String[]Gets the Modules that are referenced by this Module project.Gets the Projects that are referenced by this Module project.Gets the module folder for panels.Gets the associated plug-ins.Gets the project.- IProject[]- getProjectReferences- (boolean onlyModuleProjects) Gets the Projects that are referenced by this Module project.- IFolder[]Gets the array of folders required to be created.Gets the designer properties of the module models that are referenced by this Module project.Gets the root container.Gets the module folder for selectors.Gets the Module Project Settings.Gets the module folder for styles.Gets the fonts installed in this module project.Gets the module folder for text tables.Gets the module folder for VirtualSpace.- booleanVerifies if project has completed loading and it is not disposed of.- booleanChecks if the Module project is disposed of.- booleanChecks if the file is the module settings file.- boolean- isOnClassPath- (IResource resource) Checks if a resource is inside the classpath of this Module project.- booleanChecks if a plug-in is active in the Module project.- isReservedResource- (IResource resource) Checks if the resource is a reserved resource.- void- markModuleReference- (ModuleModel module) Marks a Module as being used by or referenced in this project.- void- markModuleReference- (String moduleName) Marks a Module as being used by or referenced in this project.- booleanRemoves a listener for Commit Refactoring in this project.- intRemoves the specified plug-in from this project.- booleanRemoves a new resource listener when a resource is added or removed.- voidSaves the Java classpath of a project in order to be able to use it in the Server.- voidSaves the settings when possible.- saveSettings- (Shell shell) Saves the module settings.- voidSchedules a full build of a project.- booleanValidates the presence of the required project resources and the problem markers for the project.
- Field Details- RESOURCE_NAME_MARKER_IDThe marker ID for resource name problems.- See Also:
 
- LOAD_FILE_MARKER_IDThe marker ID for load file problems.- See Also:
 
- MISSING_RESOURCE_MARKER_IDThe marker ID for missing project resource problems.- See Also:
 
- MODULE_DIRECTORY_NAMEThe "iiziModule" module directory name, where files are stored.- See Also:
 
- MODULE_SETTINGS_FILE_NAMEThe ".iiziModuleProject" file name containing all settings.- See Also:
 
- moduleSettingsThe IIZI Module settings file, null when creating new model project.
 
- Method Details- fromGets the module model from a project if possible.- Parameters:
- project- The project.
- Returns:
- The module model if the project is an IIZI Module project, null otherwise.
 
- getAppDistributionFileGets the application distribution file.- Returns:
- The file, but it may not exist!
 
- getJavaPropCnrGets the property container for a project.- Returns:
- The Java property container.
 
- getSettingsGets the Module Project Settings.
- isReservedResourceChecks if the resource is a reserved resource.- Parameters:
- resource- File or Folder to check.
- Returns:
- The error string or null for no error. An error is returned if it's a project or the workspace root.
 
- isDisposedpublic boolean isDisposed()Checks if the Module project is disposed of.
- getJavaProjectGets the Java Project instance for this project.
- addPluginAdds a plug-in to this Module project instance, without creating anything. If a folder doesn't exist, CoreException is thrown.- Parameters:
- pd- The plug-in description.
- doCreateDir- Flag to create the directory of the plug-in, if it is directory/file plug-in.
- Throws:
- CoreException- For errors.
 
- getPluginsGets the associated plug-ins.- Returns:
- The array of plug-in's.
 
- removePluginRemoves the specified plug-in from this project. This can only be done if no files are present in the folder.- Parameters:
- pd- The plug-in description.
- Returns:
- 0=OK, 1=not active, 2=Can't remove: directory is not empty, 3=directory error.
- Throws:
- CoreException- For errors.
 
- isPluginActiveChecks if a plug-in is active in the Module project.- Returns:
- true if the plug-in is active, false otherwise.
 
- getBaseModuleFolderGets the base module folder "iiziModule".- Returns:
- The base module folder.
 
- getVirtualSpaceModuleFolderGets the module folder for VirtualSpace.- Returns:
- The ModuleFolder instance.
 
- getPanelModuleFolderGets the module folder for panels.- Returns:
- The ModuleFolder instance.
 
- getStyleModuleFolderGets the module folder for styles.- Returns:
- The ModuleFolder instance.
 
- getSelectorModuleFolderGets the module folder for selectors.- Returns:
- The ModuleFolder instance.
 
- getImageDefinitionModuleFolderGets the module folder for image definitions.- Returns:
- The ModuleFolder instance.
 
- getAssetsModuleFolderGets the module folder for assets.- Returns:
- The ModuleFolder instance.
 
- getTextTableModuleFolderGets the module folder for text tables.- Returns:
- The ModuleFolder instance.
 
- getModuleFolderGets the array of folders defined for the module project.- Parameters:
- type- The type, e.g. "panel".
- Returns:
- The ModuleFolder for the type, null if not found.
 
- getModuleFolderGets the module folder for a plug-in.- Parameters:
- pd- The plug-in descriptor.
- Returns:
- The ModuleFolder for the type, null if defined for the project, or the plug-in is not directory based.
 
- getModuleFoldersGets the array of folders defined for the module project.- Returns:
- A new array of the ModuleFolder's.
 
- getProjectGets the project.- Returns:
- The Eclipse project.
 
- getRootContainerGets the root container.- Returns:
- The root property container for the Module.
 
- getKStringInfoProviderGets a KStringInfoProvider initialized for the module model.- Returns:
- A KStringInfoProvider instance.
 
- getCNChildrenGets the children (just one) for the root container for the Common Navigator.- Returns:
- The children to display for the Common Navigator.
 
- hasCompletedLoadingpublic boolean hasCompletedLoading()Verifies if project has completed loading and it is not disposed of.- Returns:
- true if loading has completed and the project is not closed or disposed of.
 
- validateProjectResourcePresencepublic boolean validateProjectResourcePresence()Validates the presence of the required project resources and the problem markers for the project.- Returns:
- true for OK, false for error.
 
- getQuickFixCreateFoldersGets the array of folders required to be created.- Returns:
- The array of folders that needs to be created, null for none (i.e. OK).
 
- saveSettingspublic void saveSettings()Saves the settings when possible. If the workspace is locked, the operation is postponed in a Job.
- saveSettingsSaves the module settings.- Parameters:
- shell- Shell used for error message, null for logging only.
- Returns:
- null for success, otherwise the exception.
 
- isModuleSettingsFileChecks if the file is the module settings file.- Parameters:
- file- The file to test with.
- Returns:
- true if it's the module settings file, false otherwise.
 
- isOnClassPathChecks if a resource is inside the classpath of this Module project.- Parameters:
- resource- The resource to check.
- Returns:
- true if it's on the classpath, false otherwise.
 
- markModuleReferenceMarks a Module as being used by or referenced in this project.- Parameters:
- module- The module to mark as referenced.
 
- markModuleReferenceMarks a Module as being used by or referenced in this project.- Parameters:
- moduleName- The module name to mark as referenced.
 
- getModuleNameReferencesGets the Modules that are referenced by this Module project.- Returns:
- An new (cloned) array of all the referenced Module names.
 
- getProjectReferencesGets the Projects that are referenced by this Module project.- Parameters:
- onlyModuleProjects- Flag for only module projects, or if Java projects should be added too.
- Returns:
- An new (cloned) array of all the referenced Module Projects. The projects can be both Java projects as well as Module projects.
 
- getModuleProjectReferencesGets the Projects that are referenced by this Module project. This module is included first.- Returns:
- An new (cloned) array of all the referenced Module Projects.
 
- getReferencedDesignerPropModulesGets the designer properties of the module models that are referenced by this Module project. This project's designer property always comes first.- Returns:
- An new (cloned) array of all the Module Project's designer properties.
 
- getBuildPathProjectsGets the Java projects that are included on the classpath of this project.- Returns:
- A new list of projects on the build path.
 
- addCommitRefactoringListenerpublic boolean addCommitRefactoringListener- (ICommitRefactoring listener, RefactoringOperation... operations) Adds a listener for Commit Refactoring in this project.- Parameters:
- listener- The listener.
- operations- The operations of interest.
- Returns:
- true if successful, false if listener was already present.
 
- removeCommitRefactoringListenerRemoves a listener for Commit Refactoring in this project.- Parameters:
- listener- The listener.
- Returns:
- true if successful, false if listener was not present.
 
- scheduleCleanAndRebuildpublic void scheduleCleanAndRebuild()Schedules a full build of a project.
- cleanRebuildPropertyMarkerspublic void cleanRebuildPropertyMarkers()Cleans the property error markers from this project and rebuilds them.
- saveClasspathpublic void saveClasspath()Saves the Java classpath of a project in order to be able to use it in the Server.
- getInstalledFontsGets all the installed fonts in this project and all projects referenced.- Returns:
- A new list with the font files instances.
 
- getStylesFontFilesGets the fonts installed in this module project.- Returns:
- A new array of font files, only from the styles font faces.
 
- getInstalledFontsMapGets the map of installed fonts. This map is cached and a read-only copy is returned. The key in the map is the font family name. If a font family has several styles/weights defined, the normal weight and style is used the EditorFontFiles instance.- Returns:
- An map of the installed fonts. Do not modify this map or the List value(s), it is a shared instance.
 
- clearInstalledFontsMapCachepublic void clearInstalledFontsMapCache()Clears the installed font map cache.
- addResourceListenerAdds a new resource listener when a resource is added or removed. Calling this method multiple times with the same listener will have no effect (but to return false).- Parameters:
- listener- The listener to add.
- Returns:
- true if the listener was added, false otherwise.
- Throws:
- NullPointerException- If the listener is- null.
 
- removeResourceListenerRemoves a new resource listener when a resource is added or removed.- Parameters:
- listener- The listener to remove.
- Returns:
- true if listener is successfully removed, false otherwise.