Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » ServerTools (WTP) » How to Use Eclipse EMF Resource Edit Model Extension
How to Use Eclipse EMF Resource Edit Model Extension [message #180656] Thu, 05 October 2006 15:21
Eclipse UserFriend
Originally posted by: rajesh.jain.compuware.com

<newbie>
I am trying to understand the usage of
org.eclipse.wst.common.emfworkbench.integration.editModel extension? Any
information or where to find more info on how to use this for EMF Editor? Or
am I going in a wrong direction.


The help topic for this is:
http://help.eclipse.org/help32/index.jsp?topic=/org.eclipse. wst.doc.isv/reference/extension-points/web/org_eclipse_wst_c ommon_emfworkbench_integration_editModelExtension.html
(below) is vague on how to use it for beginner


EMF Resource Edit Model

Identifier:
org.eclipse.wst.common.emfworkbench.integration.editModel

Since:
1.0


Description:
Edit models provide a framework for managing a set of EMF resources within a
unit of work. For example, a workspace operation may affect a change to
multiple EMF resources. Edit models provide basic services such as loads,
saves (when necessary), and validate edit for the managed resources. Edit
models are reference counted, therefore a single instance of an edit model
can be shared by more than one operation or editor. By declaring an edit
model, a plugin provider enables other components to contribute resources to
be managed by that edit model.


Configuration Markup:

<!ELEMENT extension (editModel+)>

<!ATTLIST extension

point CDATA #REQUIRED

id CDATA #IMPLIED

name CDATA #IMPLIED>


point - a fully qualified identifier of the target extension point
id - an optional identifier of the extension instance
name - an optional name of the extension instance


<!ELEMENT editModel (editModelResource+)>

<!ATTLIST editModel

editModelID CDATA #REQUIRED

factoryClass CDATA #REQUIRED

loadUnknownResourcesAsReadOnly (true | false)

parentModelID CDATA #IMPLIED>


The declaration for an edit model to be used in the workspace.



editModelID - A unique identifier for the edit model.
factoryClass - An optional factory class that is used for this edit model.
The class must implement the interface
org.eclipse.wst.common.internal.emfworkbench.integration.Edi tModelFactory.
If none is specified, then a generic EditModel is created.
loadUnknownResourcesAsReadOnly -
parentModelID -


<!ELEMENT editModelResource EMPTY>

<!ATTLIST editModelResource

URI CDATA #REQUIRED

autoload (true | false) "false">


This is an individual contribution of a resource to the edit model. If more
than one instance of the same URI is registered against an edit model id,
the resource is still only loaded once.



URI - The URI of the resource relative to the root container from which EMF
resources are loaded.
autoload - Indicator which determines whether this resource should be
autoloaded when the edit model is created, or when an IFile corresponding to
this resource is added.


Examples:
<extension
id="editModel.acme.parent"
name="Acme Parent Edit Model"
point="org.eclipse.wst.common.emfworkbench.integration.editModel ">
<editModel
editModelID="com.acme.acmepro.parent.editModel"
factoryClass=" org.eclipse.wst.common.internal.emfworkbench.integration.Edi tModelFactory ">
<editModelResource URI="DIR/resource0.xml"/>
<editModelResource URI="DIR/resource1.xml"/>
</editModel>
</extension>

<extension
id="editModel.acme.child"
name="Acme Child Edit Model"
point="org.eclipse.wst.common.emfworkbench.integration.editModel ">
<editModel
editModelID="com.acme.acmepro.child.editModel"
factoryClass=" org.eclipse.wst.common.internal.emfworkbench.integration.Edi tModelFactory "
parentModelID="com.acme.acmepro.parent.editModel">
<editModelResource URI="DIR/resource2.xml"/>
<editModelResource URI="DIR/resource3.xml"/>
</editModel>
</extension>


API Information:
Edit Models can be accessed through the
org.eclipse.wst.common.internal.emfworkbench.EMFWorkbenchCon text.
Previous Topic:EMF EditModel Extension
Next Topic:xml editor usable for rcp
Goto Forum:
  


Current Time: Thu Apr 25 18:56:21 GMT 2024

Powered by FUDForum. Page generated in 0.03173 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top