User:Lindenb/Notebook/UMR915/20110517: Difference between revisions
From OpenWetWare
No edit summary |
No edit summary |
||
Line 126: | Line 126: | ||
[[Image:Emf14.png]] | [[Image:Emf14.png]] | ||
=content generated= | |||
==EMFDataStore.edit== | |||
<pre>find EMFDataStore.edit -type f | |||
EMFDataStore.edit/.classpath | |||
EMFDataStore.edit/plugin.xml | |||
EMFDataStore.edit/META-INF/MANIFEST.MF | |||
EMFDataStore.edit/src/DataStore/provider/EmfdatastoreEditPlugin.java | |||
EMFDataStore.edit/.project | |||
EMFDataStore.edit/plugin.properties | |||
EMFDataStore.edit/bin/DataStore/provider/EmfdatastoreEditPlugin$Implementation.class | |||
EMFDataStore.edit/bin/DataStore/provider/EmfdatastoreEditPlugin.class | |||
EMFDataStore.edit/build.properties</pre> | |||
<pre> xmllint --format EMFDataStore.edit/plugin.xml | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<?eclipse version="3.0"?> | |||
<!-- | |||
<copyright> | |||
</copyright> | |||
$Id$ | |||
--> | |||
<plugin> | |||
</plugin></pre> | |||
<pre> cat EMFDataStore.edit/META-INF/MANIFEST.MF | |||
Manifest-Version: 1.0 | |||
Bundle-ManifestVersion: 2 | |||
Bundle-Name: %pluginName | |||
Bundle-SymbolicName: EMFDataStore.edit;singleton:=true | |||
Bundle-Version: 1.0.0 | |||
Bundle-ClassPath: . | |||
Bundle-Activator: DataStore.provider.EmfdatastoreEditPlugin$Implementation | |||
Bundle-Vendor: %providerName | |||
Bundle-Localization: plugin | |||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6 | |||
Export-Package: DataStore.provider | |||
Require-Bundle: org.eclipse.core.runtime, | |||
EMFDataStore;visibility:=reexport, | |||
org.eclipse.emf.edit;visibility:=reexport | |||
Bundle-ActivationPolicy: lazy</pre> | |||
<pre>cat EMFDataStore.edit/plugin.properties | |||
# <copyright> | |||
# </copyright> | |||
# | |||
# $Id$ | |||
pluginName = Emfdatastore Edit Support | |||
providerName = www.example.org | |||
_UI_CreateChild_text = {0} | |||
_UI_CreateChild_text2 = {1} {0} | |||
_UI_CreateChild_text3 = {1} | |||
_UI_CreateChild_tooltip = Create New {0} Under {1} Feature | |||
_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}. | |||
_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent. | |||
_UI_PropertyDescriptor_description = The {0} of the {1} | |||
_UI_Unknown_type = Object | |||
_UI_Unknown_datatype= Value | |||
_UI_Unknown_feature = Unspecified | |||
_UI_Gender_UNKNOWN_literal = UNKNOWN | |||
_UI_Gender_MALE_literal = MALE | |||
_UI_Gender_FEMALE_literal = FEMALE</pre> | |||
<pre>cat EMFDataStore.edit/src/DataStore/provider/EmfdatastoreEditPlugin.java | |||
/** | |||
* <copyright> | |||
* </copyright> | |||
* | |||
* $Id$ | |||
*/ | |||
package DataStore.provider; | |||
import org.eclipse.emf.common.EMFPlugin; | |||
import org.eclipse.emf.common.util.ResourceLocator; | |||
/** | |||
* This is the central singleton for the Emfdatastore edit plugin. | |||
* <!-- begin-user-doc --> | |||
* <!-- end-user-doc --> | |||
* @generated | |||
*/ | |||
public final class EmfdatastoreEditPlugin extends EMFPlugin { | |||
/** | |||
* Keep track of the singleton. | |||
* <!-- begin-user-doc --> | |||
* <!-- end-user-doc --> | |||
* @generated | |||
*/ | |||
public static final EmfdatastoreEditPlugin INSTANCE = new EmfdatastoreEditPlugin(); | |||
/** | |||
* Keep track of the singleton. | |||
* <!-- begin-user-doc --> | |||
* <!-- end-user-doc --> | |||
* @generated | |||
*/ | |||
private static Implementation plugin; | |||
/** | |||
* Create the instance. | |||
* <!-- begin-user-doc --> | |||
* <!-- end-user-doc --> | |||
* @generated | |||
*/ | |||
public EmfdatastoreEditPlugin() { | |||
super | |||
(new ResourceLocator [] { | |||
}); | |||
} | |||
/** | |||
* Returns the singleton instance of the Eclipse plugin. | |||
* <!-- begin-user-doc --> | |||
* <!-- end-user-doc --> | |||
* @return the singleton instance. | |||
* @generated | |||
*/ | |||
@Override | |||
public ResourceLocator getPluginResourceLocator() { | |||
return plugin; | |||
} | |||
/** | |||
* Returns the singleton instance of the Eclipse plugin. | |||
* <!-- begin-user-doc --> | |||
* <!-- end-user-doc --> | |||
* @return the singleton instance. | |||
* @generated | |||
*/ | |||
public static Implementation getPlugin() { | |||
return plugin; | |||
} | |||
/** | |||
* The actual implementation of the Eclipse <b>Plugin</b>. | |||
* <!-- begin-user-doc --> | |||
* <!-- end-user-doc --> | |||
* @generated | |||
*/ | |||
public static class Implementation extends EclipsePlugin { | |||
/** | |||
* Creates an instance. | |||
* <!-- begin-user-doc --> | |||
* <!-- end-user-doc --> | |||
* @generated | |||
*/ | |||
public Implementation() { | |||
super(); | |||
// Remember the static instance. | |||
// | |||
plugin = this; | |||
} | |||
} | |||
}</pre> | |||
<pre> cat EMFDataStore.edit/build.properties | |||
# <copyright> | |||
# </copyright> | |||
# | |||
# $Id$ | |||
bin.includes = .,\ | |||
icons/,\ | |||
META-INF/,\ | |||
plugin.xml,\ | |||
plugin.properties | |||
jars.compile.order = . | |||
source.. = src/ | |||
output.. = bin/</pre> | |||
[[Category:EMF]] | [[Category:EMF]] |
Revision as of 09:56, 18 May 2011
EMF
learning EMF -eclipse modeling framework- http://www.eclipse.org/modeling/emf/
Select project location
The new project is created:
~/tmp/workspace20110401> find ./EMFDataStore/ ./EMFDataStore/ ./EMFDataStore/.classpath ./EMFDataStore/META-INF ./EMFDataStore/META-INF/MANIFEST.MF ./EMFDataStore/src ./EMFDataStore/model ./EMFDataStore/.project ./EMFDataStore/bin
cat ./EMFDataStore/.classpath <?xml version="1.0" encoding="UTF-8"?> <classpath> <classpathentry kind="src" path="src"/> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/> <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> <classpathentry kind="output" path="bin"/> </classpath>
cat ./EMFDataStore/.project <?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>EMFDataStore</name> <comment></comment> <projects> </projects> <buildSpec> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.pde.ManifestBuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.pde.SchemaBuilder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.eclipse.jdt.core.javanature</nature> <nature>org.eclipse.pde.PluginNature</nature> </natures> </projectDescription>
Then : create new Ecore Model:
We want to generate a whole package:
find ./EMFDataStore/ -type f ./EMFDataStore/.classpath ./EMFDataStore/META-INF/MANIFEST.MF ./EMFDataStore/model/emfdatastore.ecore ./EMFDataStore/.project
cat ./EMFDataStore/model/emfdatastore.ecore <?xml version="1.0" encoding="UTF-8"?> <ecore:EPackage xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmi:version="2.0" name=""/>
Create EMF Generator Model
create a generator model
create model for ECore
select the emfdatastore.ecore in the workspace
find ./EMFDataStore/ -type f ./EMFDataStore/.classpath ./EMFDataStore/META-INF/MANIFEST.MF ./EMFDataStore/model/emfdatastore.genmodel ./EMFDataStore/model/emfdatastore.ecore ./EMFDataStore/.project
xmllint --format ./EMFDataStore/model/emfdatastore.genmodel <?xml version="1.0" encoding="UTF-8"?> <genmodel:GenModel xmlns:xmi="http://www.omg.org/XMI" xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" xmi:version="2.0" modelDirectory="/EMFDataStore/src" modelPluginID="EMFDataStore" modelName="Emfdatastore" importerID="org.eclipse.emf.importer.ecore" complianceLevel="6.0" copyrightFields="false"> <foreignModel>emfdatastore.ecore</foreignModel> <genPackages prefix="DataStore" disposableProviderFactory="true" ecorePackage="emfdatastore.ecore#/"> <genEnums typeSafeEnumCompatible="false" ecoreEnum="emfdatastore.ecore#//Gender"> <genEnumLiterals ecoreEnumLiteral="emfdatastore.ecore#//Gender/UNKNOWN"/> <genEnumLiterals ecoreEnumLiteral="emfdatastore.ecore#//Gender/MALE"/> <genEnumLiterals ecoreEnumLiteral="emfdatastore.ecore#//Gender/FEMALE"/> </genEnums> </genPackages> </genmodel:GenModel>
content generated
EMFDataStore.edit
find EMFDataStore.edit -type f EMFDataStore.edit/.classpath EMFDataStore.edit/plugin.xml EMFDataStore.edit/META-INF/MANIFEST.MF EMFDataStore.edit/src/DataStore/provider/EmfdatastoreEditPlugin.java EMFDataStore.edit/.project EMFDataStore.edit/plugin.properties EMFDataStore.edit/bin/DataStore/provider/EmfdatastoreEditPlugin$Implementation.class EMFDataStore.edit/bin/DataStore/provider/EmfdatastoreEditPlugin.class EMFDataStore.edit/build.properties
xmllint --format EMFDataStore.edit/plugin.xml <?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.0"?> <!-- <copyright> </copyright> $Id$ --> <plugin> </plugin>
cat EMFDataStore.edit/META-INF/MANIFEST.MF Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %pluginName Bundle-SymbolicName: EMFDataStore.edit;singleton:=true Bundle-Version: 1.0.0 Bundle-ClassPath: . Bundle-Activator: DataStore.provider.EmfdatastoreEditPlugin$Implementation Bundle-Vendor: %providerName Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: JavaSE-1.6 Export-Package: DataStore.provider Require-Bundle: org.eclipse.core.runtime, EMFDataStore;visibility:=reexport, org.eclipse.emf.edit;visibility:=reexport Bundle-ActivationPolicy: lazy
cat EMFDataStore.edit/plugin.properties # <copyright> # </copyright> # # $Id$ pluginName = Emfdatastore Edit Support providerName = www.example.org _UI_CreateChild_text = {0} _UI_CreateChild_text2 = {1} {0} _UI_CreateChild_text3 = {1} _UI_CreateChild_tooltip = Create New {0} Under {1} Feature _UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}. _UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent. _UI_PropertyDescriptor_description = The {0} of the {1} _UI_Unknown_type = Object _UI_Unknown_datatype= Value _UI_Unknown_feature = Unspecified _UI_Gender_UNKNOWN_literal = UNKNOWN _UI_Gender_MALE_literal = MALE _UI_Gender_FEMALE_literal = FEMALE
cat EMFDataStore.edit/src/DataStore/provider/EmfdatastoreEditPlugin.java /** * <copyright> * </copyright> * * $Id$ */ package DataStore.provider; import org.eclipse.emf.common.EMFPlugin; import org.eclipse.emf.common.util.ResourceLocator; /** * This is the central singleton for the Emfdatastore edit plugin. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public final class EmfdatastoreEditPlugin extends EMFPlugin { /** * Keep track of the singleton. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static final EmfdatastoreEditPlugin INSTANCE = new EmfdatastoreEditPlugin(); /** * Keep track of the singleton. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ private static Implementation plugin; /** * Create the instance. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EmfdatastoreEditPlugin() { super (new ResourceLocator [] { }); } /** * Returns the singleton instance of the Eclipse plugin. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the singleton instance. * @generated */ @Override public ResourceLocator getPluginResourceLocator() { return plugin; } /** * Returns the singleton instance of the Eclipse plugin. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the singleton instance. * @generated */ public static Implementation getPlugin() { return plugin; } /** * The actual implementation of the Eclipse <b>Plugin</b>. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static class Implementation extends EclipsePlugin { /** * Creates an instance. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Implementation() { super(); // Remember the static instance. // plugin = this; } } }
cat EMFDataStore.edit/build.properties # <copyright> # </copyright> # # $Id$ bin.includes = .,\ icons/,\ META-INF/,\ plugin.xml,\ plugin.properties jars.compile.order = . source.. = src/ output.. = bin/