diff options
Diffstat (limited to 'plugins/infra/architecture')
93 files changed, 9982 insertions, 0 deletions
diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/.classpath b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/.classpath new file mode 100644 index 00000000000..2534a1484b3 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/.classpath @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="src" path="src"/> + <classpathentry kind="src" path="src-gen"/> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/.project b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/.project new file mode 100644 index 00000000000..171b0fe340f --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.papyrus.infra.architecture.representation.edit</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> diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/META-INF/MANIFEST.MF b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..f43a8742c3b --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/META-INF/MANIFEST.MF @@ -0,0 +1,21 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.eclipse.papyrus.infra.architecture.representation.edit;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-ClassPath: . +Bundle-Activator: org.eclipse.papyrus.infra.architecture.representation.provider.RepresentationEditPlugin$Implementation +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Export-Package: org.eclipse.papyrus.infra.architecture.representation.provider +Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.12.0,4.0.0)", + org.eclipse.emf.edit;bundle-version="[2.12.0,3.0.0)";visibility:=reexport, + org.eclipse.papyrus.infra.core.architecture;bundle-version="[1.0.0,2.0.0)";visibility:=reexport, + org.eclipse.papyrus.infra.architecture.representation;bundle-version="[1.0.0,2.0.0)";visibility:=reexport, + org.eclipse.papyrus.infra.core.architecture.edit;bundle-version="[1.0.0,2.0.0)";visibility:=reexport, + org.eclipse.papyrus.infra.constraints;bundle-version="[2.0.0,3.0.0)";visibility:=reexport, + org.eclipse.papyrus.infra.constraints.edit;bundle-version="[2.0.0,3.0.0)";visibility:=reexport, + org.eclipse.papyrus.infra.types;bundle-version="[3.0.0,4.0.0)";visibility:=reexport, + org.eclipse.papyrus.infra.types.edit;bundle-version="[3.0.0,4.0.0)";visibility:=reexport +Bundle-ActivationPolicy: lazy diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/about.html b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/about.html new file mode 100644 index 00000000000..bbf2bd6aac7 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>January 30, 2017</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p> + +</body> +</html>
\ No newline at end of file diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/build.properties b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/build.properties new file mode 100644 index 00000000000..7fcb9ee906a --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/build.properties @@ -0,0 +1,21 @@ +* Copyright (c) 2017 CEA LIST. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Maged Elaasar - Initial API and implementation +# +# + +bin.includes = .,\ + icons/,\ + META-INF/,\ + plugin.xml,\ + plugin.properties +jars.compile.order = . +source.. = src-gen/,\ + src/ +output.. = bin/ diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/ctool16/CreateOwningRule_newModelPath_ModelAutoCreate.gif b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/ctool16/CreateOwningRule_newModelPath_ModelAutoCreate.gif Binary files differnew file mode 100644 index 00000000000..fb95b9aa0cf --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/ctool16/CreateOwningRule_newModelPath_ModelAutoCreate.gif diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/ctool16/CreateOwningRule_selectDiagramRoot_RootAutoSelect.gif b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/ctool16/CreateOwningRule_selectDiagramRoot_RootAutoSelect.gif Binary files differnew file mode 100644 index 00000000000..ee3c4a99628 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/ctool16/CreateOwningRule_selectDiagramRoot_RootAutoSelect.gif diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/ctool16/CreatePapyrusRepresentationKind_modelRules_ModelRule.gif b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/ctool16/CreatePapyrusRepresentationKind_modelRules_ModelRule.gif Binary files differnew file mode 100644 index 00000000000..4e7f8d9ecc7 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/ctool16/CreatePapyrusRepresentationKind_modelRules_ModelRule.gif diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/ctool16/CreatePapyrusRepresentationKind_owningRules_OwningRule.gif b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/ctool16/CreatePapyrusRepresentationKind_owningRules_OwningRule.gif Binary files differnew file mode 100644 index 00000000000..c3d4aed100c --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/ctool16/CreatePapyrusRepresentationKind_owningRules_OwningRule.gif diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/obj16/ModelAutoCreate.gif b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/obj16/ModelAutoCreate.gif Binary files differnew file mode 100644 index 00000000000..c4295364c97 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/obj16/ModelAutoCreate.gif diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/obj16/ModelRule.gif b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/obj16/ModelRule.gif Binary files differnew file mode 100644 index 00000000000..844429c8c64 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/obj16/ModelRule.gif diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/obj16/OwningRule.gif b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/obj16/OwningRule.gif Binary files differnew file mode 100644 index 00000000000..8eb92f5266e --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/obj16/OwningRule.gif diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/obj16/RootAutoSelect.gif b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/obj16/RootAutoSelect.gif Binary files differnew file mode 100644 index 00000000000..c4295364c97 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/icons/full/obj16/RootAutoSelect.gif diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/plugin.properties b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/plugin.properties new file mode 100644 index 00000000000..2b10a04920b --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/plugin.properties @@ -0,0 +1,76 @@ +* Copyright (c) 2017 CEA LIST. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Maged Elaasar - Initial API and implementation +# +# + +pluginName = Representation Edit Support +providerName=Eclipse Modeling Project + +_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_PapyrusRepresentationKind_type = Papyrus Representation Kind +_UI_PapyrusDiagram_type = Papyrus Diagram +_UI_PapyrusSyncTable_type = Papyrus Sync Table +_UI_PapyrusTable_type = Papyrus Table +_UI_Rule_type = Rule +_UI_ModelRule_type = Model Rule +_UI_OwningRule_type = Owning Rule +_UI_ChildRule_type = Child Rule +_UI_PaletteRule_type = Palette Rule +_UI_PathElement_type = Path Element +_UI_ModelAutoCreate_type = Model Auto Create +_UI_RootAutoSelect_type = Root Auto Select +_UI_AssistantRule_type = Assistant Rule +_UI_Unknown_type = Object + +_UI_Unknown_datatype= Value + +_UI_PapyrusRepresentationKind_parent_feature = Parent +_UI_PapyrusRepresentationKind_modelRules_feature = Model Rules +_UI_PapyrusRepresentationKind_owningRules_feature = Owning Rules +_UI_PapyrusRepresentationKind_implementationID_feature = Implementation ID +_UI_PapyrusDiagram_customPalette_feature = Custom Palette +_UI_PapyrusDiagram_customStyle_feature = Custom Style +_UI_PapyrusDiagram_childRules_feature = Child Rules +_UI_PapyrusDiagram_paletteRules_feature = Palette Rules +_UI_PapyrusDiagram_assistantRules_feature = Assistant Rules +_UI_PapyrusTable_configuration_feature = Configuration +_UI_Rule_permit_feature = Permit +_UI_ModelRule_element_feature = Element +_UI_ModelRule_stereotypes_feature = Stereotypes +_UI_ModelRule_multiplicity_feature = Multiplicity +_UI_OwningRule_element_feature = Element +_UI_OwningRule_stereotypes_feature = Stereotypes +_UI_OwningRule_multiplicity_feature = Multiplicity +_UI_OwningRule_newModelPath_feature = New Model Path +_UI_OwningRule_selectDiagramRoot_feature = Select Diagram Root +_UI_ChildRule_element_feature = Element +_UI_ChildRule_stereotypes_feature = Stereotypes +_UI_ChildRule_origin_feature = Origin +_UI_ChildRule_insertionPath_feature = Insertion Path +_UI_PaletteRule_element_feature = Element +_UI_PathElement_feature_feature = Feature +_UI_PathElement_origin_feature = Origin +_UI_PathElement_target_feature = Target +_UI_ModelAutoCreate_feature_feature = Feature +_UI_ModelAutoCreate_origin_feature = Origin +_UI_ModelAutoCreate_creationType_feature = Creation Type +_UI_RootAutoSelect_feature_feature = Feature +_UI_AssistantRule_elementTypeID_feature = Element Type ID +_UI_Unknown_feature = Unspecified + +_UI_PapyrusDiagram_creationCommandClass_feature = Creation Command Class diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/plugin.xml b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/plugin.xml new file mode 100644 index 00000000000..9c884712e5e --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/plugin.xml @@ -0,0 +1,33 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.0"?> + +<!-- +* Copyright (c) 2017 CEA LIST. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Eclipse Public License v1.0 + which accompanies this distribution, and is available at + http://www.eclipse.org/legal/epl-v10.html + + Contributors: + Maged Elaasar - Initial API and implementation + + +--> + +<plugin> + + <extension point="org.eclipse.emf.edit.itemProviderAdapterFactories"> + <!-- @generated Representation --> + <factory + uri="http://www.eclipse.org/papyrus/infra/core/architecture/representation" + class="org.eclipse.papyrus.infra.architecture.representation.provider.RepresentationItemProviderAdapterFactory" + supportedTypes= + "org.eclipse.emf.edit.provider.IEditingDomainItemProvider + org.eclipse.emf.edit.provider.IStructuredItemContentProvider + org.eclipse.emf.edit.provider.ITreeItemContentProvider + org.eclipse.emf.edit.provider.IItemLabelProvider + org.eclipse.emf.edit.provider.IItemPropertySource"/> + </extension> + +</plugin> diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/pom.xml b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/pom.xml new file mode 100644 index 00000000000..45b95e5cf0d --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/pom.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.eclipse.papyrus</groupId> + <artifactId>org.eclipse.papyrus.infra-architecture</artifactId> + <version>0.0.1-SNAPSHOT</version> + </parent> + <artifactId>org.eclipse.papyrus.infra.architecture.representation.edit</artifactId> + <version>1.0.0-SNAPSHOT</version> + <packaging>eclipse-plugin</packaging> +</project> diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/ModelAutoCreateItemProvider.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/ModelAutoCreateItemProvider.java new file mode 100644 index 00000000000..d5a8c2607dc --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/ModelAutoCreateItemProvider.java @@ -0,0 +1,219 @@ +/** +* Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IChildCreationExtender; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate; +import org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate} object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class ModelAutoCreateItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ModelAutoCreateItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addFeaturePropertyDescriptor(object); + addOriginPropertyDescriptor(object); + addCreationTypePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Feature feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + protected void addFeaturePropertyDescriptor(Object object) { + itemPropertyDescriptors.add(new EReferencePropertyDescriptor( + createItemPropertyDescriptor + (((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ModelAutoCreate_feature_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ModelAutoCreate_feature_feature", "_UI_ModelAutoCreate_type"), + RepresentationPackage.Literals.MODEL_AUTO_CREATE__FEATURE, + true, + false, + true, + null, + null, + null))); + } + + /** + * This adds a property descriptor for the Origin feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addOriginPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ModelAutoCreate_origin_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ModelAutoCreate_origin_feature", "_UI_ModelAutoCreate_type"), + RepresentationPackage.Literals.MODEL_AUTO_CREATE__ORIGIN, + false, + false, + false, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Creation Type feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + protected void addCreationTypePropertyDescriptor(Object object) { + itemPropertyDescriptors.add(new ComplexTypePropertyDescriptor(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ModelAutoCreate_creationType_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ModelAutoCreate_creationType_feature", "_UI_ModelAutoCreate_type"), + RepresentationPackage.Literals.MODEL_AUTO_CREATE__CREATION_TYPE, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null))); + } + + /** + * This returns ModelAutoCreate.gif. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/ModelAutoCreate")); + } + + /** + * This returns the label text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + */ + @Override + public String getText(Object object) { + ModelAutoCreate path = (ModelAutoCreate) object; + StringBuilder builder = new StringBuilder(); + EClass origin = path.getOrigin(); + EReference feature = path.getFeature(); + String target = path.getCreationType(); + builder.append(origin != null ? origin.getName() : "?"); + builder.append("."); + builder.append(feature != null ? feature.getName() : "?"); + builder.append(" = new "); + builder.append(target != null ? target : "?"); + return builder.toString(); + } + + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(ModelAutoCreate.class)) { + case RepresentationPackage.MODEL_AUTO_CREATE__CREATION_TYPE: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return ((IChildCreationExtender)adapterFactory).getResourceLocator(); + } + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/ModelRuleItemProvider.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/ModelRuleItemProvider.java new file mode 100644 index 00000000000..b423bf321f4 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/ModelRuleItemProvider.java @@ -0,0 +1,265 @@ +/** +* Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.infra.constraints.ConstraintsFactory; +import org.eclipse.papyrus.infra.constraints.ConstraintsPackage; +import org.eclipse.papyrus.infra.architecture.representation.ModelRule; +import org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.architecture.representation.ModelRule} object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class ModelRuleItemProvider extends RuleItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ModelRuleItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addElementMultiplicityPropertyDescriptor(object); + addElementPropertyDescriptor(object); + addStereotypesPropertyDescriptor(object); + addMultiplicityPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Element Multiplicity feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addElementMultiplicityPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_DisplayUnit_elementMultiplicity_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_DisplayUnit_elementMultiplicity_feature", "_UI_DisplayUnit_type"), + ConstraintsPackage.Literals.DISPLAY_UNIT__ELEMENT_MULTIPLICITY, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This adds a property descriptor for the Element feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + protected void addElementPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(new EClassPropertyDescriptor(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ModelRule_element_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ModelRule_element_feature", "_UI_ModelRule_type"), + RepresentationPackage.Literals.MODEL_RULE__ELEMENT, + true, + false, + true, + null, + null, + null))); + } + + /** + * This adds a property descriptor for the Stereotypes feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + protected void addStereotypesPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(new StereotypePropertyDescriptor(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ModelRule_stereotypes_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ModelRule_stereotypes_feature", "_UI_ModelRule_type"), + RepresentationPackage.Literals.MODEL_RULE__STEREOTYPES, + true, + false, + true, + null, + null, + null))); + } + + /** + * This adds a property descriptor for the Multiplicity feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addMultiplicityPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_ModelRule_multiplicity_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_ModelRule_multiplicity_feature", "_UI_ModelRule_type"), + RepresentationPackage.Literals.MODEL_RULE__MULTIPLICITY, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(ConstraintsPackage.Literals.DISPLAY_UNIT__CONSTRAINTS); + } + return childrenFeatures; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + /** + * This returns ModelRule.gif. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/ModelRule")); + } + + /** + * This returns the label text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + */ + @Override + public String getText(Object object) { + ModelRule rule = (ModelRule) object; + StringBuilder builder = new StringBuilder("Root: "); + if (!rule.getStereotypes().isEmpty()) { + builder.append("<<"); + for (int i = 0; i != rule.getStereotypes().size(); i++) { + if (i != 0) { + builder.append(","); + } + builder.append(rule.getStereotypes().get(i).getName()); + } + builder.append(">> "); + } + builder.append(rule.getElement() != null ? rule.getElement().getName() : "#"); + builder.append("["); + builder.append(rule.getMultiplicity() == -1 ? "*" : rule.getMultiplicity()); + builder.append("] => "); + builder.append(rule.isPermit() ? "allow" : "deny"); + return builder.toString(); + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(ModelRule.class)) { + case RepresentationPackage.MODEL_RULE__ELEMENT_MULTIPLICITY: + case RepresentationPackage.MODEL_RULE__MULTIPLICITY: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case RepresentationPackage.MODEL_RULE__CONSTRAINTS: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add + (createChildParameter + (ConstraintsPackage.Literals.DISPLAY_UNIT__CONSTRAINTS, + ConstraintsFactory.eINSTANCE.createSimpleConstraint())); + + newChildDescriptors.add + (createChildParameter + (ConstraintsPackage.Literals.DISPLAY_UNIT__CONSTRAINTS, + ConstraintsFactory.eINSTANCE.createCompositeConstraint())); + } + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/OwningRuleItemProvider.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/OwningRuleItemProvider.java new file mode 100644 index 00000000000..b96674f3ada --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/OwningRuleItemProvider.java @@ -0,0 +1,242 @@ +/** +* Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.infra.architecture.representation.OwningRule; +import org.eclipse.papyrus.infra.architecture.representation.RepresentationFactory; +import org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.architecture.representation.OwningRule} object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class OwningRuleItemProvider extends RuleItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public OwningRuleItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addElementPropertyDescriptor(object); + addStereotypesPropertyDescriptor(object); + addMultiplicityPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Element feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + protected void addElementPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(new EClassPropertyDescriptor(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_OwningRule_element_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_OwningRule_element_feature", "_UI_OwningRule_type"), + RepresentationPackage.Literals.OWNING_RULE__ELEMENT, + true, + false, + true, + null, + null, + null))); + } + + /** + * This adds a property descriptor for the Stereotypes feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated NOT + */ + protected void addStereotypesPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(new StereotypePropertyDescriptor(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_OwningRule_stereotypes_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_OwningRule_stereotypes_feature", "_UI_OwningRule_type"), + RepresentationPackage.Literals.OWNING_RULE__STEREOTYPES, + true, + false, + true, + null, + null, + null))); + } + + /** + * This adds a property descriptor for the Multiplicity feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addMultiplicityPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_OwningRule_multiplicity_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_OwningRule_multiplicity_feature", "_UI_OwningRule_type"), + RepresentationPackage.Literals.OWNING_RULE__MULTIPLICITY, + true, + false, + false, + ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, + null, + null)); + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(RepresentationPackage.Literals.OWNING_RULE__NEW_MODEL_PATH); + childrenFeatures.add(RepresentationPackage.Literals.OWNING_RULE__SELECT_DIAGRAM_ROOT); + } + return childrenFeatures; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + /** + * This returns OwningRule.gif. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/OwningRule")); + } + + /** + * This returns the label text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + */ + @Override + public String getText(Object object) { + OwningRule rule = (OwningRule) object; + StringBuilder builder = new StringBuilder("Owner: "); + if (!rule.getStereotypes().isEmpty()) { + builder.append("<<"); + for (int i = 0; i != rule.getStereotypes().size(); i++) { + if (i != 0) { + builder.append(","); + } + builder.append(rule.getStereotypes().get(i).getName()); + } + builder.append(">> "); + } + builder.append(rule.getElement() != null ? rule.getElement().getName() : "#"); + builder.append("["); + builder.append(rule.getMultiplicity() == -1 ? "*" : rule.getMultiplicity()); + builder.append("] => "); + builder.append(rule.isPermit() ? "allow" : "deny"); + return builder.toString(); + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(OwningRule.class)) { + case RepresentationPackage.OWNING_RULE__MULTIPLICITY: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case RepresentationPackage.OWNING_RULE__NEW_MODEL_PATH: + case RepresentationPackage.OWNING_RULE__SELECT_DIAGRAM_ROOT: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add + (createChildParameter + (RepresentationPackage.Literals.OWNING_RULE__NEW_MODEL_PATH, + RepresentationFactory.eINSTANCE.createModelAutoCreate())); + + newChildDescriptors.add + (createChildParameter + (RepresentationPackage.Literals.OWNING_RULE__SELECT_DIAGRAM_ROOT, + RepresentationFactory.eINSTANCE.createRootAutoSelect())); + } + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/PapyrusRepresentationKindItemProvider.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/PapyrusRepresentationKindItemProvider.java new file mode 100644 index 00000000000..e159b0a91e5 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/PapyrusRepresentationKindItemProvider.java @@ -0,0 +1,215 @@ +/** +* Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.infra.core.architecture.ArchitectureDescriptionLanguage; +import org.eclipse.papyrus.infra.core.architecture.provider.RepresentationKindItemProvider; +import org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind; +import org.eclipse.papyrus.infra.architecture.representation.RepresentationFactory; +import org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind} object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class PapyrusRepresentationKindItemProvider extends RepresentationKindItemProvider { + /** + * This constructs an instance from a factory and a notifier. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public PapyrusRepresentationKindItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addParentPropertyDescriptor(object); + addImplementationIDPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Parent feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addParentPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_PapyrusRepresentationKind_parent_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_PapyrusRepresentationKind_parent_feature", "_UI_PapyrusRepresentationKind_type"), + RepresentationPackage.Literals.PAPYRUS_REPRESENTATION_KIND__PARENT, + true, + false, + true, + null, + null, + null)); + } + + /** + * This adds a property descriptor for the Implementation ID feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addImplementationIDPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_PapyrusRepresentationKind_implementationID_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_PapyrusRepresentationKind_implementationID_feature", "_UI_PapyrusRepresentationKind_type"), + RepresentationPackage.Literals.PAPYRUS_REPRESENTATION_KIND__IMPLEMENTATION_ID, + true, + false, + false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, + null, + null)); + } + + /** + * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an + * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or + * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(RepresentationPackage.Literals.PAPYRUS_REPRESENTATION_KIND__MODEL_RULES); + childrenFeatures.add(RepresentationPackage.Literals.PAPYRUS_REPRESENTATION_KIND__OWNING_RULES); + } + return childrenFeatures; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + /** + * This returns the label text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String getText(Object object) { + String label = ((PapyrusRepresentationKind)object).getName(); + return label == null || label.length() == 0 ? + getString("_UI_PapyrusRepresentationKind_type") : + getString("_UI_PapyrusRepresentationKind_type") + " " + label; + } + + /** + * This returns the label text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + */ + protected static String getTextFor(PapyrusRepresentationKind view) { + ArchitectureDescriptionLanguage lang = (ArchitectureDescriptionLanguage) view.eContainer(); + if (view.getName() == null) { + return (lang.getName() + " :: <natural> [" + view.getImplementationID() + "]"); + } + return (lang.getName() + " :: " + view.getName()); + } + + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(PapyrusRepresentationKind.class)) { + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__IMPLEMENTATION_ID: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__MODEL_RULES: + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__OWNING_RULES: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add + (createChildParameter + (RepresentationPackage.Literals.PAPYRUS_REPRESENTATION_KIND__MODEL_RULES, + RepresentationFactory.eINSTANCE.createModelRule())); + + newChildDescriptors.add + (createChildParameter + (RepresentationPackage.Literals.PAPYRUS_REPRESENTATION_KIND__OWNING_RULES, + RepresentationFactory.eINSTANCE.createOwningRule())); + } + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/RepresentationEditPlugin.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/RepresentationEditPlugin.java new file mode 100644 index 00000000000..6aecd4e8cc9 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/RepresentationEditPlugin.java @@ -0,0 +1,105 @@ +/** +* Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation.provider; + +import org.eclipse.emf.common.EMFPlugin; +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.papyrus.infra.constraints.provider.ConstraintsEditPlugin; +import org.eclipse.papyrus.infra.core.architecture.provider.ArchitectureEditPlugin; +import org.eclipse.papyrus.infra.types.provider.TypesConfigurationsEditPlugin; + +/** + * This is the central singleton for the Representation edit plugin. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public final class RepresentationEditPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static final RepresentationEditPlugin INSTANCE = new RepresentationEditPlugin(); + + /** + * 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 RepresentationEditPlugin() { + super + (new ResourceLocator [] { + ArchitectureEditPlugin.INSTANCE, + ConstraintsEditPlugin.INSTANCE, + TypesConfigurationsEditPlugin.INSTANCE, + }); + } + + /** + * 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; + } + } + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/RepresentationItemProviderAdapterFactory.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/RepresentationItemProviderAdapterFactory.java new file mode 100644 index 00000000000..1fd81305a2c --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/RepresentationItemProviderAdapterFactory.java @@ -0,0 +1,321 @@ +/** +* Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation.provider; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.Notifier; +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.edit.provider.ChangeNotifier; +import org.eclipse.emf.edit.provider.ChildCreationExtenderManager; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.ComposedAdapterFactory; +import org.eclipse.emf.edit.provider.IChangeNotifier; +import org.eclipse.emf.edit.provider.IChildCreationExtender; +import org.eclipse.emf.edit.provider.IDisposable; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.INotifyChangedListener; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage; +import org.eclipse.papyrus.infra.architecture.representation.util.RepresentationAdapterFactory; + +/** + * This is the factory that is used to provide the interfaces needed to support Viewers. + * The adapters generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged fireNotifyChanged}. + * The adapters also support Eclipse property sheets. + * Note that most of the adapters are shared among multiple instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class RepresentationItemProviderAdapterFactory extends RepresentationAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable, IChildCreationExtender { + /** + * This keeps track of the root adapter factory that delegates to this adapter factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected ComposedAdapterFactory parentAdapterFactory; + + /** + * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected IChangeNotifier changeNotifier = new ChangeNotifier(); + + /** + * This helps manage the child creation extenders. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected ChildCreationExtenderManager childCreationExtenderManager = new ChildCreationExtenderManager(RepresentationEditPlugin.INSTANCE, RepresentationPackage.eNS_URI); + + /** + * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected Collection<Object> supportedTypes = new ArrayList<Object>(); + + /** + * This constructs an instance. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public RepresentationItemProviderAdapterFactory() { + supportedTypes.add(IEditingDomainItemProvider.class); + supportedTypes.add(IStructuredItemContentProvider.class); + supportedTypes.add(ITreeItemContentProvider.class); + supportedTypes.add(IItemLabelProvider.class); + supportedTypes.add(IItemPropertySource.class); + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.infra.architecture.representation.ModelRule} instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected ModelRuleItemProvider modelRuleItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.infra.architecture.representation.ModelRule}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Adapter createModelRuleAdapter() { + if (modelRuleItemProvider == null) { + modelRuleItemProvider = new ModelRuleItemProvider(this); + } + + return modelRuleItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.infra.architecture.representation.OwningRule} instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected OwningRuleItemProvider owningRuleItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.infra.architecture.representation.OwningRule}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Adapter createOwningRuleAdapter() { + if (owningRuleItemProvider == null) { + owningRuleItemProvider = new OwningRuleItemProvider(this); + } + + return owningRuleItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate} instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected ModelAutoCreateItemProvider modelAutoCreateItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Adapter createModelAutoCreateAdapter() { + if (modelAutoCreateItemProvider == null) { + modelAutoCreateItemProvider = new ModelAutoCreateItemProvider(this); + } + + return modelAutoCreateItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.infra.architecture.representation.RootAutoSelect} instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected RootAutoSelectItemProvider rootAutoSelectItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.papyrus.infra.architecture.representation.RootAutoSelect}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Adapter createRootAutoSelectAdapter() { + if (rootAutoSelectItemProvider == null) { + rootAutoSelectItemProvider = new RootAutoSelectItemProvider(this); + } + + return rootAutoSelectItemProvider; + } + + /** + * This returns the root adapter factory that contains this factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ComposeableAdapterFactory getRootAdapterFactory() { + return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); + } + + /** + * This sets the composed adapter factory that contains this factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { + this.parentAdapterFactory = parentAdapterFactory; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean isFactoryForType(Object type) { + return supportedTypes.contains(type) || super.isFactoryForType(type); + } + + /** + * This implementation substitutes the factory itself as the key for the adapter. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Adapter adapt(Notifier notifier, Object type) { + return super.adapt(notifier, this); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object adapt(Object object, Object type) { + if (isFactoryForType(type)) { + Object adapter = super.adapt(object, type); + if (!(type instanceof Class<?>) || (((Class<?>)type).isInstance(adapter))) { + return adapter; + } + } + + return null; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public List<IChildCreationExtender> getChildCreationExtenders() { + return childCreationExtenderManager.getChildCreationExtenders(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public Collection<?> getNewChildDescriptors(Object object, EditingDomain editingDomain) { + return childCreationExtenderManager.getNewChildDescriptors(object, editingDomain); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ResourceLocator getResourceLocator() { + return childCreationExtenderManager; + } + + /** + * This adds a listener. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void addListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.addListener(notifyChangedListener); + } + + /** + * This removes a listener. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void removeListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.removeListener(notifyChangedListener); + } + + /** + * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void fireNotifyChanged(Notification notification) { + changeNotifier.fireNotifyChanged(notification); + + if (parentAdapterFactory != null) { + parentAdapterFactory.fireNotifyChanged(notification); + } + } + + /** + * This disposes all of the item providers created by this factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void dispose() { + if (modelRuleItemProvider != null) modelRuleItemProvider.dispose(); + if (owningRuleItemProvider != null) owningRuleItemProvider.dispose(); + if (modelAutoCreateItemProvider != null) modelAutoCreateItemProvider.dispose(); + if (rootAutoSelectItemProvider != null) rootAutoSelectItemProvider.dispose(); + } + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/RootAutoSelectItemProvider.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/RootAutoSelectItemProvider.java new file mode 100644 index 00000000000..4d42a3d3833 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/RootAutoSelectItemProvider.java @@ -0,0 +1,155 @@ +/** +* Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IChildCreationExtender; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.architecture.representation.RootAutoSelect} object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class RootAutoSelectItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public RootAutoSelectItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addFeaturePropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Feature feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addFeaturePropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_RootAutoSelect_feature_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_RootAutoSelect_feature_feature", "_UI_RootAutoSelect_type"), + RepresentationPackage.Literals.ROOT_AUTO_SELECT__FEATURE, + true, + false, + true, + null, + null, + null)); + } + + /** + * This returns RootAutoSelect.gif. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/RootAutoSelect")); + } + + /** + * This returns the label text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_RootAutoSelect_type"); + } + + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return ((IChildCreationExtender)adapterFactory).getResourceLocator(); + } + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/RuleItemProvider.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/RuleItemProvider.java new file mode 100644 index 00000000000..4568ace215f --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen/org/eclipse/papyrus/infra/architecture/representation/provider/RuleItemProvider.java @@ -0,0 +1,154 @@ +/** +* Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation.provider; + + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.IChildCreationExtender; +import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.IItemPropertySource; +import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; +import org.eclipse.emf.edit.provider.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; +import org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage; +import org.eclipse.papyrus.infra.architecture.representation.Rule; + +/** + * This is the item provider adapter for a {@link org.eclipse.papyrus.infra.architecture.representation.Rule} object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ +public class RuleItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + IStructuredItemContentProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public RuleItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addPermitPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Permit feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected void addPermitPropertyDescriptor(Object object) { + itemPropertyDescriptors.add + (createItemPropertyDescriptor + (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), + getResourceLocator(), + getString("_UI_Rule_permit_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_Rule_permit_feature", "_UI_Rule_type"), + RepresentationPackage.Literals.RULE__PERMIT, + true, + false, + false, + ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, + null, + null)); + } + + /** + * This returns the label text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String getText(Object object) { + Rule rule = (Rule)object; + return getString("_UI_Rule_type") + " " + rule.isPermit(); + } + + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(Rule.class)) { + case RepresentationPackage.RULE__PERMIT: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return ((IChildCreationExtender)adapterFactory).getResourceLocator(); + } + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src/org/eclipse/papyrus/infra/architecture/representation/provider/ComplexTypePropertyDescriptor.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src/org/eclipse/papyrus/infra/architecture/representation/provider/ComplexTypePropertyDescriptor.java new file mode 100644 index 00000000000..fdad8254577 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src/org/eclipse/papyrus/infra/architecture/representation/provider/ComplexTypePropertyDescriptor.java @@ -0,0 +1,71 @@ +/***************************************************************************** + * Copyright (c) 2014 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.architecture.representation.provider; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.gmf.runtime.emf.type.core.ClientContextManager; +import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry; +import org.eclipse.gmf.runtime.emf.type.core.IClientContext; +import org.eclipse.gmf.runtime.emf.type.core.IElementType; +import org.eclipse.papyrus.infra.core.architecture.ArchitectureDescriptionLanguage; +import org.eclipse.papyrus.infra.core.architecture.provider.SurrogateItemPropertyDescriptor; +import org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate; +import org.eclipse.papyrus.infra.architecture.representation.OwningRule; +import org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind; + +/** + * This is used for the ModelAutoCreate.target property because we may want to create stereotyped elements + * + * @author Laurent Wouters + */ +public class ComplexTypePropertyDescriptor extends SurrogateItemPropertyDescriptor { + /** + * Constructor. + * + * @param inner + */ + public ComplexTypePropertyDescriptor(IItemPropertyDescriptor inner) { + super(inner); + } + + /** + * @see org.eclipse.papyrus.infra.architecture.representation.provider.SurrogateItemPropertyDescriptor#getChoiceOfValues(java.lang.Object) + * + * @param object + * @return + */ + @Override + public Collection<?> getChoiceOfValues(Object object) { + ModelAutoCreate rule = (ModelAutoCreate) object; + OwningRule owningRule = (OwningRule) rule.eContainer(); + PapyrusRepresentationKind repKind = (PapyrusRepresentationKind) owningRule.eContainer(); + ArchitectureDescriptionLanguage language = repKind.getLanguage(); + + List<String> result = new ArrayList<String>(); + IClientContext context = ClientContextManager.getInstance().getClientContext(language.getId()); + IElementType[] types = ElementTypeRegistry.getInstance().getElementTypes(context); + if (types != null) { + for (IElementType type : types) { + result.add(type.getId()); + } + } + Collections.sort(result); + return result; + } +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src/org/eclipse/papyrus/infra/architecture/representation/provider/EClassPropertyDescriptor.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src/org/eclipse/papyrus/infra/architecture/representation/provider/EClassPropertyDescriptor.java new file mode 100644 index 00000000000..c371046190e --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src/org/eclipse/papyrus/infra/architecture/representation/provider/EClassPropertyDescriptor.java @@ -0,0 +1,73 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.architecture.representation.provider; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.papyrus.infra.core.architecture.ArchitectureDescriptionLanguage; +import org.eclipse.papyrus.infra.core.architecture.provider.SurrogateItemPropertyDescriptor; + +/** + * Represents a descriptor for properties of type EClass + * + * @author Laurent Wouters + */ +public class EClassPropertyDescriptor extends SurrogateItemPropertyDescriptor { + private static final Collection<EObject> empty = new ArrayList<EObject>(); + + /** + * Constructor. + * + * @param inner + */ + public EClassPropertyDescriptor(IItemPropertyDescriptor inner) { + super(inner); + } + + /** + * @see org.eclipse.papyrus.infra.architecture.representation.provider.SurrogateItemPropertyDescriptor#getChoiceOfValues(java.lang.Object) + * + * @param object + * @return + */ + @Override + public Collection<?> getChoiceOfValues(Object object) { + EObject current = (EObject) object; + while (current != null && !(current instanceof ArchitectureDescriptionLanguage)) { + current = current.eContainer(); + } + if (current == null) { + return empty; + } + ArchitectureDescriptionLanguage conf = (ArchitectureDescriptionLanguage) current; + List<EClass> result = new ArrayList<EClass>(); + EPackage p = conf.getMetamodel(); + if (p == null) { + return result; + } + for (EClassifier c : p.getEClassifiers()) { + if (c instanceof EClass) { + result.add((EClass) c); + } + } + return result; + } +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src/org/eclipse/papyrus/infra/architecture/representation/provider/EReferencePropertyDescriptor.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src/org/eclipse/papyrus/infra/architecture/representation/provider/EReferencePropertyDescriptor.java new file mode 100644 index 00000000000..7a435e24b48 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src/org/eclipse/papyrus/infra/architecture/representation/provider/EReferencePropertyDescriptor.java @@ -0,0 +1,49 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + *****************************************************************************/ +package org.eclipse.papyrus.infra.architecture.representation.provider; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.papyrus.infra.core.architecture.provider.SurrogateItemPropertyDescriptor; +import org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate; + +/** + * Represents a descriptor for properties of type EReference + * + * @author Laurent Wouters + */ +public class EReferencePropertyDescriptor extends SurrogateItemPropertyDescriptor { + private static final Collection<?> empty = new ArrayList<EReference>(); + + public EReferencePropertyDescriptor(IItemPropertyDescriptor inner) { + super(inner); + } + + @Override + public Collection<?> getChoiceOfValues(Object object) { + if (object instanceof ModelAutoCreate) { + ModelAutoCreate pe = (ModelAutoCreate) object; + EClass origin = pe.getOrigin(); + if (origin == null) { + return empty; + } + return origin.getEAllReferences(); + } + return empty; + } +}
\ No newline at end of file diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src/org/eclipse/papyrus/infra/architecture/representation/provider/StereotypePropertyDescriptor.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src/org/eclipse/papyrus/infra/architecture/representation/provider/StereotypePropertyDescriptor.java new file mode 100644 index 00000000000..8c833508b50 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation.edit/src/org/eclipse/papyrus/infra/architecture/representation/provider/StereotypePropertyDescriptor.java @@ -0,0 +1,118 @@ +/***************************************************************************** + * Copyright (c) 2013 CEA LIST. + * + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * Benoit Maggi benoit.maggi@cea.fr - Bug 473366 : get stereotype recursively + *****************************************************************************/ +package org.eclipse.papyrus.infra.architecture.representation.provider; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EClassifier; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.edit.provider.IItemLabelProvider; +import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; +import org.eclipse.papyrus.infra.core.architecture.ArchitectureDescriptionLanguage; +import org.eclipse.papyrus.infra.core.architecture.provider.SurrogateItemPropertyDescriptor; + +/** + * Represents a descriptor for stereotype properties + * + * @author Laurent Wouters + */ +public class StereotypePropertyDescriptor extends SurrogateItemPropertyDescriptor { + private static final Collection<EObject> empty = new ArrayList<EObject>(); + + public StereotypePropertyDescriptor(IItemPropertyDescriptor inner) { + super(inner); + } + + /** + * @see org.eclipse.papyrus.infra.architecture.representation.provider.SurrogateItemPropertyDescriptor#getChoiceOfValues(java.lang.Object) + * + * @param object + * @return + */ + @Override + public Collection<?> getChoiceOfValues(Object object) { + EObject current = (EObject) object; + while (current != null && !(current instanceof ArchitectureDescriptionLanguage)) { + current = current.eContainer(); + } + if (current == null) { + return empty; + } + ArchitectureDescriptionLanguage conf = (ArchitectureDescriptionLanguage) current; + List<EClass> result = new ArrayList<EClass>(); + for (EPackage p : conf.getProfiles()) { + result.addAll(getAllStereotypes(p)); + } + return result; + } + + + /** + * Get all stereotype contained (even in sub package) + * @param ePackage + * @return + */ + protected List<EClass> getAllStereotypes(EPackage ePackage) { + List<EClass> result = new ArrayList<EClass>(); + for (EClassifier clazz : ePackage.getEClassifiers()) { + if (clazz instanceof EClass) { + result.add((EClass) clazz); + } + } + for (EPackage subPackage : ePackage.getESubpackages()) { + result.addAll(getAllStereotypes(subPackage)); + } + return result; + } + + @Override + public IItemLabelProvider getLabelProvider(Object object) { + return new IItemLabelProvider() { + public String getText(Object object) { + if (object instanceof EClass) { + return eClassToString((EClass) object); + } + if (object instanceof EList<?>) { + EList<?> list = (EList<?>) object; + if (list.isEmpty()) { + return ""; + } + StringBuilder builder = new StringBuilder("{"); + for (int i = 0; i != list.size(); i++) { + if (i != 0) { + builder.append(", "); + } + builder.append(eClassToString((EClass) list.get(i))); + } + builder.append("}"); + return builder.toString(); + } + return ""; + } + + public Object getImage(Object object) { + return null; + } + }; + } + + private String eClassToString(EClass item) { + return item.getEPackage().getNsPrefix() + "#" + item.getName(); + } +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/.classpath b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/.classpath new file mode 100644 index 00000000000..f0c55498599 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/.classpath @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="src" path="src-gen"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/.project b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/.project new file mode 100644 index 00000000000..d630a445dcd --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.papyrus.infra.architecture.representation</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.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/.settings/org.eclipse.core.resources.prefs b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000000..7ec365db4eb --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,2 @@ +eclipse.preferences.version=1 +encoding//model/Representation.ecore_diagram=UTF-8 diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/.settings/org.eclipse.jdt.core.prefs b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..0c68a61dca8 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/META-INF/MANIFEST.MF b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..fd9fe5cc24b --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/META-INF/MANIFEST.MF @@ -0,0 +1,18 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.eclipse.papyrus.infra.architecture.representation;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Export-Package: org.eclipse.papyrus.infra.architecture.representation, + org.eclipse.papyrus.infra.architecture.representation.impl, + org.eclipse.papyrus.infra.architecture.representation.util +Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.12.0,4.0.0)", + org.eclipse.emf.ecore;bundle-version="[2.12.0,3.0.0)";visibility:=reexport, + org.eclipse.papyrus.infra.constraints;bundle-version="[2.0.0,3.0.0)";visibility:=reexport, + org.eclipse.papyrus.infra.types;visibility:=reexport, + org.eclipse.papyrus.infra.core.architecture;bundle-version="[1.0.0,2.0.0)";visibility:=reexport +Bundle-ActivationPolicy: lazy diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/about.html b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/about.html new file mode 100644 index 00000000000..bbf2bd6aac7 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>January 30, 2017</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p> + +</body> +</html>
\ No newline at end of file diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/build.properties b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/build.properties new file mode 100644 index 00000000000..0e30cb6a26e --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/build.properties @@ -0,0 +1,21 @@ +* Copyright (c) 2017 CEA LIST. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Maged Elaasar - Initial API and implementation +# +# + +bin.includes = .,\ + model/,\ + META-INF/,\ + plugin.xml,\ + plugin.properties +jars.compile.order = . +source.. = src-gen/,\ + src/ +output.. = bin/ diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/model/Representation.ecore b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/model/Representation.ecore new file mode 100755 index 00000000000..5b891670fbb --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/model/Representation.ecore @@ -0,0 +1,58 @@ +<?xml version="1.0" encoding="UTF-8"?> +<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="representation" nsURI="http://www.eclipse.org/papyrus/infra/core/architecture/representation" + nsPrefix="representation"> + <eClassifiers xsi:type="ecore:EClass" name="PapyrusRepresentationKind" abstract="true" + eSuperTypes="../../org.eclipse.papyrus.infra.core.architecture/model/Architecture.ecore#//RepresentationKind"> + <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//PapyrusRepresentationKind"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="modelRules" lowerBound="1" + upperBound="-1" eType="#//ModelRule" containment="true"> + <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> + <details key="documentation" value="These rules determine which model elements can be the semantic element behind this diagram"/> + </eAnnotations> + </eStructuralFeatures> + <eStructuralFeatures xsi:type="ecore:EReference" name="owningRules" lowerBound="1" + upperBound="-1" eType="#//OwningRule" containment="true"> + <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> + <details key="documentation" value="These rules determine which elements can be the syntactic owner of this diagram"/> + </eAnnotations> + </eStructuralFeatures> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="implementationID" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Rule" abstract="true"> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="permit" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EBoolean" defaultValueLiteral="true"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="ModelRule" eSuperTypes="#//Rule ../../org.eclipse.papyrus.infra.constraints/Model/Constraints.ecore#//DisplayUnit"> + <eStructuralFeatures xsi:type="ecore:EReference" name="element" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EClass"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="stereotypes" upperBound="-1" + eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EClass"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="multiplicity" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" defaultValueLiteral="-1"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="OwningRule" eSuperTypes="#//Rule"> + <eStructuralFeatures xsi:type="ecore:EReference" name="element" eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EClass"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="stereotypes" upperBound="-1" + eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EClass"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="multiplicity" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" defaultValueLiteral="-1"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="newModelPath" upperBound="-1" + eType="#//ModelAutoCreate" containment="true"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="selectDiagramRoot" upperBound="-1" + eType="#//RootAutoSelect" containment="true"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="ModelAutoCreate"> + <eStructuralFeatures xsi:type="ecore:EReference" name="feature" lowerBound="1" + eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EReference"/> + <eStructuralFeatures xsi:type="ecore:EReference" name="origin" lowerBound="1" + eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EClass" changeable="false" + volatile="true" transient="true" derived="true"/> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="creationType" lowerBound="1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="RootAutoSelect"> + <eStructuralFeatures xsi:type="ecore:EReference" name="feature" lowerBound="1" + eType="ecore:EClass http://www.eclipse.org/emf/2002/Ecore#//EReference"/> + </eClassifiers> +</ecore:EPackage> diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/model/Representation.ecore_diagram b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/model/Representation.ecore_diagram new file mode 100644 index 00000000000..2e73b597ddf --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/model/Representation.ecore_diagram @@ -0,0 +1,184 @@ +<?xml version="1.0" encoding="UTF-8"?> +<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmi:id="_5ux9gMRoEeaCrrNUITTDvQ" type="Ecore" measurementUnit="Pixel"> + <children xmi:type="notation:Shape" xmi:id="_6FZGsMRoEeaCrrNUITTDvQ" type="2001" fontName=".SF NS Text"> + <children xmi:type="notation:DecorationNode" xmi:id="_6FiQoMRoEeaCrrNUITTDvQ" type="5001"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_6Fi3sMRoEeaCrrNUITTDvQ" type="7001"> + <styles xmi:type="notation:SortingStyle" xmi:id="_6Fi3scRoEeaCrrNUITTDvQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_6Fi3ssRoEeaCrrNUITTDvQ"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_6Fi3s8RoEeaCrrNUITTDvQ" type="7002"> + <styles xmi:type="notation:SortingStyle" xmi:id="_6Fi3tMRoEeaCrrNUITTDvQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_6Fi3tcRoEeaCrrNUITTDvQ"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_6Fi3tsRoEeaCrrNUITTDvQ" type="7003"> + <styles xmi:type="notation:SortingStyle" xmi:id="_6Fi3t8RoEeaCrrNUITTDvQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_6Fi3uMRoEeaCrrNUITTDvQ"/> + </children> + <element xmi:type="ecore:EClass" href="Representation.ecore#//PapyrusRepresentationKind"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_6FZtwMRoEeaCrrNUITTDvQ" x="90" y="9"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_6Fl7AMRoEeaCrrNUITTDvQ" type="2001" fontName=".SF NS Text"> + <children xmi:type="notation:DecorationNode" xmi:id="_6Fl7AsRoEeaCrrNUITTDvQ" type="5001"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_6Fl7A8RoEeaCrrNUITTDvQ" type="7001"> + <styles xmi:type="notation:SortingStyle" xmi:id="_6Fl7BMRoEeaCrrNUITTDvQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_6Fl7BcRoEeaCrrNUITTDvQ"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_6Fl7BsRoEeaCrrNUITTDvQ" type="7002"> + <styles xmi:type="notation:SortingStyle" xmi:id="_6Fl7B8RoEeaCrrNUITTDvQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_6Fl7CMRoEeaCrrNUITTDvQ"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_6Fl7CcRoEeaCrrNUITTDvQ" type="7003"> + <styles xmi:type="notation:SortingStyle" xmi:id="_6Fl7CsRoEeaCrrNUITTDvQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_6Fl7C8RoEeaCrrNUITTDvQ"/> + </children> + <element xmi:type="ecore:EClass" href="Representation.ecore#//Rule"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_6Fl7AcRoEeaCrrNUITTDvQ" x="107" y="135"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_6FmiEMRoEeaCrrNUITTDvQ" type="2001" fontName=".SF NS Text"> + <children xmi:type="notation:DecorationNode" xmi:id="_6FmiEsRoEeaCrrNUITTDvQ" type="5001"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_6FnJIMRoEeaCrrNUITTDvQ" type="7001"> + <styles xmi:type="notation:SortingStyle" xmi:id="_6FnJIcRoEeaCrrNUITTDvQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_6FnJIsRoEeaCrrNUITTDvQ"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_6FnJI8RoEeaCrrNUITTDvQ" type="7002"> + <styles xmi:type="notation:SortingStyle" xmi:id="_6FnJJMRoEeaCrrNUITTDvQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_6FnJJcRoEeaCrrNUITTDvQ"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_6FnJJsRoEeaCrrNUITTDvQ" type="7003"> + <styles xmi:type="notation:SortingStyle" xmi:id="_6FnJJ8RoEeaCrrNUITTDvQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_6FnJKMRoEeaCrrNUITTDvQ"/> + </children> + <element xmi:type="ecore:EClass" href="Representation.ecore#//ModelRule"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_6FmiEcRoEeaCrrNUITTDvQ" x="45" y="270"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_6FnJKcRoEeaCrrNUITTDvQ" type="2001" fontName=".SF NS Text"> + <children xmi:type="notation:DecorationNode" xmi:id="_6FnwMMRoEeaCrrNUITTDvQ" type="5001"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_6FnwMcRoEeaCrrNUITTDvQ" type="7001"> + <styles xmi:type="notation:SortingStyle" xmi:id="_6FnwMsRoEeaCrrNUITTDvQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_6FnwM8RoEeaCrrNUITTDvQ"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_6FnwNMRoEeaCrrNUITTDvQ" type="7002"> + <styles xmi:type="notation:SortingStyle" xmi:id="_6FnwNcRoEeaCrrNUITTDvQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_6FnwNsRoEeaCrrNUITTDvQ"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_6FnwN8RoEeaCrrNUITTDvQ" type="7003"> + <styles xmi:type="notation:SortingStyle" xmi:id="_6FnwOMRoEeaCrrNUITTDvQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_6FnwOcRoEeaCrrNUITTDvQ"/> + </children> + <element xmi:type="ecore:EClass" href="Representation.ecore#//OwningRule"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_6FnJKsRoEeaCrrNUITTDvQ" x="171" y="270"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_6Fqzg8RoEeaCrrNUITTDvQ" type="2001" fontName=".SF NS Text"> + <children xmi:type="notation:DecorationNode" xmi:id="_6FqzhcRoEeaCrrNUITTDvQ" type="5001"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_6FqzhsRoEeaCrrNUITTDvQ" type="7001"> + <styles xmi:type="notation:SortingStyle" xmi:id="_6Fqzh8RoEeaCrrNUITTDvQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_6FqziMRoEeaCrrNUITTDvQ"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_6FqzicRoEeaCrrNUITTDvQ" type="7002"> + <styles xmi:type="notation:SortingStyle" xmi:id="_6FqzisRoEeaCrrNUITTDvQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_6Fqzi8RoEeaCrrNUITTDvQ"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_6FrakMRoEeaCrrNUITTDvQ" type="7003"> + <styles xmi:type="notation:SortingStyle" xmi:id="_6FrakcRoEeaCrrNUITTDvQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_6FraksRoEeaCrrNUITTDvQ"/> + </children> + <element xmi:type="ecore:EClass" href="Representation.ecore#//ModelAutoCreate"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_6FqzhMRoEeaCrrNUITTDvQ" x="225" y="387"/> + </children> + <children xmi:type="notation:Shape" xmi:id="_6Frak8RoEeaCrrNUITTDvQ" type="2001" fontName=".SF NS Text"> + <children xmi:type="notation:DecorationNode" xmi:id="_6FralcRoEeaCrrNUITTDvQ" type="5001"/> + <children xmi:type="notation:BasicCompartment" xmi:id="_6FralsRoEeaCrrNUITTDvQ" type="7001"> + <styles xmi:type="notation:SortingStyle" xmi:id="_6Fral8RoEeaCrrNUITTDvQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_6FramMRoEeaCrrNUITTDvQ"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_6FramcRoEeaCrrNUITTDvQ" type="7002"> + <styles xmi:type="notation:SortingStyle" xmi:id="_6FramsRoEeaCrrNUITTDvQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_6Fram8RoEeaCrrNUITTDvQ"/> + </children> + <children xmi:type="notation:BasicCompartment" xmi:id="_6FsBoMRoEeaCrrNUITTDvQ" type="7003"> + <styles xmi:type="notation:SortingStyle" xmi:id="_6FsBocRoEeaCrrNUITTDvQ"/> + <styles xmi:type="notation:FilteringStyle" xmi:id="_6FsBosRoEeaCrrNUITTDvQ"/> + </children> + <element xmi:type="ecore:EClass" href="Representation.ecore#//RootAutoSelect"/> + <layoutConstraint xmi:type="notation:Bounds" xmi:id="_6FralMRoEeaCrrNUITTDvQ" x="126" y="387"/> + </children> + <styles xmi:type="notation:DiagramStyle" xmi:id="_5ux9gcRoEeaCrrNUITTDvQ"/> + <element xmi:type="ecore:EPackage" href="Representation.ecore#/"/> + <edges xmi:type="notation:Connector" xmi:id="_6K2OcMRoEeaCrrNUITTDvQ" type="4002" source="_6FZGsMRoEeaCrrNUITTDvQ" target="_6FZGsMRoEeaCrrNUITTDvQ" routing="Rectilinear"> + <children xmi:type="notation:DecorationNode" xmi:id="_6K3ckMRoEeaCrrNUITTDvQ" type="6001"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_6K3ckcRoEeaCrrNUITTDvQ" x="5" y="45"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_6K3cksRoEeaCrrNUITTDvQ" type="6003"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_6K3ck8RoEeaCrrNUITTDvQ" x="11" y="-14"/> + </children> + <styles xmi:type="notation:FontStyle" xmi:id="_6K2OccRoEeaCrrNUITTDvQ" fontName=".SF NS Text"/> + <element xmi:type="ecore:EReference" href="Representation.ecore#//PapyrusRepresentationKind/parent"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_6K2OcsRoEeaCrrNUITTDvQ" points="[70, -19, 70, -19]$[132, -19, 132, -19]$[132, 17, 132, 17]$[70, 17, 70, 17]"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_6LlOQMRoEeaCrrNUITTDvQ" type="4003" source="_6FZGsMRoEeaCrrNUITTDvQ" target="_6FmiEMRoEeaCrrNUITTDvQ" routing="Rectilinear"> + <children xmi:type="notation:DecorationNode" xmi:id="_6LlOQ8RoEeaCrrNUITTDvQ" type="6002"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_6LlORMRoEeaCrrNUITTDvQ" x="127" y="30"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_6LlORcRoEeaCrrNUITTDvQ" type="6004"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_6LlORsRoEeaCrrNUITTDvQ" x="29" y="-17"/> + </children> + <styles xmi:type="notation:FontStyle" xmi:id="_6LlOQcRoEeaCrrNUITTDvQ" fontName=".SF NS Text"/> + <element xmi:type="ecore:EReference" href="Representation.ecore#//PapyrusRepresentationKind/modelRules"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_6LlOQsRoEeaCrrNUITTDvQ" points="[27, 0, 47, -202]$[27, 49, 47, -153]$[-50, 49, -30, -153]$[-50, 202, -30, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_6OZRs8RoEeaCrrNUITTDvQ" id="(0.16546762589928057,1.0)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_6OZRtMRoEeaCrrNUITTDvQ" id="(0.4948453608247423,0.0)"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_6Lu_QMRoEeaCrrNUITTDvQ" type="4003" source="_6FZGsMRoEeaCrrNUITTDvQ" target="_6FnJKcRoEeaCrrNUITTDvQ" routing="Rectilinear"> + <children xmi:type="notation:DecorationNode" xmi:id="_6Lu_Q8RoEeaCrrNUITTDvQ" type="6002"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_6Lu_RMRoEeaCrrNUITTDvQ" x="130" y="-35"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_6Lu_RcRoEeaCrrNUITTDvQ" type="6004"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_6LvmUMRoEeaCrrNUITTDvQ" x="30" y="19"/> + </children> + <styles xmi:type="notation:FontStyle" xmi:id="_6Lu_QcRoEeaCrrNUITTDvQ" fontName=".SF NS Text"/> + <element xmi:type="ecore:EReference" href="Representation.ecore#//PapyrusRepresentationKind/owningRules"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_6Lu_QsRoEeaCrrNUITTDvQ" points="[22, 0, -61, -202]$[22, 40, -61, -162]$[107, 40, 24, -162]$[107, 202, 24, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_6OZRscRoEeaCrrNUITTDvQ" id="(0.33093525179856115,1.0)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_6OZRssRoEeaCrrNUITTDvQ" id="(0.4948453608247423,0.0)"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_6ME9gMRoEeaCrrNUITTDvQ" type="4004" source="_6FmiEMRoEeaCrrNUITTDvQ" target="_6Fl7AMRoEeaCrrNUITTDvQ" routing="Tree"> + <styles xmi:type="notation:FontStyle" xmi:id="_6ME9gcRoEeaCrrNUITTDvQ" fontName=".SF NS Text"/> + <element xsi:nil="true"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_6ME9gsRoEeaCrrNUITTDvQ" points="[33, -59, -50, 135]$[33, -103, -50, 91]$[65, -103, -18, 91]$[65, -135, -18, 59]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_6ObG4MRoEeaCrrNUITTDvQ" id="(0.4948453608247423,1.0)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_6ObG4cRoEeaCrrNUITTDvQ" id="(0.6764705882352942,0.0)"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_6MGysMRoEeaCrrNUITTDvQ" type="4003" source="_6FnJKcRoEeaCrrNUITTDvQ" target="_6Fqzg8RoEeaCrrNUITTDvQ" routing="Rectilinear"> + <children xmi:type="notation:DecorationNode" xmi:id="_6MGys8RoEeaCrrNUITTDvQ" type="6002"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_6MGytMRoEeaCrrNUITTDvQ" x="16" y="-40"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_6MGytcRoEeaCrrNUITTDvQ" type="6004"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_6MGytsRoEeaCrrNUITTDvQ" x="-4" y="19"/> + </children> + <styles xmi:type="notation:FontStyle" xmi:id="_6MGyscRoEeaCrrNUITTDvQ" fontName=".SF NS Text"/> + <element xmi:type="ecore:EReference" href="Representation.ecore#//OwningRule/newModelPath"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_6MGyssRoEeaCrrNUITTDvQ" points="[-3, 3, -33, -58]$[-3, 61, -33, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_6OYDksRoEeaCrrNUITTDvQ" id="(0.865979381443299,0.9491525423728814)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_6OYqoMRoEeaCrrNUITTDvQ" id="(0.49586776859504134,0.0)"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_6MLEIMRoEeaCrrNUITTDvQ" type="4003" source="_6FnJKcRoEeaCrrNUITTDvQ" target="_6Frak8RoEeaCrrNUITTDvQ" routing="Rectilinear"> + <children xmi:type="notation:DecorationNode" xmi:id="_6MLEI8RoEeaCrrNUITTDvQ" type="6002"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_6MLEJMRoEeaCrrNUITTDvQ" x="16" y="51"/> + </children> + <children xmi:type="notation:DecorationNode" xmi:id="_6MLEJcRoEeaCrrNUITTDvQ" type="6004"> + <layoutConstraint xmi:type="notation:Location" xmi:id="_6MLEJsRoEeaCrrNUITTDvQ" x="-4" y="-17"/> + </children> + <styles xmi:type="notation:FontStyle" xmi:id="_6MLEIcRoEeaCrrNUITTDvQ" fontName=".SF NS Text"/> + <element xmi:type="ecore:EReference" href="Representation.ecore#//OwningRule/selectDiagramRoot"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_6MLEIsRoEeaCrrNUITTDvQ" points="[-54, 0, 22, -58]$[-54, 58, 22, 0]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_6OYqocRoEeaCrrNUITTDvQ" id="(0.7422680412371134,1.0)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_6OYqosRoEeaCrrNUITTDvQ" id="(0.4939759036144578,0.0)"/> + </edges> + <edges xmi:type="notation:Connector" xmi:id="_6MOHcMRoEeaCrrNUITTDvQ" type="4004" source="_6FnJKcRoEeaCrrNUITTDvQ" target="_6Fl7AMRoEeaCrrNUITTDvQ" routing="Tree"> + <styles xmi:type="notation:FontStyle" xmi:id="_6MOHccRoEeaCrrNUITTDvQ" fontName=".SF NS Text"/> + <element xsi:nil="true"/> + <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_6MOHcsRoEeaCrrNUITTDvQ" points="[0, -59, 101, 126]$[0, -86, 101, 99]$[-135, -86, -34, 99]$[-135, -126, -34, 59]"/> + <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_6OYqo8RoEeaCrrNUITTDvQ" id="(0.24742268041237114,1.0)"/> + <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_6OYqpMRoEeaCrrNUITTDvQ" id="(0.8333333333333334,0.0)"/> + </edges> +</notation:Diagram> diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/model/Representation.genmodel b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/model/Representation.genmodel new file mode 100644 index 00000000000..dec16cb1457 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/model/Representation.genmodel @@ -0,0 +1,47 @@ +<?xml version="1.0" encoding="UTF-8"?> +<genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" + xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" copyrightText="Copyright (c) 2016 CEA LIST.

 All rights reserved. This program and the accompanying materials
 are made available under the terms of the Eclipse Public License v1.0
 which accompanies this distribution, and is available at
 http://www.eclipse.org/legal/epl-v10.html
 
 Contributors:
 Maged Elaasar - Initial API and implementation
 
" + modelDirectory="/org.eclipse.papyrus.infra.architecture.representation/src-gen" + editDirectory="/org.eclipse.papyrus.infra.architecture.representation.edit/src-gen" + editorDirectory="/org.eclipse.papyrus.infra.architecture.representation.editor/src-gen" + modelPluginID="org.eclipse.papyrus.infra.architecture.representation" modelName="Representation" + rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" testsDirectory="/org.eclipse.papyrus.infra.architecture.representation.tests/src-gen" + importerID="org.eclipse.emf.importer.ecore" complianceLevel="8.0" copyrightFields="false" + editorPluginID="org.eclipse.papyrus.infra.architecture.representation.editor" + usedGenPackages="../../org.eclipse.papyrus.infra.core.architecture/model/Architecture.genmodel#//architecture ../../org.eclipse.papyrus.infra.constraints/Model/Constraints.genmodel#//constraints ../../org.eclipse.papyrus.infra.types/model/ElementTypesConfigurations.genmodel#//types" + operationReflection="true" importOrganizing="true"> + <foreignModel>Representation.ecore</foreignModel> + <genPackages prefix="Representation" basePackage="org.eclipse.papyrus.infra.core.architecture" + disposableProviderFactory="true" extensibleProviderFactory="true" childCreationExtenders="true" + ecorePackage="Representation.ecore#/"> + <genClasses image="false" ecoreClass="Representation.ecore#//PapyrusRepresentationKind"> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference Representation.ecore#//PapyrusRepresentationKind/parent"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Representation.ecore#//PapyrusRepresentationKind/modelRules"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Representation.ecore#//PapyrusRepresentationKind/owningRules"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Representation.ecore#//PapyrusRepresentationKind/implementationID"/> + </genClasses> + <genClasses image="false" ecoreClass="Representation.ecore#//Rule"> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Representation.ecore#//Rule/permit"/> + </genClasses> + <genClasses ecoreClass="Representation.ecore#//ModelRule"> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference Representation.ecore#//ModelRule/element"/> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference Representation.ecore#//ModelRule/stereotypes"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Representation.ecore#//ModelRule/multiplicity"/> + </genClasses> + <genClasses ecoreClass="Representation.ecore#//OwningRule"> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference Representation.ecore#//OwningRule/element"/> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference Representation.ecore#//OwningRule/stereotypes"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Representation.ecore#//OwningRule/multiplicity"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Representation.ecore#//OwningRule/newModelPath"/> + <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference Representation.ecore#//OwningRule/selectDiagramRoot"/> + </genClasses> + <genClasses ecoreClass="Representation.ecore#//ModelAutoCreate"> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference Representation.ecore#//ModelAutoCreate/feature"/> + <genFeatures property="Readonly" notify="false" createChild="false" ecoreFeature="ecore:EReference Representation.ecore#//ModelAutoCreate/origin"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute Representation.ecore#//ModelAutoCreate/creationType"/> + </genClasses> + <genClasses ecoreClass="Representation.ecore#//RootAutoSelect"> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference Representation.ecore#//RootAutoSelect/feature"/> + </genClasses> + </genPackages> +</genmodel:GenModel> diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/plugin.properties b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/plugin.properties new file mode 100644 index 00000000000..58d9ca152fe --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/plugin.properties @@ -0,0 +1,14 @@ +* Copyright (c) 2017 CEA LIST. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Maged Elaasar - Initial API and implementation +# +# + +pluginName = Representation Model +providerName=Eclipse Modeling Project diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/plugin.xml b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/plugin.xml new file mode 100644 index 00000000000..d5bc156dc53 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/plugin.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.0"?> + +<!-- +* Copyright (c) 2017 CEA LIST. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Eclipse Public License v1.0 + which accompanies this distribution, and is available at + http://www.eclipse.org/legal/epl-v10.html + + Contributors: + Maged Elaasar - Initial API and implementation + + +--> + +<plugin> + + <extension point="org.eclipse.emf.ecore.generated_package"> + <!-- @generated Representation --> + <package + uri="http://www.eclipse.org/papyrus/infra/core/architecture/representation" + class="org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage" + genModel="model/Representation.genmodel"/> + </extension> + + <extension + point="org.eclipse.emf.ecore.factory_override"> + <factory + uri="http://www.eclipse.org/papyrus/infra/core/architecture/representation" + class="org.eclipse.papyrus.infra.architecture.representation.impl.RepresentationFactoryCustomImpl"> + </factory> + </extension> + +</plugin> diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/pom.xml b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/pom.xml new file mode 100644 index 00000000000..db883c5ade1 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/pom.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.eclipse.papyrus</groupId> + <artifactId>org.eclipse.papyrus.infra-architecture</artifactId> + <version>0.0.1-SNAPSHOT</version> + </parent> + <artifactId>org.eclipse.papyrus.infra.architecture.representation</artifactId> + <version>1.0.0-SNAPSHOT</version> + <packaging>eclipse-plugin</packaging> +</project> diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/ModelAutoCreate.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/ModelAutoCreate.java new file mode 100644 index 00000000000..22faee6a8f6 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/ModelAutoCreate.java @@ -0,0 +1,106 @@ +/** + * Copyright (c) 2016 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EReference; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Model Auto Create</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate#getFeature <em>Feature</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate#getOrigin <em>Origin</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate#getCreationType <em>Creation Type</em>}</li> + * </ul> + * + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getModelAutoCreate() + * @model + * @generated + */ +public interface ModelAutoCreate extends EObject { + /** + * Returns the value of the '<em><b>Feature</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Feature</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Feature</em>' reference. + * @see #setFeature(EReference) + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getModelAutoCreate_Feature() + * @model required="true" + * @generated + */ + EReference getFeature(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate#getFeature <em>Feature</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Feature</em>' reference. + * @see #getFeature() + * @generated + */ + void setFeature(EReference value); + + /** + * Returns the value of the '<em><b>Origin</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Origin</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Origin</em>' reference. + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getModelAutoCreate_Origin() + * @model required="true" transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + EClass getOrigin(); + + /** + * Returns the value of the '<em><b>Creation Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Creation Type</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Creation Type</em>' attribute. + * @see #setCreationType(String) + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getModelAutoCreate_CreationType() + * @model required="true" + * @generated + */ + String getCreationType(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate#getCreationType <em>Creation Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Creation Type</em>' attribute. + * @see #getCreationType() + * @generated + */ + void setCreationType(String value); + +} // ModelAutoCreate diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/ModelRule.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/ModelRule.java new file mode 100644 index 00000000000..41e36a9a687 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/ModelRule.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) 2016 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.papyrus.infra.constraints.DisplayUnit; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Model Rule</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.ModelRule#getElement <em>Element</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.ModelRule#getStereotypes <em>Stereotypes</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.ModelRule#getMultiplicity <em>Multiplicity</em>}</li> + * </ul> + * + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getModelRule() + * @model + * @generated + */ +public interface ModelRule extends Rule, DisplayUnit { + /** + * Returns the value of the '<em><b>Element</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Element</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Element</em>' reference. + * @see #setElement(EClass) + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getModelRule_Element() + * @model + * @generated + */ + EClass getElement(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.infra.architecture.representation.ModelRule#getElement <em>Element</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Element</em>' reference. + * @see #getElement() + * @generated + */ + void setElement(EClass value); + + /** + * Returns the value of the '<em><b>Stereotypes</b></em>' reference list. + * The list contents are of type {@link org.eclipse.emf.ecore.EClass}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Stereotypes</em>' reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Stereotypes</em>' reference list. + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getModelRule_Stereotypes() + * @model + * @generated + */ + EList<EClass> getStereotypes(); + + /** + * Returns the value of the '<em><b>Multiplicity</b></em>' attribute. + * The default value is <code>"-1"</code>. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Multiplicity</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Multiplicity</em>' attribute. + * @see #setMultiplicity(int) + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getModelRule_Multiplicity() + * @model default="-1" required="true" + * @generated + */ + int getMultiplicity(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.infra.architecture.representation.ModelRule#getMultiplicity <em>Multiplicity</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Multiplicity</em>' attribute. + * @see #getMultiplicity() + * @generated + */ + void setMultiplicity(int value); + +} // ModelRule diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/OwningRule.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/OwningRule.java new file mode 100644 index 00000000000..a40bf00e644 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/OwningRule.java @@ -0,0 +1,142 @@ +/** + * Copyright (c) 2016 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Owning Rule</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.OwningRule#getElement <em>Element</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.OwningRule#getStereotypes <em>Stereotypes</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.OwningRule#getMultiplicity <em>Multiplicity</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.OwningRule#getNewModelPath <em>New Model Path</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.OwningRule#getSelectDiagramRoot <em>Select Diagram Root</em>}</li> + * </ul> + * + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getOwningRule() + * @model + * @generated + */ +public interface OwningRule extends Rule { + /** + * Returns the value of the '<em><b>Element</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Element</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Element</em>' reference. + * @see #setElement(EClass) + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getOwningRule_Element() + * @model + * @generated + */ + EClass getElement(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.infra.architecture.representation.OwningRule#getElement <em>Element</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Element</em>' reference. + * @see #getElement() + * @generated + */ + void setElement(EClass value); + + /** + * Returns the value of the '<em><b>Stereotypes</b></em>' reference list. + * The list contents are of type {@link org.eclipse.emf.ecore.EClass}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Stereotypes</em>' reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Stereotypes</em>' reference list. + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getOwningRule_Stereotypes() + * @model + * @generated + */ + EList<EClass> getStereotypes(); + + /** + * Returns the value of the '<em><b>Multiplicity</b></em>' attribute. + * The default value is <code>"-1"</code>. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Multiplicity</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Multiplicity</em>' attribute. + * @see #setMultiplicity(int) + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getOwningRule_Multiplicity() + * @model default="-1" required="true" + * @generated + */ + int getMultiplicity(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.infra.architecture.representation.OwningRule#getMultiplicity <em>Multiplicity</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Multiplicity</em>' attribute. + * @see #getMultiplicity() + * @generated + */ + void setMultiplicity(int value); + + /** + * Returns the value of the '<em><b>New Model Path</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>New Model Path</em>' containment reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>New Model Path</em>' containment reference list. + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getOwningRule_NewModelPath() + * @model containment="true" + * @generated + */ + EList<ModelAutoCreate> getNewModelPath(); + + /** + * Returns the value of the '<em><b>Select Diagram Root</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.papyrus.infra.architecture.representation.RootAutoSelect}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Select Diagram Root</em>' containment reference list isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Select Diagram Root</em>' containment reference list. + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getOwningRule_SelectDiagramRoot() + * @model containment="true" + * @generated + */ + EList<RootAutoSelect> getSelectDiagramRoot(); + +} // OwningRule diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/PapyrusRepresentationKind.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/PapyrusRepresentationKind.java new file mode 100644 index 00000000000..72f64329f61 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/PapyrusRepresentationKind.java @@ -0,0 +1,122 @@ +/** + * Copyright (c) 2016 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.papyrus.infra.core.architecture.RepresentationKind; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Papyrus Representation Kind</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind#getParent <em>Parent</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind#getModelRules <em>Model Rules</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind#getOwningRules <em>Owning Rules</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind#getImplementationID <em>Implementation ID</em>}</li> + * </ul> + * + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getPapyrusRepresentationKind() + * @model abstract="true" + * @generated + */ +public interface PapyrusRepresentationKind extends RepresentationKind { + /** + * Returns the value of the '<em><b>Parent</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Parent</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Parent</em>' reference. + * @see #setParent(PapyrusRepresentationKind) + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getPapyrusRepresentationKind_Parent() + * @model + * @generated + */ + PapyrusRepresentationKind getParent(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind#getParent <em>Parent</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Parent</em>' reference. + * @see #getParent() + * @generated + */ + void setParent(PapyrusRepresentationKind value); + + /** + * Returns the value of the '<em><b>Model Rules</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.papyrus.infra.architecture.representation.ModelRule}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * <!-- begin-model-doc --> + * These rules determine which model elements can be the semantic element behind this diagram + * <!-- end-model-doc --> + * @return the value of the '<em>Model Rules</em>' containment reference list. + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getPapyrusRepresentationKind_ModelRules() + * @model containment="true" required="true" + * @generated + */ + EList<ModelRule> getModelRules(); + + /** + * Returns the value of the '<em><b>Owning Rules</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.papyrus.infra.architecture.representation.OwningRule}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * <!-- begin-model-doc --> + * These rules determine which elements can be the syntactic owner of this diagram + * <!-- end-model-doc --> + * @return the value of the '<em>Owning Rules</em>' containment reference list. + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getPapyrusRepresentationKind_OwningRules() + * @model containment="true" required="true" + * @generated + */ + EList<OwningRule> getOwningRules(); + + /** + * Returns the value of the '<em><b>Implementation ID</b></em>' attribute. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Implementation ID</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Implementation ID</em>' attribute. + * @see #setImplementationID(String) + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getPapyrusRepresentationKind_ImplementationID() + * @model required="true" + * @generated + */ + String getImplementationID(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind#getImplementationID <em>Implementation ID</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Implementation ID</em>' attribute. + * @see #getImplementationID() + * @generated + */ + void setImplementationID(String value); + +} // PapyrusRepresentationKind diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/RepresentationFactory.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/RepresentationFactory.java new file mode 100644 index 00000000000..07b58c37fc7 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/RepresentationFactory.java @@ -0,0 +1,80 @@ +/** + * Copyright (c) 2016 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation; + +import org.eclipse.emf.ecore.EFactory; + +/** + * <!-- begin-user-doc --> + * The <b>Factory</b> for the model. + * It provides a create method for each non-abstract class of the model. + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage + * @generated + */ +public interface RepresentationFactory extends EFactory { + /** + * The singleton instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + RepresentationFactory eINSTANCE = org.eclipse.papyrus.infra.architecture.representation.impl.RepresentationFactoryImpl.init(); + + /** + * Returns a new object of class '<em>Model Rule</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Model Rule</em>'. + * @generated + */ + ModelRule createModelRule(); + + /** + * Returns a new object of class '<em>Owning Rule</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Owning Rule</em>'. + * @generated + */ + OwningRule createOwningRule(); + + /** + * Returns a new object of class '<em>Model Auto Create</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Model Auto Create</em>'. + * @generated + */ + ModelAutoCreate createModelAutoCreate(); + + /** + * Returns a new object of class '<em>Root Auto Select</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return a new object of class '<em>Root Auto Select</em>'. + * @generated + */ + RootAutoSelect createRootAutoSelect(); + + /** + * Returns the package supported by this factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the package supported by this factory. + * @generated + */ + RepresentationPackage getRepresentationPackage(); + +} //RepresentationFactory diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/RepresentationPackage.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/RepresentationPackage.java new file mode 100644 index 00000000000..954820eeb2b --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/RepresentationPackage.java @@ -0,0 +1,952 @@ +/** + * Copyright (c) 2016 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +import org.eclipse.papyrus.infra.core.architecture.ArchitecturePackage; + +/** + * <!-- begin-user-doc --> + * The <b>Package</b> for the model. + * It contains accessors for the meta objects to represent + * <ul> + * <li>each class,</li> + * <li>each feature of each class,</li> + * <li>each operation of each class,</li> + * <li>each enum,</li> + * <li>and each data type</li> + * </ul> + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationFactory + * @model kind="package" + * @generated + */ +public interface RepresentationPackage extends EPackage { + /** + * The package name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNAME = "representation"; + + /** + * The package namespace URI. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNS_URI = "http://www.eclipse.org/papyrus/infra/core/architecture/representation"; + + /** + * The package namespace name. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + String eNS_PREFIX = "representation"; + + /** + * The singleton instance of the package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + RepresentationPackage eINSTANCE = org.eclipse.papyrus.infra.architecture.representation.impl.RepresentationPackageImpl.init(); + + /** + * The meta object id for the '{@link org.eclipse.papyrus.infra.architecture.representation.impl.PapyrusRepresentationKindImpl <em>Papyrus Representation Kind</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.infra.architecture.representation.impl.PapyrusRepresentationKindImpl + * @see org.eclipse.papyrus.infra.architecture.representation.impl.RepresentationPackageImpl#getPapyrusRepresentationKind() + * @generated + */ + int PAPYRUS_REPRESENTATION_KIND = 0; + + /** + * The feature id for the '<em><b>Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PAPYRUS_REPRESENTATION_KIND__NAME = ArchitecturePackage.REPRESENTATION_KIND__NAME; + + /** + * The feature id for the '<em><b>Desciption</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PAPYRUS_REPRESENTATION_KIND__DESCIPTION = ArchitecturePackage.REPRESENTATION_KIND__DESCIPTION; + + /** + * The feature id for the '<em><b>Qualified Name</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PAPYRUS_REPRESENTATION_KIND__QUALIFIED_NAME = ArchitecturePackage.REPRESENTATION_KIND__QUALIFIED_NAME; + + /** + * The feature id for the '<em><b>Language</b></em>' container reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PAPYRUS_REPRESENTATION_KIND__LANGUAGE = ArchitecturePackage.REPRESENTATION_KIND__LANGUAGE; + + /** + * The feature id for the '<em><b>Concerns</b></em>' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PAPYRUS_REPRESENTATION_KIND__CONCERNS = ArchitecturePackage.REPRESENTATION_KIND__CONCERNS; + + /** + * The feature id for the '<em><b>Icon</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PAPYRUS_REPRESENTATION_KIND__ICON = ArchitecturePackage.REPRESENTATION_KIND__ICON; + + /** + * The feature id for the '<em><b>Parent</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PAPYRUS_REPRESENTATION_KIND__PARENT = ArchitecturePackage.REPRESENTATION_KIND_FEATURE_COUNT + 0; + + /** + * The feature id for the '<em><b>Model Rules</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PAPYRUS_REPRESENTATION_KIND__MODEL_RULES = ArchitecturePackage.REPRESENTATION_KIND_FEATURE_COUNT + 1; + + /** + * The feature id for the '<em><b>Owning Rules</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PAPYRUS_REPRESENTATION_KIND__OWNING_RULES = ArchitecturePackage.REPRESENTATION_KIND_FEATURE_COUNT + 2; + + /** + * The feature id for the '<em><b>Implementation ID</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PAPYRUS_REPRESENTATION_KIND__IMPLEMENTATION_ID = ArchitecturePackage.REPRESENTATION_KIND_FEATURE_COUNT + 3; + + /** + * The number of structural features of the '<em>Papyrus Representation Kind</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PAPYRUS_REPRESENTATION_KIND_FEATURE_COUNT = ArchitecturePackage.REPRESENTATION_KIND_FEATURE_COUNT + 4; + + /** + * The number of operations of the '<em>Papyrus Representation Kind</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int PAPYRUS_REPRESENTATION_KIND_OPERATION_COUNT = ArchitecturePackage.REPRESENTATION_KIND_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.infra.architecture.representation.impl.RuleImpl <em>Rule</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.infra.architecture.representation.impl.RuleImpl + * @see org.eclipse.papyrus.infra.architecture.representation.impl.RepresentationPackageImpl#getRule() + * @generated + */ + int RULE = 1; + + /** + * The feature id for the '<em><b>Permit</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RULE__PERMIT = 0; + + /** + * The number of structural features of the '<em>Rule</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RULE_FEATURE_COUNT = 1; + + /** + * The number of operations of the '<em>Rule</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int RULE_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.infra.architecture.representation.impl.ModelRuleImpl <em>Model Rule</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.infra.architecture.representation.impl.ModelRuleImpl + * @see org.eclipse.papyrus.infra.architecture.representation.impl.RepresentationPackageImpl#getModelRule() + * @generated + */ + int MODEL_RULE = 2; + + /** + * The feature id for the '<em><b>Permit</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_RULE__PERMIT = RULE__PERMIT; + + /** + * The feature id for the '<em><b>Constraints</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_RULE__CONSTRAINTS = RULE_FEATURE_COUNT + 0; + + /** + * The feature id for the '<em><b>Element Multiplicity</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_RULE__ELEMENT_MULTIPLICITY = RULE_FEATURE_COUNT + 1; + + /** + * The feature id for the '<em><b>Element</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_RULE__ELEMENT = RULE_FEATURE_COUNT + 2; + + /** + * The feature id for the '<em><b>Stereotypes</b></em>' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_RULE__STEREOTYPES = RULE_FEATURE_COUNT + 3; + + /** + * The feature id for the '<em><b>Multiplicity</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_RULE__MULTIPLICITY = RULE_FEATURE_COUNT + 4; + + /** + * The number of structural features of the '<em>Model Rule</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_RULE_FEATURE_COUNT = RULE_FEATURE_COUNT + 5; + + /** + * The number of operations of the '<em>Model Rule</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_RULE_OPERATION_COUNT = RULE_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.infra.architecture.representation.impl.OwningRuleImpl <em>Owning Rule</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.infra.architecture.representation.impl.OwningRuleImpl + * @see org.eclipse.papyrus.infra.architecture.representation.impl.RepresentationPackageImpl#getOwningRule() + * @generated + */ + int OWNING_RULE = 3; + + /** + * The feature id for the '<em><b>Permit</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int OWNING_RULE__PERMIT = RULE__PERMIT; + + /** + * The feature id for the '<em><b>Element</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int OWNING_RULE__ELEMENT = RULE_FEATURE_COUNT + 0; + + /** + * The feature id for the '<em><b>Stereotypes</b></em>' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int OWNING_RULE__STEREOTYPES = RULE_FEATURE_COUNT + 1; + + /** + * The feature id for the '<em><b>Multiplicity</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int OWNING_RULE__MULTIPLICITY = RULE_FEATURE_COUNT + 2; + + /** + * The feature id for the '<em><b>New Model Path</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int OWNING_RULE__NEW_MODEL_PATH = RULE_FEATURE_COUNT + 3; + + /** + * The feature id for the '<em><b>Select Diagram Root</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int OWNING_RULE__SELECT_DIAGRAM_ROOT = RULE_FEATURE_COUNT + 4; + + /** + * The number of structural features of the '<em>Owning Rule</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int OWNING_RULE_FEATURE_COUNT = RULE_FEATURE_COUNT + 5; + + /** + * The number of operations of the '<em>Owning Rule</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int OWNING_RULE_OPERATION_COUNT = RULE_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.infra.architecture.representation.impl.ModelAutoCreateImpl <em>Model Auto Create</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.infra.architecture.representation.impl.ModelAutoCreateImpl + * @see org.eclipse.papyrus.infra.architecture.representation.impl.RepresentationPackageImpl#getModelAutoCreate() + * @generated + */ + int MODEL_AUTO_CREATE = 4; + + /** + * The feature id for the '<em><b>Feature</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_AUTO_CREATE__FEATURE = 0; + + /** + * The feature id for the '<em><b>Origin</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_AUTO_CREATE__ORIGIN = 1; + + /** + * The feature id for the '<em><b>Creation Type</b></em>' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_AUTO_CREATE__CREATION_TYPE = 2; + + /** + * The number of structural features of the '<em>Model Auto Create</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_AUTO_CREATE_FEATURE_COUNT = 3; + + /** + * The number of operations of the '<em>Model Auto Create</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int MODEL_AUTO_CREATE_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.papyrus.infra.architecture.representation.impl.RootAutoSelectImpl <em>Root Auto Select</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.infra.architecture.representation.impl.RootAutoSelectImpl + * @see org.eclipse.papyrus.infra.architecture.representation.impl.RepresentationPackageImpl#getRootAutoSelect() + * @generated + */ + int ROOT_AUTO_SELECT = 5; + + /** + * The feature id for the '<em><b>Feature</b></em>' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ROOT_AUTO_SELECT__FEATURE = 0; + + /** + * The number of structural features of the '<em>Root Auto Select</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ROOT_AUTO_SELECT_FEATURE_COUNT = 1; + + /** + * The number of operations of the '<em>Root Auto Select</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + * @ordered + */ + int ROOT_AUTO_SELECT_OPERATION_COUNT = 0; + + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind <em>Papyrus Representation Kind</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Papyrus Representation Kind</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind + * @generated + */ + EClass getPapyrusRepresentationKind(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind#getParent <em>Parent</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>Parent</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind#getParent() + * @see #getPapyrusRepresentationKind() + * @generated + */ + EReference getPapyrusRepresentationKind_Parent(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind#getModelRules <em>Model Rules</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference list '<em>Model Rules</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind#getModelRules() + * @see #getPapyrusRepresentationKind() + * @generated + */ + EReference getPapyrusRepresentationKind_ModelRules(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind#getOwningRules <em>Owning Rules</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference list '<em>Owning Rules</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind#getOwningRules() + * @see #getPapyrusRepresentationKind() + * @generated + */ + EReference getPapyrusRepresentationKind_OwningRules(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind#getImplementationID <em>Implementation ID</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Implementation ID</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind#getImplementationID() + * @see #getPapyrusRepresentationKind() + * @generated + */ + EAttribute getPapyrusRepresentationKind_ImplementationID(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.infra.architecture.representation.Rule <em>Rule</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Rule</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.Rule + * @generated + */ + EClass getRule(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.architecture.representation.Rule#isPermit <em>Permit</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Permit</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.Rule#isPermit() + * @see #getRule() + * @generated + */ + EAttribute getRule_Permit(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.infra.architecture.representation.ModelRule <em>Model Rule</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Model Rule</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.ModelRule + * @generated + */ + EClass getModelRule(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.infra.architecture.representation.ModelRule#getElement <em>Element</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>Element</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.ModelRule#getElement() + * @see #getModelRule() + * @generated + */ + EReference getModelRule_Element(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.papyrus.infra.architecture.representation.ModelRule#getStereotypes <em>Stereotypes</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference list '<em>Stereotypes</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.ModelRule#getStereotypes() + * @see #getModelRule() + * @generated + */ + EReference getModelRule_Stereotypes(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.architecture.representation.ModelRule#getMultiplicity <em>Multiplicity</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Multiplicity</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.ModelRule#getMultiplicity() + * @see #getModelRule() + * @generated + */ + EAttribute getModelRule_Multiplicity(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.infra.architecture.representation.OwningRule <em>Owning Rule</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Owning Rule</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.OwningRule + * @generated + */ + EClass getOwningRule(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.infra.architecture.representation.OwningRule#getElement <em>Element</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>Element</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.OwningRule#getElement() + * @see #getOwningRule() + * @generated + */ + EReference getOwningRule_Element(); + + /** + * Returns the meta object for the reference list '{@link org.eclipse.papyrus.infra.architecture.representation.OwningRule#getStereotypes <em>Stereotypes</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference list '<em>Stereotypes</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.OwningRule#getStereotypes() + * @see #getOwningRule() + * @generated + */ + EReference getOwningRule_Stereotypes(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.architecture.representation.OwningRule#getMultiplicity <em>Multiplicity</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Multiplicity</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.OwningRule#getMultiplicity() + * @see #getOwningRule() + * @generated + */ + EAttribute getOwningRule_Multiplicity(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.infra.architecture.representation.OwningRule#getNewModelPath <em>New Model Path</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference list '<em>New Model Path</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.OwningRule#getNewModelPath() + * @see #getOwningRule() + * @generated + */ + EReference getOwningRule_NewModelPath(); + + /** + * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.infra.architecture.representation.OwningRule#getSelectDiagramRoot <em>Select Diagram Root</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the containment reference list '<em>Select Diagram Root</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.OwningRule#getSelectDiagramRoot() + * @see #getOwningRule() + * @generated + */ + EReference getOwningRule_SelectDiagramRoot(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate <em>Model Auto Create</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Model Auto Create</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate + * @generated + */ + EClass getModelAutoCreate(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate#getFeature <em>Feature</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>Feature</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate#getFeature() + * @see #getModelAutoCreate() + * @generated + */ + EReference getModelAutoCreate_Feature(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate#getOrigin <em>Origin</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>Origin</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate#getOrigin() + * @see #getModelAutoCreate() + * @generated + */ + EReference getModelAutoCreate_Origin(); + + /** + * Returns the meta object for the attribute '{@link org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate#getCreationType <em>Creation Type</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the attribute '<em>Creation Type</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate#getCreationType() + * @see #getModelAutoCreate() + * @generated + */ + EAttribute getModelAutoCreate_CreationType(); + + /** + * Returns the meta object for class '{@link org.eclipse.papyrus.infra.architecture.representation.RootAutoSelect <em>Root Auto Select</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for class '<em>Root Auto Select</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.RootAutoSelect + * @generated + */ + EClass getRootAutoSelect(); + + /** + * Returns the meta object for the reference '{@link org.eclipse.papyrus.infra.architecture.representation.RootAutoSelect#getFeature <em>Feature</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the meta object for the reference '<em>Feature</em>'. + * @see org.eclipse.papyrus.infra.architecture.representation.RootAutoSelect#getFeature() + * @see #getRootAutoSelect() + * @generated + */ + EReference getRootAutoSelect_Feature(); + + /** + * Returns the factory that creates the instances of the model. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the factory that creates the instances of the model. + * @generated + */ + RepresentationFactory getRepresentationFactory(); + + /** + * <!-- begin-user-doc --> + * Defines literals for the meta objects that represent + * <ul> + * <li>each class,</li> + * <li>each feature of each class,</li> + * <li>each operation of each class,</li> + * <li>each enum,</li> + * <li>and each data type</li> + * </ul> + * <!-- end-user-doc --> + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link org.eclipse.papyrus.infra.architecture.representation.impl.PapyrusRepresentationKindImpl <em>Papyrus Representation Kind</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.infra.architecture.representation.impl.PapyrusRepresentationKindImpl + * @see org.eclipse.papyrus.infra.architecture.representation.impl.RepresentationPackageImpl#getPapyrusRepresentationKind() + * @generated + */ + EClass PAPYRUS_REPRESENTATION_KIND = eINSTANCE.getPapyrusRepresentationKind(); + + /** + * The meta object literal for the '<em><b>Parent</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference PAPYRUS_REPRESENTATION_KIND__PARENT = eINSTANCE.getPapyrusRepresentationKind_Parent(); + + /** + * The meta object literal for the '<em><b>Model Rules</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference PAPYRUS_REPRESENTATION_KIND__MODEL_RULES = eINSTANCE.getPapyrusRepresentationKind_ModelRules(); + + /** + * The meta object literal for the '<em><b>Owning Rules</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference PAPYRUS_REPRESENTATION_KIND__OWNING_RULES = eINSTANCE.getPapyrusRepresentationKind_OwningRules(); + + /** + * The meta object literal for the '<em><b>Implementation ID</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute PAPYRUS_REPRESENTATION_KIND__IMPLEMENTATION_ID = eINSTANCE.getPapyrusRepresentationKind_ImplementationID(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.infra.architecture.representation.impl.RuleImpl <em>Rule</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.infra.architecture.representation.impl.RuleImpl + * @see org.eclipse.papyrus.infra.architecture.representation.impl.RepresentationPackageImpl#getRule() + * @generated + */ + EClass RULE = eINSTANCE.getRule(); + + /** + * The meta object literal for the '<em><b>Permit</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute RULE__PERMIT = eINSTANCE.getRule_Permit(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.infra.architecture.representation.impl.ModelRuleImpl <em>Model Rule</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.infra.architecture.representation.impl.ModelRuleImpl + * @see org.eclipse.papyrus.infra.architecture.representation.impl.RepresentationPackageImpl#getModelRule() + * @generated + */ + EClass MODEL_RULE = eINSTANCE.getModelRule(); + + /** + * The meta object literal for the '<em><b>Element</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference MODEL_RULE__ELEMENT = eINSTANCE.getModelRule_Element(); + + /** + * The meta object literal for the '<em><b>Stereotypes</b></em>' reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference MODEL_RULE__STEREOTYPES = eINSTANCE.getModelRule_Stereotypes(); + + /** + * The meta object literal for the '<em><b>Multiplicity</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute MODEL_RULE__MULTIPLICITY = eINSTANCE.getModelRule_Multiplicity(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.infra.architecture.representation.impl.OwningRuleImpl <em>Owning Rule</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.infra.architecture.representation.impl.OwningRuleImpl + * @see org.eclipse.papyrus.infra.architecture.representation.impl.RepresentationPackageImpl#getOwningRule() + * @generated + */ + EClass OWNING_RULE = eINSTANCE.getOwningRule(); + + /** + * The meta object literal for the '<em><b>Element</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference OWNING_RULE__ELEMENT = eINSTANCE.getOwningRule_Element(); + + /** + * The meta object literal for the '<em><b>Stereotypes</b></em>' reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference OWNING_RULE__STEREOTYPES = eINSTANCE.getOwningRule_Stereotypes(); + + /** + * The meta object literal for the '<em><b>Multiplicity</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute OWNING_RULE__MULTIPLICITY = eINSTANCE.getOwningRule_Multiplicity(); + + /** + * The meta object literal for the '<em><b>New Model Path</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference OWNING_RULE__NEW_MODEL_PATH = eINSTANCE.getOwningRule_NewModelPath(); + + /** + * The meta object literal for the '<em><b>Select Diagram Root</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference OWNING_RULE__SELECT_DIAGRAM_ROOT = eINSTANCE.getOwningRule_SelectDiagramRoot(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.infra.architecture.representation.impl.ModelAutoCreateImpl <em>Model Auto Create</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.infra.architecture.representation.impl.ModelAutoCreateImpl + * @see org.eclipse.papyrus.infra.architecture.representation.impl.RepresentationPackageImpl#getModelAutoCreate() + * @generated + */ + EClass MODEL_AUTO_CREATE = eINSTANCE.getModelAutoCreate(); + + /** + * The meta object literal for the '<em><b>Feature</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference MODEL_AUTO_CREATE__FEATURE = eINSTANCE.getModelAutoCreate_Feature(); + + /** + * The meta object literal for the '<em><b>Origin</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference MODEL_AUTO_CREATE__ORIGIN = eINSTANCE.getModelAutoCreate_Origin(); + + /** + * The meta object literal for the '<em><b>Creation Type</b></em>' attribute feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EAttribute MODEL_AUTO_CREATE__CREATION_TYPE = eINSTANCE.getModelAutoCreate_CreationType(); + + /** + * The meta object literal for the '{@link org.eclipse.papyrus.infra.architecture.representation.impl.RootAutoSelectImpl <em>Root Auto Select</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.infra.architecture.representation.impl.RootAutoSelectImpl + * @see org.eclipse.papyrus.infra.architecture.representation.impl.RepresentationPackageImpl#getRootAutoSelect() + * @generated + */ + EClass ROOT_AUTO_SELECT = eINSTANCE.getRootAutoSelect(); + + /** + * The meta object literal for the '<em><b>Feature</b></em>' reference feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + EReference ROOT_AUTO_SELECT__FEATURE = eINSTANCE.getRootAutoSelect_Feature(); + + } + +} //RepresentationPackage diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/RootAutoSelect.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/RootAutoSelect.java new file mode 100644 index 00000000000..daa32e15234 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/RootAutoSelect.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2016 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EReference; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Root Auto Select</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.RootAutoSelect#getFeature <em>Feature</em>}</li> + * </ul> + * + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getRootAutoSelect() + * @model + * @generated + */ +public interface RootAutoSelect extends EObject { + /** + * Returns the value of the '<em><b>Feature</b></em>' reference. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Feature</em>' reference isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Feature</em>' reference. + * @see #setFeature(EReference) + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getRootAutoSelect_Feature() + * @model required="true" + * @generated + */ + EReference getFeature(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.infra.architecture.representation.RootAutoSelect#getFeature <em>Feature</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Feature</em>' reference. + * @see #getFeature() + * @generated + */ + void setFeature(EReference value); + +} // RootAutoSelect diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/Rule.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/Rule.java new file mode 100644 index 00000000000..aa24a6c8bf3 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/Rule.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2016 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation; + +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Rule</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * </p> + * <ul> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.Rule#isPermit <em>Permit</em>}</li> + * </ul> + * + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getRule() + * @model abstract="true" + * @generated + */ +public interface Rule extends EObject { + /** + * Returns the value of the '<em><b>Permit</b></em>' attribute. + * The default value is <code>"true"</code>. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Permit</em>' attribute isn't clear, + * there really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * @return the value of the '<em>Permit</em>' attribute. + * @see #setPermit(boolean) + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#getRule_Permit() + * @model default="true" required="true" + * @generated + */ + boolean isPermit(); + + /** + * Sets the value of the '{@link org.eclipse.papyrus.infra.architecture.representation.Rule#isPermit <em>Permit</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param value the new value of the '<em>Permit</em>' attribute. + * @see #isPermit() + * @generated + */ + void setPermit(boolean value); + +} // Rule diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/ModelAutoCreateImpl.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/ModelAutoCreateImpl.java new file mode 100644 index 00000000000..b5a3e566a07 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/ModelAutoCreateImpl.java @@ -0,0 +1,263 @@ +/** + * Copyright (c) 2016 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation.impl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate; +import org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Model Auto Create</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.impl.ModelAutoCreateImpl#getFeature <em>Feature</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.impl.ModelAutoCreateImpl#getOrigin <em>Origin</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.impl.ModelAutoCreateImpl#getCreationType <em>Creation Type</em>}</li> + * </ul> + * + * @generated + */ +public class ModelAutoCreateImpl extends MinimalEObjectImpl.Container implements ModelAutoCreate { + /** + * The cached value of the '{@link #getFeature() <em>Feature</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getFeature() + * @generated + * @ordered + */ + protected EReference feature; + + /** + * The default value of the '{@link #getCreationType() <em>Creation Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getCreationType() + * @generated + * @ordered + */ + protected static final String CREATION_TYPE_EDEFAULT = null; + + /** + * The cached value of the '{@link #getCreationType() <em>Creation Type</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getCreationType() + * @generated + * @ordered + */ + protected String creationType = CREATION_TYPE_EDEFAULT; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected ModelAutoCreateImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return RepresentationPackage.Literals.MODEL_AUTO_CREATE; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getFeature() { + if (feature != null && feature.eIsProxy()) { + InternalEObject oldFeature = (InternalEObject)feature; + feature = (EReference)eResolveProxy(oldFeature); + if (feature != oldFeature) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, RepresentationPackage.MODEL_AUTO_CREATE__FEATURE, oldFeature, feature)); + } + } + return feature; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference basicGetFeature() { + return feature; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setFeature(EReference newFeature) { + EReference oldFeature = feature; + feature = newFeature; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, RepresentationPackage.MODEL_AUTO_CREATE__FEATURE, oldFeature, feature)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getOrigin() { + EClass origin = basicGetOrigin(); + return origin != null && origin.eIsProxy() ? (EClass)eResolveProxy((InternalEObject)origin) : origin; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass basicGetOrigin() { + // TODO: implement this method to return the 'Origin' reference + // -> do not perform proxy resolution + // Ensure that you remove @generated or mark it @generated NOT + throw new UnsupportedOperationException(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getCreationType() { + return creationType; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setCreationType(String newCreationType) { + String oldCreationType = creationType; + creationType = newCreationType; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, RepresentationPackage.MODEL_AUTO_CREATE__CREATION_TYPE, oldCreationType, creationType)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case RepresentationPackage.MODEL_AUTO_CREATE__FEATURE: + if (resolve) return getFeature(); + return basicGetFeature(); + case RepresentationPackage.MODEL_AUTO_CREATE__ORIGIN: + if (resolve) return getOrigin(); + return basicGetOrigin(); + case RepresentationPackage.MODEL_AUTO_CREATE__CREATION_TYPE: + return getCreationType(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case RepresentationPackage.MODEL_AUTO_CREATE__FEATURE: + setFeature((EReference)newValue); + return; + case RepresentationPackage.MODEL_AUTO_CREATE__CREATION_TYPE: + setCreationType((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case RepresentationPackage.MODEL_AUTO_CREATE__FEATURE: + setFeature((EReference)null); + return; + case RepresentationPackage.MODEL_AUTO_CREATE__CREATION_TYPE: + setCreationType(CREATION_TYPE_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case RepresentationPackage.MODEL_AUTO_CREATE__FEATURE: + return feature != null; + case RepresentationPackage.MODEL_AUTO_CREATE__ORIGIN: + return basicGetOrigin() != null; + case RepresentationPackage.MODEL_AUTO_CREATE__CREATION_TYPE: + return CREATION_TYPE_EDEFAULT == null ? creationType != null : !CREATION_TYPE_EDEFAULT.equals(creationType); + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (creationType: "); + result.append(creationType); + result.append(')'); + return result.toString(); + } + +} //ModelAutoCreateImpl diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/ModelRuleImpl.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/ModelRuleImpl.java new file mode 100644 index 00000000000..9025905ffcd --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/ModelRuleImpl.java @@ -0,0 +1,431 @@ +/** + * Copyright (c) 2016 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.papyrus.infra.architecture.representation.ModelRule; +import org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage; +import org.eclipse.papyrus.infra.constraints.ConstraintDescriptor; +import org.eclipse.papyrus.infra.constraints.ConstraintsPackage; +import org.eclipse.papyrus.infra.constraints.DisplayUnit; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Model Rule</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.impl.ModelRuleImpl#getConstraints <em>Constraints</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.impl.ModelRuleImpl#getElementMultiplicity <em>Element Multiplicity</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.impl.ModelRuleImpl#getElement <em>Element</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.impl.ModelRuleImpl#getStereotypes <em>Stereotypes</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.impl.ModelRuleImpl#getMultiplicity <em>Multiplicity</em>}</li> + * </ul> + * + * @generated + */ +public class ModelRuleImpl extends RuleImpl implements ModelRule { + /** + * The cached value of the '{@link #getConstraints() <em>Constraints</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getConstraints() + * @generated + * @ordered + */ + protected EList<ConstraintDescriptor> constraints; + + /** + * The default value of the '{@link #getElementMultiplicity() <em>Element Multiplicity</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getElementMultiplicity() + * @generated + * @ordered + */ + protected static final int ELEMENT_MULTIPLICITY_EDEFAULT = 1; + + /** + * The cached value of the '{@link #getElementMultiplicity() <em>Element Multiplicity</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getElementMultiplicity() + * @generated + * @ordered + */ + protected int elementMultiplicity = ELEMENT_MULTIPLICITY_EDEFAULT; + + /** + * The cached value of the '{@link #getElement() <em>Element</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getElement() + * @generated + * @ordered + */ + protected EClass element; + + /** + * The cached value of the '{@link #getStereotypes() <em>Stereotypes</em>}' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getStereotypes() + * @generated + * @ordered + */ + protected EList<EClass> stereotypes; + + /** + * The default value of the '{@link #getMultiplicity() <em>Multiplicity</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getMultiplicity() + * @generated + * @ordered + */ + protected static final int MULTIPLICITY_EDEFAULT = -1; + + /** + * The cached value of the '{@link #getMultiplicity() <em>Multiplicity</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getMultiplicity() + * @generated + * @ordered + */ + protected int multiplicity = MULTIPLICITY_EDEFAULT; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected ModelRuleImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return RepresentationPackage.Literals.MODEL_RULE; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<ConstraintDescriptor> getConstraints() { + if (constraints == null) { + constraints = new EObjectContainmentWithInverseEList<ConstraintDescriptor>(ConstraintDescriptor.class, this, RepresentationPackage.MODEL_RULE__CONSTRAINTS, ConstraintsPackage.CONSTRAINT_DESCRIPTOR__DISPLAY); + } + return constraints; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public int getElementMultiplicity() { + return elementMultiplicity; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setElementMultiplicity(int newElementMultiplicity) { + int oldElementMultiplicity = elementMultiplicity; + elementMultiplicity = newElementMultiplicity; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, RepresentationPackage.MODEL_RULE__ELEMENT_MULTIPLICITY, oldElementMultiplicity, elementMultiplicity)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getElement() { + if (element != null && element.eIsProxy()) { + InternalEObject oldElement = (InternalEObject)element; + element = (EClass)eResolveProxy(oldElement); + if (element != oldElement) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, RepresentationPackage.MODEL_RULE__ELEMENT, oldElement, element)); + } + } + return element; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass basicGetElement() { + return element; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setElement(EClass newElement) { + EClass oldElement = element; + element = newElement; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, RepresentationPackage.MODEL_RULE__ELEMENT, oldElement, element)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<EClass> getStereotypes() { + if (stereotypes == null) { + stereotypes = new EObjectResolvingEList<EClass>(EClass.class, this, RepresentationPackage.MODEL_RULE__STEREOTYPES); + } + return stereotypes; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public int getMultiplicity() { + return multiplicity; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setMultiplicity(int newMultiplicity) { + int oldMultiplicity = multiplicity; + multiplicity = newMultiplicity; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, RepresentationPackage.MODEL_RULE__MULTIPLICITY, oldMultiplicity, multiplicity)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case RepresentationPackage.MODEL_RULE__CONSTRAINTS: + return ((InternalEList<InternalEObject>)(InternalEList<?>)getConstraints()).basicAdd(otherEnd, msgs); + } + return super.eInverseAdd(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case RepresentationPackage.MODEL_RULE__CONSTRAINTS: + return ((InternalEList<?>)getConstraints()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case RepresentationPackage.MODEL_RULE__CONSTRAINTS: + return getConstraints(); + case RepresentationPackage.MODEL_RULE__ELEMENT_MULTIPLICITY: + return getElementMultiplicity(); + case RepresentationPackage.MODEL_RULE__ELEMENT: + if (resolve) return getElement(); + return basicGetElement(); + case RepresentationPackage.MODEL_RULE__STEREOTYPES: + return getStereotypes(); + case RepresentationPackage.MODEL_RULE__MULTIPLICITY: + return getMultiplicity(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case RepresentationPackage.MODEL_RULE__CONSTRAINTS: + getConstraints().clear(); + getConstraints().addAll((Collection<? extends ConstraintDescriptor>)newValue); + return; + case RepresentationPackage.MODEL_RULE__ELEMENT_MULTIPLICITY: + setElementMultiplicity((Integer)newValue); + return; + case RepresentationPackage.MODEL_RULE__ELEMENT: + setElement((EClass)newValue); + return; + case RepresentationPackage.MODEL_RULE__STEREOTYPES: + getStereotypes().clear(); + getStereotypes().addAll((Collection<? extends EClass>)newValue); + return; + case RepresentationPackage.MODEL_RULE__MULTIPLICITY: + setMultiplicity((Integer)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case RepresentationPackage.MODEL_RULE__CONSTRAINTS: + getConstraints().clear(); + return; + case RepresentationPackage.MODEL_RULE__ELEMENT_MULTIPLICITY: + setElementMultiplicity(ELEMENT_MULTIPLICITY_EDEFAULT); + return; + case RepresentationPackage.MODEL_RULE__ELEMENT: + setElement((EClass)null); + return; + case RepresentationPackage.MODEL_RULE__STEREOTYPES: + getStereotypes().clear(); + return; + case RepresentationPackage.MODEL_RULE__MULTIPLICITY: + setMultiplicity(MULTIPLICITY_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case RepresentationPackage.MODEL_RULE__CONSTRAINTS: + return constraints != null && !constraints.isEmpty(); + case RepresentationPackage.MODEL_RULE__ELEMENT_MULTIPLICITY: + return elementMultiplicity != ELEMENT_MULTIPLICITY_EDEFAULT; + case RepresentationPackage.MODEL_RULE__ELEMENT: + return element != null; + case RepresentationPackage.MODEL_RULE__STEREOTYPES: + return stereotypes != null && !stereotypes.isEmpty(); + case RepresentationPackage.MODEL_RULE__MULTIPLICITY: + return multiplicity != MULTIPLICITY_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public int eBaseStructuralFeatureID(int derivedFeatureID, Class<?> baseClass) { + if (baseClass == DisplayUnit.class) { + switch (derivedFeatureID) { + case RepresentationPackage.MODEL_RULE__CONSTRAINTS: return ConstraintsPackage.DISPLAY_UNIT__CONSTRAINTS; + case RepresentationPackage.MODEL_RULE__ELEMENT_MULTIPLICITY: return ConstraintsPackage.DISPLAY_UNIT__ELEMENT_MULTIPLICITY; + default: return -1; + } + } + return super.eBaseStructuralFeatureID(derivedFeatureID, baseClass); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public int eDerivedStructuralFeatureID(int baseFeatureID, Class<?> baseClass) { + if (baseClass == DisplayUnit.class) { + switch (baseFeatureID) { + case ConstraintsPackage.DISPLAY_UNIT__CONSTRAINTS: return RepresentationPackage.MODEL_RULE__CONSTRAINTS; + case ConstraintsPackage.DISPLAY_UNIT__ELEMENT_MULTIPLICITY: return RepresentationPackage.MODEL_RULE__ELEMENT_MULTIPLICITY; + default: return -1; + } + } + return super.eDerivedStructuralFeatureID(baseFeatureID, baseClass); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (elementMultiplicity: "); + result.append(elementMultiplicity); + result.append(", multiplicity: "); + result.append(multiplicity); + result.append(')'); + return result.toString(); + } + +} //ModelRuleImpl diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/OwningRuleImpl.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/OwningRuleImpl.java new file mode 100644 index 00000000000..ed80a0633c8 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/OwningRuleImpl.java @@ -0,0 +1,363 @@ +/** + * Copyright (c) 2016 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.EObjectResolvingEList; +import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate; +import org.eclipse.papyrus.infra.architecture.representation.OwningRule; +import org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage; +import org.eclipse.papyrus.infra.architecture.representation.RootAutoSelect; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Owning Rule</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.impl.OwningRuleImpl#getElement <em>Element</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.impl.OwningRuleImpl#getStereotypes <em>Stereotypes</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.impl.OwningRuleImpl#getMultiplicity <em>Multiplicity</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.impl.OwningRuleImpl#getNewModelPath <em>New Model Path</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.impl.OwningRuleImpl#getSelectDiagramRoot <em>Select Diagram Root</em>}</li> + * </ul> + * + * @generated + */ +public class OwningRuleImpl extends RuleImpl implements OwningRule { + /** + * The cached value of the '{@link #getElement() <em>Element</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getElement() + * @generated + * @ordered + */ + protected EClass element; + + /** + * The cached value of the '{@link #getStereotypes() <em>Stereotypes</em>}' reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getStereotypes() + * @generated + * @ordered + */ + protected EList<EClass> stereotypes; + + /** + * The default value of the '{@link #getMultiplicity() <em>Multiplicity</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getMultiplicity() + * @generated + * @ordered + */ + protected static final int MULTIPLICITY_EDEFAULT = -1; + + /** + * The cached value of the '{@link #getMultiplicity() <em>Multiplicity</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getMultiplicity() + * @generated + * @ordered + */ + protected int multiplicity = MULTIPLICITY_EDEFAULT; + + /** + * The cached value of the '{@link #getNewModelPath() <em>New Model Path</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getNewModelPath() + * @generated + * @ordered + */ + protected EList<ModelAutoCreate> newModelPath; + + /** + * The cached value of the '{@link #getSelectDiagramRoot() <em>Select Diagram Root</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getSelectDiagramRoot() + * @generated + * @ordered + */ + protected EList<RootAutoSelect> selectDiagramRoot; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected OwningRuleImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return RepresentationPackage.Literals.OWNING_RULE; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getElement() { + if (element != null && element.eIsProxy()) { + InternalEObject oldElement = (InternalEObject)element; + element = (EClass)eResolveProxy(oldElement); + if (element != oldElement) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, RepresentationPackage.OWNING_RULE__ELEMENT, oldElement, element)); + } + } + return element; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass basicGetElement() { + return element; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setElement(EClass newElement) { + EClass oldElement = element; + element = newElement; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, RepresentationPackage.OWNING_RULE__ELEMENT, oldElement, element)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<EClass> getStereotypes() { + if (stereotypes == null) { + stereotypes = new EObjectResolvingEList<EClass>(EClass.class, this, RepresentationPackage.OWNING_RULE__STEREOTYPES); + } + return stereotypes; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public int getMultiplicity() { + return multiplicity; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setMultiplicity(int newMultiplicity) { + int oldMultiplicity = multiplicity; + multiplicity = newMultiplicity; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, RepresentationPackage.OWNING_RULE__MULTIPLICITY, oldMultiplicity, multiplicity)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<ModelAutoCreate> getNewModelPath() { + if (newModelPath == null) { + newModelPath = new EObjectContainmentEList<ModelAutoCreate>(ModelAutoCreate.class, this, RepresentationPackage.OWNING_RULE__NEW_MODEL_PATH); + } + return newModelPath; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<RootAutoSelect> getSelectDiagramRoot() { + if (selectDiagramRoot == null) { + selectDiagramRoot = new EObjectContainmentEList<RootAutoSelect>(RootAutoSelect.class, this, RepresentationPackage.OWNING_RULE__SELECT_DIAGRAM_ROOT); + } + return selectDiagramRoot; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case RepresentationPackage.OWNING_RULE__NEW_MODEL_PATH: + return ((InternalEList<?>)getNewModelPath()).basicRemove(otherEnd, msgs); + case RepresentationPackage.OWNING_RULE__SELECT_DIAGRAM_ROOT: + return ((InternalEList<?>)getSelectDiagramRoot()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case RepresentationPackage.OWNING_RULE__ELEMENT: + if (resolve) return getElement(); + return basicGetElement(); + case RepresentationPackage.OWNING_RULE__STEREOTYPES: + return getStereotypes(); + case RepresentationPackage.OWNING_RULE__MULTIPLICITY: + return getMultiplicity(); + case RepresentationPackage.OWNING_RULE__NEW_MODEL_PATH: + return getNewModelPath(); + case RepresentationPackage.OWNING_RULE__SELECT_DIAGRAM_ROOT: + return getSelectDiagramRoot(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case RepresentationPackage.OWNING_RULE__ELEMENT: + setElement((EClass)newValue); + return; + case RepresentationPackage.OWNING_RULE__STEREOTYPES: + getStereotypes().clear(); + getStereotypes().addAll((Collection<? extends EClass>)newValue); + return; + case RepresentationPackage.OWNING_RULE__MULTIPLICITY: + setMultiplicity((Integer)newValue); + return; + case RepresentationPackage.OWNING_RULE__NEW_MODEL_PATH: + getNewModelPath().clear(); + getNewModelPath().addAll((Collection<? extends ModelAutoCreate>)newValue); + return; + case RepresentationPackage.OWNING_RULE__SELECT_DIAGRAM_ROOT: + getSelectDiagramRoot().clear(); + getSelectDiagramRoot().addAll((Collection<? extends RootAutoSelect>)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case RepresentationPackage.OWNING_RULE__ELEMENT: + setElement((EClass)null); + return; + case RepresentationPackage.OWNING_RULE__STEREOTYPES: + getStereotypes().clear(); + return; + case RepresentationPackage.OWNING_RULE__MULTIPLICITY: + setMultiplicity(MULTIPLICITY_EDEFAULT); + return; + case RepresentationPackage.OWNING_RULE__NEW_MODEL_PATH: + getNewModelPath().clear(); + return; + case RepresentationPackage.OWNING_RULE__SELECT_DIAGRAM_ROOT: + getSelectDiagramRoot().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case RepresentationPackage.OWNING_RULE__ELEMENT: + return element != null; + case RepresentationPackage.OWNING_RULE__STEREOTYPES: + return stereotypes != null && !stereotypes.isEmpty(); + case RepresentationPackage.OWNING_RULE__MULTIPLICITY: + return multiplicity != MULTIPLICITY_EDEFAULT; + case RepresentationPackage.OWNING_RULE__NEW_MODEL_PATH: + return newModelPath != null && !newModelPath.isEmpty(); + case RepresentationPackage.OWNING_RULE__SELECT_DIAGRAM_ROOT: + return selectDiagramRoot != null && !selectDiagramRoot.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (multiplicity: "); + result.append(multiplicity); + result.append(')'); + return result.toString(); + } + +} //OwningRuleImpl diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/PapyrusRepresentationKindImpl.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/PapyrusRepresentationKindImpl.java new file mode 100644 index 00000000000..e5988a89138 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/PapyrusRepresentationKindImpl.java @@ -0,0 +1,329 @@ +/** + * Copyright (c) 2016 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation.impl; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.papyrus.infra.architecture.representation.ModelRule; +import org.eclipse.papyrus.infra.architecture.representation.OwningRule; +import org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind; +import org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage; +import org.eclipse.papyrus.infra.core.architecture.impl.RepresentationKindImpl; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Papyrus Representation Kind</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.impl.PapyrusRepresentationKindImpl#getParent <em>Parent</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.impl.PapyrusRepresentationKindImpl#getModelRules <em>Model Rules</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.impl.PapyrusRepresentationKindImpl#getOwningRules <em>Owning Rules</em>}</li> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.impl.PapyrusRepresentationKindImpl#getImplementationID <em>Implementation ID</em>}</li> + * </ul> + * + * @generated + */ +public abstract class PapyrusRepresentationKindImpl extends RepresentationKindImpl implements PapyrusRepresentationKind { + /** + * The cached value of the '{@link #getParent() <em>Parent</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getParent() + * @generated + * @ordered + */ + protected PapyrusRepresentationKind parent; + + /** + * The cached value of the '{@link #getModelRules() <em>Model Rules</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getModelRules() + * @generated + * @ordered + */ + protected EList<ModelRule> modelRules; + + /** + * The cached value of the '{@link #getOwningRules() <em>Owning Rules</em>}' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getOwningRules() + * @generated + * @ordered + */ + protected EList<OwningRule> owningRules; + + /** + * The default value of the '{@link #getImplementationID() <em>Implementation ID</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getImplementationID() + * @generated + * @ordered + */ + protected static final String IMPLEMENTATION_ID_EDEFAULT = null; + + /** + * The cached value of the '{@link #getImplementationID() <em>Implementation ID</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getImplementationID() + * @generated + * @ordered + */ + protected String implementationID = IMPLEMENTATION_ID_EDEFAULT; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected PapyrusRepresentationKindImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return RepresentationPackage.Literals.PAPYRUS_REPRESENTATION_KIND; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public PapyrusRepresentationKind getParent() { + if (parent != null && parent.eIsProxy()) { + InternalEObject oldParent = (InternalEObject)parent; + parent = (PapyrusRepresentationKind)eResolveProxy(oldParent); + if (parent != oldParent) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__PARENT, oldParent, parent)); + } + } + return parent; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public PapyrusRepresentationKind basicGetParent() { + return parent; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setParent(PapyrusRepresentationKind newParent) { + PapyrusRepresentationKind oldParent = parent; + parent = newParent; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__PARENT, oldParent, parent)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<ModelRule> getModelRules() { + if (modelRules == null) { + modelRules = new EObjectContainmentEList<ModelRule>(ModelRule.class, this, RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__MODEL_RULES); + } + return modelRules; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EList<OwningRule> getOwningRules() { + if (owningRules == null) { + owningRules = new EObjectContainmentEList<OwningRule>(OwningRule.class, this, RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__OWNING_RULES); + } + return owningRules; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public String getImplementationID() { + return implementationID; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setImplementationID(String newImplementationID) { + String oldImplementationID = implementationID; + implementationID = newImplementationID; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__IMPLEMENTATION_ID, oldImplementationID, implementationID)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__MODEL_RULES: + return ((InternalEList<?>)getModelRules()).basicRemove(otherEnd, msgs); + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__OWNING_RULES: + return ((InternalEList<?>)getOwningRules()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__PARENT: + if (resolve) return getParent(); + return basicGetParent(); + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__MODEL_RULES: + return getModelRules(); + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__OWNING_RULES: + return getOwningRules(); + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__IMPLEMENTATION_ID: + return getImplementationID(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__PARENT: + setParent((PapyrusRepresentationKind)newValue); + return; + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__MODEL_RULES: + getModelRules().clear(); + getModelRules().addAll((Collection<? extends ModelRule>)newValue); + return; + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__OWNING_RULES: + getOwningRules().clear(); + getOwningRules().addAll((Collection<? extends OwningRule>)newValue); + return; + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__IMPLEMENTATION_ID: + setImplementationID((String)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__PARENT: + setParent((PapyrusRepresentationKind)null); + return; + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__MODEL_RULES: + getModelRules().clear(); + return; + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__OWNING_RULES: + getOwningRules().clear(); + return; + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__IMPLEMENTATION_ID: + setImplementationID(IMPLEMENTATION_ID_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__PARENT: + return parent != null; + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__MODEL_RULES: + return modelRules != null && !modelRules.isEmpty(); + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__OWNING_RULES: + return owningRules != null && !owningRules.isEmpty(); + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND__IMPLEMENTATION_ID: + return IMPLEMENTATION_ID_EDEFAULT == null ? implementationID != null : !IMPLEMENTATION_ID_EDEFAULT.equals(implementationID); + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (implementationID: "); + result.append(implementationID); + result.append(')'); + return result.toString(); + } + +} //PapyrusRepresentationKindImpl diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/RepresentationFactoryImpl.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/RepresentationFactoryImpl.java new file mode 100644 index 00000000000..e7857a3f895 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/RepresentationFactoryImpl.java @@ -0,0 +1,138 @@ +/** + * Copyright (c) 2016 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.impl.EFactoryImpl; + +import org.eclipse.emf.ecore.plugin.EcorePlugin; +import org.eclipse.papyrus.infra.architecture.representation.*; + +/** + * <!-- begin-user-doc --> + * An implementation of the model <b>Factory</b>. + * <!-- end-user-doc --> + * @generated + */ +public class RepresentationFactoryImpl extends EFactoryImpl implements RepresentationFactory { + /** + * Creates the default factory implementation. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public static RepresentationFactory init() { + try { + RepresentationFactory theRepresentationFactory = (RepresentationFactory)EPackage.Registry.INSTANCE.getEFactory(RepresentationPackage.eNS_URI); + if (theRepresentationFactory != null) { + return theRepresentationFactory; + } + } + catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new RepresentationFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public RepresentationFactoryImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case RepresentationPackage.MODEL_RULE: return createModelRule(); + case RepresentationPackage.OWNING_RULE: return createOwningRule(); + case RepresentationPackage.MODEL_AUTO_CREATE: return createModelAutoCreate(); + case RepresentationPackage.ROOT_AUTO_SELECT: return createRootAutoSelect(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ModelRule createModelRule() { + ModelRuleImpl modelRule = new ModelRuleImpl(); + return modelRule; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public OwningRule createOwningRule() { + OwningRuleImpl owningRule = new OwningRuleImpl(); + return owningRule; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public ModelAutoCreate createModelAutoCreate() { + ModelAutoCreateImpl modelAutoCreate = new ModelAutoCreateImpl(); + return modelAutoCreate; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public RootAutoSelect createRootAutoSelect() { + RootAutoSelectImpl rootAutoSelect = new RootAutoSelectImpl(); + return rootAutoSelect; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public RepresentationPackage getRepresentationPackage() { + return (RepresentationPackage)getEPackage(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @deprecated + * @generated + */ + @Deprecated + public static RepresentationPackage getPackage() { + return RepresentationPackage.eINSTANCE; + } + +} //RepresentationFactoryImpl diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/RepresentationPackageImpl.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/RepresentationPackageImpl.java new file mode 100644 index 00000000000..0eb6e133c31 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/RepresentationPackageImpl.java @@ -0,0 +1,484 @@ +/** + * Copyright (c) 2016 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation.impl; + +import org.eclipse.emf.ecore.EAttribute; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.EReference; + +import org.eclipse.emf.ecore.impl.EPackageImpl; +import org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate; +import org.eclipse.papyrus.infra.architecture.representation.ModelRule; +import org.eclipse.papyrus.infra.architecture.representation.OwningRule; +import org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind; +import org.eclipse.papyrus.infra.architecture.representation.RepresentationFactory; +import org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage; +import org.eclipse.papyrus.infra.architecture.representation.RootAutoSelect; +import org.eclipse.papyrus.infra.architecture.representation.Rule; +import org.eclipse.papyrus.infra.constraints.ConstraintsPackage; + +import org.eclipse.papyrus.infra.core.architecture.ArchitecturePackage; + +/** + * <!-- begin-user-doc --> + * An implementation of the model <b>Package</b>. + * <!-- end-user-doc --> + * @generated + */ +public class RepresentationPackageImpl extends EPackageImpl implements RepresentationPackage { + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass papyrusRepresentationKindEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass ruleEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass modelRuleEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass owningRuleEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass modelAutoCreateEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private EClass rootAutoSelectEClass = null; + + /** + * Creates an instance of the model <b>Package</b>, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + * <p>Note: the correct way to create the package is via the static + * factory method {@link #init init()}, which also performs + * initialization of the package, or returns the registered package, + * if one already exists. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage#eNS_URI + * @see #init() + * @generated + */ + private RepresentationPackageImpl() { + super(eNS_URI, RepresentationFactory.eINSTANCE); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. + * + * <p>This method is used to initialize {@link RepresentationPackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static RepresentationPackage init() { + if (isInited) return (RepresentationPackage)EPackage.Registry.INSTANCE.getEPackage(RepresentationPackage.eNS_URI); + + // Obtain or create and register package + RepresentationPackageImpl theRepresentationPackage = (RepresentationPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof RepresentationPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new RepresentationPackageImpl()); + + isInited = true; + + // Initialize simple dependencies + ArchitecturePackage.eINSTANCE.eClass(); + ConstraintsPackage.eINSTANCE.eClass(); + + // Create package meta-data objects + theRepresentationPackage.createPackageContents(); + + // Initialize created meta-data + theRepresentationPackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theRepresentationPackage.freeze(); + + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(RepresentationPackage.eNS_URI, theRepresentationPackage); + return theRepresentationPackage; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getPapyrusRepresentationKind() { + return papyrusRepresentationKindEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getPapyrusRepresentationKind_Parent() { + return (EReference)papyrusRepresentationKindEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getPapyrusRepresentationKind_ModelRules() { + return (EReference)papyrusRepresentationKindEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getPapyrusRepresentationKind_OwningRules() { + return (EReference)papyrusRepresentationKindEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getPapyrusRepresentationKind_ImplementationID() { + return (EAttribute)papyrusRepresentationKindEClass.getEStructuralFeatures().get(3); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getRule() { + return ruleEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getRule_Permit() { + return (EAttribute)ruleEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getModelRule() { + return modelRuleEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getModelRule_Element() { + return (EReference)modelRuleEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getModelRule_Stereotypes() { + return (EReference)modelRuleEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getModelRule_Multiplicity() { + return (EAttribute)modelRuleEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getOwningRule() { + return owningRuleEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getOwningRule_Element() { + return (EReference)owningRuleEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getOwningRule_Stereotypes() { + return (EReference)owningRuleEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getOwningRule_Multiplicity() { + return (EAttribute)owningRuleEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getOwningRule_NewModelPath() { + return (EReference)owningRuleEClass.getEStructuralFeatures().get(3); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getOwningRule_SelectDiagramRoot() { + return (EReference)owningRuleEClass.getEStructuralFeatures().get(4); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getModelAutoCreate() { + return modelAutoCreateEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getModelAutoCreate_Feature() { + return (EReference)modelAutoCreateEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getModelAutoCreate_Origin() { + return (EReference)modelAutoCreateEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EAttribute getModelAutoCreate_CreationType() { + return (EAttribute)modelAutoCreateEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EClass getRootAutoSelect() { + return rootAutoSelectEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getRootAutoSelect_Feature() { + return (EReference)rootAutoSelectEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public RepresentationFactory getRepresentationFactory() { + return (RepresentationFactory)getEFactoryInstance(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private boolean isCreated = false; + + /** + * Creates the meta-model objects for the package. This method is + * guarded to have no affect on any invocation but its first. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void createPackageContents() { + if (isCreated) return; + isCreated = true; + + // Create classes and their features + papyrusRepresentationKindEClass = createEClass(PAPYRUS_REPRESENTATION_KIND); + createEReference(papyrusRepresentationKindEClass, PAPYRUS_REPRESENTATION_KIND__PARENT); + createEReference(papyrusRepresentationKindEClass, PAPYRUS_REPRESENTATION_KIND__MODEL_RULES); + createEReference(papyrusRepresentationKindEClass, PAPYRUS_REPRESENTATION_KIND__OWNING_RULES); + createEAttribute(papyrusRepresentationKindEClass, PAPYRUS_REPRESENTATION_KIND__IMPLEMENTATION_ID); + + ruleEClass = createEClass(RULE); + createEAttribute(ruleEClass, RULE__PERMIT); + + modelRuleEClass = createEClass(MODEL_RULE); + createEReference(modelRuleEClass, MODEL_RULE__ELEMENT); + createEReference(modelRuleEClass, MODEL_RULE__STEREOTYPES); + createEAttribute(modelRuleEClass, MODEL_RULE__MULTIPLICITY); + + owningRuleEClass = createEClass(OWNING_RULE); + createEReference(owningRuleEClass, OWNING_RULE__ELEMENT); + createEReference(owningRuleEClass, OWNING_RULE__STEREOTYPES); + createEAttribute(owningRuleEClass, OWNING_RULE__MULTIPLICITY); + createEReference(owningRuleEClass, OWNING_RULE__NEW_MODEL_PATH); + createEReference(owningRuleEClass, OWNING_RULE__SELECT_DIAGRAM_ROOT); + + modelAutoCreateEClass = createEClass(MODEL_AUTO_CREATE); + createEReference(modelAutoCreateEClass, MODEL_AUTO_CREATE__FEATURE); + createEReference(modelAutoCreateEClass, MODEL_AUTO_CREATE__ORIGIN); + createEAttribute(modelAutoCreateEClass, MODEL_AUTO_CREATE__CREATION_TYPE); + + rootAutoSelectEClass = createEClass(ROOT_AUTO_SELECT); + createEReference(rootAutoSelectEClass, ROOT_AUTO_SELECT__FEATURE); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + private boolean isInitialized = false; + + /** + * Complete the initialization of the package and its meta-model. This + * method is guarded to have no affect on any invocation but its first. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void initializePackageContents() { + if (isInitialized) return; + isInitialized = true; + + // Initialize package + setName(eNAME); + setNsPrefix(eNS_PREFIX); + setNsURI(eNS_URI); + + // Obtain other dependent packages + ArchitecturePackage theArchitecturePackage = (ArchitecturePackage)EPackage.Registry.INSTANCE.getEPackage(ArchitecturePackage.eNS_URI); + ConstraintsPackage theConstraintsPackage = (ConstraintsPackage)EPackage.Registry.INSTANCE.getEPackage(ConstraintsPackage.eNS_URI); + + // Create type parameters + + // Set bounds for type parameters + + // Add supertypes to classes + papyrusRepresentationKindEClass.getESuperTypes().add(theArchitecturePackage.getRepresentationKind()); + modelRuleEClass.getESuperTypes().add(this.getRule()); + modelRuleEClass.getESuperTypes().add(theConstraintsPackage.getDisplayUnit()); + owningRuleEClass.getESuperTypes().add(this.getRule()); + + // Initialize classes, features, and operations; add parameters + initEClass(papyrusRepresentationKindEClass, PapyrusRepresentationKind.class, "PapyrusRepresentationKind", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getPapyrusRepresentationKind_Parent(), this.getPapyrusRepresentationKind(), null, "parent", null, 0, 1, PapyrusRepresentationKind.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getPapyrusRepresentationKind_ModelRules(), this.getModelRule(), null, "modelRules", null, 1, -1, PapyrusRepresentationKind.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getPapyrusRepresentationKind_OwningRules(), this.getOwningRule(), null, "owningRules", null, 1, -1, PapyrusRepresentationKind.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getPapyrusRepresentationKind_ImplementationID(), ecorePackage.getEString(), "implementationID", null, 1, 1, PapyrusRepresentationKind.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(ruleEClass, Rule.class, "Rule", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getRule_Permit(), ecorePackage.getEBoolean(), "permit", "true", 1, 1, Rule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(modelRuleEClass, ModelRule.class, "ModelRule", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getModelRule_Element(), ecorePackage.getEClass(), null, "element", null, 0, 1, ModelRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getModelRule_Stereotypes(), ecorePackage.getEClass(), null, "stereotypes", null, 0, -1, ModelRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getModelRule_Multiplicity(), ecorePackage.getEInt(), "multiplicity", "-1", 1, 1, ModelRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(owningRuleEClass, OwningRule.class, "OwningRule", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getOwningRule_Element(), ecorePackage.getEClass(), null, "element", null, 0, 1, OwningRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getOwningRule_Stereotypes(), ecorePackage.getEClass(), null, "stereotypes", null, 0, -1, OwningRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getOwningRule_Multiplicity(), ecorePackage.getEInt(), "multiplicity", "-1", 1, 1, OwningRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getOwningRule_NewModelPath(), this.getModelAutoCreate(), null, "newModelPath", null, 0, -1, OwningRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getOwningRule_SelectDiagramRoot(), this.getRootAutoSelect(), null, "selectDiagramRoot", null, 0, -1, OwningRule.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(modelAutoCreateEClass, ModelAutoCreate.class, "ModelAutoCreate", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getModelAutoCreate_Feature(), ecorePackage.getEReference(), null, "feature", null, 1, 1, ModelAutoCreate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEReference(getModelAutoCreate_Origin(), ecorePackage.getEClass(), null, "origin", null, 1, 1, ModelAutoCreate.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); + initEAttribute(getModelAutoCreate_CreationType(), ecorePackage.getEString(), "creationType", null, 1, 1, ModelAutoCreate.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(rootAutoSelectEClass, RootAutoSelect.class, "RootAutoSelect", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); + initEReference(getRootAutoSelect_Feature(), ecorePackage.getEReference(), null, "feature", null, 1, 1, RootAutoSelect.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Create resource + createResource(eNS_URI); + } + +} //RepresentationPackageImpl diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/RootAutoSelectImpl.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/RootAutoSelectImpl.java new file mode 100644 index 00000000000..393bce8bafc --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/RootAutoSelectImpl.java @@ -0,0 +1,167 @@ +/** + * Copyright (c) 2016 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation.impl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EReference; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage; +import org.eclipse.papyrus.infra.architecture.representation.RootAutoSelect; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Root Auto Select</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.impl.RootAutoSelectImpl#getFeature <em>Feature</em>}</li> + * </ul> + * + * @generated + */ +public class RootAutoSelectImpl extends MinimalEObjectImpl.Container implements RootAutoSelect { + /** + * The cached value of the '{@link #getFeature() <em>Feature</em>}' reference. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #getFeature() + * @generated + * @ordered + */ + protected EReference feature; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected RootAutoSelectImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return RepresentationPackage.Literals.ROOT_AUTO_SELECT; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference getFeature() { + if (feature != null && feature.eIsProxy()) { + InternalEObject oldFeature = (InternalEObject)feature; + feature = (EReference)eResolveProxy(oldFeature); + if (feature != oldFeature) { + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.RESOLVE, RepresentationPackage.ROOT_AUTO_SELECT__FEATURE, oldFeature, feature)); + } + } + return feature; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public EReference basicGetFeature() { + return feature; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setFeature(EReference newFeature) { + EReference oldFeature = feature; + feature = newFeature; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, RepresentationPackage.ROOT_AUTO_SELECT__FEATURE, oldFeature, feature)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case RepresentationPackage.ROOT_AUTO_SELECT__FEATURE: + if (resolve) return getFeature(); + return basicGetFeature(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case RepresentationPackage.ROOT_AUTO_SELECT__FEATURE: + setFeature((EReference)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case RepresentationPackage.ROOT_AUTO_SELECT__FEATURE: + setFeature((EReference)null); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case RepresentationPackage.ROOT_AUTO_SELECT__FEATURE: + return feature != null; + } + return super.eIsSet(featureID); + } + +} //RootAutoSelectImpl diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/RuleImpl.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/RuleImpl.java new file mode 100644 index 00000000000..ebb2594255b --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/impl/RuleImpl.java @@ -0,0 +1,173 @@ +/** + * Copyright (c) 2016 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation.impl; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage; +import org.eclipse.papyrus.infra.architecture.representation.Rule; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Rule</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * </p> + * <ul> + * <li>{@link org.eclipse.papyrus.infra.architecture.representation.impl.RuleImpl#isPermit <em>Permit</em>}</li> + * </ul> + * + * @generated + */ +public abstract class RuleImpl extends MinimalEObjectImpl.Container implements Rule { + /** + * The default value of the '{@link #isPermit() <em>Permit</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isPermit() + * @generated + * @ordered + */ + protected static final boolean PERMIT_EDEFAULT = true; + + /** + * The cached value of the '{@link #isPermit() <em>Permit</em>}' attribute. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @see #isPermit() + * @generated + * @ordered + */ + protected boolean permit = PERMIT_EDEFAULT; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected RuleImpl() { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + protected EClass eStaticClass() { + return RepresentationPackage.Literals.RULE; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public boolean isPermit() { + return permit; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public void setPermit(boolean newPermit) { + boolean oldPermit = permit; + permit = newPermit; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, RepresentationPackage.RULE__PERMIT, oldPermit, permit)); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case RepresentationPackage.RULE__PERMIT: + return isPermit(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case RepresentationPackage.RULE__PERMIT: + setPermit((Boolean)newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case RepresentationPackage.RULE__PERMIT: + setPermit(PERMIT_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case RepresentationPackage.RULE__PERMIT: + return permit != PERMIT_EDEFAULT; + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (permit: "); + result.append(permit); + result.append(')'); + return result.toString(); + } + +} //RuleImpl diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/util/RepresentationAdapterFactory.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/util/RepresentationAdapterFactory.java new file mode 100644 index 00000000000..5c6de95af9b --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/util/RepresentationAdapterFactory.java @@ -0,0 +1,278 @@ +/** + * Copyright (c) 2016 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation.util; + +import org.eclipse.emf.common.notify.Adapter; +import org.eclipse.emf.common.notify.Notifier; + +import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.papyrus.infra.architecture.representation.*; +import org.eclipse.papyrus.infra.constraints.DisplayUnit; + +import org.eclipse.papyrus.infra.core.architecture.ADElement; +import org.eclipse.papyrus.infra.core.architecture.RepresentationKind; + +/** + * <!-- begin-user-doc --> + * The <b>Adapter Factory</b> for the model. + * It provides an adapter <code>createXXX</code> method for each class of the model. + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage + * @generated + */ +public class RepresentationAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static RepresentationPackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public RepresentationAdapterFactory() { + if (modelPackage == null) { + modelPackage = RepresentationPackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * <!-- begin-user-doc --> + * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model. + * <!-- end-user-doc --> + * @return whether this factory is applicable for the type of the object. + * @generated + */ + @Override + public boolean isFactoryForType(Object object) { + if (object == modelPackage) { + return true; + } + if (object instanceof EObject) { + return ((EObject)object).eClass().getEPackage() == modelPackage; + } + return false; + } + + /** + * The switch that delegates to the <code>createXXX</code> methods. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected RepresentationSwitch<Adapter> modelSwitch = + new RepresentationSwitch<Adapter>() { + @Override + public Adapter casePapyrusRepresentationKind(PapyrusRepresentationKind object) { + return createPapyrusRepresentationKindAdapter(); + } + @Override + public Adapter caseRule(Rule object) { + return createRuleAdapter(); + } + @Override + public Adapter caseModelRule(ModelRule object) { + return createModelRuleAdapter(); + } + @Override + public Adapter caseOwningRule(OwningRule object) { + return createOwningRuleAdapter(); + } + @Override + public Adapter caseModelAutoCreate(ModelAutoCreate object) { + return createModelAutoCreateAdapter(); + } + @Override + public Adapter caseRootAutoSelect(RootAutoSelect object) { + return createRootAutoSelectAdapter(); + } + @Override + public Adapter caseADElement(ADElement object) { + return createADElementAdapter(); + } + @Override + public Adapter caseRepresentationKind(RepresentationKind object) { + return createRepresentationKindAdapter(); + } + @Override + public Adapter caseDisplayUnit(DisplayUnit object) { + return createDisplayUnitAdapter(); + } + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the <code>target</code>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param target the object to adapt. + * @return the adapter for the <code>target</code>. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject)target); + } + + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind <em>Papyrus Representation Kind</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind + * @generated + */ + public Adapter createPapyrusRepresentationKindAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.architecture.representation.Rule <em>Rule</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.papyrus.infra.architecture.representation.Rule + * @generated + */ + public Adapter createRuleAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.architecture.representation.ModelRule <em>Model Rule</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.papyrus.infra.architecture.representation.ModelRule + * @generated + */ + public Adapter createModelRuleAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.architecture.representation.OwningRule <em>Owning Rule</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.papyrus.infra.architecture.representation.OwningRule + * @generated + */ + public Adapter createOwningRuleAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate <em>Model Auto Create</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate + * @generated + */ + public Adapter createModelAutoCreateAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.architecture.representation.RootAutoSelect <em>Root Auto Select</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.papyrus.infra.architecture.representation.RootAutoSelect + * @generated + */ + public Adapter createRootAutoSelectAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.core.architecture.ADElement <em>AD Element</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.papyrus.infra.core.architecture.ADElement + * @generated + */ + public Adapter createADElementAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.core.architecture.RepresentationKind <em>Representation Kind</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.papyrus.infra.core.architecture.RepresentationKind + * @generated + */ + public Adapter createRepresentationKindAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.infra.constraints.DisplayUnit <em>Display Unit</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * @return the new adapter. + * @see org.eclipse.papyrus.infra.constraints.DisplayUnit + * @generated + */ + public Adapter createDisplayUnitAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * <!-- begin-user-doc --> + * This default implementation returns null. + * <!-- end-user-doc --> + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //RepresentationAdapterFactory diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/util/RepresentationSwitch.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/util/RepresentationSwitch.java new file mode 100644 index 00000000000..8b02aab277f --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src-gen/org/eclipse/papyrus/infra/architecture/representation/util/RepresentationSwitch.java @@ -0,0 +1,279 @@ +/** + * Copyright (c) 2016 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.representation.util; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; +import org.eclipse.papyrus.infra.architecture.representation.*; +import org.eclipse.papyrus.infra.constraints.DisplayUnit; + +import org.eclipse.papyrus.infra.core.architecture.ADElement; +import org.eclipse.papyrus.infra.core.architecture.RepresentationKind; + +/** + * <!-- begin-user-doc --> + * The <b>Switch</b> for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the <code>caseXXX</code> method for each class of the model, + * starting with the actual class of the object + * and proceeding up the inheritance hierarchy + * until a non-null result is returned, + * which is the result of the switch. + * <!-- end-user-doc --> + * @see org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage + * @generated + */ +public class RepresentationSwitch<T> extends Switch<T> { + /** + * The cached model package + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + protected static RepresentationPackage modelPackage; + + /** + * Creates an instance of the switch. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @generated + */ + public RepresentationSwitch() { + if (modelPackage == null) { + modelPackage = RepresentationPackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @param ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; + } + + /** + * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * @return the first non-null result returned by a <code>caseXXX</code> call. + * @generated + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case RepresentationPackage.PAPYRUS_REPRESENTATION_KIND: { + PapyrusRepresentationKind papyrusRepresentationKind = (PapyrusRepresentationKind)theEObject; + T result = casePapyrusRepresentationKind(papyrusRepresentationKind); + if (result == null) result = caseRepresentationKind(papyrusRepresentationKind); + if (result == null) result = caseADElement(papyrusRepresentationKind); + if (result == null) result = defaultCase(theEObject); + return result; + } + case RepresentationPackage.RULE: { + Rule rule = (Rule)theEObject; + T result = caseRule(rule); + if (result == null) result = defaultCase(theEObject); + return result; + } + case RepresentationPackage.MODEL_RULE: { + ModelRule modelRule = (ModelRule)theEObject; + T result = caseModelRule(modelRule); + if (result == null) result = caseRule(modelRule); + if (result == null) result = caseDisplayUnit(modelRule); + if (result == null) result = defaultCase(theEObject); + return result; + } + case RepresentationPackage.OWNING_RULE: { + OwningRule owningRule = (OwningRule)theEObject; + T result = caseOwningRule(owningRule); + if (result == null) result = caseRule(owningRule); + if (result == null) result = defaultCase(theEObject); + return result; + } + case RepresentationPackage.MODEL_AUTO_CREATE: { + ModelAutoCreate modelAutoCreate = (ModelAutoCreate)theEObject; + T result = caseModelAutoCreate(modelAutoCreate); + if (result == null) result = defaultCase(theEObject); + return result; + } + case RepresentationPackage.ROOT_AUTO_SELECT: { + RootAutoSelect rootAutoSelect = (RootAutoSelect)theEObject; + T result = caseRootAutoSelect(rootAutoSelect); + if (result == null) result = defaultCase(theEObject); + return result; + } + default: return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Papyrus Representation Kind</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Papyrus Representation Kind</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T casePapyrusRepresentationKind(PapyrusRepresentationKind object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Rule</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Rule</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseRule(Rule object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Model Rule</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Model Rule</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseModelRule(ModelRule object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Owning Rule</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Owning Rule</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseOwningRule(OwningRule object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Model Auto Create</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Model Auto Create</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseModelAutoCreate(ModelAutoCreate object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Root Auto Select</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Root Auto Select</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseRootAutoSelect(RootAutoSelect object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>AD Element</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>AD Element</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseADElement(ADElement object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Representation Kind</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Representation Kind</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseRepresentationKind(RepresentationKind object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Display Unit</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Display Unit</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseDisplayUnit(DisplayUnit object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * <!-- end-user-doc --> + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>EObject</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) { + return null; + } + +} //RepresentationSwitch diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src/org/eclipse/papyrus/infra/architecture/representation/impl/ModelAutoCreateCustomImpl.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src/org/eclipse/papyrus/infra/architecture/representation/impl/ModelAutoCreateCustomImpl.java new file mode 100644 index 00000000000..f2c043ace13 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src/org/eclipse/papyrus/infra/architecture/representation/impl/ModelAutoCreateCustomImpl.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2015 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Benoit Maggi benoit.maggi@cea.fr - Initial API and implementation + * + */ +package org.eclipse.papyrus.infra.architecture.representation.impl; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EClass; +import org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate; +import org.eclipse.papyrus.infra.architecture.representation.OwningRule; +import org.eclipse.papyrus.infra.architecture.representation.impl.ModelAutoCreateImpl; + + +public class ModelAutoCreateCustomImpl extends ModelAutoCreateImpl implements ModelAutoCreate { + + + /** + * @see org.eclipse.papyrus.infra.architecture.representation.impl.ModelAutoCreateImpl#basicGetOrigin() + * + * @return + */ + @Override + public EClass basicGetOrigin() { + OwningRule rule = (OwningRule) this.eContainer(); + EList<ModelAutoCreate> list = rule.getNewModelPath(); + int index = list.indexOf(this); + if (index == 0) { + return rule.getElement(); + } + + return null; // FIXME used to be : list.get(index - 1).getCreationType(); + } + + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src/org/eclipse/papyrus/infra/architecture/representation/impl/RepresentationFactoryCustomImpl.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src/org/eclipse/papyrus/infra/architecture/representation/impl/RepresentationFactoryCustomImpl.java new file mode 100644 index 00000000000..cdfcbe7b66f --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture.representation/src/org/eclipse/papyrus/infra/architecture/representation/impl/RepresentationFactoryCustomImpl.java @@ -0,0 +1,56 @@ +/** + * Copyright (c) 2015 CEA LIST, Christian W. Damus, and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Benoit Maggi benoit.maggi@cea.fr - Initial API and implementation + * Christian W. Damus - bug 463156 + * + */ +package org.eclipse.papyrus.infra.architecture.representation.impl; + +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.emf.ecore.plugin.EcorePlugin; +import org.eclipse.papyrus.infra.architecture.representation.ModelAutoCreate; +import org.eclipse.papyrus.infra.architecture.representation.RepresentationFactory; +import org.eclipse.papyrus.infra.architecture.representation.RepresentationPackage; +import org.eclipse.papyrus.infra.architecture.representation.impl.ModelAutoCreateImpl; +import org.eclipse.papyrus.infra.architecture.representation.impl.RepresentationFactoryImpl; + + +public class RepresentationFactoryCustomImpl extends RepresentationFactoryImpl implements RepresentationFactory { + + public static RepresentationFactory init() { + try { + RepresentationFactory theRepresentationFactory = (RepresentationFactory) EPackage.Registry.INSTANCE.getEFactory(RepresentationPackage.eNS_URI); + if (theRepresentationFactory != null) { + return theRepresentationFactory; + } + } catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new RepresentationFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public RepresentationFactoryCustomImpl() { + super(); + } + + @Override + public ModelAutoCreate createModelAutoCreate() { + ModelAutoCreateImpl modelAutoCreate = new ModelAutoCreateCustomImpl(); + return modelAutoCreate; + } + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/.classpath b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/.classpath new file mode 100644 index 00000000000..eca7bdba8f0 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/.classpath @@ -0,0 +1,7 @@ +<?xml version="1.0" encoding="UTF-8"?> +<classpath> + <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> + <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> + <classpathentry kind="src" path="src"/> + <classpathentry kind="output" path="bin"/> +</classpath> diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/.project b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/.project new file mode 100644 index 00000000000..b84c4044c74 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/.project @@ -0,0 +1,28 @@ +<?xml version="1.0" encoding="UTF-8"?> +<projectDescription> + <name>org.eclipse.papyrus.infra.architecture</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.pde.PluginNature</nature> + <nature>org.eclipse.jdt.core.javanature</nature> + </natures> +</projectDescription> diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/.settings/org.eclipse.jdt.core.prefs b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..0c68a61dca8 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/META-INF/MANIFEST.MF b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..ca78652d551 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: org.eclipse.papyrus.infra.architecture;singleton:=true +Bundle-Version: 1.0.0.qualifier +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Export-Package: org.eclipse.papyrus.infra.architecture, + org.eclipse.papyrus.infra.architecture.commands, + org.eclipse.papyrus.infra.architecture.listeners, + org.eclipse.papyrus.infra.core.architecture.merged +Require-Bundle: org.eclipse.papyrus.infra.core.architecture;bundle-version="[1.0.0,2.0.0)";visibility:=reexport, + org.eclipse.papyrus.infra.services.edit;bundle-version="[2.0.0,3.0.0)", + org.eclipse.papyrus.infra.core;bundle-version="[2.3.0,3.0.0)" +Bundle-ActivationPolicy: lazy +Bundle-Vendor: %providerName diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/about.html b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/about.html new file mode 100644 index 00000000000..bbf2bd6aac7 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/about.html @@ -0,0 +1,28 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/> +<title>About</title> +</head> +<body lang="EN-US"> +<h2>About This Content</h2> + +<p>January 30, 2017</p> +<h3>License</h3> + +<p>The Eclipse Foundation makes available all content in this plug-in ("Content"). Unless otherwise +indicated below, the Content is provided to you under the terms and conditions of the +Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is available +at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>. +For purposes of the EPL, "Program" will mean the Content.</p> + +<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is +being redistributed by another party ("Redistributor") and different terms and conditions may +apply to your use of any object code in the Content. Check the Redistributor's license that was +provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise +indicated below, the terms and conditions of the EPL still apply to any source code in the Content +and such source code may be obtained at <a href="http://www.eclipse.org">http://www.eclipse.org</a>.</p> + +</body> +</html>
\ No newline at end of file diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/build.properties b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/build.properties new file mode 100644 index 00000000000..0d413bddebd --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/build.properties @@ -0,0 +1,7 @@ +source.. = src/ +output.. = bin/ +bin.includes = META-INF/,\ + .,\ + plugin.properties,\ + plugin.xml +
\ No newline at end of file diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/plugin.properties b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/plugin.properties new file mode 100644 index 00000000000..f8028c40563 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/plugin.properties @@ -0,0 +1,14 @@ +# Copyright (c) 2017 CEA LIST. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +# +# Contributors: +# Maged Elaasar - Initial API and implementation +# +# + +pluginName = Architecture Services +providerName=Eclipse Modeling Project diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/plugin.xml b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/plugin.xml new file mode 100644 index 00000000000..daedd8ffb97 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/plugin.xml @@ -0,0 +1,31 @@ +<?xml version="1.0" encoding="UTF-8"?> +<?eclipse version="3.0"?> + +<!-- + Copyright (c) 2016 CEA LIST. + + All rights reserved. This program and the accompanying materials + are made available under the terms of the Eclipse Public License v1.0 + which accompanies this distribution, and is available at + http://www.eclipse.org/legal/epl-v10.html + + Contributors: + Laurent Wouters laurent.wouters@cea.fr - Initial API and implementation + + +--> + +<plugin> + <extension-point id="models" name="Architecture Models" schema="schema/models.exsd"/> + <extension-point id="commandProviders" name="Architecture Command Providers" schema="schema/commands.exsd"/> + <extension-point id="listeners" name="Architecture Listneers" schema="schema/listeners.exsd"/> + + <extension + point="org.eclipse.papyrus.infra.core.model"> + <modelSetSnippet + classname="org.eclipse.papyrus.infra.architecture.listeners.ArchitectureDescriptionSnippet" + description="Adapter attached to the ModelSet to listen to architecture changes"> + </modelSetSnippet> + </extension> + +</plugin> diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/pom.xml b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/pom.xml new file mode 100644 index 00000000000..50ab4a4ee64 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/pom.xml @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> + <modelVersion>4.0.0</modelVersion> + <parent> + <groupId>org.eclipse.papyrus</groupId> + <artifactId>org.eclipse.papyrus.infra-architecture</artifactId> + <version>0.0.1-SNAPSHOT</version> + </parent> + <artifactId>org.eclipse.papyrus.infra.architecture</artifactId> + <version>1.0.0-SNAPSHOT</version> + <packaging>eclipse-plugin</packaging> +</project> diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/schema/commands.exsd b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/schema/commands.exsd new file mode 100644 index 00000000000..964f9881d5f --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/schema/commands.exsd @@ -0,0 +1,107 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!-- Schema file written by PDE --> +<schema targetNamespace="org.eclipse.papyrus.infra.architecture" xmlns="http://www.w3.org/2001/XMLSchema"> +<annotation> + <appInfo> + <meta.schema plugin="org.eclipse.papyrus.infra.architecture" id="commands" name="Architecture Command Providers"/> + </appInfo> + <documentation> + Definition of architecture command providers + </documentation> + </annotation> + + <element name="extension"> + <annotation> + <appInfo> + <meta.element /> + </appInfo> + </annotation> + <complexType> + <sequence> + <element ref="commandProvider" minOccurs="1" maxOccurs="unbounded"/> + </sequence> + <attribute name="point" type="string" use="required"> + <annotation> + <documentation> + + </documentation> + </annotation> + </attribute> + <attribute name="id" type="string"> + <annotation> + <documentation> + + </documentation> + </annotation> + </attribute> + <attribute name="name" type="string"> + <annotation> + <documentation> + + </documentation> + <appInfo> + <meta.attribute translatable="true"/> + </appInfo> + </annotation> + </attribute> + </complexType> + </element> + + <element name="commandProvider"> + <annotation> + <documentation> + contributes an architecture command provider + </documentation> + </annotation> + <complexType> + <attribute name="class" type="string" use="required"> + <annotation> + <documentation> + A fully qualified name of a class implementing the org.eclipse.papyrus.infra.architecture.commands.ICommandProvider interface. + </documentation> + <appInfo> + <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.infra.architecture.commands.ICommandProvider"/> + </appInfo> + </annotation> + </attribute> + </complexType> + </element> + + <annotation> + <appInfo> + <meta.section type="since"/> + </appInfo> + <documentation> + [Enter the first release in which this extension point appears.] + </documentation> + </annotation> + + <annotation> + <appInfo> + <meta.section type="examples"/> + </appInfo> + <documentation> + [Enter extension point usage example here.] + </documentation> + </annotation> + + <annotation> + <appInfo> + <meta.section type="apiinfo"/> + </appInfo> + <documentation> + [Enter API information here.] + </documentation> + </annotation> + + <annotation> + <appInfo> + <meta.section type="implementation"/> + </appInfo> + <documentation> + [Enter information about supplied implementation of this extension point.] + </documentation> + </annotation> + + +</schema> diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/schema/listeners.exsd b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/schema/listeners.exsd new file mode 100644 index 00000000000..2448123718b --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/schema/listeners.exsd @@ -0,0 +1,107 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!-- Schema file written by PDE --> +<schema targetNamespace="org.eclipse.papyrus.infra.architecture" xmlns="http://www.w3.org/2001/XMLSchema"> +<annotation> + <appInfo> + <meta.schema plugin="org.eclipse.papyrus.infra.architecture" id="listeners" name="Architecture Listeners"/> + </appInfo> + <documentation> + Definition of architecture listeners + </documentation> + </annotation> + + <element name="extension"> + <annotation> + <appInfo> + <meta.element /> + </appInfo> + </annotation> + <complexType> + <sequence> + <element ref="listener" minOccurs="1" maxOccurs="unbounded"/> + </sequence> + <attribute name="point" type="string" use="required"> + <annotation> + <documentation> + + </documentation> + </annotation> + </attribute> + <attribute name="id" type="string"> + <annotation> + <documentation> + + </documentation> + </annotation> + </attribute> + <attribute name="name" type="string"> + <annotation> + <documentation> + + </documentation> + <appInfo> + <meta.attribute translatable="true"/> + </appInfo> + </annotation> + </attribute> + </complexType> + </element> + + <element name="listener"> + <annotation> + <documentation> + contributes an architecture listener + </documentation> + </annotation> + <complexType> + <attribute name="class" type="string" use="required"> + <annotation> + <documentation> + A fully qualified name of a class implementing the org.eclipse.papyrus.infra.architecture.listeners.IArchitectureDescriptionListener interface. + </documentation> + <appInfo> + <meta.attribute kind="java" basedOn=":org.eclipse.papyrus.infra.architecture.listeners.IArchitectureDescriptionListener"/> + </appInfo> + </annotation> + </attribute> + </complexType> + </element> + + <annotation> + <appInfo> + <meta.section type="since"/> + </appInfo> + <documentation> + [Enter the first release in which this extension point appears.] + </documentation> + </annotation> + + <annotation> + <appInfo> + <meta.section type="examples"/> + </appInfo> + <documentation> + [Enter extension point usage example here.] + </documentation> + </annotation> + + <annotation> + <appInfo> + <meta.section type="apiinfo"/> + </appInfo> + <documentation> + [Enter API information here.] + </documentation> + </annotation> + + <annotation> + <appInfo> + <meta.section type="implementation"/> + </appInfo> + <documentation> + [Enter information about supplied implementation of this extension point.] + </documentation> + </annotation> + + +</schema> diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/schema/models.exsd b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/schema/models.exsd new file mode 100644 index 00000000000..01d94c00902 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/schema/models.exsd @@ -0,0 +1,109 @@ +<?xml version='1.0' encoding='UTF-8'?> +<!-- Schema file written by PDE --> +<schema targetNamespace="org.eclipse.papyrus.infra.architecture" xmlns="http://www.w3.org/2001/XMLSchema"> +<annotation> + <appInfo> + <meta.schema plugin="org.eclipse.papyrus.infra.architecture" id="models" name="Architecture Models"/> + </appInfo> + <documentation> + Definition of an architecture domain. + </documentation> + </annotation> + + <element name="extension"> + <annotation> + <appInfo> + <meta.element /> + </appInfo> + </annotation> + <complexType> + <sequence> + <element ref="model" minOccurs="1" maxOccurs="unbounded"/> + </sequence> + <attribute name="point" type="string" use="required"> + <annotation> + <documentation> + + </documentation> + </annotation> + </attribute> + <attribute name="id" type="string"> + <annotation> + <documentation> + + </documentation> + </annotation> + </attribute> + <attribute name="name" type="string"> + <annotation> + <documentation> + + </documentation> + <appInfo> + <meta.attribute translatable="true"/> + </appInfo> + </annotation> + </attribute> + </complexType> + </element> + + <element name="model"> + <annotation> + <documentation> + contributes an architecture model + </documentation> + </annotation> + <complexType> + <attribute name="path" type="string" use="required"> + <annotation> + <documentation> + Path to an architecture model file in the bundle. + +Note: Do not forget to add the file in the binary build of the plugin! + </documentation> + <appInfo> + <meta.attribute kind="resource"/> + </appInfo> + </annotation> + </attribute> + </complexType> + </element> + + <annotation> + <appInfo> + <meta.section type="since"/> + </appInfo> + <documentation> + [Enter the first release in which this extension point appears.] + </documentation> + </annotation> + + <annotation> + <appInfo> + <meta.section type="examples"/> + </appInfo> + <documentation> + [Enter extension point usage example here.] + </documentation> + </annotation> + + <annotation> + <appInfo> + <meta.section type="apiinfo"/> + </appInfo> + <documentation> + [Enter API information here.] + </documentation> + </annotation> + + <annotation> + <appInfo> + <meta.section type="implementation"/> + </appInfo> + <documentation> + [Enter information about supplied implementation of this extension point.] + </documentation> + </annotation> + + +</schema> diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/Activator.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/Activator.java new file mode 100644 index 00000000000..4b6d2d237f5 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/Activator.java @@ -0,0 +1,62 @@ +/** + * Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture; + +import org.eclipse.core.runtime.Plugin; +import org.eclipse.papyrus.infra.core.log.LogHelper; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class Activator extends Plugin { + + // The plug-in ID + public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.architecture"; //$NON-NLS-1$ + + // The shared instance + private static Activator plugin; + + /** Logging helper */ + public static LogHelper log; + + /** + * The constructor + */ + public Activator() { + } + + @Override + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + log = new LogHelper(this); + } + + @Override + public void stop(BundleContext context) throws Exception { + log = null; + plugin = null; + super.stop(context); + } + + /** + * Returns the shared instance + * + * @return the shared instance + */ + public static Activator getDefault() { + return plugin; + } +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/ArchitectureDescriptionUtils.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/ArchitectureDescriptionUtils.java new file mode 100644 index 00000000000..18c9e69463c --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/ArchitectureDescriptionUtils.java @@ -0,0 +1,333 @@ +/** + * Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.CompoundCommand; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.transaction.RecordingCommand; +import org.eclipse.papyrus.infra.architecture.commands.IModelConversionCommand; +import org.eclipse.papyrus.infra.architecture.commands.IModelCreationCommand; +import org.eclipse.papyrus.infra.architecture.commands.ModelCommandProviderRegistry; +import org.eclipse.papyrus.infra.core.architecture.ArchitectureDescription; +import org.eclipse.papyrus.infra.core.architecture.ArchitectureDescriptionPreferences; +import org.eclipse.papyrus.infra.core.architecture.ArchitectureFactory; +import org.eclipse.papyrus.infra.core.architecture.ArchitecturePackage; +import org.eclipse.papyrus.infra.core.architecture.merged.MergedArchitectureContext; +import org.eclipse.papyrus.infra.core.architecture.merged.MergedArchitectureViewpoint; +import org.eclipse.papyrus.infra.core.resource.IModel; +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.core.resource.sasheditor.DiModel; + +/** + * An API for manipulating architecture descriptions in a model set + * + * @since 1.0 + */ +public class ArchitectureDescriptionUtils { + + /** + * The model set in context + */ + private ModelSet modelSet; + + /** + * The architecture domain manager + */ + private ArchitectureDomainManager manager = ArchitectureDomainManager.getInstance(); + + /** + * Constructs an instance of this class given a model set + * + * @param modelSet The given model set + */ + public ArchitectureDescriptionUtils(ModelSet modelSet) { + this.modelSet = modelSet; + } + + /** + * Gets the model set in context + * + * @return a model set + */ + public ModelSet getModelSet() { + return modelSet; + } + + /** + * Gets the architecture context set in the model set + * + * @return architecture context + */ + public MergedArchitectureContext getArchitectureContext() { + String contextId = getArchitectureContextId(); + return manager.getArchitectureContextById(contextId); + } + + /** + * Gets the architecture context id set in the model set + * + * @return architecture context id + */ + public String getArchitectureContextId() { + ArchitectureDescription description = getArchitectureDescription(); + if (description != null) + return description.getContextId(); + return ArchitectureDomainManager.getInstance().getDefaultArchitectureContextId(); + } + + /** + * Gets the architecture viewpoints set in the model set + * + * @return a collection of architecture viewpoints + */ + public Collection<MergedArchitectureViewpoint> getArchitectureViewpoints() { + List<MergedArchitectureViewpoint> viewpoints = new ArrayList<MergedArchitectureViewpoint>(); + for (String viewpointId : getArchitectureViewpointIds()) { + MergedArchitectureViewpoint viewpoint = manager.getArchitectureViewpointById(viewpointId); + if (viewpoint != null) + viewpoints.add(viewpoint); + } + return viewpoints; + } + + /** + * Gets the architecture viewpoint ids set in the model set + * + * @return a collection of architecture viewpoin ids + */ + public Collection<String> getArchitectureViewpointIds() { + ArchitectureDescriptionPreferences preferences = getArchitectureDescriptionPreferences(); + if (preferences != null) + return preferences.getViewpointIds(); + MergedArchitectureContext context = ArchitectureDomainManager.getInstance().getDefaultArchitectureContext(); + List<String> viewpointIds = new ArrayList<String>(); + for (MergedArchitectureViewpoint viewpoint : context.getViewpoints()) { + viewpointIds.add(viewpoint.getId()); + } + return viewpointIds; + } + + /** + * Returns a command that applies the given contextId and viewpoint ids to the model set + * and creates a new model in the set based on them + * + * Model creation is based on the creation command configured with the architecture context + * and contribution commands registered in extensions + * + * @param contextId the context id to apply to the model set + * @param viewpointIds the viewpoint ids to apply to the model set + * @return a command to create a new model + */ + public Command createNewModel(final String contextId, final String[] viewpointIds) { + CompoundCommand cc = new CompoundCommand("Create New Model"); + // Add the main command to create the model + cc.append(getModelCreationCommand(contextId)); + // Add commands from registered providers to create the model + cc.append(ModelCommandProviderRegistry.getInstance().getModelCreationCommand(modelSet, contextId)); + // Add a command to set the new context id to the model set + cc.append(getSetContextCommand(contextId)); + // Add a command to set the new viewpoint ids to the model set + cc.append(getSetViewpointCommand(viewpointIds)); + return cc; + } + + /** + * Returns a command that switches the contextId of the model set to the given id and + * converts the semantic model as a result + * + * Model conversion is based on the conversion command configured with the architecture context + * and contribution commands registered in extensions + * + * @param contextId the context id to apply to the model set + * @return a command that switches the model set to the given context id + */ + public Command switchArchitectureContextId(final String contextId) { + CompoundCommand cc = new CompoundCommand("Switch Architecture Context"); + // Add the main command to convert the model + cc.append(getModelConversionCommand(contextId)); + // Add commands from registered providers to convert the model + cc.append(ModelCommandProviderRegistry.getInstance().getModelConversionCommand(modelSet, contextId)); + // Add a command to set the new context id + cc.append(getSetContextCommand(contextId)); + return cc; + } + + /** + * Returns a command that switches the viewpoints of the model set to the given id + * + * @param viewpointIds the new viewpoint ids to apply to the model set + * @return a command that switches the model set to the given viewpoint ids + */ + public Command switchArchitectureViewpointIds(final String[] viewpointIds) { + CompoundCommand cc = new CompoundCommand("Switch Architecture Viewpoints"); + // Add a command to convert the model + cc.append(getSetViewpointCommand(viewpointIds)); + return cc; + } + + /** + * Returns a command to set the context id in the model set + * + * @param contextId the new context id + * @return a command that sets the context id in the model set + */ + protected Command getSetContextCommand(String contextId) { + return new RecordingCommand(modelSet.getTransactionalEditingDomain()) { + @Override + protected void doExecute() { + ArchitectureDescription description = getArchitectureDescription(); + if (description == null) { + description = ArchitectureFactory.eINSTANCE.createArchitectureDescription(); + addArchitectureDescription(description); + } + description.setContextId(contextId); + } + }; + } + + /** + * Returns a command to create a new model in the model set based on the given context id + * + * @param contextId the context id + * @return a command that creates a new model + */ + protected Command getModelCreationCommand(String contextId) { + final MergedArchitectureContext context = manager.getArchitectureContextById(contextId); + if (context.getCreationCommandClass() == null) + return null; + return new RecordingCommand(modelSet.getTransactionalEditingDomain()) { + @Override + protected void doExecute() { + try { + IModelCreationCommand creationCommand = (IModelCreationCommand) context.getCreationCommandClass().newInstance(); + creationCommand.createModel(modelSet); + } catch (Exception e) { + Activator.log.error(e); + } + } + }; + } + + /** + * Returns a command to converts a new model in the model set based on the given new context id + * + * @param contextId the new context id + * @return a command that converts a model + */ + protected Command getModelConversionCommand(String contextId) { + MergedArchitectureContext context = manager.getArchitectureContextById(contextId); + if (context.getConversionCommandClass() == null) + return null; + return new RecordingCommand(modelSet.getTransactionalEditingDomain()) { + @Override + protected void doExecute() { + try { + IModelConversionCommand conversionCommand = (IModelConversionCommand) context.getConversionCommandClass().newInstance(); + conversionCommand.convertModel(modelSet); + } catch (Exception e) { + Activator.log.error(e); + } + } + }; + } + + /** + * Returns a command that sets the given viewpoint ids to the model set + * + * @param viewpointIds The new viewpoint ids + * @return a command to set the viewpoint ids + */ + protected Command getSetViewpointCommand(String[] viewpointIds) { + return new RecordingCommand(modelSet.getTransactionalEditingDomain()) { + @Override + protected void doExecute() { + ArchitectureDescriptionPreferences preferences = getArchitectureDescriptionPreferences(); + if (preferences == null) { + preferences = ArchitectureFactory.eINSTANCE.createArchitectureDescriptionPreferences(); + addArchitectureDescriptionPreferences(preferences); + } + Arrays.sort(viewpointIds); + preferences.eSet(ArchitecturePackage.eINSTANCE.getArchitectureDescriptionPreferences_ViewpointIds(), Arrays.asList(viewpointIds)); + } + }; + } + + /** + * Gets the architecture description element in the model set + * + * @return the architecture description element + */ + protected ArchitectureDescription getArchitectureDescription() { + ArchitectureDescription description = null; + for (EObject root : getDiResource().getContents()) { + if (root instanceof ArchitectureDescription) { + description = (ArchitectureDescription) root; + break; + } + } + return description; + } + + /** + * Adds the given architecture description element to the resource set + * + * @param description an architecture description element + */ + protected void addArchitectureDescription(ArchitectureDescription description) { + getDiResource().getContents().add(description); + } + + /** + * Gets the architecture description preferences element in the model set + * + * @return the architecture description preferences element + */ + protected ArchitectureDescriptionPreferences getArchitectureDescriptionPreferences() { + ArchitectureDescriptionPreferences preferences = null; + for (EObject root : getDiResource().getContents()) { + if (root instanceof ArchitectureDescriptionPreferences) { + preferences = (ArchitectureDescriptionPreferences) root; + break; + } + } + return preferences; + } + + /** + * Adds the given architecture description preferences element to the resource set + * + * @param description an architecture description preferences element + */ + protected void addArchitectureDescriptionPreferences(ArchitectureDescriptionPreferences preferences) { + getDiResource().getContents().add(preferences); + } + + /** + * Gets the DI resource from the model set + * + * @return the DI resource + */ + protected Resource getDiResource() { + IModel model = modelSet.getModel(DiModel.DI_MODEL_ID); + return ((DiModel)model).getResource(); + } + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/ArchitectureDomainManager.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/ArchitectureDomainManager.java new file mode 100644 index 00000000000..152e35b9baf --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/ArchitectureDomainManager.java @@ -0,0 +1,233 @@ +/** + * Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashSet; +import java.util.List; + +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.Platform; +import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener; +import org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent; +import org.eclipse.emf.common.util.URI; +import org.eclipse.papyrus.infra.core.architecture.merged.MergedArchitectureContext; +import org.eclipse.papyrus.infra.core.architecture.merged.MergedArchitectureDomain; +import org.eclipse.papyrus.infra.core.architecture.merged.MergedArchitectureViewpoint; + +/** + * The main API for reading architecture domains information + * + * It reads architecture domain models registered in extensions and preferences + * + * @since 1.0 + */ +public class ArchitectureDomainManager implements IPreferenceChangeListener { + + /** + * The extension point for architecture models + */ + private static final String EXTENSION_POINT = Activator.PLUGIN_ID + ".models"; + + /** + * The name pf the path attribute + */ + private static final String PATH = "path"; //$NON-NLS-1$ + + /** + * The singleton instance of this class + */ + private static ArchitectureDomainManager INSTANCE; + + /** + * Gets the singleton instance of this class + * + * @return the singleton instance of this class + */ + public static ArchitectureDomainManager getInstance() { + if (INSTANCE == null) + INSTANCE = new ArchitectureDomainManager(); + return INSTANCE; + } + + /** + * An interface for listening to changes to architectural domains + */ + public static interface Listener { + public void domainManagerChanged(); + } + + /** + * The architecture domain preferences + */ + private ArchitectureDomainPreferences preferences; + + /** + * The architecture domain merger + */ + private ArchitectureDomainMerger merger; + + /** + * A collection of listeners to architecture domain changes + */ + private Collection<Listener> listeners; + + /** + * Constructs a new instance of this class + */ + private ArchitectureDomainManager() { + listeners = new HashSet<Listener>(); + merger = new ArchitectureDomainMerger(); + preferences = new ArchitectureDomainPreferences(); + preferences.addListener(this); + initializeFromExtensions(); + initializeFromPreferences(); + merger.init(); // init as early as possible + } + + /** + * initialize the architecture domain merger from the registered extensions + */ + private void initializeFromExtensions() { + List<URI> models = new ArrayList<URI>(); + IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_POINT); + for (IConfigurationElement element : elements) { + String path = element.getAttribute(PATH); + String bundleId = element.getContributor().getName(); + String modelPath = bundleId + IPath.SEPARATOR + path; + models.add(URI.createPlatformPluginURI(modelPath, true)); + } + merger.setExtensionModels(models); + } + + /** + * initialize the architecture domain merger from the preferences + */ + private void initializeFromPreferences() { + preferences.read(); + List<URI> models = new ArrayList<URI>(); + for (String value : preferences.getAddedModelURIs()) { + if (value.length()>0) { + models.add(URI.createURI(value, true)); + } + } + merger.setPreferenceModels(models); + } + + /** + * Add the given listener to the domain changes + * + * @param listener a given domain change listener + */ + public void addListener(Listener listener) { + listeners.add(listener); + } + + /** + * Remove the given listener to the domain changes + * + * @param listener a given domain change listener + */ + public void removeListener(Listener listener) { + listeners.remove(listener); + } + + /** + * React to the preferences changing by reinitializing from them; notify listeners + * @see org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener#preferenceChange(org.eclipse.core.runtime.preferences.IEclipsePreferences.PreferenceChangeEvent) + * + * @param event a preference change event + */ + @Override + public void preferenceChange(PreferenceChangeEvent event) { + initializeFromPreferences(); + for (Listener listener : listeners) + listener.domainManagerChanged(); + } + + /** + * Gets the architecture domain preferences + * + * @return the architecture domain preferences + */ + public ArchitectureDomainPreferences getPreferences() { + return preferences; + } + + /** + * Get the architecture domain merger + * + * @return the architecture domain merger + */ + public ArchitectureDomainMerger getMerger() { + return merger; + } + + /** + * Gets the collection of architecture contexts that are visible based on preferences + * + * @return a list of architecture contexts + */ + public Collection<MergedArchitectureContext> getVisibleArchitectureContexts() { + Collection<MergedArchitectureContext> contexts = new ArrayList<MergedArchitectureContext>(); + for (MergedArchitectureDomain domain : merger.getDomains()) { + for (MergedArchitectureContext context : domain.getContexts()) { + if (!preferences.getExcludedContextIds().contains(context.getId())) + contexts.add(context); + } + } + return contexts; + } + + /** + * Gets the id of the default architecture context + * + * @return the default architecture context id + */ + public String getDefaultArchitectureContextId() { + return preferences.getDefaultContextId(); + } + + /** + * Gets the default architecture context + * + * @return the default architecture context + */ + public MergedArchitectureContext getDefaultArchitectureContext() { + return getArchitectureContextById(getDefaultArchitectureContextId()); + } + + /** + * Gets an architecture context by the given id + * + * @param id a given id of an architecture context + * @return the architecture context with the given id + */ + public MergedArchitectureContext getArchitectureContextById(String id) { + return merger.getArchitectureContextById(id); + } + + /** + * Gets an architecture viewpoint by the given id + * + * @param id a given id of an architecture viewpoint + * @return the architecture viewpoint with the given id + */ + public MergedArchitectureViewpoint getArchitectureViewpointById(String id) { + return merger.getArchitectureViewpointById(id); + } + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/ArchitectureDomainMerger.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/ArchitectureDomainMerger.java new file mode 100644 index 00000000000..62d2c0f94cd --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/ArchitectureDomainMerger.java @@ -0,0 +1,237 @@ +/** + * Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture; + +import java.io.IOException; +import java.util.Collection; +import java.util.HashMap; +import java.util.Map; + +import org.eclipse.emf.common.util.URI; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; +import org.eclipse.papyrus.infra.core.architecture.ArchitectureDomain; +import org.eclipse.papyrus.infra.core.architecture.merged.MergedADElement; +import org.eclipse.papyrus.infra.core.architecture.merged.MergedArchitectureContext; +import org.eclipse.papyrus.infra.core.architecture.merged.MergedArchitectureDomain; +import org.eclipse.papyrus.infra.core.architecture.merged.MergedArchitectureViewpoint; + +/** + * A merger for architecture domains read from extensions or preferences or contributed + * dynamically (programmatically) + * + * It produces a collection of {@link org.eclipse.papyrus.infra.core.architecture. + * merged.MergedDomain}s by merging a collection of {@link org.eclipse.papyrus.infra. + * core.architecture.ArchitectureDomain}s. + * + * @since 1.0 + */ +public class ArchitectureDomainMerger implements Cloneable { + + /** + * A resource set used to load architecture models + */ + private ResourceSet resourceSet; + + /** + * a collection of architecture models coming from extensions + */ + private Collection<URI> extensionModels; + + /** + * a collection of architecture models coming from preferences + */ + private Collection<URI> preferenceModels; + + /** + * a collection of architecture domains contributed dynamically (programmatically) + */ + private Collection<ArchitectureDomain> dynamicDomains; + + /** + * A collection of merged domains + */ + private Map<String, MergedArchitectureDomain> mergedDomains; + + /** + * a cached mapping from id to ADElement + */ + private Map<String, MergedADElement> idCache; + + /** + * Constructs a new instance of the class + */ + ArchitectureDomainMerger() { + } + + /** + * Sets the collection of architecture models URIs read from extensions + * + * @param models a collection of architecture model URIs + */ + public void setExtensionModels(Collection<URI> models) { + this.extensionModels = models; + reset(); + } + + /** + * Sets the collection of architecture model URIs read from preferences + * + * @param models a collection of architecture model URIS + */ + public void setPreferenceModels(Collection<URI> models) { + this.preferenceModels = models; + reset(); + } + + /** + * Sets the collection of architecture domains contributed dynamically + * + * @param domains a collection of architecture domains + */ + public void setDynamicDomains(Collection<ArchitectureDomain> domains) { + this.dynamicDomains = domains; + reset(); + } + + /** + * Gets the collection of merged architecture domains + * + * @return the collection of merged architecture domains + */ + public Collection<MergedArchitectureDomain> getDomains() { + if (mergedDomains == null) + init(); + return mergedDomains.values(); + } + + /** + * Gets an architecture context given its id + * + * @param id an id for an architecture context + * @return an architecture context + */ + public MergedArchitectureContext getArchitectureContextById(String id) { + if (mergedDomains == null) + init(); + MergedADElement found = idCache.get(id); + return (found instanceof MergedArchitectureContext)? (MergedArchitectureContext)found : null; + } + + /** + * Gets an architecture viewpoint given its id + * + * @param id an id for an architecture viewpoint + * @return an architecture viewpoint + */ + public MergedArchitectureViewpoint getArchitectureViewpointById(String id) { + if (mergedDomains == null) + init(); + MergedADElement found = idCache.get(id); + return (found instanceof MergedArchitectureViewpoint)? (MergedArchitectureViewpoint)found : null; + } + + @Override + public ArchitectureDomainMerger clone() { + ArchitectureDomainMerger clone = new ArchitectureDomainMerger(); + clone.setExtensionModels(extensionModels); + clone.setPreferenceModels(preferenceModels); + return clone; + } + + /* + * Resets the merger's state + */ + private void reset() { + resourceSet = null; + mergedDomains = null; + idCache = null; + } + + /** + * Initializes this instance of the merger + */ + void init() { + resourceSet = new ResourceSetImpl(); + mergedDomains = new HashMap<String, MergedArchitectureDomain>(); + if (extensionModels != null) { + for (URI model : extensionModels) { + ArchitectureDomain domain = loadDomain(resourceSet.createResource(model)); + if (domain != null) + merge(domain); + } + } + if (preferenceModels != null) { + for (URI model : preferenceModels) { + ArchitectureDomain domain = loadDomain(resourceSet.createResource(model)); + if (domain != null) + merge(domain); + } + } + if (dynamicDomains != null) { + for (ArchitectureDomain domain : dynamicDomains) { + if (domain != null) + merge(domain); + } + } + buildCache(); + } + + /* + * Read an architecture domain from the given architecture model resource + */ + private ArchitectureDomain loadDomain(Resource resource) { + try { + resource.load(null); + } catch (IOException e) { + // Don't log the error yet; we're trying several options + return null; + } + EObject content = resource.getContents().get(0); + if (content instanceof ArchitectureDomain) { + return (ArchitectureDomain) content; + } else + Activator.log.warn("file "+resource.getURI()+ " is not an architecture model"); + return null; + } + + /* + * Merges the given architecture domain with the others + */ + private void merge(ArchitectureDomain domain) { + MergedArchitectureDomain merged = mergedDomains.get(domain.getName()); + if (merged == null) { + mergedDomains.put(domain.getName(), merged = new MergedArchitectureDomain()); + } + merged.merge(domain); + } + + /* + * builds a id to element cache for faster lookup + */ + private void buildCache() { + idCache = new HashMap<String, MergedADElement>(); + for (MergedArchitectureDomain domain : mergedDomains.values()) { + for (MergedArchitectureContext context : domain.getContexts()) { + idCache.put(context.getId(), context); + for (MergedArchitectureViewpoint viewpoint : context.getViewpoints()) { + idCache.put(viewpoint.getId(), viewpoint); + } + } + } + } + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/ArchitectureDomainPreferences.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/ArchitectureDomainPreferences.java new file mode 100644 index 00000000000..e7954f363d6 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/ArchitectureDomainPreferences.java @@ -0,0 +1,160 @@ +/** + * Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.List; +import java.util.Set; + +import org.eclipse.core.runtime.preferences.IEclipsePreferences; +import org.eclipse.core.runtime.preferences.IEclipsePreferences.IPreferenceChangeListener; +import org.eclipse.core.runtime.preferences.InstanceScope; +import org.eclipse.papyrus.infra.services.edit.context.TypeContext; +import org.osgi.service.prefs.BackingStoreException; + +/** + * This class reads/writes the architecture domain preferences + * + * @since 1.0 + */ +public class ArchitectureDomainPreferences implements Cloneable { + + /** + * The addedModels preference property name + */ + public static final String ADDED_MODELS = "addedModels"; //$NON-NLS-1$ + + /** + * The excludedContexts preference property name + */ + public static final String EXCLUDED_CONTEXTS = "excludedContexts"; //$NON-NLS-1$ + + /** + * The defaultContext preference property name + */ + public static final String DEFAULT_CONTEXT = "defaultContext"; //$NON-NLS-1$ + + /** + * The list of added architecture models in the preferences + */ + private List<String> addedModels; + + /** + * The set of excluded architecture contexts in the preferences + */ + private Set<String> excludedContexts; + + /** + * The id of the default context in the preferences + */ + private String defaultContext; + + /** + * The default value of the default context when not set + */ + private String defaultDefaultContext = TypeContext.getDefaultContextId(); + + /* + * Gets the preferences node + */ + private static IEclipsePreferences getPreferences() { + return InstanceScope.INSTANCE.getNode(Activator.PLUGIN_ID); + } + + /** + * Reads the state of the preferences + */ + public void read() { + addedModels = Arrays.asList(getPreferences().get(ArchitectureDomainPreferences.ADDED_MODELS, "").split(" ")); + excludedContexts = new HashSet<String>(Arrays.asList(getPreferences().get(ArchitectureDomainPreferences.EXCLUDED_CONTEXTS, "").split(","))); + defaultContext = getPreferences().get(ArchitectureDomainPreferences.DEFAULT_CONTEXT, defaultDefaultContext); + } + + /** + * Writes the state of the preferences + */ + public void write() { + getPreferences().put(ArchitectureDomainPreferences.ADDED_MODELS, String.join(" ", addedModels)); + getPreferences().put(ArchitectureDomainPreferences.EXCLUDED_CONTEXTS, String.join(",", excludedContexts)); + if (defaultContext != null) + getPreferences().put(ArchitectureDomainPreferences.DEFAULT_CONTEXT, defaultContext); + else + getPreferences().remove(ArchitectureDomainPreferences.DEFAULT_CONTEXT); + try { + getPreferences().flush(); + } catch (BackingStoreException e) { + Activator.log.error(e); + } + } + + /** + * Resets the state of this class to default + */ + public void reset() { + addedModels.clear(); + excludedContexts.clear(); + defaultContext = defaultDefaultContext; + } + + /** + * Adds the given preference change listener + * + * @param listener + */ + public void addListener(IPreferenceChangeListener listener) { + getPreferences().addPreferenceChangeListener(listener); + } + + /** + * @return the added model URIs + */ + public List<String> getAddedModelURIs() { + return addedModels; + } + + /** + * @return the excluded context ids + */ + public Set<String> getExcludedContextIds() { + return excludedContexts; + } + + /** + * @return the default context id + */ + public String getDefaultContextId() { + return defaultContext; + } + + /** + * Sets the default context id + * + * @param defaultContext the default context id + */ + public void setDefaultContextId(String defaultContext) { + this.defaultContext = defaultContext; + } + + @Override + public ArchitectureDomainPreferences clone() { + ArchitectureDomainPreferences clone = new ArchitectureDomainPreferences(); + clone.addedModels = new ArrayList<String>(getAddedModelURIs()); + clone.excludedContexts = new HashSet<String>(getExcludedContextIds()); + clone.setDefaultContextId(getDefaultContextId()); + return clone; + } + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/commands/IModelCommandProvider.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/commands/IModelCommandProvider.java new file mode 100644 index 00000000000..0e27176bdaa --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/commands/IModelCommandProvider.java @@ -0,0 +1,46 @@ +/** + * Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.commands; + +import org.eclipse.emf.common.command.Command; +import org.eclipse.papyrus.infra.core.resource.ModelSet; + +/** + * An interface to provide architecture model creation and conversion commands by an extension + * + * @since 1.0 + */ +public interface IModelCommandProvider { + + /** + * Gets a model creation command that represents the contributions of a command provider + * The model is created in the given model set based on the given context id + * + * @param modelSet the model set to create the model in + * @param contextId context id for which a model is created + * @return a command to create a model + */ + Command getModelCreationCommand(ModelSet modelSet, String contextId); + + /** + * Gets a model conversion command that represents the contributions of a command provider + * The model is converted in the given model set based on the given new context id + * + * @param modelSet the model set that contains the model to be converted + * @param contextId the context id for which a model is converted + * @return a command to convert a model to the given context id + */ + Command getModelConversionCommand(ModelSet modelSet, String contextId); + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/commands/IModelConversionCommand.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/commands/IModelConversionCommand.java new file mode 100644 index 00000000000..615b49af0e0 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/commands/IModelConversionCommand.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.commands; + +import org.eclipse.papyrus.infra.core.resource.ModelSet; + +/** + * An Interface to convert a model in a model set + * + * @since 1.0 + */ +public interface IModelConversionCommand { + + /** + * Converts the model in the given model set + * + * @param modelSet the model set + */ + void convertModel(final ModelSet modelSet); + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/commands/IModelCreationCommand.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/commands/IModelCreationCommand.java new file mode 100644 index 00000000000..b8b6dd9912f --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/commands/IModelCreationCommand.java @@ -0,0 +1,32 @@ +/** + * Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.commands; + +import org.eclipse.papyrus.infra.core.resource.ModelSet; + +/** + * An Interface to create a model in a model set + * + * @since 1.0 + */ +public interface IModelCreationCommand { + + /** + * Creates the model in the given model set + * + * @param modelSet the model set + */ + void createModel(final ModelSet modelSet); + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/commands/ModelCommandProviderRegistry.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/commands/ModelCommandProviderRegistry.java new file mode 100644 index 00000000000..c30b5251d2f --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/commands/ModelCommandProviderRegistry.java @@ -0,0 +1,118 @@ +/** + * Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.commands; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.Platform; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.CompoundCommand; +import org.eclipse.papyrus.infra.architecture.Activator; +import org.eclipse.papyrus.infra.core.resource.ModelSet; + +/** + * A registry for architecture model command providers registered in extensions + * + * @since 1.0 + */ +public class ModelCommandProviderRegistry implements IModelCommandProvider { + + /** + * The extension point id + */ + private final static String EXTENSION_POINT_ID = Activator.PLUGIN_ID + ".commandProviders"; + + /** + * The name of the class attribute + */ + private static final String PROVIDER_CLASS = "class"; + + /** + * The singleton instance of this class + */ + private static ModelCommandProviderRegistry registry; + + /** + * A collection of registerd command providers + */ + private Collection<IModelCommandProvider> providers; + + /** + * Gets the singleton instance of this class + * + * @return the singleton instance + */ + public static synchronized ModelCommandProviderRegistry getInstance() { + if (registry == null) { + registry = new ModelCommandProviderRegistry(); + registry.init(); + } + return registry; + } + + /** + * Gets a model creation command that aggregates the contributions of the command providers + * The model is created in the given model set based on the given context id + * + * @param modelSet the model set to create the model in + * @param contextId context id for which a model is created + * @return a command to create a model + */ + @Override + public Command getModelCreationCommand(ModelSet modelSet, String contextId) { + CompoundCommand cc = new CompoundCommand("Contributions to Model Creation"); + for (IModelCommandProvider provider : providers) { + cc.append(provider.getModelCreationCommand(modelSet, contextId)); + } + return cc.isEmpty() ? null : cc; + } + + /** + * Gets a model conversion command that aggregates the contributions of the command providers + * The model is converted in the given model set based on the given new context id + * + * @param modelSet the model set that contains the model to be converted + * @param contextId the context id for which a model is converted + * @return a command to convert a model to the given context id + */ + @Override + public Command getModelConversionCommand(ModelSet modelSet, String contextId) { + CompoundCommand cc = new CompoundCommand("Contributions to Model Conversion"); + for (IModelCommandProvider provider : providers) { + cc.append(provider.getModelConversionCommand(modelSet, contextId)); + } + return cc.isEmpty() ? null : cc; + } + + /* + * initializes the registry from extensions + */ + private void init() { + providers = new ArrayList<IModelCommandProvider>(); + IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_POINT_ID); + for (IConfigurationElement configurationElement : elements) { + try { + Object providerClass = configurationElement.createExecutableExtension(PROVIDER_CLASS); + if (providerClass instanceof IModelCommandProvider) { + providers.add((IModelCommandProvider) providerClass); + } + } catch (CoreException e) { + Activator.log.error(e); + } + } + } +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionAdapter.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionAdapter.java new file mode 100644 index 00000000000..6acaa9220a0 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionAdapter.java @@ -0,0 +1,43 @@ +/** + * Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.listeners; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.ecore.util.EContentAdapter; +import org.eclipse.papyrus.infra.core.architecture.ArchitectureDescription; +import org.eclipse.papyrus.infra.core.architecture.ArchitectureDescriptionPreferences; + +/** + * An adapter that is installed in DI models to listen to architecture description changes + * + * @since 1.0 + */ +public class ArchitectureDescriptionAdapter extends EContentAdapter { + + /** + * Listens to changes on ArchitectureDescription* objects + */ + @Override + public void notifyChanged(Notification notification) { + if (notification.getEventType() == Notification.REMOVING_ADAPTER) + return; + Object notifier = notification.getNotifier(); + if (notifier instanceof ArchitectureDescription) { + ArchitectureDescriptionNotifier.getInstance().fireArchitectureContextChanged(notification); + } else if (notifier instanceof ArchitectureDescriptionPreferences) { + ArchitectureDescriptionNotifier.getInstance().fireArchitectureViewpointsChanged(notification); + } + } + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionNotifier.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionNotifier.java new file mode 100644 index 00000000000..dc221a27b4e --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionNotifier.java @@ -0,0 +1,104 @@ +/** + * Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.listeners; + +import java.util.ArrayList; +import java.util.Collection; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IConfigurationElement; +import org.eclipse.core.runtime.Platform; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.papyrus.infra.architecture.Activator; + +/** + * A notifier for registered listeners on events affecting architecture descriptions in models + * + * @since 1.0 + */ +public class ArchitectureDescriptionNotifier { + + /** + * The name of the extension point + */ + private final static String EXTENSION_POINT_ID = Activator.PLUGIN_ID + ".listeners"; + + /** + * The class property name + */ + private static final String LISTENER_CLASS = "class"; + + /** + * The singleton instance of this class + */ + private static ArchitectureDescriptionNotifier notifier; + + /** + * The collection of registered listeners in extensions + */ + private static Collection<IArchitectureDescriptionListener> listeners; + + /** + * Gets the singleton instance of this class + * + * @return the singleton instance + */ + public static synchronized ArchitectureDescriptionNotifier getInstance() { + if (notifier == null) { + notifier = new ArchitectureDescriptionNotifier(); + listeners = new ArrayList<IArchitectureDescriptionListener>(); + notifier.init(); + } + return notifier; + } + + /** + * Fires architecture context change events for registered listeners + * + * @param notification the change event + */ + public void fireArchitectureContextChanged(Notification notification) { + for (IArchitectureDescriptionListener policyCheckerListener : listeners) { + policyCheckerListener.architectureContextChanged(notification); + } + } + + /** + * Fires architecture viewpoint change events for registered listeners + * + * @param notification the change event + */ + public void fireArchitectureViewpointsChanged(Notification notification) { + for (IArchitectureDescriptionListener policyCheckerListener : listeners) { + policyCheckerListener.architectureViewpointsChanged(notification); + } + } + + /* + * initializes the collection of listeners from the extensions + */ + private void init() { + IConfigurationElement[] elements = Platform.getExtensionRegistry().getConfigurationElementsFor(EXTENSION_POINT_ID); + for (IConfigurationElement configurationElement : elements) { + try { + Object listenerClass = configurationElement.createExecutableExtension(LISTENER_CLASS); + if (listenerClass instanceof IArchitectureDescriptionListener) { + listeners.add((IArchitectureDescriptionListener) listenerClass); + } + } catch (CoreException e) { + Activator.log.error(e); + } + } + } +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionSnippet.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionSnippet.java new file mode 100644 index 00000000000..2739e936fa6 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/ArchitectureDescriptionSnippet.java @@ -0,0 +1,57 @@ +/** + * Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.listeners; + +import org.eclipse.papyrus.infra.core.resource.IModelSetSnippet; +import org.eclipse.papyrus.infra.core.resource.ModelSet; +import org.eclipse.papyrus.infra.core.resource.sasheditor.DiModel; + +/** + * A model snippet to install the architecture description adapter in the DI model + * + * @since 1.0 + */ +public class ArchitectureDescriptionSnippet implements IModelSetSnippet { + + /** + * The installed adapter + */ + private ArchitectureDescriptionAdapter adapter; + + /** + * Installs the architecture adapter model snippet on the given model set + * + * @see org.eclipse.papyrus.infra.core.resource.IModelSetSnippet#start(org.eclipse.papyrus.infra.core.resource.ModelSet) + * + * @param modelSet the given model set + */ + @Override + public void start(ModelSet modelSet) { + DiModel diModel = (DiModel) modelSet.getModel(DiModel.DI_MODEL_ID); + diModel.getResource().eAdapters().add(adapter = new ArchitectureDescriptionAdapter()); + } + + /** + * Removes the architecture adapter model snippet from the given model set + * + * @see org.eclipse.papyrus.infra.core.resource.IModelSetSnippet#dispose(org.eclipse.papyrus.infra.core.resource.ModelSet) + * + * @param modelSet the given model set + */ + @Override + public void dispose(ModelSet modelSet) { + DiModel diModel = (DiModel) modelSet.getModel(DiModel.DI_MODEL_ID); + diModel.getResource().eAdapters().remove(adapter); + } +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/IArchitectureDescriptionListener.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/IArchitectureDescriptionListener.java new file mode 100644 index 00000000000..2814e2f73a6 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/architecture/listeners/IArchitectureDescriptionListener.java @@ -0,0 +1,45 @@ +/** + * Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.architecture.listeners; + +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.papyrus.infra.core.architecture.ArchitectureDescriptionPreferences; + +/** + * An interface for listening to architecture description change events in models + * Listeners are expected to update UI in response + * + * @since 1.0 + */ +public interface IArchitectureDescriptionListener { + + /** + * Responds to an architecture context id change event + * + * The event's notifier is of type {@link ArchitectureDescription} + * + * @param notification the change event + */ + void architectureContextChanged(Notification notification); + + /** + * Responds to an architecture viewpoint id change events + * + * The event's notifier is of type {@link ArchitectureDescriptionPreferences} + * + * @param notification the change event + */ + void architectureViewpointsChanged(Notification notification); + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedADElement.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedADElement.java new file mode 100644 index 00000000000..5c0500a5de4 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedADElement.java @@ -0,0 +1,156 @@ +/** + * Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.core.architecture.merged; + +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.Set; + +import org.eclipse.papyrus.infra.core.architecture.ADElement; + +/** + * An element that represents a merged collection of {@link org.eclipse.papyrus.infra.core. + * architecture.ADElement}s that are instances of the same EClass. This allows the definition + * of architecture elements to be split across several architectural models (*.architecture). + * + * All merged elements is assumed to have the same name and qualified name values. However, only + * one of those elements (the main merge increment) has values for the single-valued properties. + * On the other hand, all multi-valued properties of the elements are merged. + * + * @see org.eclipse.papyrus.infra.core.architecture.ADElement + * @since 1.0 + */ +public class MergedADElement { + + /** + * The merged parent of this element + */ + protected MergedADElement parent; + + /** + * the architecture elements that represent merge increments of this element + */ + protected Collection<ADElement> elements; + + /** + * Create a new '<em><b>Merged AD Element</b></em>'. + * + * @param parent the merged parent of this element + */ + public MergedADElement(MergedADElement parent) { + this.parent = parent; + this.elements = new LinkedHashSet<ADElement>(); + } + + /** + * Get the element's parent + * + * @return the parent element + */ + public MergedADElement getParent() { + return parent; + } + + /** + * Get the element's name + * + * @return a name + */ + public String getName() { + for (ADElement element : elements) { + if (element.getName() != null) + return element.getName(); + } + return null; + } + + /** + * Get the element's qualified name + * + * @return a qualified name + */ + public String getQualifiedName() { + for (ADElement element : elements) { + if (element.getQualifiedName() != null) + return element.getQualifiedName(); + } + return null; + } + + /** + * Get the element's description + * + * @return a description + */ + public String getDesciption() { + for (ADElement element : elements) { + if (element.getDesciption() != null) + return element.getDesciption(); + } + return null; + } + + /** + * Get a merge increment whose image represents that of the merged element + * + * By default, any one of the merge increments will be returned. Subclasses may override. + * + * @return a merge increment + */ + public Object getImageObject() { + if (!elements.isEmpty()) + return elements.iterator().next(); + return null; + } + + @Override + public int hashCode() { + int hash = 0; + for (ADElement element : elements) { + hash += element.hashCode(); + } + return hash; + } + + @Override + public boolean equals(Object obj) { + if (!(obj instanceof MergedADElement)) + return false; + MergedADElement other = (MergedADElement) obj; + if (other.parent != this.parent) + return false; + Set<ADElement> copy = new HashSet<ADElement>(this.elements); + copy.retainAll(other.elements); + return copy.size() == this.elements.size(); + } + + @Override + public String toString() { + Iterator<ADElement> i = elements.iterator(); + if (i.hasNext()) + return i.next().toString(); + return super.toString(); + } + + /* + * Adds the given element to the collection of merged elements + */ + void merge(ADElement element) { + elements.add(element); + } + + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureContext.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureContext.java new file mode 100644 index 00000000000..85d487ac916 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureContext.java @@ -0,0 +1,175 @@ +/** + * Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.core.architecture.merged; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Set; + +import org.eclipse.papyrus.infra.core.architecture.ADElement; +import org.eclipse.papyrus.infra.core.architecture.ArchitectureContext; +import org.eclipse.papyrus.infra.core.architecture.ArchitectureViewpoint; +import org.eclipse.papyrus.infra.types.ElementTypeSetConfiguration; + +/** + * An element that represents a merged collection of {@link org.eclipse.papyrus.infra.core. + * architecture.ArchitectureContext}s. This allows the definition of architecture contexts + * to be split across several architectural models (*.architecture). + * + * This class is a subclass of {@link org.eclipse.papyrus.infra.core.architecture.merged. + * MergedADElement}s + * + * @see org.eclipse.papyrus.infra.core.architecture.ArchitectureContext + * @since 1.0 + */ +public abstract class MergedArchitectureContext extends MergedADElement { + + /** + * Create a new '<em><b>Merged Architecture Context</b></em>'. + * + * @param domain the merged parent domain of this context + */ + public MergedArchitectureContext(MergedArchitectureDomain domain) { + super(domain); + } + + /** + * Gets the context's id + * + * @return an id + */ + public String getId() { + for (ADElement element : elements) { + ArchitectureContext context = (ArchitectureContext) element; + if (context.getId() != null) + return context.getId(); + } + return null; + } + + /** + * Gets the context's icon path + * + * @return an icon path + */ + public String getIcon() { + for (ADElement element : elements) { + ArchitectureContext context = (ArchitectureContext) element; + if (context.getIcon() != null) + return context.getIcon(); + } + return null; + } + + /** + * Gets the context's extension prefix + * + * @return an extension prefix + */ + public String getExtensionPrefix() { + for (ADElement element : elements) { + ArchitectureContext context = (ArchitectureContext) element; + if (context.getExtensionPrefix() != null) + return context.getExtensionPrefix(); + } + return null; + } + + /** + * Gets the context's creation command class + * + * @return a creation command class + */ + public Class<?> getCreationCommandClass() { + for (ADElement element : elements) { + ArchitectureContext context = (ArchitectureContext) element; + if (context.getCreationCommandClass() != null) + return context.getCreationCommandClass(); + } + return null; + } + + /** + * Gets the context's conversion command class + * + * @return a conversion command class + */ + public Class<?> getConversionCommandClass() { + for (ADElement element : elements) { + ArchitectureContext context = (ArchitectureContext) element; + if (context.getConversionCommandClass() != null) + return context.getConversionCommandClass(); + } + return null; + } + + /** + * Gets the context's parent domain + * + * @return the parent domain + */ + public MergedArchitectureDomain getDomain() { + return (MergedArchitectureDomain) getParent(); + } + + /** + * Gets the context's element type set configurations + * + * @return a merged collection of element type set configurations + */ + public Collection<ElementTypeSetConfiguration> getElementTypes() { + Set<ElementTypeSetConfiguration> configurations = new LinkedHashSet<ElementTypeSetConfiguration>(); + for (ADElement element : elements) { + ArchitectureContext context = (ArchitectureContext) element; + configurations.addAll(context.getElementTypes()); + } + return Collections.unmodifiableCollection(configurations); + } + + /** + * Gets the context's viewpoints + * + * @return a merged collection of viewpoints + */ + public Collection<MergedArchitectureViewpoint> getViewpoints() { + Map<String, MergedArchitectureViewpoint> viewpoints = new HashMap<String, MergedArchitectureViewpoint>(); + for (ADElement element : elements) { + ArchitectureContext context = (ArchitectureContext) element; + for (ArchitectureViewpoint viewpoint : context.getViewpoints()) { + MergedArchitectureViewpoint merged = viewpoints.get(viewpoint.getName()); + if (merged == null) { + viewpoints.put(viewpoint.getName(), merged = new MergedArchitectureViewpoint(this)); + } + merged.merge(viewpoint); + } + } + return Collections.unmodifiableCollection(viewpoints.values()); + } + + /* + * Gets the merge increment that has an icon value + */ + @Override + public Object getImageObject() { + for (ADElement element : elements) { + ArchitectureContext context = (ArchitectureContext) element; + if (context.getIcon() != null) + return context; + } + return super.getImageObject(); + } +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureDescriptionLanguage.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureDescriptionLanguage.java new file mode 100644 index 00000000000..5e0b7b191e5 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureDescriptionLanguage.java @@ -0,0 +1,90 @@ +/** + * Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.core.architecture.merged; + +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedHashSet; +import java.util.Set; + +import org.eclipse.emf.ecore.EPackage; +import org.eclipse.papyrus.infra.core.architecture.ADElement; +import org.eclipse.papyrus.infra.core.architecture.ArchitectureDescriptionLanguage; +import org.eclipse.papyrus.infra.core.architecture.RepresentationKind; + +/** + * An element that represents a merged collection of {@link org.eclipse.papyrus.infra.core. + * architecture.ArchitectureDescriptionLanguage}s. This allows the definition of architecture + * description languages to be split across several architectural models (*.architecture). + * + * This class is a subclass of {@link org.eclipse.papyrus.infra.core.architecture.merged. + * MergedArchitectureContext}s + * + * @see org.eclipse.papyrus.infra.core.architecture.ArchitectureDescriptionLanguage + * @since 1.0 + */ +public class MergedArchitectureDescriptionLanguage extends MergedArchitectureContext { + + /** + * Create a new '<em><b>Merged Architecture Description Language</b></em>'. + * + * @param domain the merged parent domain of this language + */ + public MergedArchitectureDescriptionLanguage(MergedArchitectureDomain domain) { + super(domain); + } + + /** + * Get the language's metamodel EPackage + * + * @return an EPackage + */ + public EPackage getMetamodel() { + for (ADElement element : elements) { + ArchitectureDescriptionLanguage language = (ArchitectureDescriptionLanguage) element; + if (language.getMetamodel() != null) + return language.getMetamodel(); + } + return null; + } + + /** + * Get a merged collection of the language's profile EPackages + * + * @return a collection of EPackages + */ + public Collection<EPackage> getProfiles() { + Set<EPackage> profiles = new LinkedHashSet<EPackage>(); + for (ADElement element : elements) { + ArchitectureDescriptionLanguage language = (ArchitectureDescriptionLanguage) element; + profiles.addAll(language.getProfiles()); + } + return Collections.unmodifiableCollection(profiles); + } + + /** + * Get a merged collection of the language's representation kinds + * + * @return a collection of representation kinds + */ + public Collection<RepresentationKind> getRepresentationKinds() { + Set<RepresentationKind> kinds = new LinkedHashSet<RepresentationKind>(); + for (ADElement element : elements) { + ArchitectureDescriptionLanguage language = (ArchitectureDescriptionLanguage) element; + kinds.addAll(language.getRepresentationKinds()); + } + return Collections.unmodifiableCollection(kinds); + } + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureDomain.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureDomain.java new file mode 100644 index 00000000000..0eeea05adb0 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureDomain.java @@ -0,0 +1,110 @@ +/** + * Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.core.architecture.merged; + +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashSet; +import java.util.Map; +import java.util.Set; + +import org.eclipse.papyrus.infra.core.architecture.ADElement; +import org.eclipse.papyrus.infra.core.architecture.ArchitectureContext; +import org.eclipse.papyrus.infra.core.architecture.ArchitectureDescriptionLanguage; +import org.eclipse.papyrus.infra.core.architecture.ArchitectureDomain; +import org.eclipse.papyrus.infra.core.architecture.Concern; +import org.eclipse.papyrus.infra.core.architecture.Stakeholder; + +/** + * An element that represents a merged collection of {@link org.eclipse.papyrus.infra.core. + * architecture.ArchitectureDomain}s. This allows the definition of architecture + * domains to be split across several architectural models (*.architecture). + * + * This class is a subclass of {@link org.eclipse.papyrus.infra.core.architecture.merged. + * MergedADElement}s + * + * @see org.eclipse.papyrus.infra.core.architecture.ArchitectureDomain + * @since 1.0 + */ +public class MergedArchitectureDomain extends MergedADElement { + + /** + * Create a new '<em><b>Merged Architecture Domain</b></em>'. + */ + public MergedArchitectureDomain() { + super(null); + } + + /** + * Get a merged collection of the domain's stakeholders + * + * @return a collection of stakeholders + */ + public Collection<Stakeholder> getStakeholders() { + Set<Stakeholder> stakeholders = new LinkedHashSet<Stakeholder>(); + for (ADElement element : elements) { + ArchitectureDomain domain = (ArchitectureDomain) element; + stakeholders.addAll(domain.getStakeholders()); + } + return Collections.unmodifiableCollection(stakeholders); + } + + /** + * Get a merged collection of the domain's concerns + * + * @return a collection of concerns + */ + public Collection<Concern> getConcerns() { + Set<Concern> concerns = new LinkedHashSet<Concern>(); + for (ADElement element : elements) { + ArchitectureDomain domain = (ArchitectureDomain) element; + concerns.addAll(domain.getConcerns()); + } + return Collections.unmodifiableCollection(concerns); + } + + /** + * Get a merged collection of the domain's contexts + * + * @return a collection of contexts + */ + public Collection<MergedArchitectureContext> getContexts() { + Map<String, MergedArchitectureContext> contexts = new HashMap<String, MergedArchitectureContext>(); + for (ADElement element : elements) { + ArchitectureDomain domain = (ArchitectureDomain) element; + for (ArchitectureContext context : domain.getContexts()) { + MergedArchitectureContext merged = contexts.get(context.getName()); + if (merged == null) { + if (context instanceof ArchitectureDescriptionLanguage) + contexts.put(context.getName(), merged = new MergedArchitectureDescriptionLanguage(this)); + else + contexts.put(context.getName(), merged = new MergedArchitectureFramework(this)); + } + merged.merge(context); + } + } + return Collections.unmodifiableCollection(contexts.values()); + } + + /** + * Merges the given domain element with the other merge increments + * + * @param domain a given domain to merge + */ + public void merge(ArchitectureDomain domain) { + elements.add(domain); + } + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureFramework.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureFramework.java new file mode 100644 index 00000000000..4bf826ae1a6 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureFramework.java @@ -0,0 +1,38 @@ +/** + * Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.core.architecture.merged; + +/** + * An element that represents a merged collection of {@link org.eclipse.papyrus.infra.core. + * architecture.ArchitectureFramework}s. This allows the definition of architecture + * framework to be split across several architectural models (*.architecture). + * + * This class is a subclass of {@link org.eclipse.papyrus.infra.core.architecture.merged. + * MergedArchitectureContext}s + * + * @see org.eclipse.papyrus.infra.core.architecture.ArchitectureFramework + * @since 1.0 + */ +public class MergedArchitectureFramework extends MergedArchitectureContext { + + /** + * Create a new '<em><b>Merged Architecture Framework</b></em>'. + * + * @param domain the merged parent domain of this framework + */ + public MergedArchitectureFramework(MergedArchitectureDomain domain) { + super(domain); + } + +} diff --git a/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureViewpoint.java b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureViewpoint.java new file mode 100644 index 00000000000..2930fc544e0 --- /dev/null +++ b/plugins/infra/architecture/org.eclipse.papyrus.infra.architecture/src/org/eclipse/papyrus/infra/core/architecture/merged/MergedArchitectureViewpoint.java @@ -0,0 +1,99 @@ +/** + * Copyright (c) 2017 CEA LIST. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Maged Elaasar - Initial API and implementation + * + * + */ +package org.eclipse.papyrus.infra.core.architecture.merged; + +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedHashSet; +import java.util.Set; + +import org.eclipse.papyrus.infra.core.architecture.ADElement; +import org.eclipse.papyrus.infra.core.architecture.ArchitectureViewpoint; +import org.eclipse.papyrus.infra.core.architecture.Concern; +import org.eclipse.papyrus.infra.core.architecture.RepresentationKind; + +/** + * An element that represents a merged collection of {@link org.eclipse.papyrus.infra.core. + * architecture.ArchitectureViewpoint}s. This allows the definition of architecture + * viewpoints to be split across several architectural models (*.architecture). + * + * This class is a subclass of {@link org.eclipse.papyrus.infra.core.architecture.merged. + * MergedADElement}s + * + * @see org.eclipse.papyrus.infra.core.architecture.ArchitectureViewpoint + * @since 1.0 + */ +public class MergedArchitectureViewpoint extends MergedADElement { + + /** + * Create a new '<em><b>Merged Architecture Viewpoint</b></em>'. + * + * @param context the merged parent context of this viewpoint + */ + public MergedArchitectureViewpoint(MergedArchitectureContext context) { + super(context); + } + + /** + * Gets the viewpoint's parent context + * + * @return an architecture context + */ + public MergedArchitectureContext getContext() { + return (MergedArchitectureContext) getParent(); + } + + /** + * Get the viewpoints's id + * + * @return an id + */ + public String getId() { + for (ADElement element : elements) { + ArchitectureViewpoint viewpoint = (ArchitectureViewpoint) element; + if (viewpoint.getId() != null) + return viewpoint.getId(); + } + return null; + } + + /** + * Gets the viewpoint's merged concerns + * + * @return a merged collection of concerns + */ + public Collection<Concern> getConcerns() { + Set<Concern> concerns = new LinkedHashSet<Concern>(); + for (ADElement element : elements) { + ArchitectureViewpoint viewpoint = (ArchitectureViewpoint) element; + concerns.addAll(viewpoint.getConcerns()); + } + return Collections.unmodifiableCollection(concerns); + } + + /** + * Gets the viewpoint's merged representation kinds + * + * @return a merged collection of representation kinds + */ + public Collection<RepresentationKind> getRepresentationKinds() { + Set<RepresentationKind> kinds = new LinkedHashSet<RepresentationKind>(); + for (ADElement element : elements) { + ArchitectureViewpoint viewpoint = (ArchitectureViewpoint) element; + kinds.addAll(viewpoint.getRepresentationKinds()); + } + return Collections.unmodifiableCollection(kinds); + } + +} diff --git a/plugins/infra/architecture/pom.xml b/plugins/infra/architecture/pom.xml new file mode 100644 index 00000000000..a46a143e4ab --- /dev/null +++ b/plugins/infra/architecture/pom.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<project> + <modelVersion>4.0.0</modelVersion> + <artifactId>org.eclipse.papyrus.infra-architecture</artifactId> + <packaging>pom</packaging> + <parent> + <groupId>org.eclipse.papyrus</groupId> + <artifactId>org.eclipse.papyrus.infra</artifactId> + <version>0.0.1-SNAPSHOT</version> + </parent> + <name>Papyrus Infra Architecture</name> + <description>Architecture framework for Papyrus including the architecture representation package.</description> + + <modules> + <module>org.eclipse.papyrus.infra.architecture</module> + <module>org.eclipse.papyrus.infra.architecture.representation</module> + <module>org.eclipse.papyrus.infra.architecture.representation.edit</module> + </modules> +</project> |