Skip to content

Commit f7856eb

Browse files
TCapabilityType metaclass changed from attribute to class + ToscaDesignerComponenetContributor first implementation
1 parent e49ed2c commit f7856eb

File tree

14 files changed

+166
-47
lines changed

14 files changed

+166
-47
lines changed

ToscaDesigner/src/main/conf/module.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@
372372
</PropertyDefinition>
373373
</PropertyTable>
374374
</Stereotype>
375-
<Stereotype name="TCapabilityType" metaclass="Standard.Attribute" owner-stereotype="" is-hidden="false" label="%stereotype.TCapabilityType.label" uid="42438c96-0721-406a-a8b9-c4a85931cc60" is-abstract="false">
375+
<Stereotype name="TCapabilityType" metaclass="Standard.Class" owner-stereotype="" is-hidden="false" label="%stereotype.TCapabilityType.label" uid="42438c96-0721-406a-a8b9-c4a85931cc60" is-abstract="false">
376376
<Icon path="res/icon/gui/capabilityType24.ICON.png"/>
377377
<Image path="res/icon/gui/capabilityType48.IMAGE.png"/>
378378
</Stereotype>
@@ -992,10 +992,10 @@
992992
<HParameter name="name" value="Element"/>
993993
</Handler>
994994
</Command>
995-
<Command id="Export" label="%command.Export.label" tooltip="%command.Export.tooltip" image="" modify-model="false">
995+
<Command id="Export" label="%command.Export.label" tooltip="%command.Export.tooltip" image="res/icon/gui/export.png" modify-model="false">
996996
<Scope metaclass="Standard.Package" stereotype="ToscaDesigner#ToscaModel"/>
997997
<Handler class="fr.softeam.toscadesigner.handlers.commands.ToacaModelExport">
998-
<HParameter name="name" value="Element"/>
998+
<HParameter name="name" value=""/>
999999
</Handler>
10001000
</Command>
10011001
<Command id="Service_Template_Diagram" label="%command.Service_Template_Diagram.label" tooltip="%command.Service_Template_Diagram.tooltip" image="res/icon/gui/diagram/service_template_diag24.png" modify-model="true">
-205 Bytes
Binary file not shown.

ToscaDesigner/src/main/java/fr/softeam/toscadesigner/api/ToscaDesignerProxyFactory.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ public static final void initialize(final IModelingSession session) throws MdaPr
182182
fr.softeam.toscadesigner.api.tosca.standard.class_.TCapabilityDefinition.MdaTypes.init(session);
183183
fr.softeam.toscadesigner.api.tosca.standard.class_.TCapabilityDefinitionsType.MdaTypes.init(session);
184184
fr.softeam.toscadesigner.api.tosca.infrastructure.modelelement.TCapabilityRef.MdaTypes.init(session);
185-
fr.softeam.toscadesigner.api.tosca.standard.attribute.TCapabilityType.MdaTypes.init(session);
185+
fr.softeam.toscadesigner.api.tosca.standard.class_.TCapabilityType.MdaTypes.init(session);
186186
fr.softeam.toscadesigner.api.tosca.infrastructure.modelelement.TCondition.MdaTypes.init(session);
187187
fr.softeam.toscadesigner.api.tosca.infrastructure.modelelement.TConstraint.MdaTypes.init(session);
188188
fr.softeam.toscadesigner.api.tosca.infrastructure.modelelement.TDefinitions.MdaTypes.init(session);
@@ -292,7 +292,6 @@ public final Object visitAttribute(Attribute obj) {
292292
switch (this.stName) {
293293
case fr.softeam.toscadesigner.api.tosca.standard.attribute.Metadata.STEREOTYPE_NAME: return fr.softeam.toscadesigner.api.tosca.standard.attribute.Metadata.instantiate(obj);
294294
case fr.softeam.toscadesigner.api.tosca.standard.attribute.PropertyDefinitionType.STEREOTYPE_NAME: return fr.softeam.toscadesigner.api.tosca.standard.attribute.PropertyDefinitionType.instantiate(obj);
295-
case fr.softeam.toscadesigner.api.tosca.standard.attribute.TCapabilityType.STEREOTYPE_NAME: return fr.softeam.toscadesigner.api.tosca.standard.attribute.TCapabilityType.instantiate(obj);
296295
case fr.softeam.toscadesigner.api.tosca.standard.attribute.TDeploymentArtifact.STEREOTYPE_NAME: return fr.softeam.toscadesigner.api.tosca.standard.attribute.TDeploymentArtifact.instantiate(obj);
297296
case fr.softeam.toscadesigner.api.tosca.standard.attribute.TPropertyDef.STEREOTYPE_NAME: return fr.softeam.toscadesigner.api.tosca.standard.attribute.TPropertyDef.instantiate(obj);
298297
default:
@@ -374,6 +373,8 @@ public final Object visitClass(Class obj) {
374373
case fr.softeam.toscadesigner.api.tosca.standard.class_.TRequirementDefinition.STEREOTYPE_NAME: return fr.softeam.toscadesigner.api.tosca.standard.class_.TRequirementDefinition.instantiate(obj);
375374
case fr.softeam.toscadesigner.api.tosca.standard.class_.TRequirementDefinitionType.STEREOTYPE_NAME: return fr.softeam.toscadesigner.api.tosca.standard.class_.TRequirementDefinitionType.instantiate(obj);
376375
case fr.softeam.toscadesigner.api.tosca.standard.class_.TTopologyElementInstanceStates.STEREOTYPE_NAME: return fr.softeam.toscadesigner.api.tosca.standard.class_.TTopologyElementInstanceStates.instantiate(obj);
376+
case fr.softeam.toscadesigner.api.tosca.standard.class_.TCapabilityType.STEREOTYPE_NAME: return fr.softeam.toscadesigner.api.tosca.standard.class_.TCapabilityType.instantiate(obj);
377+
377378
default:
378379
break;
379380
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
package fr.softeam.toscadesigner.api;
2+
3+
public interface ToscaDesignerStereotypes {
4+
5+
public static final String TNODETYPE = "TNodeType";
6+
public static final String TRELATIONSHIPTYPE = "TRelationshipType";
7+
public static final String TARTIFACTTYPE = "TartifactType";
8+
public static final String TINTERFACE = "TInterface";
9+
public static final String TGROUP = "TGroup";
10+
public static final String TPOLICY = "TPolicy";
11+
public static final String TCAPABILITY_DEFINITION = "TCapabilityDefinition";
12+
public static final String CAPABILITY_DEFINITIONS_TYPE = "CapabilityDefinitionsType";
13+
14+
}

ToscaDesigner/src/main/java/fr/softeam/toscadesigner/api/tosca/standard/attribute/TCapabilityDefinition.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@
1919
import com.modeliosoft.modelio.api.module.mda.MdaProxyException;
2020
import com.modeliosoft.modelio.javadesigner.annotations.objid;
2121
import fr.softeam.toscadesigner.api.ToscaDesignerProxyFactory;
22+
import fr.softeam.toscadesigner.api.tosca.standard.class_.TCapabilityType;
23+
2224
import org.modelio.api.modelio.model.IModelingSession;
2325
import org.modelio.api.modelio.model.ModelingSessionRegistry;
2426
import org.modelio.api.modelio.model.PropertyConverter;
@@ -233,7 +235,6 @@ public int hashCode() {
233235
* null
234236
*
235237
*/
236-
@objid ("bfac5b4a-5a84-4e8c-8a43-ad2f0c28d8ef")
237238
public void setCapabilityType(final TCapabilityType obj) {
238239
Dependency dep = null;
239240
for (Dependency d : this.elt.getDependsOnDependency())

ToscaDesigner/src/main/java/fr/softeam/toscadesigner/api/tosca/standard/class_/TCapabilityDefinition.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
import com.modeliosoft.modelio.api.module.mda.MdaProxyException;
2020
import com.modeliosoft.modelio.javadesigner.annotations.objid;
2121
import fr.softeam.toscadesigner.api.ToscaDesignerProxyFactory;
22-
import fr.softeam.toscadesigner.api.tosca.standard.attribute.TCapabilityType;
22+
import fr.softeam.toscadesigner.api.tosca.standard.class_.TCapabilityType;
2323
import org.modelio.api.modelio.model.IModelingSession;
2424
import org.modelio.api.modelio.model.ModelingSessionRegistry;
2525
import org.modelio.api.modelio.model.PropertyConverter;

ToscaDesigner/src/main/java/fr/softeam/toscadesigner/api/tosca/standard/attribute/TCapabilityType.java renamed to ToscaDesigner/src/main/java/fr/softeam/toscadesigner/api/tosca/standard/class_/TCapabilityType.java

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
* WARNING: GENERATED FILE - DO NOT EDIT
33
* Module: ToscaDesigner v0.0.00
44
5-
* This file was generated on 28/10/2024 10:11 by Modelio Studio.
5+
* This file was generated on 07/01/2025 10:10 by Modelio Studio.
66
*/
7-
package fr.softeam.toscadesigner.api.tosca.standard.attribute;
7+
package fr.softeam.toscadesigner.api.tosca.standard.class_;
88

99
import java.util.ArrayList;
1010
import java.util.Collections;
@@ -29,79 +29,79 @@
2929
import org.modelio.metamodel.uml.infrastructure.TagType;
3030
import org.modelio.metamodel.uml.infrastructure.properties.PropertyDefinition;
3131
import org.modelio.metamodel.uml.infrastructure.properties.PropertyTableDefinition;
32-
import org.modelio.metamodel.uml.statik.Attribute;
32+
import org.modelio.metamodel.uml.statik.Class;
3333
import org.modelio.vcore.smkernel.mapi.MObject;
3434
import org.modelio.vcore.smkernel.mapi.MRef;
3535

3636
/**
37-
* Proxy class to handle a {@link Attribute} with << TCapabilityType >> stereotype.
37+
* Proxy class to handle a {@link Class} with << TCapabilityType >> stereotype.
3838
* <p>Stereotype description:
3939
* <br/><i>null</i></p>
4040
*/
4141
@objid ("df4c6a7d-ab07-4d7f-807d-a2220e3ed9c9")
4242
public class TCapabilityType implements IMdaProxy {
43-
@objid ("ce244caf-cc7c-47f8-92b5-b570cb616ec1")
43+
@objid ("2127f552-22c2-42f2-a5ff-42d1e5bf49e6")
4444
public static final String STEREOTYPE_NAME = "TCapabilityType";
4545

4646
/**
47-
* The underlying {@link Attribute} represented by this proxy, never null.
47+
* The underlying {@link Class} represented by this proxy, never null.
4848
*/
49-
@objid ("6c426833-4468-4e81-8fef-ea65cc4efb5b")
50-
protected final Attribute elt;
49+
@objid ("8b3bf623-16c7-46e0-9bc1-0e58d9b3dcfc")
50+
protected final Class elt;
5151

5252
/**
53-
* Tells whether a {@link TCapabilityType proxy} can be instantiated from a {@link MObject} checking it is a {@link Attribute} stereotyped << TCapabilityType >>.
53+
* Tells whether a {@link TCapabilityType proxy} can be instantiated from a {@link MObject} checking it is a {@link Class} stereotyped << TCapabilityType >>.
5454
* <p>
5555
* The method returns <code>false</code> if the instantiation cannot be carried out.
5656
* @param elt a model object
5757
* @return <code>true</code> if the instantiation can be carried out else <code>false</code>.
5858
*/
59-
@objid ("119dd205-5860-4723-85b0-644801a390cf")
59+
@objid ("befd200e-7e30-4386-99be-b09247505648")
6060
public static boolean canInstantiate(final MObject elt) {
61-
return ((elt instanceof Attribute) && (TCapabilityType.MdaTypes.STEREOTYPE_ELT!=null) && ((Attribute) elt).isStereotyped(TCapabilityType.MdaTypes.STEREOTYPE_ELT));
61+
return ((elt instanceof Class) && (TCapabilityType.MdaTypes.STEREOTYPE_ELT!=null) && ((Class) elt).isStereotyped(TCapabilityType.MdaTypes.STEREOTYPE_ELT));
6262
}
6363

6464
/**
65-
* Create a new {@link Attribute} stereotyped << TCapabilityType >> then instantiate a {@link TCapabilityType} proxy.
65+
* Create a new {@link Class} stereotyped << TCapabilityType >> then instantiate a {@link TCapabilityType} proxy.
6666
*
67-
* @return a {@link TCapabilityType} proxy on the created {@link Attribute}.
67+
* @return a {@link TCapabilityType} proxy on the created {@link Class}.
6868
*/
69-
@objid ("e84393d2-dbf3-4bca-a9fd-8b17195a70d8")
69+
@objid ("befde462-08bd-43f5-bb03-17cb18669fb9")
7070
public static TCapabilityType create(final IModelingSession session) {
71-
ModelElement e = (ModelElement)session.getModel().createElement("Standard.Attribute");
71+
ModelElement e = (ModelElement)session.getModel().createElement("Standard.Class");
7272
e.getExtension().add(TCapabilityType.MdaTypes.STEREOTYPE_ELT);
73-
return TCapabilityType.instantiate((Attribute)e);
73+
return TCapabilityType.instantiate((Class)e);
7474
}
7575

7676
/**
77-
* Tries to instantiate a {@link TCapabilityType} proxy from a {@link Attribute} stereotyped << TCapabilityType >> checking its metaclass and its stereotype.
77+
* Tries to instantiate a {@link TCapabilityType} proxy from a {@link Class} stereotyped << TCapabilityType >> checking its metaclass and its stereotype.
7878
* <p>
7979
* The method returns <i>null</i> if the instantiation cannot be carried out.
80-
* @param obj a Attribute
80+
* @param obj a Class
8181
* @return a {@link TCapabilityType} proxy or <i>null</i>.
8282
*/
83-
@objid ("931754e1-5554-47f5-8ff6-719dc0fb61c5")
84-
public static TCapabilityType instantiate(final Attribute obj) {
83+
@objid ("5bc25df7-820d-4fed-b3d6-d456c0ff6067")
84+
public static TCapabilityType instantiate(final Class obj) {
8585
return TCapabilityType.canInstantiate(obj) ? new TCapabilityType(obj) : null;
8686
}
8787

8888
/**
89-
* Tries to instantiate a {@link TCapabilityType} proxy from a {@link Attribute} stereotyped << TCapabilityType >> checking its metaclass and its stereotype.
89+
* Tries to instantiate a {@link TCapabilityType} proxy from a {@link Class} stereotyped << TCapabilityType >> checking its metaclass and its stereotype.
9090
* <p>
9191
* The method throws an {@link IllegalArgumentException} if the instantiation cannot be carried out.
92-
* @param obj a {@link Attribute}
92+
* @param obj a {@link Class}
9393
* @return a {@link TCapabilityType} proxy.
9494
* @throws IllegalArgumentException if the instantiation cannot be carried out.
9595
*/
96-
@objid ("d4a17b29-dbf2-4bf3-b1e5-e8da87100411")
97-
public static TCapabilityType safeInstantiate(final Attribute obj) throws IllegalArgumentException {
96+
@objid ("aa49202d-78d2-4c55-8c59-dd0e7a1a714b")
97+
public static TCapabilityType safeInstantiate(final Class obj) throws IllegalArgumentException {
9898
if (TCapabilityType.canInstantiate(obj))
9999
return new TCapabilityType(obj);
100100
else
101101
throw new IllegalArgumentException("TCapabilityType: Cannot instantiate "+obj+": wrong element type or stereotype");
102102
}
103103

104-
@objid ("7171fffe-5e68-4589-b24b-228b2f4ce31f")
104+
@objid ("64e49d58-a162-4634-978c-fd40ae5dde99")
105105
@Override
106106
public boolean equals(final Object obj) {
107107
if (this == obj) {
@@ -118,38 +118,38 @@ public boolean equals(final Object obj) {
118118
}
119119

120120
/**
121-
* Get the underlying {@link Attribute}.
122-
* @return the Attribute represented by this proxy, never null.
121+
* Get the underlying {@link Class}.
122+
* @return the Class represented by this proxy, never null.
123123
*/
124-
@objid ("2e097b7f-0676-4f9c-b655-f18467a9bf8c")
125-
public Attribute getElement() {
124+
@objid ("2ba7cf6c-39c5-4b99-843f-7ee46daa44d7")
125+
public Class getElement() {
126126
return this.elt;
127127
}
128128

129-
@objid ("6a765897-c030-47c8-80e3-144ad4e3b54f")
129+
@objid ("b4a9699c-3652-4a6f-aa19-6a7b20c8e0da")
130130
@Override
131131
public int hashCode() {
132132
return 23 + ((this.elt == null) ? 0 : this.elt.hashCode());
133133

134134
}
135135

136-
@objid ("3e2bdb9e-4d5f-44e6-90e0-2583955e2c0c")
137-
protected TCapabilityType(final Attribute elt) {
136+
@objid ("676bbf62-740f-4a3b-8a2a-46f97ac8170c")
137+
protected TCapabilityType(final Class elt) {
138138
this.elt = elt;
139139
}
140140

141141
@objid ("4f23151a-ea23-49ca-9cf0-d94cb227254e")
142142
public static final class MdaTypes {
143-
@objid ("d2907dbc-79ef-4d76-8132-824507383d11")
143+
@objid ("1e8769cb-708b-4cb6-8c35-df6ed425ecf0")
144144
public static Stereotype STEREOTYPE_ELT;
145145

146-
@objid ("b3dbc75d-05d0-486b-9404-f384a2ab865d")
146+
@objid ("64170778-62ed-4049-9d63-b38bd34b972c")
147147
private static Stereotype MDAASSOCDEP;
148148

149-
@objid ("1efeb537-80ba-4ae7-aaa2-42009ff02224")
149+
@objid ("ff7179fe-fccc-4c85-ae4a-023fe7a292cd")
150150
private static TagType MDAASSOCDEP_ROLE;
151151

152-
@objid ("d44a1b1a-89a5-4cd9-ae56-bd2c84904d2a")
152+
@objid ("77700d5a-d4fc-497b-92bb-ab017046fa2c")
153153
public static void init(final IModelingSession session) throws MdaProxyException {
154154
List <MRef> missingRefs = new ArrayList<>();
155155
MRef mRef;

ToscaDesigner/src/main/java/fr/softeam/toscadesigner/handlers/commands/submodel/CreateServiceTemplateDigramCommand.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
import com.modeliosoft.modelio.javadesigner.annotations.objid;
55
import fr.softeam.toscadesigner.api.automatic.standard.staticdiagram.ServiceTemplateDiagram;
66
import fr.softeam.toscadesigner.api.tosca.standard.package_.TServiceTemplate;
7-
import fr.softeam.toscadesigner.api.tosca.standard.package_.ToscaModel;
87
import org.modelio.api.modelio.model.IModelingSession;
98
import org.modelio.api.modelio.model.ITransaction;
109
import org.modelio.api.module.IModule;

ToscaDesigner/src/main/java/fr/softeam/toscadesigner/handlers/propertypages/serviceTemplate/TCapabilityDefinitionPropertyPage.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import java.util.Arrays;
44
import com.modeliosoft.modelio.javadesigner.annotations.objid;
5-
import fr.softeam.toscadesigner.api.tosca.standard.attribute.TCapabilityType;
5+
import fr.softeam.toscadesigner.api.tosca.standard.class_.TCapabilityType;
66
import fr.softeam.toscadesigner.api.tosca.standard.class_.TCapabilityDefinition;
77
import fr.softeam.toscadesigner.api.tosca.standard.class_.TRelationshipType;
88
import fr.softeam.toscadesigner.handlers.propertypages.core.ToscaElementPropertyPage;
@@ -36,7 +36,7 @@ public void changeProperty(int row, String value) {
3636
for (ModelElement dep :TCapabilityType.MdaTypes.STEREOTYPE_ELT.getExtendedElement()) {
3737
if (value.contains(dep.getUuid())) {
3838
this._element.setCapabilityType(
39-
TCapabilityType.instantiate((org.modelio.metamodel.uml.statik.Attribute) dep));
39+
TCapabilityType.instantiate((org.modelio.metamodel.uml.statik.Class) dep));
4040
}
4141
}
4242
break;

ToscaDesigner/src/main/java/fr/softeam/toscadesigner/handlers/propertypages/types/TCapabilityTypePropertyPage.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import com.modeliosoft.modelio.javadesigner.annotations.objid;
44

5-
import fr.softeam.toscadesigner.api.tosca.standard.attribute.TCapabilityType;
5+
import fr.softeam.toscadesigner.api.tosca.standard.class_.TCapabilityType;
66
import fr.softeam.toscadesigner.handlers.propertypages.core.ToscaElementPropertyPage;
77

88
import org.modelio.api.module.propertiesPage.IModulePropertyTable;

0 commit comments

Comments
 (0)