Skip to content

Commit 0ab096d

Browse files
committed
FOR-234 : Ajouter dans le training, l'exemple de sirius sur ecore designer fait lors de la formation CEA
1 parent 4e8170b commit 0ab096d

File tree

10 files changed

+191
-0
lines changed

10 files changed

+191
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<classpath>
3+
<classpathentry kind="src" path="src"/>
4+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
5+
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
6+
<classpathentry kind="output" path="bin"/>
7+
</classpath>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<projectDescription>
3+
<name>com.opcoach.training.sirius.ecoredesigner</name>
4+
<comment></comment>
5+
<projects>
6+
</projects>
7+
<buildSpec>
8+
<buildCommand>
9+
<name>org.eclipse.jdt.core.javabuilder</name>
10+
<arguments>
11+
</arguments>
12+
</buildCommand>
13+
<buildCommand>
14+
<name>org.eclipse.pde.ManifestBuilder</name>
15+
<arguments>
16+
</arguments>
17+
</buildCommand>
18+
<buildCommand>
19+
<name>org.eclipse.pde.SchemaBuilder</name>
20+
<arguments>
21+
</arguments>
22+
</buildCommand>
23+
</buildSpec>
24+
<natures>
25+
<nature>org.eclipse.pde.PluginNature</nature>
26+
<nature>org.eclipse.jdt.core.javanature</nature>
27+
</natures>
28+
</projectDescription>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
eclipse.preferences.version=1
2+
encoding/<project>=UTF-8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
Manifest-Version: 1.0
2+
Bundle-ManifestVersion: 2
3+
Bundle-Name: %pluginName
4+
Bundle-SymbolicName: com.opcoach.training.sirius.ecoredesigner;singleton:=true
5+
Bundle-Version: 1.0.0.qualifier
6+
Bundle-Activator: com.cea.ecoredesigner.Activator
7+
Bundle-Localization: plugin
8+
Require-Bundle: org.eclipse.ui,
9+
org.eclipse.core.runtime,
10+
org.eclipse.core.resources,
11+
org.eclipse.sirius,
12+
org.eclipse.sirius.common.acceleo.aql
13+
Bundle-ActivationPolicy: lazy
14+
Bundle-RequiredExecutionEnvironment: JavaSE-17
15+
Bundle-Vendor: %providerName
16+
Automatic-Module-Name: com.cea.ecoredesigner
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
source.. = src/
2+
output.. = bin/
3+
bin.includes = META-INF/,\
4+
.,\
5+
description/,\
6+
plugin.properties,\
7+
plugin.xml
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<description:Group xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" name="ecoredesigner" version="12.0.0.2017041100">
3+
<ownedViewpoints name="EcoreDesignerViewpoint" modelFileExtension="*.ecore">
4+
<ownedRepresentations xsi:type="description_1:DiagramDescription" name="NewDiagramForEcore2024" label="NewDiagramForEcore2024" domainClass="EPackage" enablePopupBars="true">
5+
<defaultLayer name="Default">
6+
<nodeMappings name="eclassnode" semanticCandidatesExpression="[eClassifiers->filter(EClass)/]" domainClass="EClass">
7+
<style xsi:type="style:SquareDescription" labelSize="14" sizeComputationExpression="12" labelPosition="node" resizeKind="NSEW">
8+
<borderColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
9+
<labelFormat>bold</labelFormat>
10+
<labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
11+
<color xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='yellow']"/>
12+
</style>
13+
</nodeMappings>
14+
<edgeMappings name="compostionEdge" label="compostionEdgecompostionEdge" sourceMapping="//@ownedViewpoints[name='EcoreDesignerViewpoint']/@ownedRepresentations[name='NewDiagramForEcore2024']/@defaultLayer/@nodeMappings[name='eclassnode']" targetMapping="//@ownedViewpoints[name='EcoreDesignerViewpoint']/@ownedRepresentations[name='NewDiagramForEcore2024']/@defaultLayer/@nodeMappings[name='eclassnode']" targetFinderExpression="[eType->select(containment)/]" sourceFinderExpression="feature:eContainer" domainClass="EReference" useDomainElement="true">
15+
<style sourceArrow="FillDiamond" sizeComputationExpression="2">
16+
<strokeColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='red']"/>
17+
<centerLabelStyleDescription labelSize="12">
18+
<labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
19+
</centerLabelStyleDescription>
20+
</style>
21+
</edgeMappings>
22+
<edgeMappings name="associationEdge" label="associationEdge" sourceMapping="//@ownedViewpoints[name='EcoreDesignerViewpoint']/@ownedRepresentations[name='NewDiagramForEcore2024']/@defaultLayer/@nodeMappings[name='eclassnode']" targetMapping="//@ownedViewpoints[name='EcoreDesignerViewpoint']/@ownedRepresentations[name='NewDiagramForEcore2024']/@defaultLayer/@nodeMappings[name='eclassnode']" targetFinderExpression="[eType->select(not(containment))/]" sourceFinderExpression="feature:eContainer" domainClass="EReference" useDomainElement="true">
23+
<style lineStyle="dash" sizeComputationExpression="2" routingStyle="tree">
24+
<strokeColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='gray']"/>
25+
<centerLabelStyleDescription labelSize="12">
26+
<labelColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
27+
</centerLabelStyleDescription>
28+
</style>
29+
</edgeMappings>
30+
</defaultLayer>
31+
<backgroundColor xsi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='light_orange']"/>
32+
</ownedRepresentations>
33+
<ownedJavaExtensions qualifiedClassName="com.cea.ecoredesigner.Services"/>
34+
</ownedViewpoints>
35+
</description:Group>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pluginName = com.cea.ecoredesigner
2+
providerName = Eclipse Modeling Project
3+
viewpointName = MyViewpoint
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<?eclipse version="3.0"?>
3+
<plugin>
4+
<extension point="org.eclipse.sirius.componentization">
5+
<component class="com.cea.ecoredesigner.Activator"
6+
id="com.cea.ecoredesigner"
7+
name="ecoredesigner">
8+
</component>
9+
</extension>
10+
</plugin>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
package com.cea.ecoredesigner;
2+
3+
import java.util.HashSet;
4+
import java.util.Set;
5+
6+
import org.eclipse.sirius.business.api.componentization.ViewpointRegistry;
7+
import org.eclipse.sirius.viewpoint.description.Viewpoint;
8+
import org.eclipse.ui.plugin.AbstractUIPlugin;
9+
import org.osgi.framework.BundleContext;
10+
11+
/**
12+
* The activator class controls the plug-in life cycle
13+
*/
14+
public class Activator extends AbstractUIPlugin {
15+
// The plug-in ID
16+
public static final String PLUGIN_ID = "com.cea.ecoredesigner";
17+
18+
// The shared instance
19+
private static Activator plugin;
20+
21+
private static Set<Viewpoint> viewpoints;
22+
23+
/**
24+
* The constructor
25+
*/
26+
public Activator() {
27+
}
28+
29+
/*
30+
* (non-Javadoc)
31+
*
32+
* @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
33+
*/
34+
public void start(BundleContext context) throws Exception {
35+
super.start(context);
36+
plugin = this;
37+
viewpoints = new HashSet<Viewpoint>();
38+
viewpoints.addAll(ViewpointRegistry.getInstance().registerFromPlugin(PLUGIN_ID + "/description/ecoredesigner.odesign"));
39+
}
40+
41+
/*
42+
* (non-Javadoc)
43+
*
44+
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
45+
*/
46+
public void stop(BundleContext context) throws Exception {
47+
plugin = null;
48+
if (viewpoints != null) {
49+
for (final Viewpoint viewpoint: viewpoints) {
50+
ViewpointRegistry.getInstance().disposeFromPlugin(viewpoint);
51+
}
52+
viewpoints.clear();
53+
viewpoints = null;
54+
}
55+
super.stop(context);
56+
}
57+
58+
/**
59+
* Returns the shared instance
60+
*
61+
* @return the shared instance
62+
*/
63+
public static Activator getDefault() {
64+
return plugin;
65+
}
66+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.cea.ecoredesigner;
2+
3+
import org.eclipse.emf.ecore.EObject;
4+
5+
/**
6+
* The services class used by VSM.
7+
*/
8+
public class Services {
9+
10+
/**
11+
* See http://help.eclipse.org/neon/index.jsp?topic=%2Forg.eclipse.sirius.doc%2Fdoc%2Findex.html&cp=24 for documentation on how to write service methods.
12+
*/
13+
public EObject myService(EObject self, String arg) {
14+
// TODO Auto-generated code
15+
return self;
16+
}
17+
}

0 commit comments

Comments
 (0)