|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.ObjectEditModelNature
org.eclipse.wst.common.componentcore.ModuleCoreNature
Allows projects to support flexible project structures. The ModuleCoreNature manages the configuration of a module structural builder that prepares WorkbenchModules for deployment.
To determine if a project supports flexible project structures, check for the existence of the ModuleCoreNature:
(ModuleCoreNature.getModuleCoreNature(project) != null)
If the project has a ModuleCoreNature, then the project supports flexible module structures.
In general, clients are expected to use the utility methods available on this class to acquire
the ModuleCoreNature instance from a given project (getModuleCoreNature(IProject)
or to make a flexible project flexible by adding a ModuleCoreNature (
addModuleCoreNatureIfNecessary(IProject, IProgressMonitor)).
Each ModuleCoreNature from a given project can provide access to the
org.eclipse.wst.common.modulecore.ModuleStructuralModel of the project.
org.eclipse.wst.common.modulecore.ModuleStructuralModel is a subclass of
org.eclipse.wst.common.internal.emfworkbench.integration.EditModel that manages
resources associated with the Module Structural Metamodel. As an EditModel, the
org.eclipse.wst.common.modulecore.ModuleStructuralModel references EMF resources,
that contain EMF models -- in this case, the EMF model of .wtpmodules file.
Clients are encouraged to use the Edit Facade pattern (via
org.eclipse.wst.common.modulecore.ArtifactEdit or one if its relevant subclasses)
to work directly with the Module Structural Metamodel.
Each ModuleCoreNature from a given project can also provide access to the
org.eclipse.wst.common.modulecore.ArtifactEditModel for each
org.eclipse.wst.common.modulecore.WorkbenchComponent contained by the project. Like
org.eclipse.wst.common.modulecore.ModuleStructuralModel,
org.eclipse.wst.common.modulecore.ArtifactEditModel is a subclass of
org.eclipse.wst.common.internal.emfworkbench.integration.EditModel that contains
EMF resources, which in turn contain the EMF models of module metadata files (such as J2EE
deployment descriptors).
The following diagram highlights the relationships of these subclasses of EditModel, and the
relationship of the EditModel to the EMF resources. In the diagram, "MetamodelResource" and
"MetamodelObject" are used as placeholders for the specific subclasses of
org.eclipse.emf.ecore.resource.Resource and org.eclipse.emf.ecore.EObject
respectively.
|
|
|
Figure 1: A component diagram of the Module Edit Models. |
Clients are encouraged to use the Edit Facade pattern (via
org.eclipse.wst.common.modulecore.ArtifactEdit or what if its relevant subclasses)
to work directly with the Module Structural Metamodel.
All EditModels have a lifecycle that must be enforced to keep the resources loaded that are in use, and to unload resources that are not in use. To access an EditModel, clients are required to supply an object token referred to as an accessor key. The accessor key allows the framework to better track which clients are using the EditModel, and to ensure that only a client which has accessed the EditModel with an accessor key may invoke save*()s on that EditModel.
StructureEdit,
StructureEdit.getStructureEditForRead(IProject),
StructureEdit.getStructureEditForWrite(IProject),
ArtifactEdit,
org.eclipse.wst.common.componentcore.ArtifactEdit#getArtifactEditForRead(WorkbenchComponent),
org.eclipse.wst.common.componentcore.ArtifactEdit#getArtifactEditForWrite(WorkbenchComponent),
Serialized Form| Field Summary | |
static java.lang.String |
VALIDATION_BUILDER_ID
|
| Fields inherited from interface org.eclipse.wst.common.componentcore.internal.util.IModuleConstants |
COMPONENT_STRUCTURAL_BUILDER_ID, COMPONENT_STRUCTURAL_DEPENDENCY_RESOLVER_ID, DEPENDENCY_GRAPH_BUILDER_ID, DEPENDENT_MODULE, J2EE_VERSION_1_2, J2EE_VERSION_1_3, J2EE_VERSION_1_4, JSP_VERSION_1_1, JSP_VERSION_1_2, JSP_VERSION_2_0, JST_APPCLIENT_MODULE, JST_CONNECTOR_MODULE, JST_EAR_MODULE, JST_EJB_MODULE, JST_UTILITY_MODULE, JST_WEB_MODULE, MODULE_NATURE_ID, MODULE_PLUG_IN_ID, PROJ_REL_JAVA_OUTPUT_PATH, SERVLET_VERSION_2_2, SERVLET_VERSION_2_3, SERVLET_VERSION_2_4, WST_WEB_MODULE, WTPMODULE_FILE_PATH |
| Constructor Summary | |
ModuleCoreNature()
|
|
| Method Summary | |
static ModuleCoreNature |
addModuleCoreNatureIfNecessary(org.eclipse.core.resources.IProject aProject,
org.eclipse.core.runtime.IProgressMonitor aMonitor)
Adds a ModuleCoreNature to the project. |
void |
configure()
This method should not be invoked by clients. |
org.eclipse.wst.common.componentcore.internal.ArtifactEditModel |
getArtifactEditModelForRead(URI aModuleURI,
java.lang.Object anAccessorKey)
Returns an ArtifactEditModel to work with the underlying content of an
individual WorkbenchComponent contained in the project. |
org.eclipse.wst.common.componentcore.internal.ArtifactEditModel |
getArtifactEditModelForWrite(URI aModuleURI,
java.lang.Object anAccessorKey)
Returns an ArtifactEditModel to work with the underlying content of an
individual WorkbenchComponent contained in the project. |
EditModel |
getExistingEditModel(java.lang.String artifactEditModelId,
java.util.Map params,
boolean isReadOnly)
|
static ModuleCoreNature |
getModuleCoreNature(org.eclipse.core.resources.IProject aProject)
Find and return the ModuleCoreNature of aProject, if available. |
org.eclipse.wst.common.componentcore.internal.ModuleStructuralModel |
getModuleStructuralModelForRead(java.lang.Object anAccessorKey)
Return a ModuleStructuralModel for read-only access.
|
org.eclipse.wst.common.componentcore.internal.ModuleStructuralModel |
getModuleStructuralModelForWrite(java.lang.Object anAccessorKey)
Return a ModuleStructuralModel for write access.
|
java.lang.String |
getNatureID()
|
ResourceSet |
getResourceSet()
This method should not be invoked by clients. |
void |
primaryContributeToContext(EMFWorkbenchContextBase aNature)
This method should not be invoked by clients. |
void |
secondaryContributeToContext(EMFWorkbenchContextBase aNature)
This method should not be invoked by clients. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.eclipse.core.resources.IProjectNature |
deconfigure, getProject, setProject |
| Field Detail |
public static final java.lang.String VALIDATION_BUILDER_ID
| Constructor Detail |
public ModuleCoreNature()
| Method Detail |
public static ModuleCoreNature getModuleCoreNature(org.eclipse.core.resources.IProject aProject)
Find and return the ModuleCoreNature of aProject, if available.
This method may return null.
aProject - An accessible project
public static ModuleCoreNature addModuleCoreNatureIfNecessary(org.eclipse.core.resources.IProject aProject,
org.eclipse.core.runtime.IProgressMonitor aMonitor)
Adds a ModuleCoreNature to the project.
This method may return null.
aProject - A accessible project.aMonitor - A progress monitor to track the time to completion
public org.eclipse.wst.common.componentcore.internal.ModuleStructuralModel getModuleStructuralModelForRead(java.lang.Object anAccessorKey)
Return a ModuleStructuralModel for read-only access.
Clients are encouraged to use ModuleCore#getModuleCoreForRead(IProject) to work
with the Module Structural Metamodels of flexible projects.
See the discussion what a ModuleStructuralModel is and how it relates to the Module Structural Metamodel .
Also see the discussion of the purpose of an accessor key .
anAccessorKey - Typically client supplies the object that invoked this method, or a proxy (
new Object()) in the case of other static methods requesting a
ModuleStructuralModel.
ModuleStructuralModelfor the project of the current nature.public org.eclipse.wst.common.componentcore.internal.ModuleStructuralModel getModuleStructuralModelForWrite(java.lang.Object anAccessorKey)
Return a ModuleStructuralModel for write access.
Clients are encouraged to use ModuleCore#getModuleCoreForWrite(IProject) to work
with the Module Structural Metamodels of flexible projects.
See the discussion what a ModuleStructuralModel is and how it relates to the Module Structural Metamodel .
Also see the discussion of the purpose of an accessor key .
anAccessorKey - Typically client supplies the object that invoked this method, or a proxy (
new Object()) in the case of other static methods requesting a
ModuleStructuralModel.
ModuleStructuralModelfor the project of the current nature.
public org.eclipse.wst.common.componentcore.internal.ArtifactEditModel getArtifactEditModelForRead(URI aModuleURI,
java.lang.Object anAccessorKey)
Returns an ArtifactEditModel to work with the underlying content of an
individual WorkbenchComponent contained in the project. ArtifactEditModels
are used to manipulate the content models for individual WorkbenchComponents. In
general, a content model will contain an EMF representation of the module's relevant
deployment descriptor, and possibly other EMF resources as well.
ArtifactEditModels that are returned from this method may not be used to modify and
persist changes to the underlying Module Content Metamodel. Clients that need to make changes
to the underlying Module Content Module, and that choose to work directly with the
ArtifactEditModel should use getArtifactEditModelForWrite(URI, Object).
Clients are encouraged to use ArtifactEdit or one of its relevant subclasses to
work with the module content model, instead of working with directly with the EditModel:
ArtifactEdit editFacade = ArtifactEdit.getArtifactEditForRead(aWorkbenchModule);
When a client is aware of the underlying type of module, more specific Edit Facades may be acquired:
WebEdit editFacade = WebEdit.getWebEditForRead(aWorkbenchModule);
If a particular Edit Facade is not applicable to the supplied WorkbenchComponent, then
null will be returned.
See the discussion what a ArtifactEditModel is and how it relates to the Module Content Metamodel .
Also see the discussion of the purpose of an accessor key .
aModuleURI - A fully qualified URI of the form "module:/resource/ anAccessorKey - Typically client supplies the object that invoked this method, or a proxy (
new Object()) in the case of other static methods requesting a
ModuleStructuralModel.
ArtifactEdit,
ArtifactEdit#getArtifactEditForRead(WorkbenchComponent)
public org.eclipse.wst.common.componentcore.internal.ArtifactEditModel getArtifactEditModelForWrite(URI aModuleURI,
java.lang.Object anAccessorKey)
Returns an ArtifactEditModel to work with the underlying content of an
individual WorkbenchComponent contained in the project. ArtifactEditModels
are used to manipulate the content models for individual WorkbenchComponents. In
general, a content model will contain an EMF representation of the module's relevant
deployment descriptor, and possibly other EMF resources as well.
ArtifactEditModels that are returned from this method may be used to modify and
persist changes to the underlying Module Content Metamodel. For clients that do not expect to
make modifications are encouraged to use getArtifactEditModelForRead(URI, Object)
instead.
Clients are encouraged to use ArtifactEdit or one of its relevant subclasses to
work with the module content model, instead of working with directly with the EditModel:
ArtifactEdit editFacade = ArtifactEdit.getArtifactEditForWrite(aWorkbenchModule);
When a client is aware of the underlying type of module, more specific Edit Facades may be acquired:
WebEdit editFacade = WebEdit.getWebEditForWrite(aWorkbenchModule);
If a particular Edit Facade is not applicable to the supplied WorkbenchComponent, then
null will be returned.
See the discussion what a ArtifactEditModel is and how it relates to the Module Content Metamodel .
Also see the discussion of the purpose of an accessor key .
aModuleURI - A fully qualified URI of the form "module:/resource/ anAccessorKey - Typically client supplies the object that invoked this method, or a proxy (
new Object()) in the case of other static methods requesting a
ModuleStructuralModel.
ArtifactEdit,
ArtifactEdit#getArtifactEditForRead(WorkbenchComponent)public java.lang.String getNatureID()
public void primaryContributeToContext(EMFWorkbenchContextBase aNature)
This method should not be invoked by clients.
org.eclipse.jem.util.emf.workbench.IEMFContextContributor#primaryContributeToContext(org.eclipse.jem.util.emf.workbench.EMFWorkbenchContextBase)public ResourceSet getResourceSet()
This method should not be invoked by clients.
public void secondaryContributeToContext(EMFWorkbenchContextBase aNature)
This method should not be invoked by clients.
org.eclipse.jem.util.emf.workbench.IEMFContextContributor#secondaryContributeToContext(org.eclipse.jem.util.emf.workbench.EMFWorkbenchContextBase)
public void configure()
throws org.eclipse.core.runtime.CoreException
This method should not be invoked by clients.
configure in interface org.eclipse.core.resources.IProjectNatureorg.eclipse.core.runtime.CoreExceptionorg.eclipse.jem.util.emf.workbench.nature.EMFNature#configure()
public EditModel getExistingEditModel(java.lang.String artifactEditModelId,
java.util.Map params,
boolean isReadOnly)
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||