[DiagramTemplate] Delete the old code to substitute it with the generated one
Change-Id: I0c8ec75781e2aedc5e4fb6eaf41ab295707821ee
Signed-off-by: Quentin Le Menez <quentin.lemenez@cea.fr>
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.edit/src/org/eclipse/papyrus/diagramtemplate/provider/AbstractSelectionItemProvider.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.edit/src/org/eclipse/papyrus/diagramtemplate/provider/AbstractSelectionItemProvider.java
deleted file mode 100755
index 4f7bf86..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.edit/src/org/eclipse/papyrus/diagramtemplate/provider/AbstractSelectionItemProvider.java
+++ /dev/null
@@ -1,243 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate.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.EStructuralFeature;
-import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
-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.diagramtemplate.AbstractSelection;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplateFactory;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage;
-import org.eclipse.papyrus.diagramtemplate.SelectionKind;
-
-/**
- * This is the item provider adapter for a {@link org.eclipse.papyrus.diagramtemplate.diagramtemplate.AbstractSelection} object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
-public class AbstractSelectionItemProvider
- 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 AbstractSelectionItemProvider(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);
- addKindPropertyDescriptor(object);
- addSubTypesPropertyDescriptor(object);
- }
- return itemPropertyDescriptors;
- }
-
- /**
- * This adds a property descriptor for the Element feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected void addElementPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_AbstractSelection_element_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_AbstractSelection_element_feature", "_UI_AbstractSelection_type"),
- DiagramTemplatePackage.Literals.ABSTRACT_SELECTION__ELEMENT,
- true,
- false,
- true,
- null,
- null,
- null));
- }
-
- /**
- * This adds a property descriptor for the Kind feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected void addKindPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_AbstractSelection_kind_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_AbstractSelection_kind_feature", "_UI_AbstractSelection_type"),
- DiagramTemplatePackage.Literals.ABSTRACT_SELECTION__KIND,
- true,
- false,
- false,
- ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
- null,
- null));
- }
-
- /**
- * This adds a property descriptor for the Sub Types feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected void addSubTypesPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_AbstractSelection_subTypes_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_AbstractSelection_subTypes_feature", "_UI_AbstractSelection_type"),
- DiagramTemplatePackage.Literals.ABSTRACT_SELECTION__SUB_TYPES,
- true,
- false,
- false,
- ItemPropertyDescriptor.BOOLEAN_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(DiagramTemplatePackage.Literals.ABSTRACT_SELECTION__SELECTION_REF);
- }
- 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) {
- SelectionKind labelValue = ((AbstractSelection) object).getKind();
- String label = labelValue == null ? null : labelValue.toString();
- return label == null || label.length() == 0 ? getString("_UI_AbstractSelection_type") : getString("_UI_AbstractSelection_type") + " " + label;
- }
-
- /**
- * 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(AbstractSelection.class)) {
- case DiagramTemplatePackage.ABSTRACT_SELECTION__KIND:
- case DiagramTemplatePackage.ABSTRACT_SELECTION__SUB_TYPES:
- fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
- return;
- case DiagramTemplatePackage.ABSTRACT_SELECTION__SELECTION_REF:
- 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(DiagramTemplatePackage.Literals.ABSTRACT_SELECTION__SELECTION_REF,
- DiagramTemplateFactory.eINSTANCE.createSelectionRef()));
- }
-
- /**
- * Return the resource locator for this item provider's resources.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public ResourceLocator getResourceLocator() {
- return DiagramTemplateEditPlugin.INSTANCE;
- }
-
-}
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.edit/src/org/eclipse/papyrus/diagramtemplate/provider/DiagramDefinitionItemProvider.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.edit/src/org/eclipse/papyrus/diagramtemplate/provider/DiagramDefinitionItemProvider.java
deleted file mode 100755
index 753aaae..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.edit/src/org/eclipse/papyrus/diagramtemplate/provider/DiagramDefinitionItemProvider.java
+++ /dev/null
@@ -1,322 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate.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.EStructuralFeature;
-import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
-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.diagramtemplate.DiagramDefinition;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplateFactory;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage;
-
-/**
- * This is the item provider adapter for a {@link org.eclipse.papyrus.diagramtemplate.diagramtemplate.DiagramDefinition} object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
-public class DiagramDefinitionItemProvider
- 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 DiagramDefinitionItemProvider(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);
-
- addDescriptionPropertyDescriptor(object);
- addFromRootPropertyDescriptor(object);
- addDiagramKindPropertyDescriptor(object);
- addLayoutToApplyPropertyDescriptor(object);
- addNamePropertyDescriptor(object);
- addPrefixPropertyDescriptor(object);
- }
- return itemPropertyDescriptors;
- }
-
- /**
- * This adds a property descriptor for the Description feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected void addDescriptionPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_DiagramDefinition_description_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_DiagramDefinition_description_feature", "_UI_DiagramDefinition_type"),
- DiagramTemplatePackage.Literals.DIAGRAM_DEFINITION__DESCRIPTION,
- true,
- false,
- false,
- ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
- null,
- null));
- }
-
- /**
- * This adds a property descriptor for the From Root feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected void addFromRootPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_DiagramDefinition_fromRoot_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_DiagramDefinition_fromRoot_feature", "_UI_DiagramDefinition_type"),
- DiagramTemplatePackage.Literals.DIAGRAM_DEFINITION__FROM_ROOT,
- true,
- false,
- true,
- null,
- null,
- null));
- }
-
- /**
- * This adds a property descriptor for the Diagram Kind feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected void addDiagramKindPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_DiagramDefinition_diagramKind_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_DiagramDefinition_diagramKind_feature", "_UI_DiagramDefinition_type"),
- DiagramTemplatePackage.Literals.DIAGRAM_DEFINITION__DIAGRAM_KIND,
- true,
- false,
- false,
- ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
- null,
- null));
- }
-
- /**
- * This adds a property descriptor for the Layout To Apply feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected void addLayoutToApplyPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_DiagramDefinition_layoutToApply_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_DiagramDefinition_layoutToApply_feature", "_UI_DiagramDefinition_type"),
- DiagramTemplatePackage.Literals.DIAGRAM_DEFINITION__LAYOUT_TO_APPLY,
- true,
- false,
- false,
- ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
- null,
- null));
- }
-
- /**
- * This adds a property descriptor for the Name feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected void addNamePropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_DiagramDefinition_name_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_DiagramDefinition_name_feature", "_UI_DiagramDefinition_type"),
- DiagramTemplatePackage.Literals.DIAGRAM_DEFINITION__NAME,
- true,
- false,
- false,
- ItemPropertyDescriptor.GENERIC_VALUE_IMAGE,
- null,
- null));
- }
-
- /**
- * This adds a property descriptor for the Prefix feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected void addPrefixPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_DiagramDefinition_prefix_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_DiagramDefinition_prefix_feature", "_UI_DiagramDefinition_type"),
- DiagramTemplatePackage.Literals.DIAGRAM_DEFINITION__PREFIX,
- 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(DiagramTemplatePackage.Literals.DIAGRAM_DEFINITION__SELECTION);
- }
- 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 DiagramDefinition.gif.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public Object getImage(Object object) {
- return overlayImage(object, getResourceLocator().getImage("full/obj16/DiagramDefinition"));
- }
-
- /**
- * This returns the label text for the adapted class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public String getText(Object object) {
- String label = ((DiagramDefinition) object).getName();
- return label == null || label.length() == 0 ? getString("_UI_DiagramDefinition_type") : getString("_UI_DiagramDefinition_type") + " " + label;
- }
-
- /**
- * 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(DiagramDefinition.class)) {
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__DESCRIPTION:
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__DIAGRAM_KIND:
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__LAYOUT_TO_APPLY:
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__NAME:
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__PREFIX:
- fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true));
- return;
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__SELECTION:
- 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(DiagramTemplatePackage.Literals.DIAGRAM_DEFINITION__SELECTION,
- DiagramTemplateFactory.eINSTANCE.createSelection()));
- }
-
- /**
- * Return the resource locator for this item provider's resources.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public ResourceLocator getResourceLocator() {
- return DiagramTemplateEditPlugin.INSTANCE;
- }
-
-}
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.edit/src/org/eclipse/papyrus/diagramtemplate/provider/DiagramTemplateEditPlugin.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.edit/src/org/eclipse/papyrus/diagramtemplate/provider/DiagramTemplateEditPlugin.java
deleted file mode 100755
index d71a903..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.edit/src/org/eclipse/papyrus/diagramtemplate/provider/DiagramTemplateEditPlugin.java
+++ /dev/null
@@ -1,105 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate.provider;
-
-import org.eclipse.emf.common.EMFPlugin;
-import org.eclipse.emf.common.util.ResourceLocator;
-
-/**
- * This is the central singleton for the DiagramTemplate edit plugin.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
-public final class DiagramTemplateEditPlugin extends EMFPlugin {
- /**
- * Keep track of the singleton.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public static final DiagramTemplateEditPlugin INSTANCE = new DiagramTemplateEditPlugin();
-
- /**
- * 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 DiagramTemplateEditPlugin() {
- super(new ResourceLocator[] {
- });
- }
-
- /**
- * Returns the singleton instance of the Eclipse plugin.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the singleton instance.
- * @generated
- */
- @Override
- public ResourceLocator getPluginResourceLocator() {
- return plugin;
- }
-
- /**
- * Returns the singleton instance of the Eclipse plugin.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the singleton instance.
- * @generated
- */
- public static Implementation getPlugin() {
- return plugin;
- }
-
- /**
- * The actual implementation of the Eclipse <b>Plugin</b>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public static class Implementation extends EclipsePlugin {
- /**
- * Creates an instance.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public Implementation() {
- super();
-
- // Remember the static instance.
- //
- plugin = this;
- }
- }
-
-}
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.edit/src/org/eclipse/papyrus/diagramtemplate/provider/DiagramTemplateItemProviderAdapterFactory.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.edit/src/org/eclipse/papyrus/diagramtemplate/provider/DiagramTemplateItemProviderAdapterFactory.java
deleted file mode 100755
index 6aad823..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.edit/src/org/eclipse/papyrus/diagramtemplate/provider/DiagramTemplateItemProviderAdapterFactory.java
+++ /dev/null
@@ -1,309 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate.provider;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-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.edit.provider.ChangeNotifier;
-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.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.diagramtemplate.util.DiagramTemplateAdapterFactory;
-
-/**
- * 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 DiagramTemplateItemProviderAdapterFactory extends DiagramTemplateAdapterFactory implements ComposeableAdapterFactory, IChangeNotifier, IDisposable {
- /**
- * 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 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 DiagramTemplateItemProviderAdapterFactory() {
- 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.diagramtemplate.diagramtemplate.DiagramDefinition} instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected DiagramDefinitionItemProvider diagramDefinitionItemProvider;
-
- /**
- * This creates an adapter for a {@link org.eclipse.papyrus.diagramtemplate.diagramtemplate.DiagramDefinition}.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public Adapter createDiagramDefinitionAdapter() {
- if (diagramDefinitionItemProvider == null) {
- diagramDefinitionItemProvider = new DiagramDefinitionItemProvider(this);
- }
-
- return diagramDefinitionItemProvider;
- }
-
- /**
- * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.diagramtemplate.diagramtemplate.Selection} instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected SelectionItemProvider selectionItemProvider;
-
- /**
- * This creates an adapter for a {@link org.eclipse.papyrus.diagramtemplate.diagramtemplate.Selection}.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public Adapter createSelectionAdapter() {
- if (selectionItemProvider == null) {
- selectionItemProvider = new SelectionItemProvider(this);
- }
-
- return selectionItemProvider;
- }
-
- /**
- * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.diagramtemplate.diagramtemplate.SelectionRef} instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected SelectionRefItemProvider selectionRefItemProvider;
-
- /**
- * This creates an adapter for a {@link org.eclipse.papyrus.diagramtemplate.diagramtemplate.SelectionRef}.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public Adapter createSelectionRefAdapter() {
- if (selectionRefItemProvider == null) {
- selectionRefItemProvider = new SelectionRefItemProvider(this);
- }
-
- return selectionRefItemProvider;
- }
-
- /**
- * This keeps track of the one adapter used for all {@link org.eclipse.papyrus.diagramtemplate.diagramtemplate.Template} instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected TemplateItemProvider templateItemProvider;
-
- /**
- * This creates an adapter for a {@link org.eclipse.papyrus.diagramtemplate.diagramtemplate.Template}.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public Adapter createTemplateAdapter() {
- if (templateItemProvider == null) {
- templateItemProvider = new TemplateItemProvider(this);
- }
-
- return templateItemProvider;
- }
-
- /**
- * 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;
- }
-
- /**
- * 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 (diagramDefinitionItemProvider != null) {
- diagramDefinitionItemProvider.dispose();
- }
- if (selectionItemProvider != null) {
- selectionItemProvider.dispose();
- }
- if (selectionRefItemProvider != null) {
- selectionRefItemProvider.dispose();
- }
- if (templateItemProvider != null) {
- templateItemProvider.dispose();
- }
- }
-
-}
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.edit/src/org/eclipse/papyrus/diagramtemplate/provider/SelectionItemProvider.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.edit/src/org/eclipse/papyrus/diagramtemplate/provider/SelectionItemProvider.java
deleted file mode 100755
index 9f4c4aa..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.edit/src/org/eclipse/papyrus/diagramtemplate/provider/SelectionItemProvider.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate.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.edit.provider.ComposeableAdapterFactory;
-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.ViewerNotification;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage;
-import org.eclipse.papyrus.diagramtemplate.Selection;
-import org.eclipse.papyrus.diagramtemplate.SelectionKind;
-
-/**
- * This is the item provider adapter for a {@link org.eclipse.papyrus.diagramtemplate.diagramtemplate.Selection} object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
-public class SelectionItemProvider
- extends AbstractSelectionItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
- /**
- * This constructs an instance from a factory and a notifier.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public SelectionItemProvider(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);
-
- addRecursivelyPropertyDescriptor(object);
- }
- return itemPropertyDescriptors;
- }
-
- /**
- * This adds a property descriptor for the Recursively feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected void addRecursivelyPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_Selection_recursively_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_Selection_recursively_feature", "_UI_Selection_type"),
- DiagramTemplatePackage.Literals.SELECTION__RECURSIVELY,
- true,
- false,
- false,
- ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE,
- null,
- null));
- }
-
- /**
- * This returns Selection.gif.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public Object getImage(Object object) {
- return overlayImage(object, getResourceLocator().getImage("full/obj16/Selection"));
- }
-
- /**
- * This returns the label text for the adapted class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public String getText(Object object) {
- SelectionKind labelValue = ((Selection) object).getKind();
- String label = labelValue == null ? null : labelValue.toString();
- return label == null || label.length() == 0 ? getString("_UI_Selection_type") : getString("_UI_Selection_type") + " " + label;
- }
-
- /**
- * 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(Selection.class)) {
- case DiagramTemplatePackage.SELECTION__RECURSIVELY:
- 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);
- }
-
-}
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.edit/src/org/eclipse/papyrus/diagramtemplate/provider/SelectionRefItemProvider.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.edit/src/org/eclipse/papyrus/diagramtemplate/provider/SelectionRefItemProvider.java
deleted file mode 100755
index 7915d83..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.edit/src/org/eclipse/papyrus/diagramtemplate/provider/SelectionRefItemProvider.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate.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.edit.provider.ComposeableAdapterFactory;
-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.papyrus.diagramtemplate.DiagramTemplatePackage;
-import org.eclipse.papyrus.diagramtemplate.SelectionKind;
-import org.eclipse.papyrus.diagramtemplate.SelectionRef;
-
-/**
- * This is the item provider adapter for a {@link org.eclipse.papyrus.diagramtemplate.diagramtemplate.SelectionRef} object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
-public class SelectionRefItemProvider
- extends AbstractSelectionItemProvider
- implements
- IEditingDomainItemProvider,
- IStructuredItemContentProvider,
- ITreeItemContentProvider,
- IItemLabelProvider,
- IItemPropertySource {
- /**
- * This constructs an instance from a factory and a notifier.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public SelectionRefItemProvider(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);
-
- addEReferencePropertyDescriptor(object);
- }
- return itemPropertyDescriptors;
- }
-
- /**
- * This adds a property descriptor for the EReference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected void addEReferencePropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_SelectionRef_eReference_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_SelectionRef_eReference_feature", "_UI_SelectionRef_type"),
- DiagramTemplatePackage.Literals.SELECTION_REF__EREFERENCE,
- true,
- false,
- true,
- null,
- null,
- null));
- }
-
- /**
- * This returns SelectionRef.gif.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public Object getImage(Object object) {
- return overlayImage(object, getResourceLocator().getImage("full/obj16/SelectionRef"));
- }
-
- /**
- * This returns the label text for the adapted class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public String getText(Object object) {
- SelectionKind labelValue = ((SelectionRef) object).getKind();
- String label = labelValue == null ? null : labelValue.toString();
- return label == null || label.length() == 0 ? getString("_UI_SelectionRef_type") : getString("_UI_SelectionRef_type") + " " + label;
- }
-
- /**
- * 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);
- }
-
-}
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.edit/src/org/eclipse/papyrus/diagramtemplate/provider/TemplateItemProvider.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.edit/src/org/eclipse/papyrus/diagramtemplate/provider/TemplateItemProvider.java
deleted file mode 100755
index 9cf924d..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.edit/src/org/eclipse/papyrus/diagramtemplate/provider/TemplateItemProvider.java
+++ /dev/null
@@ -1,203 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate.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.EStructuralFeature;
-import org.eclipse.emf.edit.provider.ComposeableAdapterFactory;
-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.emf.edit.provider.ViewerNotification;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplateFactory;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage;
-import org.eclipse.papyrus.diagramtemplate.Template;
-
-/**
- * This is the item provider adapter for a {@link org.eclipse.papyrus.diagramtemplate.diagramtemplate.Template} object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
-public class TemplateItemProvider
- 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 TemplateItemProvider(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);
-
- addTargetRootPropertyDescriptor(object);
- }
- return itemPropertyDescriptors;
- }
-
- /**
- * This adds a property descriptor for the Target Root feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected void addTargetRootPropertyDescriptor(Object object) {
- itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(),
- getResourceLocator(),
- getString("_UI_Template_targetRoot_feature"),
- getString("_UI_PropertyDescriptor_description", "_UI_Template_targetRoot_feature", "_UI_Template_type"),
- DiagramTemplatePackage.Literals.TEMPLATE__TARGET_ROOT,
- true,
- false,
- true,
- null,
- 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(DiagramTemplatePackage.Literals.TEMPLATE__DIAGRAM_DEFINITIONS);
- }
- 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 Template.gif.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public Object getImage(Object object) {
- return overlayImage(object, getResourceLocator().getImage("full/obj16/Template"));
- }
-
- /**
- * 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_Template_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);
-
- switch (notification.getFeatureID(Template.class)) {
- case DiagramTemplatePackage.TEMPLATE__DIAGRAM_DEFINITIONS:
- 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(DiagramTemplatePackage.Literals.TEMPLATE__DIAGRAM_DEFINITIONS,
- DiagramTemplateFactory.eINSTANCE.createDiagramDefinition()));
- }
-
- /**
- * Return the resource locator for this item provider's resources.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public ResourceLocator getResourceLocator() {
- return DiagramTemplateEditPlugin.INSTANCE;
- }
-
-}
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/META-INF/MANIFEST.MF b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/META-INF/MANIFEST.MF
index 2a90b3c..ce1a061 100755
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/META-INF/MANIFEST.MF
+++ b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/META-INF/MANIFEST.MF
@@ -18,7 +18,7 @@
org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="[3.0.0,4.0.0)",
org.eclipse.papyrus.infra.ui;bundle-version="1.2.0",
org.eclipse.papyrus.infra.core.sashwindows.di;bundle-version="1.2.0"
-Export-Package: org.eclipse.papyrus.diagramtemplate.editor,
+Export-Package: org.eclipse.papyrus.diagramtemplate.presentation,
org.eclipse.papyrus.diagramtemplate.launcher,
org.eclipse.papyrus.diagramtemplate.presentation
Bundle-Vendor: %providerName
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/plugin.xml b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/plugin.xml
index f21c076..4174e25 100755
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/plugin.xml
+++ b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/plugin.xml
@@ -13,7 +13,7 @@
<extension point="org.eclipse.ui.newWizards">
<wizard
category="org.eclipse.papyrus.wizards.category"
- class="org.eclipse.papyrus.diagramtemplate.editor.DiagramTemplateModelWizard"
+ class="org.eclipse.papyrus.diagramtemplate.presentation.DiagramTemplateModelWizard"
finalPerspective="org.eclipse.papyrus.infra.core.perspective"
icon="icons/full/obj16/DiagramTemplateModelFile.gif"
id="org.eclipse.papyrus.diagramtemplate.presentation.DiagramTemplateModelWizardID"
@@ -23,29 +23,13 @@
</wizard>
</extension>
- <extension point="org.eclipse.ui.newWizards">
- <!-- @generated diagramTemplate -->
- <category
- id="org.eclipse.emf.ecore.Wizard.category.ID"
- name="%_UI_Wizard_category"/>
- <wizard
- id="org.eclipse.papyrus.diagramtemplate.presentation.DiagramTemplateModelWizardID"
- name="%_UI_DiagramTemplateModelWizard_label"
- class="org.eclipse.papyrus.diagramtemplate.presentation.DiagramTemplateModelWizard"
- category="org.eclipse.emf.ecore.Wizard.category.ID"
- icon="icons/full/obj16/DiagramTemplateModelFile.gif">
- <description>%_UI_DiagramTemplateModelWizard_description</description>
- <selection class="org.eclipse.core.resources.IResource"/>
- </wizard>
- </extension>
-
<extension point="org.eclipse.ui.editors">
<editor
id="org.eclipse.papyrus.diagramtemplate.presentation.DiagramTemplateEditorID"
name="%_UI_DiagramTemplateEditor_label"
icon="icons/full/obj16/DiagramTemplateModelFile.gif"
extensions="diagramtemplate"
- class="org.eclipse.papyrus.diagramtemplate.editor.DiagramTemplateEditor">
+ class="org.eclipse.papyrus.diagramtemplate.presentation.DiagramTemplateEditor">
</editor>
</extension>
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/src-gen/org/eclipse/papyrus/diagramtemplate/presentation/DiagramTemplateEditor.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/src-gen/org/eclipse/papyrus/diagramtemplate/presentation/DiagramTemplateEditor.java
index 600fa01..84171d2 100755
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/src-gen/org/eclipse/papyrus/diagramtemplate/presentation/DiagramTemplateEditor.java
+++ b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/src-gen/org/eclipse/papyrus/diagramtemplate/presentation/DiagramTemplateEditor.java
@@ -83,7 +83,6 @@
import org.eclipse.papyrus.diagramtemplate.SelectionKind;
import org.eclipse.papyrus.diagramtemplate.SelectionRef;
import org.eclipse.papyrus.diagramtemplate.Template;
-import org.eclipse.papyrus.diagramtemplate.editor.DiagramTemplateEditorPlugin;
import org.eclipse.papyrus.diagramtemplate.editor.provider.DiagramDefinitionContentProvider;
import org.eclipse.papyrus.diagramtemplate.editor.provider.DiagramDefinitionLabelProvider;
import org.eclipse.papyrus.diagramtemplate.editor.provider.DiagramKindContentProvider;
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/src-gen/org/eclipse/papyrus/diagramtemplate/presentation/DiagramTemplateModelWizard.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/src-gen/org/eclipse/papyrus/diagramtemplate/presentation/DiagramTemplateModelWizard.java
index cf1ee6a..b63de77 100755
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/src-gen/org/eclipse/papyrus/diagramtemplate/presentation/DiagramTemplateModelWizard.java
+++ b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/src-gen/org/eclipse/papyrus/diagramtemplate/presentation/DiagramTemplateModelWizard.java
@@ -357,214 +357,6 @@
// This whole class was commented in the original code base
public class DiagramTemplateModelWizardInitialObjectCreationPage /* extends WizardPage */ {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected Combo initialObjectField;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected List<String> encodings;
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected Combo encodingField;
-
- /**
- * Pass in the selection.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public DiagramTemplateModelWizardInitialObjectCreationPage(String pageId) {
- super(pageId);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void createControl(Composite parent) {
- Composite composite = new Composite(parent, SWT.NONE);
- {
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.verticalSpacing = 12;
- composite.setLayout(layout);
-
- GridData data = new GridData();
- data.verticalAlignment = GridData.FILL;
- data.grabExcessVerticalSpace = true;
- data.horizontalAlignment = GridData.FILL;
- composite.setLayoutData(data);
- }
-
- Label containerLabel = new Label(composite, SWT.LEFT);
- {
- containerLabel.setText(DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_ModelObject")); //$NON-NLS-1$
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- containerLabel.setLayoutData(data);
- }
-
- initialObjectField = new Combo(composite, SWT.BORDER);
- {
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- initialObjectField.setLayoutData(data);
- }
-
- for (String objectName : getInitialObjectNames()) {
- initialObjectField.add(getLabel(objectName));
- }
-
- if (initialObjectField.getItemCount() == 1) {
- initialObjectField.select(0);
- }
- initialObjectField.addModifyListener(validator);
-
- Label encodingLabel = new Label(composite, SWT.LEFT);
- {
- encodingLabel.setText(DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_XMLEncoding")); //$NON-NLS-1$
-
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- encodingLabel.setLayoutData(data);
- }
- encodingField = new Combo(composite, SWT.BORDER);
- {
- GridData data = new GridData();
- data.horizontalAlignment = GridData.FILL;
- data.grabExcessHorizontalSpace = true;
- encodingField.setLayoutData(data);
- }
-
- for (String encoding : getEncodings()) {
- encodingField.add(encoding);
- }
-
- encodingField.select(0);
- encodingField.addModifyListener(validator);
-
- setPageComplete(validatePage());
- setControl(composite);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected ModifyListener validator = new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- setPageComplete(validatePage());
- }
- };
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected boolean validatePage() {
- return getInitialObjectName() != null && getEncodings().contains(encodingField.getText());
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void setVisible(boolean visible) {
- super.setVisible(visible);
- if (visible) {
- if (initialObjectField.getItemCount() == 1) {
- initialObjectField.clearSelection();
- encodingField.setFocus();
- } else {
- encodingField.clearSelection();
- initialObjectField.setFocus();
- }
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public String getInitialObjectName() {
- String label = initialObjectField.getText();
-
- for (String name : getInitialObjectNames()) {
- if (getLabel(name).equals(label)) {
- return name;
- }
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public String getEncoding() {
- return encodingField.getText();
- }
-
- /**
- * Returns the label for the specified type name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected String getLabel(String typeName) {
- try {
- return DiagramTemplateEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); //$NON-NLS-1$ //$NON-NLS-2$
- } catch (MissingResourceException mre) {
- DiagramTemplateEditorPlugin.INSTANCE.log(mre);
- }
- return typeName;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected Collection<String> getEncodings() {
- if (encodings == null) {
- encodings = new ArrayList<String>();
- for (StringTokenizer stringTokenizer = new StringTokenizer(DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens();) //$NON-NLS-1$
- {
- encodings.add(stringTokenizer.nextToken());
- }
- }
- return encodings;
- }
// /**
// * <!-- begin-user-doc -->
// * <!-- end-user-doc -->
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/src/org/eclipse/papyrus/diagramtemplate/editor/DiagramTemplateActionBarContributor.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/src/org/eclipse/papyrus/diagramtemplate/editor/DiagramTemplateActionBarContributor.java
deleted file mode 100755
index a5a3d4d..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/src/org/eclipse/papyrus/diagramtemplate/editor/DiagramTemplateActionBarContributor.java
+++ /dev/null
@@ -1,445 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate.editor;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.eclipse.emf.common.ui.viewer.IViewerProvider;
-import org.eclipse.emf.edit.domain.EditingDomain;
-import org.eclipse.emf.edit.domain.IEditingDomainProvider;
-import org.eclipse.emf.edit.ui.action.ControlAction;
-import org.eclipse.emf.edit.ui.action.CreateChildAction;
-import org.eclipse.emf.edit.ui.action.CreateSiblingAction;
-import org.eclipse.emf.edit.ui.action.EditingDomainActionBarContributor;
-import org.eclipse.emf.edit.ui.action.LoadResourceAction;
-import org.eclipse.emf.edit.ui.action.ValidateAction;
-import org.eclipse.jface.action.Action;
-import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.action.IContributionItem;
-import org.eclipse.jface.action.IContributionManager;
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.IToolBarManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.action.SubContributionItem;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.PartInitException;
-
-/**
- * This is the action bar contributor for the DiagramTemplate model editor.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
-public class DiagramTemplateActionBarContributor extends EditingDomainActionBarContributor implements ISelectionChangedListener {
-
- /**
- * This keeps track of the active editor.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected IEditorPart activeEditorPart;
-
- /**
- * This keeps track of the current selection provider.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected ISelectionProvider selectionProvider;
-
- /**
- * This action opens the Properties view.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected IAction showPropertiesViewAction = new Action(DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) {
-
- @Override
- public void run() {
- try {
- getPage().showView("org.eclipse.ui.views.PropertySheet");
- } catch (PartInitException exception) {
- DiagramTemplateEditorPlugin.INSTANCE.log(exception);
- }
- }
- };
-
- /**
- * This action refreshes the viewer of the current editor if the editor
- * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected IAction refreshViewerAction = new Action(DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_RefreshViewer_menu_item")) {
-
- @Override
- public boolean isEnabled() {
- return activeEditorPart instanceof IViewerProvider;
- }
-
- @Override
- public void run() {
- if (activeEditorPart instanceof IViewerProvider) {
- Viewer viewer = ((IViewerProvider) activeEditorPart).getViewer();
- if (viewer != null) {
- viewer.refresh();
- }
- }
- }
- };
-
- /**
- * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateChildAction} corresponding to each descriptor
- * generated for the current selection by the item provider.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected Collection<IAction> createChildActions;
-
- /**
- * This is the menu manager into which menu contribution items should be added for CreateChild actions.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected IMenuManager createChildMenuManager;
-
- /**
- * This will contain one {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} corresponding to each descriptor
- * generated for the current selection by the item provider.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected Collection<IAction> createSiblingActions;
-
- /**
- * This is the menu manager into which menu contribution items should be added for CreateSibling actions.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected IMenuManager createSiblingMenuManager;
-
- /**
- * This creates an instance of the contributor.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public DiagramTemplateActionBarContributor() {
- super(ADDITIONS_LAST_STYLE);
- loadResourceAction = new LoadResourceAction();
- validateAction = new ValidateAction();
- controlAction = new ControlAction();
- }
-
- /**
- * This adds Separators for editor additions to the tool bar.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void contributeToToolBar(IToolBarManager toolBarManager) {
- toolBarManager.add(new Separator("diagramtemplate-settings"));
- toolBarManager.add(new Separator("diagramtemplate-additions"));
- }
-
- /**
- * This adds to the menu bar a menu and some separators for editor additions,
- * as well as the sub-menus for object creation items.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void contributeToMenu(IMenuManager menuManager) {
- super.contributeToMenu(menuManager);
-
- IMenuManager submenuManager = new MenuManager(DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_DiagramTemplateEditor_menu"), "org.eclipse.papyrus.diagramtemplate.diagramtemplateMenuID");
- menuManager.insertAfter("additions", submenuManager);
- submenuManager.add(new Separator("settings"));
- submenuManager.add(new Separator("actions"));
- submenuManager.add(new Separator("additions"));
- submenuManager.add(new Separator("additions-end"));
-
- // Prepare for CreateChild item addition or removal.
- //
- createChildMenuManager = new MenuManager(DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
- submenuManager.insertBefore("additions", createChildMenuManager);
-
- // Prepare for CreateSibling item addition or removal.
- //
- createSiblingMenuManager = new MenuManager(DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
- submenuManager.insertBefore("additions", createSiblingMenuManager);
-
- // Force an update because Eclipse hides empty menus now.
- //
- submenuManager.addMenuListener(new IMenuListener() {
-
- public void menuAboutToShow(IMenuManager menuManager) {
- menuManager.updateAll(true);
- }
- });
-
- addGlobalActions(submenuManager);
- }
-
- /**
- * When the active editor changes, this remembers the change and registers with it as a selection provider.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void setActiveEditor(IEditorPart part) {
- super.setActiveEditor(part);
- activeEditorPart = part;
-
- // Switch to the new selection provider.
- //
- if (selectionProvider != null) {
- selectionProvider.removeSelectionChangedListener(this);
- }
- if (part == null) {
- selectionProvider = null;
- } else {
- selectionProvider = part.getSite().getSelectionProvider();
- selectionProvider.addSelectionChangedListener(this);
-
- // Fake a selection changed event to update the menus.
- //
- if (selectionProvider.getSelection() != null) {
- selectionChanged(new SelectionChangedEvent(selectionProvider, selectionProvider.getSelection()));
- }
- }
- }
-
- /**
- * This implements {@link org.eclipse.jface.viewers.ISelectionChangedListener},
- * handling {@link org.eclipse.jface.viewers.SelectionChangedEvent}s by querying for the children and siblings
- * that can be added to the selected object and updating the menus accordingly.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void selectionChanged(SelectionChangedEvent event) {
- // Remove any menu items for old selection.
- //
- if (createChildMenuManager != null) {
- depopulateManager(createChildMenuManager, createChildActions);
- }
- if (createSiblingMenuManager != null) {
- depopulateManager(createSiblingMenuManager, createSiblingActions);
- }
-
- // Query the new selection for appropriate new child/sibling descriptors
- //
- Collection<?> newChildDescriptors = null;
- Collection<?> newSiblingDescriptors = null;
-
- ISelection selection = event.getSelection();
- if (selection instanceof IStructuredSelection && ((IStructuredSelection) selection).size() == 1) {
- Object object = ((IStructuredSelection) selection).getFirstElement();
-
- EditingDomain domain = ((IEditingDomainProvider) activeEditorPart).getEditingDomain();
-
- newChildDescriptors = domain.getNewChildDescriptors(object, null);
- newSiblingDescriptors = domain.getNewChildDescriptors(null, object);
- }
-
- // Generate actions for selection; populate and redraw the menus.
- //
- createChildActions = generateCreateChildActions(newChildDescriptors, selection);
- createSiblingActions = generateCreateSiblingActions(newSiblingDescriptors, selection);
-
- if (createChildMenuManager != null) {
- populateManager(createChildMenuManager, createChildActions, null);
- createChildMenuManager.update(true);
- }
- if (createSiblingMenuManager != null) {
- populateManager(createSiblingMenuManager, createSiblingActions, null);
- createSiblingMenuManager.update(true);
- }
- }
-
- /**
- * This generates a {@link org.eclipse.emf.edit.ui.action.CreateChildAction} for each object in <code>descriptors</code>,
- * and returns the collection of these actions.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected Collection<IAction> generateCreateChildActions(Collection<?> descriptors, ISelection selection) {
- Collection<IAction> actions = new ArrayList<IAction>();
- if (descriptors != null) {
- for (Object descriptor : descriptors) {
- actions.add(new CreateChildAction(activeEditorPart, selection, descriptor));
- }
- }
- return actions;
- }
-
- /**
- * This generates a {@link org.eclipse.emf.edit.ui.action.CreateSiblingAction} for each object in <code>descriptors</code>,
- * and returns the collection of these actions.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected Collection<IAction> generateCreateSiblingActions(Collection<?> descriptors, ISelection selection) {
- Collection<IAction> actions = new ArrayList<IAction>();
- if (descriptors != null) {
- for (Object descriptor : descriptors) {
- actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor));
- }
- }
- return actions;
- }
-
- /**
- * This populates the specified <code>manager</code> with {@link org.eclipse.jface.action.ActionContributionItem}s
- * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection,
- * by inserting them before the specified contribution item <code>contributionID</code>.
- * If <code>contributionID</code> is <code>null</code>, they are simply added.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected void populateManager(IContributionManager manager, Collection<? extends IAction> actions, String contributionID) {
- if (actions != null) {
- for (IAction action : actions) {
- if (contributionID != null) {
- manager.insertBefore(contributionID, action);
- } else {
- manager.add(action);
- }
- }
- }
- }
-
- /**
- * This removes from the specified <code>manager</code> all {@link org.eclipse.jface.action.ActionContributionItem}s
- * based on the {@link org.eclipse.jface.action.IAction}s contained in the <code>actions</code> collection.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected void depopulateManager(IContributionManager manager, Collection<? extends IAction> actions) {
- if (actions != null) {
- IContributionItem[] items = manager.getItems();
- for (int i = 0; i < items.length; i++) {
- // Look into SubContributionItems
- //
- IContributionItem contributionItem = items[i];
- while (contributionItem instanceof SubContributionItem) {
- contributionItem = ((SubContributionItem) contributionItem).getInnerItem();
- }
-
- // Delete the ActionContributionItems with matching action.
- //
- if (contributionItem instanceof ActionContributionItem) {
- IAction action = ((ActionContributionItem) contributionItem).getAction();
- if (actions.contains(action)) {
- manager.remove(contributionItem);
- }
- }
- }
- }
- }
-
- /**
- * This populates the pop-up menu before it appears.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void menuAboutToShow(IMenuManager menuManager) {
- super.menuAboutToShow(menuManager);
- MenuManager submenuManager = null;
-
- submenuManager = new MenuManager(DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item"));
- populateManager(submenuManager, createChildActions, null);
- menuManager.insertBefore("edit", submenuManager);
-
- submenuManager = new MenuManager(DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item"));
- populateManager(submenuManager, createSiblingActions, null);
- menuManager.insertBefore("edit", submenuManager);
- }
-
- /**
- * This inserts global actions before the "additions-end" separator.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- protected void addGlobalActions(IMenuManager menuManager) {
- menuManager.insertAfter("additions-end", new Separator("ui-actions"));
- menuManager.insertAfter("ui-actions", showPropertiesViewAction);
-
- refreshViewerAction.setEnabled(refreshViewerAction.isEnabled());
- menuManager.insertAfter("ui-actions", refreshViewerAction);
-
- super.addGlobalActions(menuManager);
- }
-
- /**
- * This ensures that a delete action will clean up all references to deleted objects.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- protected boolean removeAllReferencesOnDelete() {
- return true;
- }
-
-}
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/src/org/eclipse/papyrus/diagramtemplate/editor/DiagramTemplateEditor.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/src/org/eclipse/papyrus/diagramtemplate/editor/DiagramTemplateEditor.java
deleted file mode 100755
index eba3e18..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/src/org/eclipse/papyrus/diagramtemplate/editor/DiagramTemplateEditor.java
+++ /dev/null
@@ -1,1610 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate.editor;
-
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.EventObject;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.emf.common.command.BasicCommandStack;
-import org.eclipse.emf.common.command.CommandStackListener;
-import org.eclipse.emf.common.util.BasicDiagnostic;
-import org.eclipse.emf.common.util.Diagnostic;
-import org.eclipse.emf.common.util.TreeIterator;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EReference;
-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.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.ecore.util.EcoreUtil.Copier;
-import org.eclipse.emf.edit.command.AddCommand;
-import org.eclipse.emf.edit.command.MoveCommand;
-import org.eclipse.emf.edit.command.RemoveCommand;
-import org.eclipse.emf.edit.command.SetCommand;
-import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain;
-import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
-import org.eclipse.emf.edit.provider.ReflectiveItemProviderAdapterFactory;
-import org.eclipse.emf.edit.provider.resource.ResourceItemProviderAdapterFactory;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider;
-import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider;
-import org.eclipse.emf.edit.ui.util.EditUIUtil;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.dialogs.ProgressMonitorDialog;
-import org.eclipse.jface.viewers.AbstractTreeViewer;
-import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.CheckStateChangedEvent;
-import org.eclipse.jface.viewers.CheckboxCellEditor;
-import org.eclipse.jface.viewers.CheckboxTableViewer;
-import org.eclipse.jface.viewers.EditingSupport;
-import org.eclipse.jface.viewers.ICheckStateListener;
-import org.eclipse.jface.viewers.ICheckStateProvider;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.ITreeSelection;
-import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.TableViewer;
-import org.eclipse.jface.viewers.TextCellEditor;
-import org.eclipse.jface.viewers.TreeViewer;
-import org.eclipse.jface.viewers.TreeViewerColumn;
-import org.eclipse.jface.viewers.Viewer;
-import org.eclipse.jface.viewers.ViewerFilter;
-import org.eclipse.papyrus.commands.CreationCommandDescriptor;
-import org.eclipse.papyrus.diagramtemplate.AbstractSelection;
-import org.eclipse.papyrus.diagramtemplate.DiagramDefinition;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplateFactory;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage;
-import org.eclipse.papyrus.diagramtemplate.Selection;
-import org.eclipse.papyrus.diagramtemplate.SelectionKind;
-import org.eclipse.papyrus.diagramtemplate.SelectionRef;
-import org.eclipse.papyrus.diagramtemplate.Template;
-import org.eclipse.papyrus.diagramtemplate.editor.provider.DiagramDefinitionContentProvider;
-import org.eclipse.papyrus.diagramtemplate.editor.provider.DiagramDefinitionLabelProvider;
-import org.eclipse.papyrus.diagramtemplate.editor.provider.DiagramKindContentProvider;
-import org.eclipse.papyrus.diagramtemplate.editor.provider.ElementsAvailableContentProvider;
-import org.eclipse.papyrus.diagramtemplate.editor.provider.ForContentProvider;
-import org.eclipse.papyrus.diagramtemplate.editor.provider.ForLabelProvider;
-import org.eclipse.papyrus.diagramtemplate.editor.provider.TypesAvailableFromEReferenceContentProvider;
-import org.eclipse.papyrus.diagramtemplate.editor.provider.TypesContentProvider;
-import org.eclipse.papyrus.diagramtemplate.editor.provider.WhatContentProvider;
-import org.eclipse.papyrus.diagramtemplate.launcher.DiagramTemplateLauncher;
-import org.eclipse.papyrus.diagramtemplate.provider.DiagramTemplateItemProviderAdapterFactory;
-import org.eclipse.papyrus.diagramtemplate.utils.Messages;
-import org.eclipse.papyrus.infra.architecture.ArchitectureDomainManager;
-import org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind;
-import org.eclipse.papyrus.infra.core.architecture.RepresentationKind;
-import org.eclipse.papyrus.infra.core.architecture.merged.MergedArchitectureContext;
-import org.eclipse.papyrus.infra.core.architecture.merged.MergedArchitectureViewpoint;
-import org.eclipse.papyrus.infra.viewpoints.policy.ViewPrototype;
-import org.eclipse.papyrus.uml.diagram.wizards.kind.DiagramKindLabelProvider;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.events.FocusAdapter;
-import org.eclipse.swt.events.FocusEvent;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.swt.widgets.Tree;
-import org.eclipse.swt.widgets.TreeColumn;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-import org.eclipse.ui.dialogs.CheckedTreeSelectionDialog;
-import org.eclipse.ui.dialogs.ElementTreeSelectionDialog;
-import org.eclipse.ui.dialogs.ListSelectionDialog;
-import org.eclipse.ui.model.BaseWorkbenchContentProvider;
-import org.eclipse.ui.model.WorkbenchLabelProvider;
-import org.eclipse.ui.part.EditorPart;
-import org.eclipse.uml2.uml.NamedElement;
-import org.eclipse.uml2.uml.UMLPackage;
-import org.eclipse.uml2.uml.edit.providers.UMLItemProviderAdapterFactory;
-import org.eclipse.uml2.uml.resource.UMLResource;
-
-import com.swtdesigner.ResourceManager;
-
-
-/**
- * The template model editor.
- *
- */
-public class DiagramTemplateEditor extends EditorPart {
-
-
- private static final String DEFAULT_NAME = Messages.DiagramTemplateEditor_0;
-
- private static final String DEFAULT_PREFIX = Messages.DiagramTemplateEditor_1;
-
- /**
- * Text widget to show the target model's path
- */
- private Text targetModelPathText;
-
- /**
- * Table widget to edit the diagram definitions
- */
- private Table diagramDefinitionTable;
-
- /**
- * TableViewer widget to edit the diagram definitions
- */
- private TableViewer diagramDefinitionTableViewer;
-
- /**
- * Text widget to edit the diagram definition's name
- */
- private Text nameText;
-
- /**
- * Text widget to edit the prefix used to generate the diagram name
- */
- private Text prefixText;
-
- /**
- * Text widget to edit the root to start the search from
- */
- private Text rootText;
-
- /**
- * Text widget to edit the diagram definition's description
- */
- private Text descriptionText;
-
- /**
- * Table widget to select the diagram kind to generate
- */
- private Table diagramTable;
-
- /**
- * CheckboxTableViewer widget to select the diagram kind to generate
- */
- private CheckboxTableViewer diagramCheckboxTableViewer;
-
- /**
- * Table widget to edit the diagram definition's selection
- */
- private Table whatTable;
-
- /**
- * TableViewer widget to edit the diagram definition's selection
- */
- private TableViewer whatTableViewer;
-
- /**
- * Tree widget to edit the diagram definition's selection
- */
- private Tree forTree;
-
- /**
- * TreeViewer widget to edit the diagram definition's selection
- */
- private TreeViewer forTreeViewer;
-
- /**
- * Button widget to add a diagram definition
- */
- private Button addDiagramDefinitionButton;
-
- /**
- * Button widget to select the root of the diagram definition
- */
- private Button selectRootButton;
-
- /**
- * Button widget to add a specificFor selection
- */
- private Button specificForButton;
-
- /**
- * Button widget to add a specificWhat selection
- */
- private Button specificWhatButton;
-
- /**
- * Button widget to load a target model
- */
- private Button loadModelButton;
-
- /**
- * Button widget to execute the template
- */
- private Button executeButton;
-
- /**
- * List of diagram categories to consider
- */
- Collection<ViewPrototype> representationsKinds = new ArrayList<ViewPrototype>();
-
- /**
- * The IFile object corresponding to the model to process
- */
- private IFile modelFile;
-
- /**
- * The ResourceSet object corresponding to the model to process
- */
- private ResourceSet targetModelResourceSet;
-
- /**
- * The Resource object corresponding to the model to process
- */
- private Resource targetModelResource = null;
-
- /**
- * This is the one adapter factory used for providing views of the model.
- */
- protected ComposedAdapterFactory adapterFactory;
-
- /**
- * This keeps track of the editing domain that is used to track all changes to the model.
- *
- * @generated
- */
- protected AdapterFactoryEditingDomain editingDomain;
-
- /**
- * Map to store the diagnostic associated with a resource.
- *
- * @generated
- */
- protected Map<Resource, Diagnostic> resourceToDiagnosticMap = new LinkedHashMap<Resource, Diagnostic>();
-
- /**
- * The diagram definition under edition
- */
- private DiagramDefinition currentDiagramDefinition;
-
- /**
- * The resource for the template
- */
- private Resource templateResource;
-
- /**
- * The template
- */
- private Template template;
-
- private DiagramTemplateFactory diagramtemplateFactory;
-
-
- /**
- *
- * Constructor.
- *
- */
- public DiagramTemplateEditor() {
- super();
- initializeEditingDomain();
-
- initializeDiagramCategories();
-
- DiagramTemplatePackage diagramtemplatePackage = DiagramTemplatePackage.eINSTANCE;
- diagramtemplateFactory = diagramtemplatePackage.getDiagramTemplateFactory();
- }
-
- /**
- * This looks up a string in plugin.properties, making a substitution.
- *
- * @generated
- */
- private static String getString(String key, Object s1) {
- return DiagramTemplateEditorPlugin.INSTANCE.getString(key, new Object[] { s1 });
- }
-
- /**
- * This is the method called to load a resource into the editing domain's resource set based on the editor's input.
- *
- * @generated NOT
- */
- protected boolean createModel() {
- URI resourceURI = EditUIUtil.getURI(getEditorInput());
- Exception exception = null;
-
- try {
- // Load the resource through the editing domain.
- templateResource = editingDomain.getResourceSet().getResource(resourceURI, true);
- } catch (Exception e) {
- exception = e;
- templateResource = editingDomain.getResourceSet().getResource(resourceURI, false);
- }
-
- Diagnostic diagnostic = analyzeResourceProblems(templateResource, exception);
- if (diagnostic.getSeverity() != Diagnostic.OK) {
- // Failed to load
- MessageDialog.openError(getSite().getShell(), Messages.DiagramTemplateEditor_2, Messages.DiagramTemplateEditor_3);
- return false;
- } else {
-
- if (templateResource.getContents().isEmpty()) {
- // Create the template
- template = diagramtemplateFactory.createTemplate();
- templateResource.getContents().add(template);
- } else {
- // Load the template
- template = (Template) templateResource.getContents().get(0);
- if (template.getTargetRoot() != null) {
- Resource res = template.getTargetRoot().eResource();
- if (res != null) {
- targetModelResource = res;
- } else {
- MessageDialog.openError(getSite().getShell(), Messages.DiagramTemplateEditor_4, Messages.DiagramTemplateEditor_5);
- }
- }
- }
-
- }
- return true;
- }
-
- /**
- * Helper method to load a model
- *
- * @param resourceSet
- * the resourceSet to load the model in
- * @param file
- * the file corresponding to the model to load
- * @return the resource corresponding to the model
- */
- protected Resource loadModel(ResourceSet resourceSet, IFile file) {
-
- resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
- resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.Factory.Registry.DEFAULT_EXTENSION, UMLResource.Factory.INSTANCE);
-
- return resourceSet.getResource(URI.createPlatformResourceURI(file.getFullPath().toString(), true), true);
- }
-
- /**
- * Helper method to update rootText widget
- */
- protected void updateRootText() {
- if (currentDiagramDefinition.getFromRoot() instanceof NamedElement) {
- rootText.setText(((NamedElement) currentDiagramDefinition.getFromRoot()).getQualifiedName());
- } else {
- rootText.setText(currentDiagramDefinition.getFromRoot().toString());
- }
- }
-
- /**
- * Helper method to update the UI
- */
- protected void updateUI() {
- diagramDefinitionTableViewer.refresh();
- forTreeViewer.setInput(currentDiagramDefinition.getSelection());
- forTreeViewer.refresh();
- whatTableViewer.refresh();
- diagramCheckboxTableViewer.refresh();
-
- nameText.setText(currentDiagramDefinition.getName());
- descriptionText.setText(currentDiagramDefinition.getDescription());
- prefixText.setText(currentDiagramDefinition.getPrefix());
- if (currentDiagramDefinition.getFromRoot() != null) {
- updateRootText();
- } else {
- rootText.setText(""); //$NON-NLS-1$
- }
- }
-
- /**
- * Helper method to initialize the diagram categories (kinds)
- */
- protected void initializeDiagramCategories() {
- ArchitectureDomainManager manager = ArchitectureDomainManager.getInstance();
- Collection<MergedArchitectureContext> contexts = manager.getVisibleArchitectureContexts();
-
- for (MergedArchitectureContext mergedArchitectureContext : contexts) {
- Collection<MergedArchitectureViewpoint> viewpoints = mergedArchitectureContext.getViewpoints();
-
- for (MergedArchitectureViewpoint mergedArchitectureViewpoint : viewpoints) {
- Collection<RepresentationKind> representations = mergedArchitectureViewpoint.getRepresentationKinds();
- for (RepresentationKind representationKind : representations) {
- if (representationKind instanceof PapyrusRepresentationKind) {
- representationsKinds.add(ViewPrototype.get((PapyrusRepresentationKind) representationKind));
- }
- }
- }
- }
- }
-
- /**
- * Helper method used to check if the element is already defined
- *
- * @param object
- * the element to find
- * @param list
- * the list to search in
- * @return
- * true if found false else
- */
- protected boolean containsElement(EObject object, List<?> list) {
- if (list != null) {
- for (Object selection : list) {
- if (((AbstractSelection) selection).getElement() == object) {
- return true;
- }
- }
- }
- return false;
- }
-
- /**
- * Helper method to clear the template of specific information
- */
- protected void clearTemplate() {
- TreeIterator<EObject> it = template.eAllContents();
- while (it.hasNext()) {
- EObject eObject = it.next();
- if (eObject instanceof DiagramDefinition) {
- ((DiagramDefinition) eObject).setFromRoot(null);
- } else if (eObject instanceof Selection) {
- if (((AbstractSelection) eObject).getKind() != SelectionKind.FOR_ALL) {
- RemoveCommand command = new RemoveCommand(editingDomain, ((Selection) eObject).eContainer(), ((Selection) eObject).eContainer().eClass().getEStructuralFeature("selection"), eObject); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
- it = template.eAllContents();
- }
- } else if (eObject instanceof SelectionRef) {
- if (((AbstractSelection) eObject).getKind() != SelectionKind.FOR_ALL) {
- RemoveCommand command = new RemoveCommand(editingDomain, ((SelectionRef) eObject).eContainer(), ((SelectionRef) eObject).eContainer().eClass().getEStructuralFeature("selectionRef"), eObject); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
- it = template.eAllContents();
- }
- }
-
-
-
- }
-
- SetCommand command = new SetCommand(editingDomain, template, template.eClass().getEStructuralFeature("targetRoot"), null); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
-
-
- modelFile = null;
- targetModelPathText.setText(""); //$NON-NLS-1$
- targetModelResourceSet = null;
- targetModelResource = null;
-
- loadModelButton.setEnabled(true);
- selectRootButton.setEnabled(false);
- executeButton.setEnabled(false);
- specificForButton.setEnabled(false);
-
- updateUI();
- }
-
- /**
- * Helper method to create a new diagram definition
- */
- protected void createNewDiagramDefinition() {
- currentDiagramDefinition = diagramtemplateFactory.createDiagramDefinition();
- currentDiagramDefinition.setName(DEFAULT_NAME);
- currentDiagramDefinition.setDescription(""); //$NON-NLS-1$
- currentDiagramDefinition.setPrefix(DEFAULT_PREFIX);
-
- if (targetModelResource != null) {
- currentDiagramDefinition.setFromRoot(targetModelResource.getContents().get(0));
- }
-
- // Update UI
- updateUI();
-
- addDiagramDefinitionButton.setEnabled(true);
- }
-
- /**
- * Returns a diagnostic describing the errors and warnings listed in the resource
- * and the specified exception (if any).
- *
- * @generated
- */
- public Diagnostic analyzeResourceProblems(Resource resource, Exception exception) {
- if (!resource.getErrors().isEmpty() || !resource.getWarnings().isEmpty()) {
- BasicDiagnostic basicDiagnostic = new BasicDiagnostic(Diagnostic.ERROR,
- "org.eclipse.papyrus.diagramtemplate.editor", 0, getString("_UI_CreateModelError_message", resource.getURI()), new Object[] { exception == null ? (Object) resource : exception }); //$NON-NLS-1$ //$NON-NLS-2$
- basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true));
- return basicDiagnostic;
- } else if (exception != null) {
- return new BasicDiagnostic(Diagnostic.ERROR, "org.eclipse.papyrus.diagramtemplate.editor", 0, getString("_UI_CreateModelError_message", resource.getURI()), new Object[] { exception }); //$NON-NLS-1$ //$NON-NLS-2$
- } else {
- return Diagnostic.OK_INSTANCE;
- }
- }
-
-
- /**
- * This sets up the editing domain for the model editor.
- *
- * @generated
- */
- protected void initializeEditingDomain() {
- // Create an adapter factory that yields item providers.
- adapterFactory = new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE);
-
- adapterFactory.addAdapterFactory(new ResourceItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new DiagramTemplateItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new UMLItemProviderAdapterFactory());
- adapterFactory.addAdapterFactory(new ReflectiveItemProviderAdapterFactory());
-
- // Create the command stack that will notify this editor as commands are executed.
- BasicCommandStack commandStack = new BasicCommandStack();
-
- // Add a listener to set the most recent command's affected objects to be the selection of the viewer with focus.
- commandStack.addCommandStackListener(new CommandStackListener() {
-
- /**
- * {@inheritDoc}
- */
- public void commandStackChanged(EventObject event) {
- updateUI();
- firePropertyChange(IEditorPart.PROP_DIRTY);
- }
- });
-
- // Create the editing domain with a special command stack.
- editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap<Resource, Boolean>());
- }
-
- /**
- * This returns whether something has been persisted to the URI of the specified resource.
- * The implementation uses the URI converter from the editor's resource set to try to open an input stream.
- *
- * @generated
- */
- protected boolean isPersisted(Resource resource) {
- boolean result = false;
- try {
- InputStream stream = editingDomain.getResourceSet().getURIConverter().createInputStream(resource.getURI());
- if (stream != null) {
- result = true;
- stream.close();
- }
- } catch (IOException e) {
- // Ignore
- }
- return result;
- }
-
- @Override
- public void doSave(IProgressMonitor monitor) {
- // Save only resources that have actually changed.
- //
- final Map<Object, Object> saveOptions = new HashMap<Object, Object>();
- saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER);
-
- // Do the work within an operation because this is a long running activity that modifies the workbench.
- //
- WorkspaceModifyOperation operation = new WorkspaceModifyOperation() {
-
- // This is the method that gets invoked when the operation runs.
- //
- @Override
- public void execute(IProgressMonitor monitor) {
- // Save the resources to the file system.
- //
- boolean first = true;
- for (Resource resource : editingDomain.getResourceSet().getResources()) {
- if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) {
- try {
- resource.save(saveOptions);
- } catch (Exception exception) {
- resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception));
- }
- first = false;
- }
- }
- }
- };
-
- try {
-
- new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation);
-
- ((BasicCommandStack) editingDomain.getCommandStack()).saveIsDone();
- firePropertyChange(IEditorPart.PROP_DIRTY);
- } catch (Exception exception) {
- // Something went wrong that shouldn't.
- //
- DiagramTemplateEditorPlugin.INSTANCE.log(exception);
- }
-
- }
-
- @Override
- public void doSaveAs() {
-
- }
-
- @Override
- public void init(IEditorSite site, IEditorInput input) throws PartInitException {
- setSite(site);
- setInputWithNotify(input);
- setPartName(input.getName());
- }
-
- @Override
- public boolean isDirty() {
- return ((BasicCommandStack) editingDomain.getCommandStack()).isSaveNeeded();
- }
-
- @Override
- public boolean isSaveAsAllowed() {
- return false;
- }
-
- private void createloadPart(Composite parent) {
-
- Composite loadComposite = new Composite(parent, SWT.NONE);
- loadComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
- loadComposite.setLayout(new GridLayout(5, false));
-
- executeButton = new Button(loadComposite, SWT.NONE);
- executeButton.setText(Messages.DiagramTemplateEditor_15);
- executeButton.setImage(ResourceManager.getPluginImage("org.eclipse.papyrus.diagramtemplate.editor", "icons/full/obj16/execute.gif")); //$NON-NLS-1$ //$NON-NLS-2$
- executeButton.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseUp(MouseEvent e) {
- if (targetModelResource != null) {
- DiagramTemplateLauncher launcher = DiagramTemplateLauncher.getInstance();
- launcher.execute(template);
- } else {
- MessageDialog.openInformation(getSite().getShell(), Messages.DiagramTemplateEditor_18, Messages.DiagramTemplateEditor_19);
- }
- }
- });
- executeButton.setEnabled(false);
-
- Label loadLabel = new Label(loadComposite, SWT.NONE);
- loadLabel.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, false, false, 1, 1));
- loadLabel.setText(Messages.DiagramTemplateEditor_20);
-
- targetModelPathText = new Text(loadComposite, SWT.BORDER);
- targetModelPathText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
- targetModelPathText.setEditable(false);
-
- loadModelButton = new Button(loadComposite, SWT.NONE);
- loadModelButton.setText(Messages.DiagramTemplateEditor_21);
- loadModelButton.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseUp(MouseEvent e) {
- ElementTreeSelectionDialog dialog = new ElementTreeSelectionDialog(getSite().getShell(), new WorkbenchLabelProvider(), new BaseWorkbenchContentProvider());
- dialog.addFilter(new ViewerFilter() {
-
- // Show only element with UML extension
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (element instanceof IContainer) {
- return true;
- } else {
- if (((IFile) element).getFileExtension().compareToIgnoreCase("uml") == 0) { //$NON-NLS-1$
- return true;
- } else {
- return false;
- }
- }
-
- }
- });
- dialog.setAllowMultiple(false);
- dialog.setTitle(Messages.DiagramTemplateEditor_23);
- dialog.setMessage(Messages.DiagramTemplateEditor_24);
- dialog.setInput(ResourcesPlugin.getWorkspace().getRoot());
- dialog.open();
-
- Object result = dialog.getFirstResult();
- if (result instanceof IFile) {
- modelFile = (IFile) dialog.getFirstResult();
- targetModelResourceSet = new ResourceSetImpl();
- targetModelResource = loadModel(targetModelResourceSet, modelFile);
- targetModelPathText.setText(targetModelResource.getURI().toString());
-
- SetCommand command = new SetCommand(editingDomain, template, template.eClass().getEStructuralFeature("targetRoot"), targetModelResource.getContents().get(0)); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
-
- // Set fromRoots automatically
- for (DiagramDefinition diagramDefinition : template.getDiagramDefinitions()) {
- diagramDefinition.setFromRoot(targetModelResource.getContents().get(0));
- }
-
- selectRootButton.setEnabled(true);
- loadModelButton.setEnabled(false);
- specificForButton.setEnabled(true);
- executeButton.setEnabled(true);
-
- updateUI();
- }
- }
- });
-
- Button clearButton = new Button(loadComposite, SWT.NONE);
- clearButton.setText(Messages.DiagramTemplateEditor_26);
- clearButton.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseUp(MouseEvent e) {
- if (MessageDialog.openConfirm(getSite().getShell(), Messages.DiagramTemplateEditor_27, Messages.DiagramTemplateEditor_28)) {
- clearTemplate();
- }
- }
- });
- }
-
- private void createDiagramDefinitionPart(Composite parent) {
- Composite diagramDefinitionPartComposite = new Composite(parent, SWT.NONE);
- diagramDefinitionPartComposite.setLayout(new GridLayout(1, false));
-
- Composite diagramDefinitionButtonsComposite = new Composite(diagramDefinitionPartComposite, SWT.NONE);
- GridLayout gl_diagramDefinitionButtonsComposite = new GridLayout(6, false);
- gl_diagramDefinitionButtonsComposite.horizontalSpacing = 0;
- gl_diagramDefinitionButtonsComposite.verticalSpacing = 1;
- gl_diagramDefinitionButtonsComposite.marginWidth = 0;
- gl_diagramDefinitionButtonsComposite.marginHeight = 0;
- diagramDefinitionButtonsComposite.setLayout(gl_diagramDefinitionButtonsComposite);
- diagramDefinitionButtonsComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
-
- Button newDiagramDefinitionButton = new Button(diagramDefinitionButtonsComposite, SWT.NONE);
- newDiagramDefinitionButton.setImage(ResourceManager.getPluginImage("org.eclipse.papyrus.diagramtemplate.editor", "icons/full/obj16/new.gif")); //$NON-NLS-1$ //$NON-NLS-2$
- newDiagramDefinitionButton.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseUp(MouseEvent e) {
- createNewDiagramDefinition();
- addDiagramDefinitionButton.setEnabled(true);
- }
- });
-
- addDiagramDefinitionButton = new Button(diagramDefinitionButtonsComposite, SWT.NONE);
- addDiagramDefinitionButton.setImage(ResourceManager.getPluginImage("org.eclipse.papyrus.diagramtemplate.editor", "icons/full/obj16/add.gif")); //$NON-NLS-1$ //$NON-NLS-2$
- addDiagramDefinitionButton.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseUp(MouseEvent e) {
- if (currentDiagramDefinition.getDiagramKind() != null) {
- if (template != null) {
- AddCommand command = new AddCommand(editingDomain, template, template.eClass().getEStructuralFeature("diagramDefinitions"), currentDiagramDefinition); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
- }
- createNewDiagramDefinition();
- } else {
- MessageDialog.openWarning(getSite().getShell(), Messages.DiagramTemplateEditor_34, Messages.DiagramTemplateEditor_35);
- }
- }
- });
-
- Button removeDiagramDefinitionButton = new Button(diagramDefinitionButtonsComposite, SWT.NONE);
- removeDiagramDefinitionButton.setImage(ResourceManager.getPluginImage("org.eclipse.papyrus.diagramtemplate.editor", "icons/full/obj16/delete.gif")); //$NON-NLS-1$ //$NON-NLS-2$
- removeDiagramDefinitionButton.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseUp(MouseEvent e) {
- ISelection selection = diagramDefinitionTableViewer.getSelection();
- if (selection instanceof IStructuredSelection) {
- Iterator it = ((IStructuredSelection) selection).iterator();
- while (it.hasNext()) {
- Object object = it.next();
-
- RemoveCommand command = new RemoveCommand(editingDomain, template, template.eClass().getEStructuralFeature("diagramDefinitions"), object); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
-
- }
-
- diagramDefinitionTableViewer.refresh();
- createNewDiagramDefinition();
- }
- }
- });
-
- Button moveUpDiagramDefinitionButton = new Button(diagramDefinitionButtonsComposite, SWT.NONE);
- moveUpDiagramDefinitionButton.setImage(ResourceManager.getPluginImage("org.eclipse.papyrus.diagramtemplate.editor", "icons/full/obj16/up.gif")); //$NON-NLS-1$ //$NON-NLS-2$
- moveUpDiagramDefinitionButton.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseUp(MouseEvent e) {
- ISelection selection = diagramDefinitionTableViewer.getSelection();
- if (selection instanceof IStructuredSelection) {
- DiagramDefinition diagramDefinition = (DiagramDefinition) ((IStructuredSelection) selection).getFirstElement();
- MoveCommand command = new MoveCommand(editingDomain, template, template.eClass().getEStructuralFeature("diagramDefinitions"), diagramDefinition, template.getDiagramDefinitions().indexOf(diagramDefinition) - 1); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
-
- diagramDefinitionTableViewer.refresh();
- }
- }
- });
-
- Button moveDownDiagramDefinitionButton = new Button(diagramDefinitionButtonsComposite, SWT.NONE);
- moveDownDiagramDefinitionButton.setImage(ResourceManager.getPluginImage("org.eclipse.papyrus.diagramtemplate.editor", "icons/full/obj16/down.gif")); //$NON-NLS-1$ //$NON-NLS-2$
- moveDownDiagramDefinitionButton.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseUp(MouseEvent e) {
- ISelection selection = diagramDefinitionTableViewer.getSelection();
- if (selection instanceof IStructuredSelection) {
- DiagramDefinition diagramDefinition = (DiagramDefinition) ((IStructuredSelection) selection).getFirstElement();
- MoveCommand command = new MoveCommand(editingDomain, template, template.eClass().getEStructuralFeature("diagramDefinitions"), diagramDefinition, template.getDiagramDefinitions().indexOf(diagramDefinition) + 1); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
-
- diagramDefinitionTableViewer.refresh();
- }
- }
- });
-
- Button copyDiagramDefinitionButton = new Button(diagramDefinitionButtonsComposite, SWT.NONE);
- copyDiagramDefinitionButton.setImage(ResourceManager.getPluginImage("org.eclipse.papyrus.diagramtemplate.editor", "icons/full/obj16/copy.gif")); //$NON-NLS-1$ //$NON-NLS-2$
- copyDiagramDefinitionButton.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseUp(MouseEvent e) {
- ISelection selection = diagramDefinitionTableViewer.getSelection();
-
- if (selection != null && !selection.isEmpty()) {
- if (selection instanceof IStructuredSelection) {
- DiagramDefinition diagramDefinition = (DiagramDefinition) ((IStructuredSelection) selection).getFirstElement();
-
- Copier copier = new Copier();
- DiagramDefinition diagramDefinitionCopy = (DiagramDefinition) copier.copy(diagramDefinition);
- copier.copyReferences();
-
- diagramDefinitionCopy.setName(Messages.DiagramTemplateEditor_47 + diagramDefinitionCopy.getName());
-
- if (template != null) {
- AddCommand command = new AddCommand(editingDomain, template, template.eClass().getEStructuralFeature("diagramDefinitions"), diagramDefinitionCopy); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
- }
- createNewDiagramDefinition();
- }
- }
- }
- });
-
- diagramDefinitionTableViewer = new TableViewer(diagramDefinitionPartComposite, SWT.BORDER | SWT.FULL_SELECTION);
- diagramDefinitionTable = diagramDefinitionTableViewer.getTable();
- diagramDefinitionTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, true, 1, 1));
- diagramDefinitionTableViewer.setContentProvider(new DiagramDefinitionContentProvider());
- diagramDefinitionTableViewer.setLabelProvider(new DiagramDefinitionLabelProvider());
- diagramDefinitionTableViewer.setInput(template.getDiagramDefinitions());
- diagramDefinitionTableViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-
- /**
- * {@inheritDoc}
- */
- public void selectionChanged(SelectionChangedEvent event) {
- if (event.getSelection() instanceof IStructuredSelection && !event.getSelection().isEmpty()) {
-
- currentDiagramDefinition = (DiagramDefinition) ((IStructuredSelection) event.getSelection()).getFirstElement();
-
- // Update UI
- updateUI();
-
- // We are under edition of an existing diagram definition: we cannot add
- addDiagramDefinitionButton.setEnabled(false);
- }
- }
- });
-
-
- }
-
- private void createDiagramInformationPart(Composite parent) {
- Composite diagramInformationComposite = new Composite(parent, SWT.NONE);
- diagramInformationComposite.setLayout(new GridLayout(5, false));
-
- Label nameLabel = new Label(diagramInformationComposite, SWT.NONE);
- nameLabel.setText(Messages.DiagramTemplateEditor_49);
-
- nameText = new Text(diagramInformationComposite, SWT.BORDER);
- nameText.addFocusListener(new FocusAdapter() {
-
- @Override
- public void focusLost(FocusEvent e) {
- SetCommand command = new SetCommand(editingDomain, currentDiagramDefinition, currentDiagramDefinition.eClass().getEStructuralFeature("name"), nameText.getText()); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
- }
- });
- nameText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
-
- Label descriptionLabel = new Label(diagramInformationComposite, SWT.NONE);
- descriptionLabel.setLayoutData(new GridData(SWT.LEFT, SWT.TOP, false, false, 1, 3));
- descriptionLabel.setText(Messages.DiagramTemplateEditor_51);
-
- descriptionText = new Text(diagramInformationComposite, SWT.BORDER | SWT.MULTI);
- descriptionText.addFocusListener(new FocusAdapter() {
-
- @Override
- public void focusLost(FocusEvent e) {
- SetCommand command = new SetCommand(editingDomain, currentDiagramDefinition, currentDiagramDefinition.eClass().getEStructuralFeature("description"), descriptionText.getText()); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
- }
- });
- descriptionText.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 3));
-
- Label prefixLabel = new Label(diagramInformationComposite, SWT.NONE);
- prefixLabel.setText(Messages.DiagramTemplateEditor_53);
-
- prefixText = new Text(diagramInformationComposite, SWT.BORDER);
- prefixText.addFocusListener(new FocusAdapter() {
-
- @Override
- public void focusLost(FocusEvent e) {
- SetCommand command = new SetCommand(editingDomain, currentDiagramDefinition, currentDiagramDefinition.eClass().getEStructuralFeature("prefix"), prefixText.getText()); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
- }
- });
- prefixText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 2, 1));
-
- Label rootLabel = new Label(diagramInformationComposite, SWT.NONE);
- rootLabel.setText(Messages.DiagramTemplateEditor_55);
-
- rootText = new Text(diagramInformationComposite, SWT.BORDER);
- rootText.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
- rootText.setEditable(false);
-
- selectRootButton = new Button(diagramInformationComposite, SWT.NONE);
- selectRootButton.setText(Messages.DiagramTemplateEditor_56);
- selectRootButton.setEnabled(false);
- selectRootButton.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseUp(MouseEvent e) {
-
- ElementTreeSelectionDialog dlg = new ElementTreeSelectionDialog(getSite().getShell(), new AdapterFactoryLabelProvider(adapterFactory), new AdapterFactoryContentProvider(adapterFactory));
- dlg.addFilter(new ViewerFilter() {
-
- // Show only eObject element
- @Override
- public boolean select(Viewer viewer, Object parentElement, Object element) {
- if (element instanceof EObject) {
- return true;
- } else {
- return false;
- }
- }
- });
- dlg.setAllowMultiple(false);
- dlg.setTitle(Messages.DiagramTemplateEditor_57);
- dlg.setMessage(Messages.DiagramTemplateEditor_58);
- dlg.setInput(targetModelResource);
- dlg.open();
-
- Object result = dlg.getFirstResult();
- if (result instanceof EObject) {
- SetCommand command = new SetCommand(editingDomain, currentDiagramDefinition, currentDiagramDefinition.eClass().getEStructuralFeature("fromRoot"), result); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
-
- updateRootText();
- }
-
- }
-
- });
-
- Label diagramLabel = new Label(diagramInformationComposite, SWT.NONE);
- diagramLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false, 5, 1));
- diagramLabel.setText(Messages.DiagramTemplateEditor_60);
-
- diagramCheckboxTableViewer = CheckboxTableViewer.newCheckList(diagramInformationComposite, SWT.BORDER | SWT.FULL_SELECTION);
- diagramTable = diagramCheckboxTableViewer.getTable();
- diagramTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 5, 1));
- diagramCheckboxTableViewer.addCheckStateListener(new ICheckStateListener() {
-
- public void checkStateChanged(CheckStateChangedEvent event) {
- Object element = event.getElement();
- if (element instanceof CreationCommandDescriptor) {
- SetCommand command = new SetCommand(editingDomain, currentDiagramDefinition, currentDiagramDefinition.eClass().getEStructuralFeature("diagramKind"), ((CreationCommandDescriptor) element).getCommandId()); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
- }
-
- diagramCheckboxTableViewer.setCheckedElements(new Object[0]);
- diagramCheckboxTableViewer.setChecked(element, true);
- }
- });
- diagramCheckboxTableViewer.setContentProvider(new DiagramKindContentProvider());
- diagramCheckboxTableViewer.setLabelProvider(new DiagramKindLabelProvider());
- diagramCheckboxTableViewer.setInput(representationsKinds);
-
- diagramCheckboxTableViewer.setCheckStateProvider(new ICheckStateProvider() {
-
- public boolean isGrayed(Object element) {
- return false;
- }
-
- public boolean isChecked(Object element) {
- if (currentDiagramDefinition != null) {
- if (element instanceof CreationCommandDescriptor && currentDiagramDefinition.getDiagramKind() != null) {
- return ((CreationCommandDescriptor) element).getCommandId().equals(currentDiagramDefinition.getDiagramKind());
- }
- }
- return false;
- }
- });
- }
-
- private void createSelectionPart(Composite parent) {
- SashForm selectionPartSashForm = new SashForm(parent, SWT.NONE);
-
- Composite forPartComposite = new Composite(selectionPartSashForm, SWT.NONE);
- forPartComposite.setLayout(new GridLayout(1, false));
-
- Composite forButtonsComposite = new Composite(forPartComposite, SWT.NONE);
- GridLayout gl_forButtonsComposite = new GridLayout(6, false);
- gl_forButtonsComposite.verticalSpacing = 0;
- gl_forButtonsComposite.horizontalSpacing = 0;
- gl_forButtonsComposite.marginHeight = 0;
- gl_forButtonsComposite.marginWidth = 0;
- forButtonsComposite.setLayout(gl_forButtonsComposite);
- forButtonsComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
-
- Label forLabel = new Label(forButtonsComposite, SWT.NONE);
- forLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
- forLabel.setText(Messages.DiagramTemplateEditor_64);
-
- Button allForButton = new Button(forButtonsComposite, SWT.NONE);
- allForButton.setImage(ResourceManager.getPluginImage("org.eclipse.papyrus.diagramtemplate.editor", "icons/full/obj16/forAll.png")); //$NON-NLS-1$ //$NON-NLS-2$
- allForButton.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseUp(MouseEvent e) {
-
- List<EObject> listOfTypes = new ArrayList<EObject>();
- UMLPackage umlPackage = UMLPackage.eINSTANCE;
- TreeIterator<EObject> it = umlPackage.eAllContents();
- while (it.hasNext()) {
- EObject typeInUML = it.next();
- if (typeInUML instanceof EClass) {
- if (targetModelResource != null) {
- if (!targetModelResource.getContents().isEmpty()) {
- // If the element is a type available in the model
- TreeIterator<EObject> itTarget = targetModelResource.getAllContents();
- while (itTarget.hasNext()) {
- EObject elementInTargetModel = itTarget.next();
-
- if (typeInUML == elementInTargetModel.eClass() && !listOfTypes.contains(typeInUML)) {
- listOfTypes.add(typeInUML);
- }
- }
- }
- } else {
- listOfTypes.add(typeInUML);
- }
- }
- }
-
- ListSelectionDialog dlg = new ListSelectionDialog(getSite().getShell(), listOfTypes, new TypesContentProvider(), new AdapterFactoryLabelProvider(adapterFactory), Messages.DiagramTemplateEditor_67);
- dlg.setTitle(Messages.DiagramTemplateEditor_68);
- dlg.open();
-
- Object[] results = dlg.getResult();
- if (results != null) {
- for (Object object : results) {
- if (object instanceof EClass) {
-
- if (!containsElement((EClass) object, currentDiagramDefinition.getSelection())) {
-
- Selection selection = diagramtemplateFactory.createSelection();
- selection.setKind(SelectionKind.FOR_ALL);
- selection.setRecursively(false);
- selection.setSubTypes(false);
- selection.setStereotypedBy(""); //$NON-NLS-1$
- selection.setElement((EClass) object);
-
- AddCommand command = new AddCommand(editingDomain, currentDiagramDefinition, currentDiagramDefinition.eClass().getEStructuralFeature("selection"), selection); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
-
-
- }
- }
- }
- forTreeViewer.refresh();
- }
- }
-
- });
- allForButton.setText(Messages.DiagramTemplateEditor_71);
-
- specificForButton = new Button(forButtonsComposite, SWT.NONE);
- specificForButton.setImage(ResourceManager.getPluginImage("org.eclipse.papyrus.diagramtemplate.editor", "icons/full/obj16/specific.gif")); //$NON-NLS-1$ //$NON-NLS-2$
- specificForButton.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseUp(MouseEvent e) {
- if (targetModelResource != null) {
- CheckedTreeSelectionDialog dlg = new CheckedTreeSelectionDialog(getSite().getShell(), new AdapterFactoryLabelProvider(adapterFactory), new AdapterFactoryContentProvider(adapterFactory));
- dlg.setInput(targetModelResource);
- dlg.setTitle(Messages.DiagramTemplateEditor_74);
- dlg.open();
-
- Object[] results = dlg.getResult();
- if (results != null) {
- for (Object object : results) {
- if (object instanceof EObject) {
-
- if (!containsElement((EObject) object, currentDiagramDefinition.getSelection())) {
- Selection selection = diagramtemplateFactory.createSelection();
- selection.setKind(SelectionKind.SPECIFIC);
- selection.setRecursively(false);
- selection.setSubTypes(false);
- selection.setStereotypedBy(""); //$NON-NLS-1$
- selection.setElement((EObject) object);
-
- // currentDiagramDefinition.getSelection().add(selection);
- AddCommand command = new AddCommand(editingDomain, currentDiagramDefinition, currentDiagramDefinition.eClass().getEStructuralFeature("selection"), selection); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
- }
- }
- }
- forTreeViewer.refresh();
- }
- }
- }
-
- });
- specificForButton.setText(Messages.DiagramTemplateEditor_77);
- specificForButton.setEnabled(false);
-
- Button removeForButton = new Button(forButtonsComposite, SWT.NONE);
- removeForButton.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseUp(MouseEvent e) {
- ISelection selection = forTreeViewer.getSelection();
- if (selection != null && selection instanceof ITreeSelection) {
- Iterator it = ((ITreeSelection) selection).iterator();
- while (it.hasNext()) {
- Object object = it.next();
- // removeSelection((AbstractSelection)object);
- if (object instanceof Selection) {
- RemoveCommand command = new RemoveCommand(editingDomain, ((Selection) object).eContainer(), ((Selection) object).eContainer().eClass().getEStructuralFeature("selection"), object); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
- } else if (object instanceof SelectionRef) {
- RemoveCommand command = new RemoveCommand(editingDomain, ((SelectionRef) object).eContainer(), ((SelectionRef) object).eContainer().eClass().getEStructuralFeature("selectionRef"), object); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
- }
- }
- forTreeViewer.refresh();
- }
- }
- });
- removeForButton.setImage(ResourceManager.getPluginImage("org.eclipse.papyrus.diagramtemplate.editor", "icons/full/obj16/delete.gif")); //$NON-NLS-1$ //$NON-NLS-2$
-
-
- Button moveUpForButton = new Button(forButtonsComposite, SWT.NONE);
- moveUpForButton.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseUp(MouseEvent e) {
- ISelection selection = forTreeViewer.getSelection();
- if (selection instanceof IStructuredSelection) {
- AbstractSelection abstractSelection = (AbstractSelection) ((IStructuredSelection) selection).getFirstElement();
- if (abstractSelection instanceof Selection) {
- MoveCommand command = new MoveCommand(editingDomain, abstractSelection.eContainer(),
- abstractSelection.eContainer().eClass().getEStructuralFeature("selection"), abstractSelection, ((DiagramDefinition) abstractSelection.eContainer()).getSelection().indexOf(abstractSelection) - 1); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
- } else if (abstractSelection instanceof SelectionRef) {
- MoveCommand command = new MoveCommand(editingDomain, abstractSelection.eContainer(),
- abstractSelection.eContainer().eClass().getEStructuralFeature("selectionRef"), abstractSelection, ((AbstractSelection) abstractSelection.eContainer()).getSelectionRef().indexOf(abstractSelection) - 1); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
- }
- forTreeViewer.refresh();
- }
- }
- });
- moveUpForButton.setImage(ResourceManager.getPluginImage("org.eclipse.papyrus.diagramtemplate.editor", "icons/full/obj16/up.gif")); //$NON-NLS-1$ //$NON-NLS-2$
-
- Button moveDownForButton = new Button(forButtonsComposite, SWT.NONE);
- moveDownForButton.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseUp(MouseEvent e) {
- ISelection selection = forTreeViewer.getSelection();
- if (selection instanceof IStructuredSelection) {
- AbstractSelection abstractSelection = (AbstractSelection) ((IStructuredSelection) selection).getFirstElement();
- if (abstractSelection instanceof Selection) {
- MoveCommand command = new MoveCommand(editingDomain, abstractSelection.eContainer(),
- abstractSelection.eContainer().eClass().getEStructuralFeature("selection"), abstractSelection, ((DiagramDefinition) abstractSelection.eContainer()).getSelection().indexOf(abstractSelection) + 1); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
- } else if (abstractSelection instanceof SelectionRef) {
- MoveCommand command = new MoveCommand(editingDomain, abstractSelection.eContainer(),
- abstractSelection.eContainer().eClass().getEStructuralFeature("selectionRef"), abstractSelection, ((AbstractSelection) abstractSelection.eContainer()).getSelectionRef().indexOf(abstractSelection) + 1); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
- }
- forTreeViewer.refresh();
- }
- }
- });
- moveDownForButton.setImage(ResourceManager.getPluginImage("org.eclipse.papyrus.diagramtemplate.editor", "icons/full/obj16/down.gif")); //$NON-NLS-1$ //$NON-NLS-2$
-
- forTreeViewer = new TreeViewer(forPartComposite, SWT.BORDER | SWT.FULL_SELECTION);
- forTree = forTreeViewer.getTree();
- forTree.setHeaderVisible(true);
- forTreeViewer.setAutoExpandLevel(AbstractTreeViewer.ALL_LEVELS);
- forTree.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
-
- TreeViewerColumn selectionTreeViewerColumn = new TreeViewerColumn(forTreeViewer, SWT.NONE);
- TreeColumn selectionTreeColumn = selectionTreeViewerColumn.getColumn();
- selectionTreeColumn.setWidth(200);
- selectionTreeColumn.setText(Messages.DiagramTemplateEditor_90);
-
- TreeViewerColumn recursivelyTreeViewerColumn = new TreeViewerColumn(forTreeViewer, SWT.NONE);
- TreeColumn recursivelyTreeColumn = recursivelyTreeViewerColumn.getColumn();
- recursivelyTreeColumn.setWidth(70);
- recursivelyTreeColumn.setText(Messages.DiagramTemplateEditor_91);
- recursivelyTreeViewerColumn.setEditingSupport(new EditingSupport(forTreeViewer) {
-
- @Override
- protected void setValue(Object element, Object value) {
- if (element instanceof Selection) {
- SetCommand command = new SetCommand(editingDomain, (Selection) element, ((Selection) element).eClass().getEStructuralFeature("recursively"), (Boolean) value); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
- // ((AbstractSelection)element).setRecursively((Boolean)value);
- getViewer().update(element, null);
- }
- }
-
- @Override
- protected Object getValue(Object element) {
- if (element instanceof Selection) {
- return Boolean.valueOf(((Selection) element).isRecursively());
- }
- return null;
- }
-
- @Override
- protected CellEditor getCellEditor(Object element) {
- if (element instanceof Selection) {
- if (((Selection) element).getKind() == SelectionKind.FOR_ALL) {
- return new CheckboxCellEditor(forTree);
- }
- }
-
- return null;
- }
-
- @Override
- protected boolean canEdit(Object element) {
- return true;
- }
- });
-
- TreeViewerColumn subTypesTreeViewerColumn = new TreeViewerColumn(forTreeViewer, SWT.NONE);
- TreeColumn subTypesTreeColumn = subTypesTreeViewerColumn.getColumn();
- subTypesTreeColumn.setWidth(70);
- subTypesTreeColumn.setText(Messages.DiagramTemplateEditor_93);
- subTypesTreeViewerColumn.setEditingSupport(new EditingSupport(forTreeViewer) {
-
- @Override
- protected void setValue(Object element, Object value) {
- if (element instanceof AbstractSelection) {
- SetCommand command = new SetCommand(editingDomain, (AbstractSelection) element, ((AbstractSelection) element).eClass().getEStructuralFeature("subTypes"), (Boolean) value); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
- // ((AbstractSelection)element).setSubTypes((Boolean)value);
- getViewer().update(element, null);
- }
- }
-
- @Override
- protected Object getValue(Object element) {
- if (element instanceof AbstractSelection) {
- return Boolean.valueOf(((AbstractSelection) element).isSubTypes());
- }
- return null;
- }
-
- @Override
- protected CellEditor getCellEditor(Object element) {
- if (element instanceof AbstractSelection) {
- if (((AbstractSelection) element).getKind() == SelectionKind.FOR_ALL) {
- return new CheckboxCellEditor(forTree);
- }
- }
- return null;
- }
-
- @Override
- protected boolean canEdit(Object element) {
- return true;
- }
- });
-
- TreeViewerColumn stereotypeTreeViewerColumn = new TreeViewerColumn(forTreeViewer, SWT.NONE);
- TreeColumn stereotypeTreeColumn = stereotypeTreeViewerColumn.getColumn();
- stereotypeTreeColumn.setWidth(200);
- stereotypeTreeColumn.setText(Messages.DiagramTemplateEditor_95);
- stereotypeTreeViewerColumn.setEditingSupport(new EditingSupport(forTreeViewer) {
-
-
-
- @Override
- protected void setValue(Object element, Object value) {
- if (element instanceof AbstractSelection) {
- SetCommand command = new SetCommand(editingDomain, (AbstractSelection) element, ((AbstractSelection) element).eClass().getEStructuralFeature("stereotypedBy"), (String) value); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
- getViewer().update(element, null);
- }
- }
-
- @Override
- protected Object getValue(Object element) {
- if (element instanceof AbstractSelection) {
- if (((AbstractSelection) element).getStereotypedBy() == null) {
- return ""; //$NON-NLS-1$
- } else {
- return ((AbstractSelection) element).getStereotypedBy();
- }
- }
- return null;
- }
-
- @Override
- protected CellEditor getCellEditor(Object element) {
- if (element instanceof AbstractSelection) {
- if (((AbstractSelection) element).getKind() == SelectionKind.FOR_ALL) {
- return new TextCellEditor(forTree);
- }
- }
- return null;
- }
-
- @Override
- protected boolean canEdit(Object element) {
- return true;
- }
- });
-
- forTreeViewer.setContentProvider(new ForContentProvider());
- forTreeViewer.setLabelProvider(new ForLabelProvider());
- forTreeViewer.addSelectionChangedListener(new ISelectionChangedListener() {
-
- public void selectionChanged(SelectionChangedEvent event) {
- ISelection selection = event.getSelection();
- if (selection != null && !selection.isEmpty()) {
- whatTableViewer.setInput(selection);
- whatTableViewer.refresh();
-
- if (selection instanceof IStructuredSelection) {
- Object selectionItem = ((IStructuredSelection) selection).getFirstElement();
- if (selectionItem instanceof AbstractSelection) {
- if (((AbstractSelection) selectionItem).getKind() == SelectionKind.FOR_ALL) {
- specificWhatButton.setEnabled(false);
- } else if (((AbstractSelection) selectionItem).getKind() == SelectionKind.SPECIFIC) {
- specificWhatButton.setEnabled(true);
- }
- }
- }
- }
- }
- });
-
- Composite whatPartComposite = new Composite(selectionPartSashForm, SWT.NONE);
- whatPartComposite.setLayout(new GridLayout(1, false));
-
- Composite whatButtonsComposite = new Composite(whatPartComposite, SWT.NONE);
- GridLayout gl_whatButtonsComposite = new GridLayout(3, false);
- gl_whatButtonsComposite.marginHeight = 0;
- gl_whatButtonsComposite.marginWidth = 0;
- gl_whatButtonsComposite.verticalSpacing = 0;
- gl_whatButtonsComposite.horizontalSpacing = 0;
- whatButtonsComposite.setLayout(gl_whatButtonsComposite);
- whatButtonsComposite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
- whatButtonsComposite.setBounds(0, 0, 64, 64);
-
- Label whatLabel = new Label(whatButtonsComposite, SWT.NONE);
- whatLabel.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
- whatLabel.setText(Messages.DiagramTemplateEditor_98);
-
- Button allWhatButton = new Button(whatButtonsComposite, SWT.NONE);
- allWhatButton.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseUp(MouseEvent e) {
- ISelection selection = whatTableViewer.getSelection();
- if (selection != null) {
- if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
-
- EReference eReference = (EReference) ((IStructuredSelection) selection).getFirstElement();
-
- ListSelectionDialog dlg = new ListSelectionDialog(getSite().getShell(), eReference, new TypesAvailableFromEReferenceContentProvider(), new AdapterFactoryLabelProvider(adapterFactory), Messages.DiagramTemplateEditor_99);
- dlg.setTitle(Messages.DiagramTemplateEditor_100);
- dlg.open();
-
- ISelection forSelection = forTreeViewer.getSelection();
- if (forSelection != null) {
- if (forSelection instanceof ITreeSelection) {
-
- AbstractSelection selectionItem = (AbstractSelection) ((ITreeSelection) forSelection).getFirstElement();
- if (selectionItem != null) {
-
- Object[] results = dlg.getResult();
- if (results != null) {
-
- for (Object object : results) {
- if (object instanceof EClass) {
-
- if (!containsElement((EClass) object, selectionItem.getSelectionRef())) {
- SelectionRef selectionRef = diagramtemplateFactory.createSelectionRef();
-
- selectionRef.setKind(SelectionKind.FOR_ALL);
- selectionRef.setElement((EClass) object);
- selectionRef.setSubTypes(false);
- selectionRef.setStereotypedBy(""); //$NON-NLS-1$
- selectionRef.setEReference(eReference);
-
- AddCommand command = new AddCommand(editingDomain, selectionItem, selectionItem.eClass().getEStructuralFeature("selectionRef"), selectionRef); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
-
- }
-
- }
- }
- }
- }
-
- }
-
- forTreeViewer.refresh();
-
- }
- }
- }
- }
- });
- allWhatButton.setImage(ResourceManager.getPluginImage("org.eclipse.papyrus.diagramtemplate.editor", "icons/full/obj16/forAllRef.png")); //$NON-NLS-1$ //$NON-NLS-2$
- allWhatButton.setText(Messages.DiagramTemplateEditor_105);
-
- specificWhatButton = new Button(whatButtonsComposite, SWT.NONE);
- specificWhatButton.setImage(ResourceManager.getPluginImage("org.eclipse.papyrus.diagramtemplate.editor", "icons/full/obj16/specificRef.gif")); //$NON-NLS-1$ //$NON-NLS-2$
- specificWhatButton.addMouseListener(new MouseAdapter() {
-
- @Override
- public void mouseUp(MouseEvent e) {
- ISelection selection = whatTableViewer.getSelection();
- if (selection != null) {
- if (selection instanceof IStructuredSelection && !selection.isEmpty()) {
-
- ISelection forSelection = forTreeViewer.getSelection();
- if (forSelection != null) {
- if (forSelection instanceof ITreeSelection) {
-
- AbstractSelection selectionItem = (AbstractSelection) ((ITreeSelection) forSelection).getFirstElement();
- if (selectionItem != null) {
-
- EReference eReference = (EReference) ((IStructuredSelection) selection).getFirstElement();
-
- Object value = selectionItem.getElement().eGet(eReference);
-
- List<EObject> valueToShow = new ArrayList<EObject>();
- if (value instanceof List) {
- valueToShow.addAll((Collection<? extends EObject>) value);
- } else if (value instanceof EObject) {
- valueToShow.add((EObject) value);
- }
-
- ListSelectionDialog dlg = new ListSelectionDialog(getSite().getShell(), valueToShow, new ElementsAvailableContentProvider(), new AdapterFactoryLabelProvider(adapterFactory), Messages.DiagramTemplateEditor_108);
- dlg.setTitle(Messages.DiagramTemplateEditor_109);
- dlg.open();
-
- Object[] results = dlg.getResult();
- if (results != null) {
-
- for (Object object : results) {
- if (object instanceof EObject) {
-
- if (!containsElement((EObject) object, selectionItem.getSelectionRef())) {
- SelectionRef selectionRef = diagramtemplateFactory.createSelectionRef();
-
- selectionRef.setKind(SelectionKind.SPECIFIC);
- selectionRef.setElement((EObject) object);
- selectionRef.setEReference(eReference);
- selectionRef.setStereotypedBy(""); //$NON-NLS-1$
- selectionRef.setSubTypes(false);
-
- AddCommand command = new AddCommand(editingDomain, selectionItem, selectionItem.eClass().getEStructuralFeature("selectionRef"), selectionRef); //$NON-NLS-1$
- editingDomain.getCommandStack().execute(command);
- }
- }
- }
- }
- }
-
- }
-
- forTreeViewer.refresh();
-
- }
- }
- }
- }
-
- });
- specificWhatButton.setText(Messages.DiagramTemplateEditor_112);
- specificWhatButton.setEnabled(false);
-
- whatTableViewer = new TableViewer(whatPartComposite, SWT.BORDER | SWT.FULL_SELECTION);
- whatTable = whatTableViewer.getTable();
- whatTableViewer.setContentProvider(new WhatContentProvider());
- whatTableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
- whatTable.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
-
- // Balance the sashForm
- selectionPartSashForm.setWeights(new int[] { 1, 1 });
- }
-
- private void createEditionPart(Composite parent) {
- SashForm editionPartSashForm = new SashForm(parent, SWT.VERTICAL);
-
- createDiagramInformationPart(editionPartSashForm);
- createSelectionPart(editionPartSashForm);
-
- // Balance the sashForm
- editionPartSashForm.setWeights(new int[] { 1, 1 });
- }
-
- private void createTemplatePart(Composite parent) {
- SashForm templatePartSashForm = new SashForm(parent, SWT.NONE);
- templatePartSashForm.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
-
- createDiagramDefinitionPart(templatePartSashForm);
- createEditionPart(templatePartSashForm);
-
- // Balance the sashForm
- templatePartSashForm.setWeights(new int[] { 140, 808 });
- }
-
- @Override
- public void createPartControl(Composite parent) {
-
- if (createModel()) {
-
- parent.setLayout(new GridLayout(1, false));
-
- createloadPart(parent);
- createTemplatePart(parent);
-
- // Create the initial diagram definition
- createNewDiagramDefinition();
-
- if (targetModelResource != null) {
- targetModelPathText.setText(targetModelResource.getURI().toString());
- selectRootButton.setEnabled(true);
- loadModelButton.setEnabled(false);
- specificForButton.setEnabled(true);
- executeButton.setEnabled(true);
- } else {
- clearTemplate();
- }
- }
- }
-
- @Override
- public void setFocus() {
- }
-}
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/src/org/eclipse/papyrus/diagramtemplate/editor/DiagramTemplateEditorPlugin.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/src/org/eclipse/papyrus/diagramtemplate/editor/DiagramTemplateEditorPlugin.java
deleted file mode 100755
index ac48a00..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/src/org/eclipse/papyrus/diagramtemplate/editor/DiagramTemplateEditorPlugin.java
+++ /dev/null
@@ -1,108 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate.editor;
-
-import org.eclipse.emf.common.EMFPlugin;
-import org.eclipse.emf.common.ui.EclipseUIPlugin;
-import org.eclipse.emf.common.util.ResourceLocator;
-
-/**
- * This is the central singleton for the DiagramTemplate editor plugin.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
-public final class DiagramTemplateEditorPlugin extends EMFPlugin {
-
- /**
- * Keep track of the singleton.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public static final DiagramTemplateEditorPlugin INSTANCE = new DiagramTemplateEditorPlugin();
-
- /**
- * 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 DiagramTemplateEditorPlugin() {
- super(new ResourceLocator[] {});
- }
-
- /**
- * Returns the singleton instance of the Eclipse plugin.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the singleton instance.
- * @generated
- */
- @Override
- public ResourceLocator getPluginResourceLocator() {
- return plugin;
- }
-
- /**
- * Returns the singleton instance of the Eclipse plugin.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the singleton instance.
- * @generated
- */
- public static Implementation getPlugin() {
- return plugin;
- }
-
- /**
- * The actual implementation of the Eclipse <b>Plugin</b>.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public static class Implementation extends EclipseUIPlugin {
-
- /**
- * Creates an instance.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public Implementation() {
- super();
-
- // Remember the static instance.
- //
- plugin = this;
- }
- }
-
-
-}
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/src/org/eclipse/papyrus/diagramtemplate/editor/DiagramTemplateModelWizard.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/src/org/eclipse/papyrus/diagramtemplate/editor/DiagramTemplateModelWizard.java
deleted file mode 100755
index 9c4b582..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate.editor/src/org/eclipse/papyrus/diagramtemplate/editor/DiagramTemplateModelWizard.java
+++ /dev/null
@@ -1,626 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate.editor;
-
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.CommonPlugin;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EClassifier;
-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.emf.ecore.xmi.XMLResource;
-import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry;
-import org.eclipse.jface.dialogs.MessageDialog;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.wizard.Wizard;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplateFactory;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage;
-import org.eclipse.ui.INewWizard;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.actions.WorkspaceModifyOperation;
-import org.eclipse.ui.dialogs.WizardNewFileCreationPage;
-import org.eclipse.ui.part.FileEditorInput;
-import org.eclipse.ui.part.ISetSelectionTarget;
-
-
-/**
- * This is a simple wizard for creating a new model file.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
-public class DiagramTemplateModelWizard extends Wizard implements INewWizard {
-
- /**
- * The supported extensions for created files.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public static final List<String> FILE_EXTENSIONS = Collections.unmodifiableList(Arrays.asList(DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_DiagramTemplateEditorFilenameExtensions").split("\\s*,\\s*")));
-
- /**
- * A formatted list of supported file extensions, suitable for display.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public static final String FORMATTED_FILE_EXTENSIONS = DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_DiagramTemplateEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", ");
-
- /**
- * This caches an instance of the model package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected DiagramTemplatePackage diagramtemplatePackage = DiagramTemplatePackage.eINSTANCE;
-
- /**
- * This caches an instance of the model factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected DiagramTemplateFactory diagramtemplateFactory = diagramtemplatePackage.getDiagramTemplateFactory();
-
- /**
- * This is the file creation page.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected DiagramTemplateModelWizardNewFileCreationPage newFileCreationPage;
-
- // /**
- // * This is the initial object creation page.
- // * <!-- begin-user-doc -->
- // * <!-- end-user-doc -->
- // *
- // * @generated
- // */
- // protected DiagramTemplateModelWizardInitialObjectCreationPage initialObjectCreationPage;
-
- /**
- * Remember the selection during initialization for populating the default container.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected IStructuredSelection selection;
-
- /**
- * Remember the workbench during initialization.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected IWorkbench workbench;
-
- /**
- * Caches the names of the types that can be created as the root object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected List<String> initialObjectNames;
-
- /**
- * This just records the information.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void init(IWorkbench workbench, IStructuredSelection selection) {
- this.workbench = workbench;
- this.selection = selection;
- setWindowTitle(DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_Wizard_label"));
- setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(DiagramTemplateEditorPlugin.INSTANCE.getImage("full/wizban/NewDiagramTemplate")));
- }
-
- /**
- * Returns the names of the types that can be created as the root object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected Collection<String> getInitialObjectNames() {
- if (initialObjectNames == null) {
- initialObjectNames = new ArrayList<String>();
- for (EClassifier eClassifier : diagramtemplatePackage.getEClassifiers()) {
- if (eClassifier instanceof EClass) {
- EClass eClass = (EClass) eClassifier;
- if (!eClass.isAbstract()) {
- initialObjectNames.add(eClass.getName());
- }
- }
- }
- Collections.sort(initialObjectNames, CommonPlugin.INSTANCE.getComparator());
- }
- return initialObjectNames;
- }
-
- /**
- * Create a new model.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated NOT
- */
- protected EObject createInitialModel() {
- EClass eClass = diagramtemplatePackage.getTemplate();
- EObject rootObject = diagramtemplateFactory.create(eClass);
- return rootObject;
- }
-
- /**
- * Do the work after everything is specified.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated NOT
- */
- @Override
- public boolean performFinish() {
- try {
- // Remember the file.
- //
- final IFile modelFile = getModelFile();
-
- // Do the work within an operation.
- //
- WorkspaceModifyOperation operation = new WorkspaceModifyOperation() {
-
- @Override
- protected void execute(IProgressMonitor progressMonitor) {
- try {
- // Create a resource set
- //
- ResourceSet resourceSet = new ResourceSetImpl();
-
- // Get the URI of the model file.
- //
- URI fileURI = URI.createPlatformResourceURI(modelFile.getFullPath().toString(), true);
-
- // Create a resource for this file.
- //
- Resource resource = resourceSet.createResource(fileURI);
-
- // Add the initial model object to the contents.
- //
- EObject rootObject = createInitialModel();
- if (rootObject != null) {
- resource.getContents().add(rootObject);
- }
-
- // Save the contents of the resource to the file system.
- //
- Map<Object, Object> options = new HashMap<Object, Object>();
- options.put(XMLResource.OPTION_ENCODING, "UTF-8");
- resource.save(options);
- } catch (Exception exception) {
- DiagramTemplateEditorPlugin.INSTANCE.log(exception);
- } finally {
- progressMonitor.done();
- }
- }
- };
-
- getContainer().run(false, false, operation);
-
- // Select the new file resource in the current view.
- //
- IWorkbenchWindow workbenchWindow = workbench.getActiveWorkbenchWindow();
- IWorkbenchPage page = workbenchWindow.getActivePage();
- final IWorkbenchPart activePart = page.getActivePart();
- if (activePart instanceof ISetSelectionTarget) {
- final ISelection targetSelection = new StructuredSelection(modelFile);
- getShell().getDisplay().asyncExec(new Runnable() {
-
- public void run() {
- ((ISetSelectionTarget) activePart).selectReveal(targetSelection);
- }
- });
- }
-
- // Open an editor on the new file.
- //
- try {
- page.openEditor(new FileEditorInput(modelFile), workbench.getEditorRegistry().getDefaultEditor(modelFile.getFullPath().toString()).getId());
- } catch (PartInitException exception) {
- MessageDialog.openError(workbenchWindow.getShell(), DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage());
- return false;
- }
-
- return true;
- } catch (Exception exception) {
- DiagramTemplateEditorPlugin.INSTANCE.log(exception);
- return false;
- }
- }
-
- /**
- * This is the one page of the wizard.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public class DiagramTemplateModelWizardNewFileCreationPage extends WizardNewFileCreationPage {
-
- /**
- * Pass in the selection.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public DiagramTemplateModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) {
- super(pageId, selection);
- }
-
- /**
- * The framework calls this to see if the file is correct.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- protected boolean validatePage() {
- if (super.validatePage()) {
- String extension = new Path(getFileName()).getFileExtension();
- if (extension == null || !FILE_EXTENSIONS.contains(extension)) {
- String key = FILE_EXTENSIONS.size() > 1 ? "_WARN_FilenameExtensions" : "_WARN_FilenameExtension";
- setErrorMessage(DiagramTemplateEditorPlugin.INSTANCE.getString(key, new Object[] { FORMATTED_FILE_EXTENSIONS }));
- return false;
- }
- return true;
- }
- return false;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public IFile getModelFile() {
- return ResourcesPlugin.getWorkspace().getRoot().getFile(getContainerFullPath().append(getFileName()));
- }
- }
-
- // /**
- // * This is the page where the type of object to create is selected.
- // * <!-- begin-user-doc -->
- // * <!-- end-user-doc -->
- // *
- // * @generated
- // */
- // public class DiagramTemplateModelWizardInitialObjectCreationPage extends WizardPage {
- //
- // /**
- // * <!-- begin-user-doc -->
- // * <!-- end-user-doc -->
- // *
- // * @generated
- // */
- // protected Combo initialObjectField;
- //
- // /**
- // * @generated
- // * <!-- begin-user-doc -->
- // * <!-- end-user-doc -->
- // */
- // protected List<String> encodings;
- //
- // /**
- // * <!-- begin-user-doc -->
- // * <!-- end-user-doc -->
- // *
- // * @generated
- // */
- // protected Combo encodingField;
- //
- // /**
- // * Pass in the selection.
- // * <!-- begin-user-doc -->
- // * <!-- end-user-doc -->
- // *
- // * @generated
- // */
- // public DiagramTemplateModelWizardInitialObjectCreationPage(String pageId) {
- // super(pageId);
- // }
- //
- // /**
- // * <!-- begin-user-doc -->
- // * <!-- end-user-doc -->
- // *
- // * @generated
- // */
- // public void createControl(Composite parent) {
- // Composite composite = new Composite(parent, SWT.NONE);
- // {
- // GridLayout layout = new GridLayout();
- // layout.numColumns = 1;
- // layout.verticalSpacing = 12;
- // composite.setLayout(layout);
- //
- // GridData data = new GridData();
- // data.verticalAlignment = GridData.FILL;
- // data.grabExcessVerticalSpace = true;
- // data.horizontalAlignment = GridData.FILL;
- // composite.setLayoutData(data);
- // }
- //
- // Label containerLabel = new Label(composite, SWT.LEFT);
- // {
- // containerLabel.setText(DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_ModelObject"));
- //
- // GridData data = new GridData();
- // data.horizontalAlignment = GridData.FILL;
- // containerLabel.setLayoutData(data);
- // }
- //
- // initialObjectField = new Combo(composite, SWT.BORDER);
- // {
- // GridData data = new GridData();
- // data.horizontalAlignment = GridData.FILL;
- // data.grabExcessHorizontalSpace = true;
- // initialObjectField.setLayoutData(data);
- // }
- //
- // for(String objectName : getInitialObjectNames()) {
- // initialObjectField.add(getLabel(objectName));
- // }
- //
- // if(initialObjectField.getItemCount() == 1) {
- // initialObjectField.select(0);
- // }
- // initialObjectField.addModifyListener(validator);
- //
- // Label encodingLabel = new Label(composite, SWT.LEFT);
- // {
- // encodingLabel.setText(DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_XMLEncoding"));
- //
- // GridData data = new GridData();
- // data.horizontalAlignment = GridData.FILL;
- // encodingLabel.setLayoutData(data);
- // }
- // encodingField = new Combo(composite, SWT.BORDER);
- // {
- // GridData data = new GridData();
- // data.horizontalAlignment = GridData.FILL;
- // data.grabExcessHorizontalSpace = true;
- // encodingField.setLayoutData(data);
- // }
- //
- // for(String encoding : getEncodings()) {
- // encodingField.add(encoding);
- // }
- //
- // encodingField.select(0);
- // encodingField.addModifyListener(validator);
- //
- // setPageComplete(validatePage());
- // setControl(composite);
- // }
- //
- // /**
- // * <!-- begin-user-doc -->
- // * <!-- end-user-doc -->
- // *
- // * @generated
- // */
- // protected ModifyListener validator = new ModifyListener() {
- //
- // public void modifyText(ModifyEvent e) {
- // setPageComplete(validatePage());
- // }
- // };
- //
- // /**
- // * <!-- begin-user-doc -->
- // * <!-- end-user-doc -->
- // *
- // * @generated
- // */
- // protected boolean validatePage() {
- // return getInitialObjectName() != null && getEncodings().contains(encodingField.getText());
- // }
- //
- // /**
- // * <!-- begin-user-doc -->
- // * <!-- end-user-doc -->
- // *
- // * @generated
- // */
- // @Override
- // public void setVisible(boolean visible) {
- // super.setVisible(visible);
- // if(visible) {
- // if(initialObjectField.getItemCount() == 1) {
- // initialObjectField.clearSelection();
- // encodingField.setFocus();
- // } else {
- // encodingField.clearSelection();
- // initialObjectField.setFocus();
- // }
- // }
- // }
- //
- // /**
- // * <!-- begin-user-doc -->
- // * <!-- end-user-doc -->
- // *
- // * @generated
- // */
- // public String getInitialObjectName() {
- // String label = initialObjectField.getText();
- //
- // for(String name : getInitialObjectNames()) {
- // if(getLabel(name).equals(label)) {
- // return name;
- // }
- // }
- // return null;
- // }
- //
- // /**
- // * <!-- begin-user-doc -->
- // * <!-- end-user-doc -->
- // *
- // * @generated
- // */
- // public String getEncoding() {
- // return encodingField.getText();
- // }
- //
- // /**
- // * Returns the label for the specified type name.
- // * <!-- begin-user-doc -->
- // * <!-- end-user-doc -->
- // *
- // * @generated
- // */
- // protected String getLabel(String typeName) {
- // try {
- // return DiagramTemplateEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type");
- // } catch (MissingResourceException mre) {
- // DiagramTemplateEditorPlugin.INSTANCE.log(mre);
- // }
- // return typeName;
- // }
- //
- // /**
- // * <!-- begin-user-doc -->
- // * <!-- end-user-doc -->
- // *
- // * @generated
- // */
- // protected Collection<String> getEncodings() {
- // if(encodings == null) {
- // encodings = new ArrayList<String>();
- // for(StringTokenizer stringTokenizer = new StringTokenizer(DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer.hasMoreTokens();) {
- // encodings.add(stringTokenizer.nextToken());
- // }
- // }
- // return encodings;
- // }
- // }
-
- /**
- * The framework calls this to create the contents of the wizard.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated NOT
- */
- @Override
- public void addPages() {
- // Create a page, set the title, and the initial model file name.
- //
- newFileCreationPage = new DiagramTemplateModelWizardNewFileCreationPage("Whatever", selection);
- newFileCreationPage.setTitle(DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_DiagramTemplateModelWizard_label"));
- newFileCreationPage.setDescription(DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_DiagramTemplateModelWizard_description"));
- newFileCreationPage.setFileName(DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_DiagramTemplateEditorFilenameDefaultBase") + "." + FILE_EXTENSIONS.get(0));
- addPage(newFileCreationPage);
-
- // Try and get the resource selection to determine a current directory for the file dialog.
- //
- if (selection != null && !selection.isEmpty()) {
- // Get the resource...
- //
- Object selectedElement = selection.iterator().next();
- if (selectedElement instanceof IResource) {
- // Get the resource parent, if its a file.
- //
- IResource selectedResource = (IResource) selectedElement;
- if (selectedResource.getType() == IResource.FILE) {
- selectedResource = selectedResource.getParent();
- }
-
- // This gives us a directory...
- //
- if (selectedResource instanceof IFolder || selectedResource instanceof IProject) {
- // Set this for the container.
- //
- newFileCreationPage.setContainerFullPath(selectedResource.getFullPath());
-
- // Make up a unique new name here.
- //
- String defaultModelBaseFilename = DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_DiagramTemplateEditorFilenameDefaultBase");
- String defaultModelFilenameExtension = FILE_EXTENSIONS.get(0);
- String modelFilename = defaultModelBaseFilename + "." + defaultModelFilenameExtension;
- for (int i = 1; ((IContainer) selectedResource).findMember(modelFilename) != null; ++i) {
- modelFilename = defaultModelBaseFilename + i + "." + defaultModelFilenameExtension;
- }
- newFileCreationPage.setFileName(modelFilename);
- }
- }
- }
- // initialObjectCreationPage = new DiagramTemplateModelWizardInitialObjectCreationPage("Whatever2");
- // initialObjectCreationPage.setTitle(DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_DiagramTemplateModelWizard_label"));
- // initialObjectCreationPage.setDescription(DiagramTemplateEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description"));
- // addPage(initialObjectCreationPage);
- }
-
- /**
- * Get the file from the page.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public IFile getModelFile() {
- return newFileCreationPage.getModelFile();
- }
-
-}
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/AbstractSelection.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/AbstractSelection.java
deleted file mode 100755
index 7ddc245..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/AbstractSelection.java
+++ /dev/null
@@ -1,170 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Abstract Selection</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.AbstractSelection#getElement <em>Element</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.AbstractSelection#getKind <em>Kind</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.AbstractSelection#getSelectionRef <em>Selection Ref</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.AbstractSelection#isSubTypes <em>Sub Types</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.AbstractSelection#getStereotypedBy <em>Stereotyped By</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getAbstractSelection()
- * @model abstract="true"
- * @generated
- */
-public interface AbstractSelection extends EObject {
- /**
- * 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(EObject)
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getAbstractSelection_Element()
- * @model
- * @generated
- */
- EObject getElement();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.diagramtemplate.AbstractSelection#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(EObject value);
-
- /**
- * Returns the value of the '<em><b>Kind</b></em>' attribute.
- * The literals are from the enumeration {@link org.eclipse.papyrus.diagramtemplate.SelectionKind}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Kind</em>' attribute isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Kind</em>' attribute.
- * @see org.eclipse.papyrus.diagramtemplate.SelectionKind
- * @see #setKind(SelectionKind)
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getAbstractSelection_Kind()
- * @model required="true"
- * @generated
- */
- SelectionKind getKind();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.diagramtemplate.AbstractSelection#getKind <em>Kind</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Kind</em>' attribute.
- * @see org.eclipse.papyrus.diagramtemplate.SelectionKind
- * @see #getKind()
- * @generated
- */
- void setKind(SelectionKind value);
-
- /**
- * Returns the value of the '<em><b>Selection Ref</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.papyrus.diagramtemplate.SelectionRef}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Selection Ref</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>Selection Ref</em>' containment reference list.
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getAbstractSelection_SelectionRef()
- * @model containment="true"
- * @generated
- */
- EList<SelectionRef> getSelectionRef();
-
- /**
- * Returns the value of the '<em><b>Sub Types</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Sub Types</em>' attribute isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Sub Types</em>' attribute.
- * @see #setSubTypes(boolean)
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getAbstractSelection_SubTypes()
- * @model required="true"
- * @generated
- */
- boolean isSubTypes();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.diagramtemplate.AbstractSelection#isSubTypes <em>Sub Types</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Sub Types</em>' attribute.
- * @see #isSubTypes()
- * @generated
- */
- void setSubTypes(boolean value);
-
- /**
- * Returns the value of the '<em><b>Stereotyped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Stereotyped By</em>' attribute isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Stereotyped By</em>' attribute.
- * @see #setStereotypedBy(String)
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getAbstractSelection_StereotypedBy()
- * @model required="true"
- * @generated
- */
- String getStereotypedBy();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.diagramtemplate.AbstractSelection#getStereotypedBy <em>Stereotyped By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Stereotyped By</em>' attribute.
- * @see #getStereotypedBy()
- * @generated
- */
- void setStereotypedBy(String value);
-
-} // AbstractSelection
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/DiagramDefinition.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/DiagramDefinition.java
deleted file mode 100755
index 4e289c9..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/DiagramDefinition.java
+++ /dev/null
@@ -1,225 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Diagram Definition</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getDescription <em>Description</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getFromRoot <em>From Root</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getSelection <em>Selection</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getDiagramKind <em>Diagram Kind</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getLayoutToApply <em>Layout To Apply</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getPrefix <em>Prefix</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getDiagramDefinition()
- * @model
- * @generated
- */
-public interface DiagramDefinition extends EObject {
- /**
- * Returns the value of the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Description</em>' attribute isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Description</em>' attribute.
- * @see #setDescription(String)
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getDiagramDefinition_Description()
- * @model required="true"
- * @generated
- */
- String getDescription();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getDescription <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Description</em>' attribute.
- * @see #getDescription()
- * @generated
- */
- void setDescription(String value);
-
- /**
- * Returns the value of the '<em><b>From Root</b></em>' reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>From Root</em>' reference isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>From Root</em>' reference.
- * @see #setFromRoot(EObject)
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getDiagramDefinition_FromRoot()
- * @model
- * @generated
- */
- EObject getFromRoot();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getFromRoot <em>From Root</em>}' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>From Root</em>' reference.
- * @see #getFromRoot()
- * @generated
- */
- void setFromRoot(EObject value);
-
- /**
- * Returns the value of the '<em><b>Selection</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.papyrus.diagramtemplate.Selection}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Selection</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>Selection</em>' containment reference list.
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getDiagramDefinition_Selection()
- * @model containment="true"
- * @generated
- */
- EList<Selection> getSelection();
-
- /**
- * Returns the value of the '<em><b>Diagram Kind</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Diagram Kind</em>' attribute isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Diagram Kind</em>' attribute.
- * @see #setDiagramKind(String)
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getDiagramDefinition_DiagramKind()
- * @model
- * @generated
- */
- String getDiagramKind();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getDiagramKind <em>Diagram Kind</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Diagram Kind</em>' attribute.
- * @see #getDiagramKind()
- * @generated
- */
- void setDiagramKind(String value);
-
- /**
- * Returns the value of the '<em><b>Layout To Apply</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Layout To Apply</em>' attribute isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Layout To Apply</em>' attribute.
- * @see #setLayoutToApply(String)
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getDiagramDefinition_LayoutToApply()
- * @model
- * @generated
- */
- String getLayoutToApply();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getLayoutToApply <em>Layout To Apply</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Layout To Apply</em>' attribute.
- * @see #getLayoutToApply()
- * @generated
- */
- void setLayoutToApply(String value);
-
- /**
- * Returns the value of the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Name</em>' attribute isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Name</em>' attribute.
- * @see #setName(String)
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getDiagramDefinition_Name()
- * @model required="true"
- * @generated
- */
- String getName();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getName <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Name</em>' attribute.
- * @see #getName()
- * @generated
- */
- void setName(String value);
-
- /**
- * Returns the value of the '<em><b>Prefix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Prefix</em>' attribute isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Prefix</em>' attribute.
- * @see #setPrefix(String)
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getDiagramDefinition_Prefix()
- * @model required="true"
- * @generated
- */
- String getPrefix();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getPrefix <em>Prefix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Prefix</em>' attribute.
- * @see #getPrefix()
- * @generated
- */
- void setPrefix(String value);
-
-} // DiagramDefinition
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/DiagramTemplateFactory.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/DiagramTemplateFactory.java
deleted file mode 100755
index 7388a09..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/DiagramTemplateFactory.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate;
-
-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.diagramtemplate.DiagramTemplatePackage
- * @generated
- */
-public interface DiagramTemplateFactory extends EFactory {
- /**
- * The singleton instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- DiagramTemplateFactory eINSTANCE = org.eclipse.papyrus.diagramtemplate.impl.DiagramTemplateFactoryImpl.init();
-
- /**
- * Returns a new object of class '<em>Diagram Definition</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return a new object of class '<em>Diagram Definition</em>'.
- * @generated
- */
- DiagramDefinition createDiagramDefinition();
-
- /**
- * Returns a new object of class '<em>Selection</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return a new object of class '<em>Selection</em>'.
- * @generated
- */
- Selection createSelection();
-
- /**
- * Returns a new object of class '<em>Selection Ref</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return a new object of class '<em>Selection Ref</em>'.
- * @generated
- */
- SelectionRef createSelectionRef();
-
- /**
- * Returns a new object of class '<em>Template</em>'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return a new object of class '<em>Template</em>'.
- * @generated
- */
- Template createTemplate();
-
- /**
- * Returns the package supported by this factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the package supported by this factory.
- * @generated
- */
- DiagramTemplatePackage getDiagramTemplatePackage();
-
-} // DiagramTemplateFactory
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/DiagramTemplatePackage.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/DiagramTemplatePackage.java
deleted file mode 100755
index a609d34..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/DiagramTemplatePackage.java
+++ /dev/null
@@ -1,945 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-
-/**
- * <!-- 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 enum,</li>
- * <li>and each data type</li>
- * </ul>
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplateFactory
- * @model kind="package"
- * @generated
- */
-public interface DiagramTemplatePackage extends EPackage {
- /**
- * The package name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- String eNAME = "diagramtemplate";
-
- /**
- * The package namespace URI.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- String eNS_URI = "http://www.eclipse.org/papyrus/diagramtemplate";
-
- /**
- * The package namespace name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- String eNS_PREFIX = "diagramtemplate";
-
- /**
- * The singleton instance of the package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- DiagramTemplatePackage eINSTANCE = org.eclipse.papyrus.diagramtemplate.impl.DiagramTemplatePackageImpl.init();
-
- /**
- * The meta object id for the '{@link org.eclipse.papyrus.diagramtemplate.impl.DiagramDefinitionImpl <em>Diagram Definition</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.papyrus.diagramtemplate.impl.DiagramDefinitionImpl
- * @see org.eclipse.papyrus.diagramtemplate.impl.DiagramTemplatePackageImpl#getDiagramDefinition()
- * @generated
- */
- int DIAGRAM_DEFINITION = 0;
-
- /**
- * The feature id for the '<em><b>Description</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DIAGRAM_DEFINITION__DESCRIPTION = 0;
-
- /**
- * The feature id for the '<em><b>From Root</b></em>' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DIAGRAM_DEFINITION__FROM_ROOT = 1;
-
- /**
- * The feature id for the '<em><b>Selection</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DIAGRAM_DEFINITION__SELECTION = 2;
-
- /**
- * The feature id for the '<em><b>Diagram Kind</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DIAGRAM_DEFINITION__DIAGRAM_KIND = 3;
-
- /**
- * The feature id for the '<em><b>Layout To Apply</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DIAGRAM_DEFINITION__LAYOUT_TO_APPLY = 4;
-
- /**
- * The feature id for the '<em><b>Name</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DIAGRAM_DEFINITION__NAME = 5;
-
- /**
- * The feature id for the '<em><b>Prefix</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DIAGRAM_DEFINITION__PREFIX = 6;
-
- /**
- * The number of structural features of the '<em>Diagram Definition</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int DIAGRAM_DEFINITION_FEATURE_COUNT = 7;
-
- /**
- * The meta object id for the '{@link org.eclipse.papyrus.diagramtemplate.impl.AbstractSelectionImpl <em>Abstract Selection</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.papyrus.diagramtemplate.impl.AbstractSelectionImpl
- * @see org.eclipse.papyrus.diagramtemplate.impl.DiagramTemplatePackageImpl#getAbstractSelection()
- * @generated
- */
- int ABSTRACT_SELECTION = 4;
-
- /**
- * The feature id for the '<em><b>Element</b></em>' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int ABSTRACT_SELECTION__ELEMENT = 0;
-
- /**
- * The feature id for the '<em><b>Kind</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int ABSTRACT_SELECTION__KIND = 1;
-
- /**
- * The feature id for the '<em><b>Selection Ref</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int ABSTRACT_SELECTION__SELECTION_REF = 2;
-
- /**
- * The feature id for the '<em><b>Sub Types</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int ABSTRACT_SELECTION__SUB_TYPES = 3;
-
- /**
- * The feature id for the '<em><b>Stereotyped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int ABSTRACT_SELECTION__STEREOTYPED_BY = 4;
-
- /**
- * The number of structural features of the '<em>Abstract Selection</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int ABSTRACT_SELECTION_FEATURE_COUNT = 5;
-
- /**
- * The meta object id for the '{@link org.eclipse.papyrus.diagramtemplate.impl.SelectionImpl <em>Selection</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.papyrus.diagramtemplate.impl.SelectionImpl
- * @see org.eclipse.papyrus.diagramtemplate.impl.DiagramTemplatePackageImpl#getSelection()
- * @generated
- */
- int SELECTION = 1;
-
- /**
- * The feature id for the '<em><b>Element</b></em>' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int SELECTION__ELEMENT = ABSTRACT_SELECTION__ELEMENT;
-
- /**
- * The feature id for the '<em><b>Kind</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int SELECTION__KIND = ABSTRACT_SELECTION__KIND;
-
- /**
- * The feature id for the '<em><b>Selection Ref</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int SELECTION__SELECTION_REF = ABSTRACT_SELECTION__SELECTION_REF;
-
- /**
- * The feature id for the '<em><b>Sub Types</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int SELECTION__SUB_TYPES = ABSTRACT_SELECTION__SUB_TYPES;
-
- /**
- * The feature id for the '<em><b>Stereotyped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int SELECTION__STEREOTYPED_BY = ABSTRACT_SELECTION__STEREOTYPED_BY;
-
- /**
- * The feature id for the '<em><b>Recursively</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int SELECTION__RECURSIVELY = ABSTRACT_SELECTION_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Selection</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int SELECTION_FEATURE_COUNT = ABSTRACT_SELECTION_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.papyrus.diagramtemplate.impl.SelectionRefImpl <em>Selection Ref</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.papyrus.diagramtemplate.impl.SelectionRefImpl
- * @see org.eclipse.papyrus.diagramtemplate.impl.DiagramTemplatePackageImpl#getSelectionRef()
- * @generated
- */
- int SELECTION_REF = 2;
-
- /**
- * The feature id for the '<em><b>Element</b></em>' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int SELECTION_REF__ELEMENT = ABSTRACT_SELECTION__ELEMENT;
-
- /**
- * The feature id for the '<em><b>Kind</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int SELECTION_REF__KIND = ABSTRACT_SELECTION__KIND;
-
- /**
- * The feature id for the '<em><b>Selection Ref</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int SELECTION_REF__SELECTION_REF = ABSTRACT_SELECTION__SELECTION_REF;
-
- /**
- * The feature id for the '<em><b>Sub Types</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int SELECTION_REF__SUB_TYPES = ABSTRACT_SELECTION__SUB_TYPES;
-
- /**
- * The feature id for the '<em><b>Stereotyped By</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int SELECTION_REF__STEREOTYPED_BY = ABSTRACT_SELECTION__STEREOTYPED_BY;
-
- /**
- * The feature id for the '<em><b>EReference</b></em>' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int SELECTION_REF__EREFERENCE = ABSTRACT_SELECTION_FEATURE_COUNT + 0;
-
- /**
- * The number of structural features of the '<em>Selection Ref</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int SELECTION_REF_FEATURE_COUNT = ABSTRACT_SELECTION_FEATURE_COUNT + 1;
-
- /**
- * The meta object id for the '{@link org.eclipse.papyrus.diagramtemplate.impl.TemplateImpl <em>Template</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.papyrus.diagramtemplate.impl.TemplateImpl
- * @see org.eclipse.papyrus.diagramtemplate.impl.DiagramTemplatePackageImpl#getTemplate()
- * @generated
- */
- int TEMPLATE = 3;
-
- /**
- * The feature id for the '<em><b>Diagram Definitions</b></em>' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int TEMPLATE__DIAGRAM_DEFINITIONS = 0;
-
- /**
- * The feature id for the '<em><b>Target Root</b></em>' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int TEMPLATE__TARGET_ROOT = 1;
-
- /**
- * The number of structural features of the '<em>Template</em>' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- * @ordered
- */
- int TEMPLATE_FEATURE_COUNT = 2;
-
- /**
- * The meta object id for the '{@link org.eclipse.papyrus.diagramtemplate.SelectionKind <em>Selection Kind</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.papyrus.diagramtemplate.SelectionKind
- * @see org.eclipse.papyrus.diagramtemplate.impl.DiagramTemplatePackageImpl#getSelectionKind()
- * @generated
- */
- int SELECTION_KIND = 5;
-
-
- /**
- * Returns the meta object for class '{@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition <em>Diagram Definition</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Diagram Definition</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.DiagramDefinition
- * @generated
- */
- EClass getDiagramDefinition();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getDescription <em>Description</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Description</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getDescription()
- * @see #getDiagramDefinition()
- * @generated
- */
- EAttribute getDiagramDefinition_Description();
-
- /**
- * Returns the meta object for the reference '{@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getFromRoot <em>From Root</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for the reference '<em>From Root</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getFromRoot()
- * @see #getDiagramDefinition()
- * @generated
- */
- EReference getDiagramDefinition_FromRoot();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getSelection <em>Selection</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for the containment reference list '<em>Selection</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getSelection()
- * @see #getDiagramDefinition()
- * @generated
- */
- EReference getDiagramDefinition_Selection();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getDiagramKind <em>Diagram Kind</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Diagram Kind</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getDiagramKind()
- * @see #getDiagramDefinition()
- * @generated
- */
- EAttribute getDiagramDefinition_DiagramKind();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getLayoutToApply <em>Layout To Apply</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Layout To Apply</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getLayoutToApply()
- * @see #getDiagramDefinition()
- * @generated
- */
- EAttribute getDiagramDefinition_LayoutToApply();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getName <em>Name</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Name</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getName()
- * @see #getDiagramDefinition()
- * @generated
- */
- EAttribute getDiagramDefinition_Name();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getPrefix <em>Prefix</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Prefix</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.DiagramDefinition#getPrefix()
- * @see #getDiagramDefinition()
- * @generated
- */
- EAttribute getDiagramDefinition_Prefix();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.papyrus.diagramtemplate.Selection <em>Selection</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Selection</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.Selection
- * @generated
- */
- EClass getSelection();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.papyrus.diagramtemplate.Selection#isRecursively <em>Recursively</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Recursively</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.Selection#isRecursively()
- * @see #getSelection()
- * @generated
- */
- EAttribute getSelection_Recursively();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.papyrus.diagramtemplate.SelectionRef <em>Selection Ref</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Selection Ref</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.SelectionRef
- * @generated
- */
- EClass getSelectionRef();
-
- /**
- * Returns the meta object for the reference '{@link org.eclipse.papyrus.diagramtemplate.SelectionRef#getEReference <em>EReference</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for the reference '<em>EReference</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.SelectionRef#getEReference()
- * @see #getSelectionRef()
- * @generated
- */
- EReference getSelectionRef_EReference();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.papyrus.diagramtemplate.Template <em>Template</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Template</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.Template
- * @generated
- */
- EClass getTemplate();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.diagramtemplate.Template#getDiagramDefinitions <em>Diagram Definitions</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for the containment reference list '<em>Diagram Definitions</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.Template#getDiagramDefinitions()
- * @see #getTemplate()
- * @generated
- */
- EReference getTemplate_DiagramDefinitions();
-
- /**
- * Returns the meta object for the reference '{@link org.eclipse.papyrus.diagramtemplate.Template#getTargetRoot <em>Target Root</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for the reference '<em>Target Root</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.Template#getTargetRoot()
- * @see #getTemplate()
- * @generated
- */
- EReference getTemplate_TargetRoot();
-
- /**
- * Returns the meta object for class '{@link org.eclipse.papyrus.diagramtemplate.AbstractSelection <em>Abstract Selection</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for class '<em>Abstract Selection</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.AbstractSelection
- * @generated
- */
- EClass getAbstractSelection();
-
- /**
- * Returns the meta object for the reference '{@link org.eclipse.papyrus.diagramtemplate.AbstractSelection#getElement <em>Element</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for the reference '<em>Element</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.AbstractSelection#getElement()
- * @see #getAbstractSelection()
- * @generated
- */
- EReference getAbstractSelection_Element();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.papyrus.diagramtemplate.AbstractSelection#getKind <em>Kind</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Kind</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.AbstractSelection#getKind()
- * @see #getAbstractSelection()
- * @generated
- */
- EAttribute getAbstractSelection_Kind();
-
- /**
- * Returns the meta object for the containment reference list '{@link org.eclipse.papyrus.diagramtemplate.AbstractSelection#getSelectionRef <em>Selection Ref</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for the containment reference list '<em>Selection Ref</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.AbstractSelection#getSelectionRef()
- * @see #getAbstractSelection()
- * @generated
- */
- EReference getAbstractSelection_SelectionRef();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.papyrus.diagramtemplate.AbstractSelection#isSubTypes <em>Sub Types</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Sub Types</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.AbstractSelection#isSubTypes()
- * @see #getAbstractSelection()
- * @generated
- */
- EAttribute getAbstractSelection_SubTypes();
-
- /**
- * Returns the meta object for the attribute '{@link org.eclipse.papyrus.diagramtemplate.AbstractSelection#getStereotypedBy <em>Stereotyped By</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for the attribute '<em>Stereotyped By</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.AbstractSelection#getStereotypedBy()
- * @see #getAbstractSelection()
- * @generated
- */
- EAttribute getAbstractSelection_StereotypedBy();
-
- /**
- * Returns the meta object for enum '{@link org.eclipse.papyrus.diagramtemplate.SelectionKind <em>Selection Kind</em>}'.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @return the meta object for enum '<em>Selection Kind</em>'.
- * @see org.eclipse.papyrus.diagramtemplate.SelectionKind
- * @generated
- */
- EEnum getSelectionKind();
-
- /**
- * 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
- */
- DiagramTemplateFactory getDiagramTemplateFactory();
-
- /**
- * <!-- 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 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.diagramtemplate.impl.DiagramDefinitionImpl <em>Diagram Definition</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.papyrus.diagramtemplate.impl.DiagramDefinitionImpl
- * @see org.eclipse.papyrus.diagramtemplate.impl.DiagramTemplatePackageImpl#getDiagramDefinition()
- * @generated
- */
- EClass DIAGRAM_DEFINITION = eINSTANCE.getDiagramDefinition();
-
- /**
- * The meta object literal for the '<em><b>Description</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- EAttribute DIAGRAM_DEFINITION__DESCRIPTION = eINSTANCE.getDiagramDefinition_Description();
-
- /**
- * The meta object literal for the '<em><b>From Root</b></em>' reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- EReference DIAGRAM_DEFINITION__FROM_ROOT = eINSTANCE.getDiagramDefinition_FromRoot();
-
- /**
- * The meta object literal for the '<em><b>Selection</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- EReference DIAGRAM_DEFINITION__SELECTION = eINSTANCE.getDiagramDefinition_Selection();
-
- /**
- * The meta object literal for the '<em><b>Diagram Kind</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- EAttribute DIAGRAM_DEFINITION__DIAGRAM_KIND = eINSTANCE.getDiagramDefinition_DiagramKind();
-
- /**
- * The meta object literal for the '<em><b>Layout To Apply</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- EAttribute DIAGRAM_DEFINITION__LAYOUT_TO_APPLY = eINSTANCE.getDiagramDefinition_LayoutToApply();
-
- /**
- * The meta object literal for the '<em><b>Name</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- EAttribute DIAGRAM_DEFINITION__NAME = eINSTANCE.getDiagramDefinition_Name();
-
- /**
- * The meta object literal for the '<em><b>Prefix</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- EAttribute DIAGRAM_DEFINITION__PREFIX = eINSTANCE.getDiagramDefinition_Prefix();
-
- /**
- * The meta object literal for the '{@link org.eclipse.papyrus.diagramtemplate.impl.SelectionImpl <em>Selection</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.papyrus.diagramtemplate.impl.SelectionImpl
- * @see org.eclipse.papyrus.diagramtemplate.impl.DiagramTemplatePackageImpl#getSelection()
- * @generated
- */
- EClass SELECTION = eINSTANCE.getSelection();
-
- /**
- * The meta object literal for the '<em><b>Recursively</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- EAttribute SELECTION__RECURSIVELY = eINSTANCE.getSelection_Recursively();
-
- /**
- * The meta object literal for the '{@link org.eclipse.papyrus.diagramtemplate.impl.SelectionRefImpl <em>Selection Ref</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.papyrus.diagramtemplate.impl.SelectionRefImpl
- * @see org.eclipse.papyrus.diagramtemplate.impl.DiagramTemplatePackageImpl#getSelectionRef()
- * @generated
- */
- EClass SELECTION_REF = eINSTANCE.getSelectionRef();
-
- /**
- * The meta object literal for the '<em><b>EReference</b></em>' reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- EReference SELECTION_REF__EREFERENCE = eINSTANCE.getSelectionRef_EReference();
-
- /**
- * The meta object literal for the '{@link org.eclipse.papyrus.diagramtemplate.impl.TemplateImpl <em>Template</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.papyrus.diagramtemplate.impl.TemplateImpl
- * @see org.eclipse.papyrus.diagramtemplate.impl.DiagramTemplatePackageImpl#getTemplate()
- * @generated
- */
- EClass TEMPLATE = eINSTANCE.getTemplate();
-
- /**
- * The meta object literal for the '<em><b>Diagram Definitions</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- EReference TEMPLATE__DIAGRAM_DEFINITIONS = eINSTANCE.getTemplate_DiagramDefinitions();
-
- /**
- * The meta object literal for the '<em><b>Target Root</b></em>' reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- EReference TEMPLATE__TARGET_ROOT = eINSTANCE.getTemplate_TargetRoot();
-
- /**
- * The meta object literal for the '{@link org.eclipse.papyrus.diagramtemplate.impl.AbstractSelectionImpl <em>Abstract Selection</em>}' class.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.papyrus.diagramtemplate.impl.AbstractSelectionImpl
- * @see org.eclipse.papyrus.diagramtemplate.impl.DiagramTemplatePackageImpl#getAbstractSelection()
- * @generated
- */
- EClass ABSTRACT_SELECTION = eINSTANCE.getAbstractSelection();
-
- /**
- * The meta object literal for the '<em><b>Element</b></em>' reference feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- EReference ABSTRACT_SELECTION__ELEMENT = eINSTANCE.getAbstractSelection_Element();
-
- /**
- * The meta object literal for the '<em><b>Kind</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- EAttribute ABSTRACT_SELECTION__KIND = eINSTANCE.getAbstractSelection_Kind();
-
- /**
- * The meta object literal for the '<em><b>Selection Ref</b></em>' containment reference list feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- EReference ABSTRACT_SELECTION__SELECTION_REF = eINSTANCE.getAbstractSelection_SelectionRef();
-
- /**
- * The meta object literal for the '<em><b>Sub Types</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- EAttribute ABSTRACT_SELECTION__SUB_TYPES = eINSTANCE.getAbstractSelection_SubTypes();
-
- /**
- * The meta object literal for the '<em><b>Stereotyped By</b></em>' attribute feature.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- EAttribute ABSTRACT_SELECTION__STEREOTYPED_BY = eINSTANCE.getAbstractSelection_StereotypedBy();
-
- /**
- * The meta object literal for the '{@link org.eclipse.papyrus.diagramtemplate.SelectionKind <em>Selection Kind</em>}' enum.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.papyrus.diagramtemplate.SelectionKind
- * @see org.eclipse.papyrus.diagramtemplate.impl.DiagramTemplatePackageImpl#getSelectionKind()
- * @generated
- */
- EEnum SELECTION_KIND = eINSTANCE.getSelectionKind();
-
- }
-
-} // DiagramTemplatePackage
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/Selection.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/Selection.java
deleted file mode 100755
index 1a2b82d..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/Selection.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate;
-
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Selection</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.Selection#isRecursively <em>Recursively</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getSelection()
- * @model
- * @generated
- */
-public interface Selection extends AbstractSelection {
- /**
- * Returns the value of the '<em><b>Recursively</b></em>' attribute.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Recursively</em>' attribute isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Recursively</em>' attribute.
- * @see #setRecursively(boolean)
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getSelection_Recursively()
- * @model required="true"
- * @generated
- */
- boolean isRecursively();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.diagramtemplate.Selection#isRecursively <em>Recursively</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Recursively</em>' attribute.
- * @see #isRecursively()
- * @generated
- */
- void setRecursively(boolean value);
-
-} // Selection
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/SelectionKind.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/SelectionKind.java
deleted file mode 100755
index f0669dc..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/SelectionKind.java
+++ /dev/null
@@ -1,273 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate;
-
-import java.util.Arrays;
-import java.util.Collections;
-import java.util.List;
-
-import org.eclipse.emf.common.util.Enumerator;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the literals of the enumeration '<em><b>Selection Kind</b></em>',
- * and utility methods for working with them.
- * <!-- end-user-doc -->
- *
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getSelectionKind()
- * @model
- * @generated
- */
-public enum SelectionKind implements Enumerator {
- /**
- * The '<em><b>For All</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #FOR_ALL_VALUE
- * @generated
- * @ordered
- */
- FOR_ALL(0, "ForAll", "ForAll"),
-
- /**
- * The '<em><b>Specific</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #SPECIFIC_VALUE
- * @generated
- * @ordered
- */
- SPECIFIC(1, "Specific", "Specific"),
-
- /**
- * The '<em><b>Query</b></em>' literal object.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #QUERY_VALUE
- * @generated
- * @ordered
- */
- QUERY(2, "Query", "Query");
-
- /**
- * The '<em><b>For All</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>For All</b></em>' literal object isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #FOR_ALL
- * @model name="ForAll"
- * @generated
- * @ordered
- */
- public static final int FOR_ALL_VALUE = 0;
-
- /**
- * The '<em><b>Specific</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>Specific</b></em>' literal object isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #SPECIFIC
- * @model name="Specific"
- * @generated
- * @ordered
- */
- public static final int SPECIFIC_VALUE = 1;
-
- /**
- * The '<em><b>Query</b></em>' literal value.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of '<em><b>Query</b></em>' literal object isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @see #QUERY
- * @model name="Query"
- * @generated
- * @ordered
- */
- public static final int QUERY_VALUE = 2;
-
- /**
- * An array of all the '<em><b>Selection Kind</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- private static final SelectionKind[] VALUES_ARRAY = new SelectionKind[] {
- FOR_ALL,
- SPECIFIC,
- QUERY,
- };
-
- /**
- * A public read-only list of all the '<em><b>Selection Kind</b></em>' enumerators.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public static final List<SelectionKind> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));
-
- /**
- * Returns the '<em><b>Selection Kind</b></em>' literal with the specified literal value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @param literal
- * the literal.
- * @return the matching enumerator or <code>null</code>.
- * @generated
- */
- public static SelectionKind get(String literal) {
- for (int i = 0; i < VALUES_ARRAY.length; ++i) {
- SelectionKind result = VALUES_ARRAY[i];
- if (result.toString().equals(literal)) {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Selection Kind</b></em>' literal with the specified name.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @param name
- * the name.
- * @return the matching enumerator or <code>null</code>.
- * @generated
- */
- public static SelectionKind getByName(String name) {
- for (int i = 0; i < VALUES_ARRAY.length; ++i) {
- SelectionKind result = VALUES_ARRAY[i];
- if (result.getName().equals(name)) {
- return result;
- }
- }
- return null;
- }
-
- /**
- * Returns the '<em><b>Selection Kind</b></em>' literal with the specified integer value.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @param value
- * the integer value.
- * @return the matching enumerator or <code>null</code>.
- * @generated
- */
- public static SelectionKind get(int value) {
- switch (value) {
- case FOR_ALL_VALUE:
- return FOR_ALL;
- case SPECIFIC_VALUE:
- return SPECIFIC;
- case QUERY_VALUE:
- return QUERY;
- }
- return null;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- private final int value;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- private final String name;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- private final String literal;
-
- /**
- * Only this class can construct instances.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- private SelectionKind(int value, String name, String literal) {
- this.value = value;
- this.name = name;
- this.literal = literal;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public int getValue() {
- return value;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public String getName() {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public String getLiteral() {
- return literal;
- }
-
- /**
- * Returns the literal value of the enumerator, which is its string representation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public String toString() {
- return literal;
- }
-
-} // SelectionKind
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/SelectionRef.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/SelectionRef.java
deleted file mode 100755
index 385ce77..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/SelectionRef.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate;
-
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Selection Ref</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.SelectionRef#getEReference <em>EReference</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getSelectionRef()
- * @model
- * @generated
- */
-public interface SelectionRef extends AbstractSelection {
- /**
- * Returns the value of the '<em><b>EReference</b></em>' reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>EReference</em>' reference isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>EReference</em>' reference.
- * @see #setEReference(EObject)
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getSelectionRef_EReference()
- * @model
- * @generated
- */
- EObject getEReference();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.diagramtemplate.SelectionRef#getEReference <em>EReference</em>}' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>EReference</em>' reference.
- * @see #getEReference()
- * @generated
- */
- void setEReference(EObject value);
-
-} // SelectionRef
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/Template.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/Template.java
deleted file mode 100755
index c0f7b83..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/Template.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate;
-
-import org.eclipse.emf.common.util.EList;
-import org.eclipse.emf.ecore.EObject;
-
-/**
- * <!-- begin-user-doc -->
- * A representation of the model object '<em><b>Template</b></em>'.
- * <!-- end-user-doc -->
- *
- * <p>
- * The following features are supported:
- * <ul>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.Template#getDiagramDefinitions <em>Diagram Definitions</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.Template#getTargetRoot <em>Target Root</em>}</li>
- * </ul>
- * </p>
- *
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getTemplate()
- * @model
- * @generated
- */
-public interface Template extends EObject {
- /**
- * Returns the value of the '<em><b>Diagram Definitions</b></em>' containment reference list.
- * The list contents are of type {@link org.eclipse.papyrus.diagramtemplate.DiagramDefinition}.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Diagram Definitions</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>Diagram Definitions</em>' containment reference list.
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getTemplate_DiagramDefinitions()
- * @model containment="true"
- * @generated
- */
- EList<DiagramDefinition> getDiagramDefinitions();
-
- /**
- * Returns the value of the '<em><b>Target Root</b></em>' reference.
- * <!-- begin-user-doc -->
- * <p>
- * If the meaning of the '<em>Target Root</em>' reference isn't clear, there really should be more of a description here...
- * </p>
- * <!-- end-user-doc -->
- *
- * @return the value of the '<em>Target Root</em>' reference.
- * @see #setTargetRoot(EObject)
- * @see org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage#getTemplate_TargetRoot()
- * @model
- * @generated
- */
- EObject getTargetRoot();
-
- /**
- * Sets the value of the '{@link org.eclipse.papyrus.diagramtemplate.Template#getTargetRoot <em>Target Root</em>}' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @param value
- * the new value of the '<em>Target Root</em>' reference.
- * @see #getTargetRoot()
- * @generated
- */
- void setTargetRoot(EObject value);
-
-} // Template
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/impl/AbstractSelectionImpl.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/impl/AbstractSelectionImpl.java
deleted file mode 100755
index 70493f1..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/impl/AbstractSelectionImpl.java
+++ /dev/null
@@ -1,432 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate.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.EObject;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.papyrus.diagramtemplate.AbstractSelection;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage;
-import org.eclipse.papyrus.diagramtemplate.SelectionKind;
-import org.eclipse.papyrus.diagramtemplate.SelectionRef;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Abstract Selection</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.impl.AbstractSelectionImpl#getElement <em>Element</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.impl.AbstractSelectionImpl#getKind <em>Kind</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.impl.AbstractSelectionImpl#getSelectionRef <em>Selection Ref</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.impl.AbstractSelectionImpl#isSubTypes <em>Sub Types</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.impl.AbstractSelectionImpl#getStereotypedBy <em>Stereotyped By</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public abstract class AbstractSelectionImpl extends EObjectImpl implements AbstractSelection {
- /**
- * The cached value of the '{@link #getElement() <em>Element</em>}' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getElement()
- * @generated
- * @ordered
- */
- protected EObject element;
-
- /**
- * The default value of the '{@link #getKind() <em>Kind</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getKind()
- * @generated
- * @ordered
- */
- protected static final SelectionKind KIND_EDEFAULT = SelectionKind.FOR_ALL;
-
- /**
- * The cached value of the '{@link #getKind() <em>Kind</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getKind()
- * @generated
- * @ordered
- */
- protected SelectionKind kind = KIND_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getSelectionRef() <em>Selection Ref</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getSelectionRef()
- * @generated
- * @ordered
- */
- protected EList<SelectionRef> selectionRef;
-
- /**
- * The default value of the '{@link #isSubTypes() <em>Sub Types</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #isSubTypes()
- * @generated
- * @ordered
- */
- protected static final boolean SUB_TYPES_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isSubTypes() <em>Sub Types</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #isSubTypes()
- * @generated
- * @ordered
- */
- protected boolean subTypes = SUB_TYPES_EDEFAULT;
-
- /**
- * The default value of the '{@link #getStereotypedBy() <em>Stereotyped By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getStereotypedBy()
- * @generated
- * @ordered
- */
- protected static final String STEREOTYPED_BY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getStereotypedBy() <em>Stereotyped By</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getStereotypedBy()
- * @generated
- * @ordered
- */
- protected String stereotypedBy = STEREOTYPED_BY_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected AbstractSelectionImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return DiagramTemplatePackage.Literals.ABSTRACT_SELECTION;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EObject getElement() {
- if (element != null && element.eIsProxy()) {
- InternalEObject oldElement = (InternalEObject) element;
- element = eResolveProxy(oldElement);
- if (element != oldElement) {
- if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, DiagramTemplatePackage.ABSTRACT_SELECTION__ELEMENT, oldElement, element));
- }
- }
- }
- return element;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EObject basicGetElement() {
- return element;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void setElement(EObject newElement) {
- EObject oldElement = element;
- element = newElement;
- if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.SET, DiagramTemplatePackage.ABSTRACT_SELECTION__ELEMENT, oldElement, element));
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public SelectionKind getKind() {
- return kind;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void setKind(SelectionKind newKind) {
- SelectionKind oldKind = kind;
- kind = newKind == null ? KIND_EDEFAULT : newKind;
- if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.SET, DiagramTemplatePackage.ABSTRACT_SELECTION__KIND, oldKind, kind));
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EList<SelectionRef> getSelectionRef() {
- if (selectionRef == null) {
- selectionRef = new EObjectContainmentEList<SelectionRef>(SelectionRef.class, this, DiagramTemplatePackage.ABSTRACT_SELECTION__SELECTION_REF);
- }
- return selectionRef;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public boolean isSubTypes() {
- return subTypes;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void setSubTypes(boolean newSubTypes) {
- boolean oldSubTypes = subTypes;
- subTypes = newSubTypes;
- if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.SET, DiagramTemplatePackage.ABSTRACT_SELECTION__SUB_TYPES, oldSubTypes, subTypes));
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public String getStereotypedBy() {
- return stereotypedBy;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void setStereotypedBy(String newStereotypedBy) {
- String oldStereotypedBy = stereotypedBy;
- stereotypedBy = newStereotypedBy;
- if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.SET, DiagramTemplatePackage.ABSTRACT_SELECTION__STEREOTYPED_BY, oldStereotypedBy, stereotypedBy));
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case DiagramTemplatePackage.ABSTRACT_SELECTION__SELECTION_REF:
- return ((InternalEList<?>) getSelectionRef()).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 DiagramTemplatePackage.ABSTRACT_SELECTION__ELEMENT:
- if (resolve) {
- return getElement();
- }
- return basicGetElement();
- case DiagramTemplatePackage.ABSTRACT_SELECTION__KIND:
- return getKind();
- case DiagramTemplatePackage.ABSTRACT_SELECTION__SELECTION_REF:
- return getSelectionRef();
- case DiagramTemplatePackage.ABSTRACT_SELECTION__SUB_TYPES:
- return isSubTypes();
- case DiagramTemplatePackage.ABSTRACT_SELECTION__STEREOTYPED_BY:
- return getStereotypedBy();
- }
- 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 DiagramTemplatePackage.ABSTRACT_SELECTION__ELEMENT:
- setElement((EObject) newValue);
- return;
- case DiagramTemplatePackage.ABSTRACT_SELECTION__KIND:
- setKind((SelectionKind) newValue);
- return;
- case DiagramTemplatePackage.ABSTRACT_SELECTION__SELECTION_REF:
- getSelectionRef().clear();
- getSelectionRef().addAll((Collection<? extends SelectionRef>) newValue);
- return;
- case DiagramTemplatePackage.ABSTRACT_SELECTION__SUB_TYPES:
- setSubTypes((Boolean) newValue);
- return;
- case DiagramTemplatePackage.ABSTRACT_SELECTION__STEREOTYPED_BY:
- setStereotypedBy((String) newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case DiagramTemplatePackage.ABSTRACT_SELECTION__ELEMENT:
- setElement((EObject) null);
- return;
- case DiagramTemplatePackage.ABSTRACT_SELECTION__KIND:
- setKind(KIND_EDEFAULT);
- return;
- case DiagramTemplatePackage.ABSTRACT_SELECTION__SELECTION_REF:
- getSelectionRef().clear();
- return;
- case DiagramTemplatePackage.ABSTRACT_SELECTION__SUB_TYPES:
- setSubTypes(SUB_TYPES_EDEFAULT);
- return;
- case DiagramTemplatePackage.ABSTRACT_SELECTION__STEREOTYPED_BY:
- setStereotypedBy(STEREOTYPED_BY_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case DiagramTemplatePackage.ABSTRACT_SELECTION__ELEMENT:
- return element != null;
- case DiagramTemplatePackage.ABSTRACT_SELECTION__KIND:
- return kind != KIND_EDEFAULT;
- case DiagramTemplatePackage.ABSTRACT_SELECTION__SELECTION_REF:
- return selectionRef != null && !selectionRef.isEmpty();
- case DiagramTemplatePackage.ABSTRACT_SELECTION__SUB_TYPES:
- return subTypes != SUB_TYPES_EDEFAULT;
- case DiagramTemplatePackage.ABSTRACT_SELECTION__STEREOTYPED_BY:
- return STEREOTYPED_BY_EDEFAULT == null ? stereotypedBy != null : !STEREOTYPED_BY_EDEFAULT.equals(stereotypedBy);
- }
- 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(" (kind: ");
- result.append(kind);
- result.append(", subTypes: ");
- result.append(subTypes);
- result.append(", stereotypedBy: ");
- result.append(stereotypedBy);
- result.append(')');
- return result.toString();
- }
-
-} // AbstractSelectionImpl
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/impl/DiagramDefinitionImpl.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/impl/DiagramDefinitionImpl.java
deleted file mode 100755
index c5693b2..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/impl/DiagramDefinitionImpl.java
+++ /dev/null
@@ -1,549 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate.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.EObject;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.papyrus.diagramtemplate.DiagramDefinition;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage;
-import org.eclipse.papyrus.diagramtemplate.Selection;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Diagram Definition</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.impl.DiagramDefinitionImpl#getDescription <em>Description</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.impl.DiagramDefinitionImpl#getFromRoot <em>From Root</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.impl.DiagramDefinitionImpl#getSelection <em>Selection</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.impl.DiagramDefinitionImpl#getDiagramKind <em>Diagram Kind</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.impl.DiagramDefinitionImpl#getLayoutToApply <em>Layout To Apply</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.impl.DiagramDefinitionImpl#getName <em>Name</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.impl.DiagramDefinitionImpl#getPrefix <em>Prefix</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class DiagramDefinitionImpl extends EObjectImpl implements DiagramDefinition {
- /**
- * The default value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected static final String DESCRIPTION_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDescription() <em>Description</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getDescription()
- * @generated
- * @ordered
- */
- protected String description = DESCRIPTION_EDEFAULT;
-
- /**
- * The cached value of the '{@link #getFromRoot() <em>From Root</em>}' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getFromRoot()
- * @generated
- * @ordered
- */
- protected EObject fromRoot;
-
- /**
- * The cached value of the '{@link #getSelection() <em>Selection</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getSelection()
- * @generated
- * @ordered
- */
- protected EList<Selection> selection;
-
- /**
- * The default value of the '{@link #getDiagramKind() <em>Diagram Kind</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getDiagramKind()
- * @generated
- * @ordered
- */
- protected static final String DIAGRAM_KIND_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getDiagramKind() <em>Diagram Kind</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getDiagramKind()
- * @generated
- * @ordered
- */
- protected String diagramKind = DIAGRAM_KIND_EDEFAULT;
-
- /**
- * The default value of the '{@link #getLayoutToApply() <em>Layout To Apply</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getLayoutToApply()
- * @generated
- * @ordered
- */
- protected static final String LAYOUT_TO_APPLY_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getLayoutToApply() <em>Layout To Apply</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getLayoutToApply()
- * @generated
- * @ordered
- */
- protected String layoutToApply = LAYOUT_TO_APPLY_EDEFAULT;
-
- /**
- * The default value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getName()
- * @generated
- * @ordered
- */
- protected static final String NAME_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getName() <em>Name</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getName()
- * @generated
- * @ordered
- */
- protected String name = NAME_EDEFAULT;
-
- /**
- * The default value of the '{@link #getPrefix() <em>Prefix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getPrefix()
- * @generated
- * @ordered
- */
- protected static final String PREFIX_EDEFAULT = null;
-
- /**
- * The cached value of the '{@link #getPrefix() <em>Prefix</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getPrefix()
- * @generated
- * @ordered
- */
- protected String prefix = PREFIX_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected DiagramDefinitionImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return DiagramTemplatePackage.Literals.DIAGRAM_DEFINITION;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public String getDescription() {
- return description;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void setDescription(String newDescription) {
- String oldDescription = description;
- description = newDescription;
- if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.SET, DiagramTemplatePackage.DIAGRAM_DEFINITION__DESCRIPTION, oldDescription, description));
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EObject getFromRoot() {
- if (fromRoot != null && fromRoot.eIsProxy()) {
- InternalEObject oldFromRoot = (InternalEObject) fromRoot;
- fromRoot = eResolveProxy(oldFromRoot);
- if (fromRoot != oldFromRoot) {
- if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, DiagramTemplatePackage.DIAGRAM_DEFINITION__FROM_ROOT, oldFromRoot, fromRoot));
- }
- }
- }
- return fromRoot;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EObject basicGetFromRoot() {
- return fromRoot;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void setFromRoot(EObject newFromRoot) {
- EObject oldFromRoot = fromRoot;
- fromRoot = newFromRoot;
- if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.SET, DiagramTemplatePackage.DIAGRAM_DEFINITION__FROM_ROOT, oldFromRoot, fromRoot));
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EList<Selection> getSelection() {
- if (selection == null) {
- selection = new EObjectContainmentEList<Selection>(Selection.class, this, DiagramTemplatePackage.DIAGRAM_DEFINITION__SELECTION);
- }
- return selection;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public String getDiagramKind() {
- return diagramKind;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void setDiagramKind(String newDiagramKind) {
- String oldDiagramKind = diagramKind;
- diagramKind = newDiagramKind;
- if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.SET, DiagramTemplatePackage.DIAGRAM_DEFINITION__DIAGRAM_KIND, oldDiagramKind, diagramKind));
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public String getLayoutToApply() {
- return layoutToApply;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void setLayoutToApply(String newLayoutToApply) {
- String oldLayoutToApply = layoutToApply;
- layoutToApply = newLayoutToApply;
- if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.SET, DiagramTemplatePackage.DIAGRAM_DEFINITION__LAYOUT_TO_APPLY, oldLayoutToApply, layoutToApply));
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public String getName() {
- return name;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void setName(String newName) {
- String oldName = name;
- name = newName;
- if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.SET, DiagramTemplatePackage.DIAGRAM_DEFINITION__NAME, oldName, name));
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public String getPrefix() {
- return prefix;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void setPrefix(String newPrefix) {
- String oldPrefix = prefix;
- prefix = newPrefix;
- if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.SET, DiagramTemplatePackage.DIAGRAM_DEFINITION__PREFIX, oldPrefix, prefix));
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__SELECTION:
- return ((InternalEList<?>) getSelection()).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 DiagramTemplatePackage.DIAGRAM_DEFINITION__DESCRIPTION:
- return getDescription();
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__FROM_ROOT:
- if (resolve) {
- return getFromRoot();
- }
- return basicGetFromRoot();
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__SELECTION:
- return getSelection();
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__DIAGRAM_KIND:
- return getDiagramKind();
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__LAYOUT_TO_APPLY:
- return getLayoutToApply();
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__NAME:
- return getName();
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__PREFIX:
- return getPrefix();
- }
- 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 DiagramTemplatePackage.DIAGRAM_DEFINITION__DESCRIPTION:
- setDescription((String) newValue);
- return;
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__FROM_ROOT:
- setFromRoot((EObject) newValue);
- return;
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__SELECTION:
- getSelection().clear();
- getSelection().addAll((Collection<? extends Selection>) newValue);
- return;
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__DIAGRAM_KIND:
- setDiagramKind((String) newValue);
- return;
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__LAYOUT_TO_APPLY:
- setLayoutToApply((String) newValue);
- return;
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__NAME:
- setName((String) newValue);
- return;
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__PREFIX:
- setPrefix((String) newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__DESCRIPTION:
- setDescription(DESCRIPTION_EDEFAULT);
- return;
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__FROM_ROOT:
- setFromRoot((EObject) null);
- return;
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__SELECTION:
- getSelection().clear();
- return;
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__DIAGRAM_KIND:
- setDiagramKind(DIAGRAM_KIND_EDEFAULT);
- return;
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__LAYOUT_TO_APPLY:
- setLayoutToApply(LAYOUT_TO_APPLY_EDEFAULT);
- return;
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__NAME:
- setName(NAME_EDEFAULT);
- return;
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__PREFIX:
- setPrefix(PREFIX_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__DESCRIPTION:
- return DESCRIPTION_EDEFAULT == null ? description != null : !DESCRIPTION_EDEFAULT.equals(description);
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__FROM_ROOT:
- return fromRoot != null;
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__SELECTION:
- return selection != null && !selection.isEmpty();
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__DIAGRAM_KIND:
- return DIAGRAM_KIND_EDEFAULT == null ? diagramKind != null : !DIAGRAM_KIND_EDEFAULT.equals(diagramKind);
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__LAYOUT_TO_APPLY:
- return LAYOUT_TO_APPLY_EDEFAULT == null ? layoutToApply != null : !LAYOUT_TO_APPLY_EDEFAULT.equals(layoutToApply);
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__NAME:
- return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name);
- case DiagramTemplatePackage.DIAGRAM_DEFINITION__PREFIX:
- return PREFIX_EDEFAULT == null ? prefix != null : !PREFIX_EDEFAULT.equals(prefix);
- }
- 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(" (description: ");
- result.append(description);
- result.append(", diagramKind: ");
- result.append(diagramKind);
- result.append(", layoutToApply: ");
- result.append(layoutToApply);
- result.append(", name: ");
- result.append(name);
- result.append(", prefix: ");
- result.append(prefix);
- result.append(')');
- return result.toString();
- }
-
-} // DiagramDefinitionImpl
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/impl/DiagramTemplateFactoryImpl.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/impl/DiagramTemplateFactoryImpl.java
deleted file mode 100755
index 60e35cd..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/impl/DiagramTemplateFactoryImpl.java
+++ /dev/null
@@ -1,211 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate.impl;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EDataType;
-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.diagramtemplate.DiagramDefinition;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplateFactory;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage;
-import org.eclipse.papyrus.diagramtemplate.Selection;
-import org.eclipse.papyrus.diagramtemplate.SelectionKind;
-import org.eclipse.papyrus.diagramtemplate.SelectionRef;
-import org.eclipse.papyrus.diagramtemplate.Template;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Factory</b>.
- * <!-- end-user-doc -->
- *
- * @generated
- */
-public class DiagramTemplateFactoryImpl extends EFactoryImpl implements DiagramTemplateFactory {
- /**
- * Creates the default factory implementation.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public static DiagramTemplateFactory init() {
- try {
- DiagramTemplateFactory theDiagramTemplateFactory = (DiagramTemplateFactory) EPackage.Registry.INSTANCE.getEFactory("http://www.eclipse.org/papyrus/diagramtemplate");
- if (theDiagramTemplateFactory != null) {
- return theDiagramTemplateFactory;
- }
- } catch (Exception exception) {
- EcorePlugin.INSTANCE.log(exception);
- }
- return new DiagramTemplateFactoryImpl();
- }
-
- /**
- * Creates an instance of the factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public DiagramTemplateFactoryImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public EObject create(EClass eClass) {
- switch (eClass.getClassifierID()) {
- case DiagramTemplatePackage.DIAGRAM_DEFINITION:
- return createDiagramDefinition();
- case DiagramTemplatePackage.SELECTION:
- return createSelection();
- case DiagramTemplatePackage.SELECTION_REF:
- return createSelectionRef();
- case DiagramTemplatePackage.TEMPLATE:
- return createTemplate();
- default:
- throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public Object createFromString(EDataType eDataType, String initialValue) {
- switch (eDataType.getClassifierID()) {
- case DiagramTemplatePackage.SELECTION_KIND:
- return createSelectionKindFromString(eDataType, initialValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public String convertToString(EDataType eDataType, Object instanceValue) {
- switch (eDataType.getClassifierID()) {
- case DiagramTemplatePackage.SELECTION_KIND:
- return convertSelectionKindToString(eDataType, instanceValue);
- default:
- throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier");
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public DiagramDefinition createDiagramDefinition() {
- DiagramDefinitionImpl diagramDefinition = new DiagramDefinitionImpl();
- return diagramDefinition;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public Selection createSelection() {
- SelectionImpl selection = new SelectionImpl();
- return selection;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public SelectionRef createSelectionRef() {
- SelectionRefImpl selectionRef = new SelectionRefImpl();
- return selectionRef;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public Template createTemplate() {
- TemplateImpl template = new TemplateImpl();
- return template;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public SelectionKind createSelectionKindFromString(EDataType eDataType, String initialValue) {
- SelectionKind result = SelectionKind.get(initialValue);
- if (result == null) {
- throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- }
- return result;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public String convertSelectionKindToString(EDataType eDataType, Object instanceValue) {
- return instanceValue == null ? null : instanceValue.toString();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public DiagramTemplatePackage getDiagramTemplatePackage() {
- return (DiagramTemplatePackage) getEPackage();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @deprecated
- * @generated
- */
- @Deprecated
- public static DiagramTemplatePackage getPackage() {
- return DiagramTemplatePackage.eINSTANCE;
- }
-
-} // DiagramTemplateFactoryImpl
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/impl/DiagramTemplatePackageImpl.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/impl/DiagramTemplatePackageImpl.java
deleted file mode 100755
index 248bd1e..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/impl/DiagramTemplatePackageImpl.java
+++ /dev/null
@@ -1,515 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate.impl;
-
-import org.eclipse.emf.ecore.EAttribute;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EEnum;
-import org.eclipse.emf.ecore.EPackage;
-import org.eclipse.emf.ecore.EReference;
-import org.eclipse.emf.ecore.impl.EPackageImpl;
-import org.eclipse.papyrus.diagramtemplate.AbstractSelection;
-import org.eclipse.papyrus.diagramtemplate.DiagramDefinition;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplateFactory;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage;
-import org.eclipse.papyrus.diagramtemplate.Selection;
-import org.eclipse.papyrus.diagramtemplate.SelectionKind;
-import org.eclipse.papyrus.diagramtemplate.SelectionRef;
-import org.eclipse.papyrus.diagramtemplate.Template;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model <b>Package</b>.
- * <!-- end-user-doc -->
- *
- * @generated
- */
-public class DiagramTemplatePackageImpl extends EPackageImpl implements DiagramTemplatePackage {
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass diagramDefinitionEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass selectionEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass selectionRefEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass templateEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- private EClass abstractSelectionEClass = null;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- private EEnum selectionKindEEnum = 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.diagramtemplate.DiagramTemplatePackage#eNS_URI
- * @see #init()
- * @generated
- */
- private DiagramTemplatePackageImpl() {
- super(eNS_URI, DiagramTemplateFactory.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 DiagramTemplatePackage#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 DiagramTemplatePackage init() {
- if (isInited) {
- return (DiagramTemplatePackage) EPackage.Registry.INSTANCE.getEPackage(DiagramTemplatePackage.eNS_URI);
- }
-
- // Obtain or create and register package
- DiagramTemplatePackageImpl theDiagramTemplatePackage = (DiagramTemplatePackageImpl) (EPackage.Registry.INSTANCE.get(eNS_URI) instanceof DiagramTemplatePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new DiagramTemplatePackageImpl());
-
- isInited = true;
-
- // Create package meta-data objects
- theDiagramTemplatePackage.createPackageContents();
-
- // Initialize created meta-data
- theDiagramTemplatePackage.initializePackageContents();
-
- // Mark meta-data to indicate it can't be changed
- theDiagramTemplatePackage.freeze();
-
-
- // Update the registry and return the package
- EPackage.Registry.INSTANCE.put(DiagramTemplatePackage.eNS_URI, theDiagramTemplatePackage);
- return theDiagramTemplatePackage;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getDiagramDefinition() {
- return diagramDefinitionEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDiagramDefinition_Description() {
- return (EAttribute) diagramDefinitionEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDiagramDefinition_FromRoot() {
- return (EReference) diagramDefinitionEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getDiagramDefinition_Selection() {
- return (EReference) diagramDefinitionEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDiagramDefinition_DiagramKind() {
- return (EAttribute) diagramDefinitionEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDiagramDefinition_LayoutToApply() {
- return (EAttribute) diagramDefinitionEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDiagramDefinition_Name() {
- return (EAttribute) diagramDefinitionEClass.getEStructuralFeatures().get(5);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getDiagramDefinition_Prefix() {
- return (EAttribute) diagramDefinitionEClass.getEStructuralFeatures().get(6);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getSelection() {
- return selectionEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getSelection_Recursively() {
- return (EAttribute) selectionEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getSelectionRef() {
- return selectionRefEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getSelectionRef_EReference() {
- return (EReference) selectionRefEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getTemplate() {
- return templateEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getTemplate_DiagramDefinitions() {
- return (EReference) templateEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getTemplate_TargetRoot() {
- return (EReference) templateEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EClass getAbstractSelection() {
- return abstractSelectionEClass;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getAbstractSelection_Element() {
- return (EReference) abstractSelectionEClass.getEStructuralFeatures().get(0);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getAbstractSelection_Kind() {
- return (EAttribute) abstractSelectionEClass.getEStructuralFeatures().get(1);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EReference getAbstractSelection_SelectionRef() {
- return (EReference) abstractSelectionEClass.getEStructuralFeatures().get(2);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getAbstractSelection_SubTypes() {
- return (EAttribute) abstractSelectionEClass.getEStructuralFeatures().get(3);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EAttribute getAbstractSelection_StereotypedBy() {
- return (EAttribute) abstractSelectionEClass.getEStructuralFeatures().get(4);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EEnum getSelectionKind() {
- return selectionKindEEnum;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public DiagramTemplateFactory getDiagramTemplateFactory() {
- return (DiagramTemplateFactory) 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
- diagramDefinitionEClass = createEClass(DIAGRAM_DEFINITION);
- createEAttribute(diagramDefinitionEClass, DIAGRAM_DEFINITION__DESCRIPTION);
- createEReference(diagramDefinitionEClass, DIAGRAM_DEFINITION__FROM_ROOT);
- createEReference(diagramDefinitionEClass, DIAGRAM_DEFINITION__SELECTION);
- createEAttribute(diagramDefinitionEClass, DIAGRAM_DEFINITION__DIAGRAM_KIND);
- createEAttribute(diagramDefinitionEClass, DIAGRAM_DEFINITION__LAYOUT_TO_APPLY);
- createEAttribute(diagramDefinitionEClass, DIAGRAM_DEFINITION__NAME);
- createEAttribute(diagramDefinitionEClass, DIAGRAM_DEFINITION__PREFIX);
-
- selectionEClass = createEClass(SELECTION);
- createEAttribute(selectionEClass, SELECTION__RECURSIVELY);
-
- selectionRefEClass = createEClass(SELECTION_REF);
- createEReference(selectionRefEClass, SELECTION_REF__EREFERENCE);
-
- templateEClass = createEClass(TEMPLATE);
- createEReference(templateEClass, TEMPLATE__DIAGRAM_DEFINITIONS);
- createEReference(templateEClass, TEMPLATE__TARGET_ROOT);
-
- abstractSelectionEClass = createEClass(ABSTRACT_SELECTION);
- createEReference(abstractSelectionEClass, ABSTRACT_SELECTION__ELEMENT);
- createEAttribute(abstractSelectionEClass, ABSTRACT_SELECTION__KIND);
- createEReference(abstractSelectionEClass, ABSTRACT_SELECTION__SELECTION_REF);
- createEAttribute(abstractSelectionEClass, ABSTRACT_SELECTION__SUB_TYPES);
- createEAttribute(abstractSelectionEClass, ABSTRACT_SELECTION__STEREOTYPED_BY);
-
- // Create enums
- selectionKindEEnum = createEEnum(SELECTION_KIND);
- }
-
- /**
- * <!-- 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);
-
- // Create type parameters
-
- // Set bounds for type parameters
-
- // Add supertypes to classes
- selectionEClass.getESuperTypes().add(this.getAbstractSelection());
- selectionRefEClass.getESuperTypes().add(this.getAbstractSelection());
-
- // Initialize classes and features; add operations and parameters
- initEClass(diagramDefinitionEClass, DiagramDefinition.class, "DiagramDefinition", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getDiagramDefinition_Description(), ecorePackage.getEString(), "description", null, 1, 1, DiagramDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getDiagramDefinition_FromRoot(), ecorePackage.getEObject(), null, "fromRoot", null, 0, 1, DiagramDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED,
- IS_ORDERED);
- initEReference(getDiagramDefinition_Selection(), this.getSelection(), null, "selection", null, 0, -1, DiagramDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED,
- IS_ORDERED);
- initEAttribute(getDiagramDefinition_DiagramKind(), ecorePackage.getEString(), "diagramKind", null, 0, 1, DiagramDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getDiagramDefinition_LayoutToApply(), ecorePackage.getEString(), "layoutToApply", null, 0, 1, DiagramDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getDiagramDefinition_Name(), ecorePackage.getEString(), "name", null, 1, 1, DiagramDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getDiagramDefinition_Prefix(), ecorePackage.getEString(), "prefix", null, 1, 1, DiagramDefinition.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(selectionEClass, Selection.class, "Selection", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getSelection_Recursively(), ecorePackage.getEBoolean(), "recursively", null, 1, 1, Selection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(selectionRefEClass, SelectionRef.class, "SelectionRef", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getSelectionRef_EReference(), ecorePackage.getEObject(), null, "eReference", null, 0, 1, SelectionRef.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED,
- IS_ORDERED);
-
- initEClass(templateEClass, Template.class, "Template", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getTemplate_DiagramDefinitions(), this.getDiagramDefinition(), null, "diagramDefinitions", null, 0, -1, Template.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
- !IS_DERIVED, IS_ORDERED);
- initEReference(getTemplate_TargetRoot(), ecorePackage.getEObject(), null, "targetRoot", null, 0, 1, Template.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- initEClass(abstractSelectionEClass, AbstractSelection.class, "AbstractSelection", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEReference(getAbstractSelection_Element(), ecorePackage.getEObject(), null, "element", null, 0, 1, AbstractSelection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED,
- IS_ORDERED);
- initEAttribute(getAbstractSelection_Kind(), this.getSelectionKind(), "kind", null, 1, 1, AbstractSelection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEReference(getAbstractSelection_SelectionRef(), this.getSelectionRef(), null, "selectionRef", null, 0, -1, AbstractSelection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE,
- !IS_DERIVED, IS_ORDERED);
- initEAttribute(getAbstractSelection_SubTypes(), ecorePackage.getEBoolean(), "subTypes", null, 1, 1, AbstractSelection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEAttribute(getAbstractSelection_StereotypedBy(), ecorePackage.getEString(), "stereotypedBy", null, 1, 1, AbstractSelection.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
-
- // Initialize enums and add enum literals
- initEEnum(selectionKindEEnum, SelectionKind.class, "SelectionKind");
- addEEnumLiteral(selectionKindEEnum, SelectionKind.FOR_ALL);
- addEEnumLiteral(selectionKindEEnum, SelectionKind.SPECIFIC);
- addEEnumLiteral(selectionKindEEnum, SelectionKind.QUERY);
-
- // Create resource
- createResource(eNS_URI);
- }
-
-} // DiagramTemplatePackageImpl
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/impl/SelectionImpl.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/impl/SelectionImpl.java
deleted file mode 100755
index 76b4731..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/impl/SelectionImpl.java
+++ /dev/null
@@ -1,183 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage;
-import org.eclipse.papyrus.diagramtemplate.Selection;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Selection</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.impl.SelectionImpl#isRecursively <em>Recursively</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class SelectionImpl extends AbstractSelectionImpl implements Selection {
- /**
- * The default value of the '{@link #isRecursively() <em>Recursively</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #isRecursively()
- * @generated
- * @ordered
- */
- protected static final boolean RECURSIVELY_EDEFAULT = false;
-
- /**
- * The cached value of the '{@link #isRecursively() <em>Recursively</em>}' attribute.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #isRecursively()
- * @generated
- * @ordered
- */
- protected boolean recursively = RECURSIVELY_EDEFAULT;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected SelectionImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return DiagramTemplatePackage.Literals.SELECTION;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public boolean isRecursively() {
- return recursively;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void setRecursively(boolean newRecursively) {
- boolean oldRecursively = recursively;
- recursively = newRecursively;
- if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.SET, DiagramTemplatePackage.SELECTION__RECURSIVELY, oldRecursively, recursively));
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case DiagramTemplatePackage.SELECTION__RECURSIVELY:
- return isRecursively();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case DiagramTemplatePackage.SELECTION__RECURSIVELY:
- setRecursively((Boolean) newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case DiagramTemplatePackage.SELECTION__RECURSIVELY:
- setRecursively(RECURSIVELY_EDEFAULT);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case DiagramTemplatePackage.SELECTION__RECURSIVELY:
- return recursively != RECURSIVELY_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(" (recursively: ");
- result.append(recursively);
- result.append(')');
- return result.toString();
- }
-
-} // SelectionImpl
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/impl/SelectionRefImpl.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/impl/SelectionRefImpl.java
deleted file mode 100755
index 0a13cd8..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/impl/SelectionRefImpl.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate.impl;
-
-import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage;
-import org.eclipse.papyrus.diagramtemplate.SelectionRef;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Selection Ref</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.impl.SelectionRefImpl#getEReference <em>EReference</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class SelectionRefImpl extends AbstractSelectionImpl implements SelectionRef {
- /**
- * The cached value of the '{@link #getEReference() <em>EReference</em>}' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getEReference()
- * @generated
- * @ordered
- */
- protected EObject eReference;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected SelectionRefImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return DiagramTemplatePackage.Literals.SELECTION_REF;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EObject getEReference() {
- if (eReference != null && eReference.eIsProxy()) {
- InternalEObject oldEReference = (InternalEObject) eReference;
- eReference = eResolveProxy(oldEReference);
- if (eReference != oldEReference) {
- if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, DiagramTemplatePackage.SELECTION_REF__EREFERENCE, oldEReference, eReference));
- }
- }
- }
- return eReference;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EObject basicGetEReference() {
- return eReference;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void setEReference(EObject newEReference) {
- EObject oldEReference = eReference;
- eReference = newEReference;
- if (eNotificationRequired()) {
- eNotify(new ENotificationImpl(this, Notification.SET, DiagramTemplatePackage.SELECTION_REF__EREFERENCE, oldEReference, eReference));
- }
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public Object eGet(int featureID, boolean resolve, boolean coreType) {
- switch (featureID) {
- case DiagramTemplatePackage.SELECTION_REF__EREFERENCE:
- if (resolve) {
- return getEReference();
- }
- return basicGetEReference();
- }
- return super.eGet(featureID, resolve, coreType);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void eSet(int featureID, Object newValue) {
- switch (featureID) {
- case DiagramTemplatePackage.SELECTION_REF__EREFERENCE:
- setEReference((EObject) newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case DiagramTemplatePackage.SELECTION_REF__EREFERENCE:
- setEReference((EObject) null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case DiagramTemplatePackage.SELECTION_REF__EREFERENCE:
- return eReference != null;
- }
- return super.eIsSet(featureID);
- }
-
-} // SelectionRefImpl
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/impl/TemplateImpl.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/impl/TemplateImpl.java
deleted file mode 100755
index 9f9cacc..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/impl/TemplateImpl.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate.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.EObject;
-import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.ENotificationImpl;
-import org.eclipse.emf.ecore.impl.EObjectImpl;
-import org.eclipse.emf.ecore.util.EObjectContainmentEList;
-import org.eclipse.emf.ecore.util.InternalEList;
-import org.eclipse.papyrus.diagramtemplate.DiagramDefinition;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage;
-import org.eclipse.papyrus.diagramtemplate.Template;
-
-/**
- * <!-- begin-user-doc -->
- * An implementation of the model object '<em><b>Template</b></em>'.
- * <!-- end-user-doc -->
- * <p>
- * The following features are implemented:
- * <ul>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.impl.TemplateImpl#getDiagramDefinitions <em>Diagram Definitions</em>}</li>
- * <li>{@link org.eclipse.papyrus.diagramtemplate.impl.TemplateImpl#getTargetRoot <em>Target Root</em>}</li>
- * </ul>
- * </p>
- *
- * @generated
- */
-public class TemplateImpl extends EObjectImpl implements Template {
- /**
- * The cached value of the '{@link #getDiagramDefinitions() <em>Diagram Definitions</em>}' containment reference list.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getDiagramDefinitions()
- * @generated
- * @ordered
- */
- protected EList<DiagramDefinition> diagramDefinitions;
-
- /**
- * The cached value of the '{@link #getTargetRoot() <em>Target Root</em>}' reference.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @see #getTargetRoot()
- * @generated
- * @ordered
- */
- protected EObject targetRoot;
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected TemplateImpl() {
- super();
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- protected EClass eStaticClass() {
- return DiagramTemplatePackage.Literals.TEMPLATE;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EList<DiagramDefinition> getDiagramDefinitions() {
- if (diagramDefinitions == null) {
- diagramDefinitions = new EObjectContainmentEList<DiagramDefinition>(DiagramDefinition.class, this, DiagramTemplatePackage.TEMPLATE__DIAGRAM_DEFINITIONS);
- }
- return diagramDefinitions;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EObject getTargetRoot() {
- if (targetRoot != null && targetRoot.eIsProxy()) {
- InternalEObject oldTargetRoot = (InternalEObject) targetRoot;
- targetRoot = eResolveProxy(oldTargetRoot);
- if (targetRoot != oldTargetRoot) {
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.RESOLVE, DiagramTemplatePackage.TEMPLATE__TARGET_ROOT, oldTargetRoot, targetRoot));
- }
- }
- return targetRoot;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public EObject basicGetTargetRoot() {
- return targetRoot;
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public void setTargetRoot(EObject newTargetRoot) {
- EObject oldTargetRoot = targetRoot;
- targetRoot = newTargetRoot;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, DiagramTemplatePackage.TEMPLATE__TARGET_ROOT, oldTargetRoot, targetRoot));
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
- switch (featureID) {
- case DiagramTemplatePackage.TEMPLATE__DIAGRAM_DEFINITIONS:
- return ((InternalEList<?>) getDiagramDefinitions()).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 DiagramTemplatePackage.TEMPLATE__DIAGRAM_DEFINITIONS:
- return getDiagramDefinitions();
- case DiagramTemplatePackage.TEMPLATE__TARGET_ROOT:
- if (resolve)
- return getTargetRoot();
- return basicGetTargetRoot();
- }
- 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 DiagramTemplatePackage.TEMPLATE__DIAGRAM_DEFINITIONS:
- getDiagramDefinitions().clear();
- getDiagramDefinitions().addAll((Collection<? extends DiagramDefinition>) newValue);
- return;
- case DiagramTemplatePackage.TEMPLATE__TARGET_ROOT:
- setTargetRoot((EObject) newValue);
- return;
- }
- super.eSet(featureID, newValue);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public void eUnset(int featureID) {
- switch (featureID) {
- case DiagramTemplatePackage.TEMPLATE__DIAGRAM_DEFINITIONS:
- getDiagramDefinitions().clear();
- return;
- case DiagramTemplatePackage.TEMPLATE__TARGET_ROOT:
- setTargetRoot((EObject) null);
- return;
- }
- super.eUnset(featureID);
- }
-
- /**
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- @Override
- public boolean eIsSet(int featureID) {
- switch (featureID) {
- case DiagramTemplatePackage.TEMPLATE__DIAGRAM_DEFINITIONS:
- return diagramDefinitions != null && !diagramDefinitions.isEmpty();
- case DiagramTemplatePackage.TEMPLATE__TARGET_ROOT:
- return targetRoot != null;
- }
- return super.eIsSet(featureID);
- }
-
-} // TemplateImpl
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/util/DiagramTemplateAdapterFactory.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/util/DiagramTemplateAdapterFactory.java
deleted file mode 100755
index 8e6d450..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/util/DiagramTemplateAdapterFactory.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate.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.diagramtemplate.AbstractSelection;
-import org.eclipse.papyrus.diagramtemplate.DiagramDefinition;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage;
-import org.eclipse.papyrus.diagramtemplate.Selection;
-import org.eclipse.papyrus.diagramtemplate.SelectionRef;
-import org.eclipse.papyrus.diagramtemplate.Template;
-
-/**
- * <!-- 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.diagramtemplate.DiagramTemplatePackage
- * @generated
- */
-public class DiagramTemplateAdapterFactory extends AdapterFactoryImpl {
- /**
- * The cached model package.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected static DiagramTemplatePackage modelPackage;
-
- /**
- * Creates an instance of the adapter factory.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public DiagramTemplateAdapterFactory() {
- if (modelPackage == null) {
- modelPackage = DiagramTemplatePackage.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 DiagramTemplateSwitch<Adapter> modelSwitch = new DiagramTemplateSwitch<Adapter>() {
- @Override
- public Adapter caseDiagramDefinition(DiagramDefinition object) {
- return createDiagramDefinitionAdapter();
- }
-
- @Override
- public Adapter caseSelection(Selection object) {
- return createSelectionAdapter();
- }
-
- @Override
- public Adapter caseSelectionRef(SelectionRef object) {
- return createSelectionRefAdapter();
- }
-
- @Override
- public Adapter caseTemplate(Template object) {
- return createTemplateAdapter();
- }
-
- @Override
- public Adapter caseAbstractSelection(AbstractSelection object) {
- return createAbstractSelectionAdapter();
- }
-
- @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.diagramtemplate.DiagramDefinition <em>Diagram Definition</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.diagramtemplate.DiagramDefinition
- * @generated
- */
- public Adapter createDiagramDefinitionAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.diagramtemplate.Selection <em>Selection</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.diagramtemplate.Selection
- * @generated
- */
- public Adapter createSelectionAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.diagramtemplate.SelectionRef <em>Selection Ref</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.diagramtemplate.SelectionRef
- * @generated
- */
- public Adapter createSelectionRefAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.diagramtemplate.Template <em>Template</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.diagramtemplate.Template
- * @generated
- */
- public Adapter createTemplateAdapter() {
- return null;
- }
-
- /**
- * Creates a new adapter for an object of class '{@link org.eclipse.papyrus.diagramtemplate.AbstractSelection <em>Abstract Selection</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.diagramtemplate.AbstractSelection
- * @generated
- */
- public Adapter createAbstractSelectionAdapter() {
- 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;
- }
-
-} // DiagramTemplateAdapterFactory
diff --git a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/util/DiagramTemplateSwitch.java b/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/util/DiagramTemplateSwitch.java
deleted file mode 100755
index f30a8b6..0000000
--- a/diagramtemplate/plugins/org.eclipse.papyrus.diagramtemplate/src/org/eclipse/papyrus/diagramtemplate/util/DiagramTemplateSwitch.java
+++ /dev/null
@@ -1,255 +0,0 @@
-/*****************************************************************************
- * Copyright (c) 2010, 2018 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:
- * Florian Noyrit florian.noyrit@cea.fr - Initial API and implementation
- *
- *****************************************************************************/
-package org.eclipse.papyrus.diagramtemplate.util;
-
-import java.util.List;
-
-import org.eclipse.emf.ecore.EClass;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.papyrus.diagramtemplate.AbstractSelection;
-import org.eclipse.papyrus.diagramtemplate.DiagramDefinition;
-import org.eclipse.papyrus.diagramtemplate.DiagramTemplatePackage;
-import org.eclipse.papyrus.diagramtemplate.Selection;
-import org.eclipse.papyrus.diagramtemplate.SelectionRef;
-import org.eclipse.papyrus.diagramtemplate.Template;
-
-/**
- * <!-- 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.diagramtemplate.DiagramTemplatePackage
- * @generated
- */
-public class DiagramTemplateSwitch<T> {
- /**
- * The cached model package
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- protected static DiagramTemplatePackage modelPackage;
-
- /**
- * Creates an instance of the switch.
- * <!-- begin-user-doc -->
- * <!-- end-user-doc -->
- *
- * @generated
- */
- public DiagramTemplateSwitch() {
- if (modelPackage == null) {
- modelPackage = DiagramTemplatePackage.eINSTANCE;
- }
- }
-
- /**
- * 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
- */
- public T doSwitch(EObject theEObject) {
- return doSwitch(theEObject.eClass(), theEObject);
- }
-
- /**
- * 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
- */
- protected T doSwitch(EClass theEClass, EObject theEObject) {
- if (theEClass.eContainer() == modelPackage) {
- return doSwitch(theEClass.getClassifierID(), theEObject);
- } else {
- List<EClass> eSuperTypes = theEClass.getESuperTypes();
- return eSuperTypes.isEmpty() ? defaultCase(theEObject) : doSwitch(eSuperTypes.get(0), theEObject);
- }
- }
-
- /**
- * 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
- */
- protected T doSwitch(int classifierID, EObject theEObject) {
- switch (classifierID) {
- case DiagramTemplatePackage.DIAGRAM_DEFINITION: {
- DiagramDefinition diagramDefinition = (DiagramDefinition) theEObject;
- T result = caseDiagramDefinition(diagramDefinition);
- if (result == null) {
- result = defaultCase(theEObject);
- }
- return result;
- }
- case DiagramTemplatePackage.SELECTION: {
- Selection selection = (Selection) theEObject;
- T result = caseSelection(selection);
- if (result == null) {
- result = caseAbstractSelection(selection);
- }
- if (result == null) {
- result = defaultCase(theEObject);
- }
- return result;
- }
- case DiagramTemplatePackage.SELECTION_REF: {
- SelectionRef selectionRef = (SelectionRef) theEObject;
- T result = caseSelectionRef(selectionRef);
- if (result == null) {
- result = caseAbstractSelection(selectionRef);
- }
- if (result == null) {
- result = defaultCase(theEObject);
- }
- return result;
- }
- case DiagramTemplatePackage.TEMPLATE: {
- Template template = (Template) theEObject;
- T result = caseTemplate(template);
- if (result == null) {
- result = defaultCase(theEObject);
- }
- return result;
- }
- case DiagramTemplatePackage.ABSTRACT_SELECTION: {
- AbstractSelection abstractSelection = (AbstractSelection) theEObject;
- T result = caseAbstractSelection(abstractSelection);
- if (result == null) {
- result = defaultCase(theEObject);
- }
- return result;
- }
- default:
- return defaultCase(theEObject);
- }
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Diagram Definition</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>Diagram Definition</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public T caseDiagramDefinition(DiagramDefinition object) {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Selection</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>Selection</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public T caseSelection(Selection object) {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Selection Ref</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>Selection Ref</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public T caseSelectionRef(SelectionRef object) {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Template</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>Template</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public T caseTemplate(Template object) {
- return null;
- }
-
- /**
- * Returns the result of interpreting the object as an instance of '<em>Abstract Selection</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>Abstract Selection</em>'.
- * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
- * @generated
- */
- public T caseAbstractSelection(AbstractSelection 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
- */
- public T defaultCase(EObject object) {
- return null;
- }
-
-} // DiagramTemplateSwitch