From 9c3dc6bb7d2e17693101253fe311cd2d79132419 Mon Sep 17 00:00:00 2001 From: Heiko Klare Date: Fri, 20 Mar 2020 17:53:07 +0100 Subject: [PATCH 1/7] Add metamodel for an ensurance database --- .../.classpath | 11 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 16 + .../build.properties | 10 + .../icons/full/obj16/EnsuranceClient.gif | Bin 0 -> 129 bytes .../icons/full/obj16/EnsuranceDatabase.gif | Bin 0 -> 129 bytes .../plugin.properties | 27 + .../plugin.xml | 22 + .../provider/EnsuranceClientItemProvider.java | 171 ++ .../EnsuranceDatabaseItemProvider.java | 168 ++ .../provider/EnsuranceEditPlugin.java | 87 + .../EnsuranceItemProviderAdapterFactory.java | 226 +++ .../.classpath | 11 + .../.project | 28 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 19 + .../build.properties | 10 + .../icons/full/obj16/EnsuranceModelFile.gif | Bin 0 -> 346 bytes .../icons/full/wizban/NewEnsurance.gif | Bin 0 -> 2462 bytes .../plugin.properties | 53 + .../plugin.xml | 37 + .../EnsuranceActionBarContributor.java | 423 ++++ .../presentation/EnsuranceEditor.java | 1777 +++++++++++++++++ .../presentation/EnsuranceEditorPlugin.java | 89 + .../presentation/EnsuranceModelWizard.java | 625 ++++++ .../.classpath | 11 + .../.project | 29 + .../.settings/org.eclipse.jdt.core.prefs | 7 + .../META-INF/MANIFEST.MF | 16 + .../build.properties | 10 + .../model/ensurance.aird | 168 ++ .../model/ensurance.ecore | 16 + .../model/ensurance.genmodel | 26 + .../plugin.properties | 4 + .../plugin.xml | 17 + .../metamodels/ensurance/EnsuranceClient.java | 69 + .../ensurance/EnsuranceDatabase.java | 38 + .../ensurance/EnsuranceFactory.java | 51 + .../ensurance/EnsurancePackage.java | 295 +++ .../kit/ipd/sdq/metamodels/ensurance/Sex.java | 204 ++ .../ensurance/impl/EnsuranceClientImpl.java | 222 ++ .../ensurance/impl/EnsuranceDatabaseImpl.java | 153 ++ .../ensurance/impl/EnsuranceFactoryImpl.java | 161 ++ .../ensurance/impl/EnsurancePackageImpl.java | 259 +++ .../util/EnsuranceAdapterFactory.java | 138 ++ .../ensurance/util/EnsuranceSwitch.java | 134 ++ .../category.xml | 6 + 48 files changed, 5886 insertions(+) create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/.classpath create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/.project create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/.settings/org.eclipse.jdt.core.prefs create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/META-INF/MANIFEST.MF create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/build.properties create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/icons/full/obj16/EnsuranceClient.gif create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/icons/full/obj16/EnsuranceDatabase.gif create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/plugin.properties create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/plugin.xml create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/provider/EnsuranceClientItemProvider.java create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/provider/EnsuranceDatabaseItemProvider.java create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/provider/EnsuranceEditPlugin.java create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/provider/EnsuranceItemProviderAdapterFactory.java create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/.classpath create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/.project create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/.settings/org.eclipse.jdt.core.prefs create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/META-INF/MANIFEST.MF create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/build.properties create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/icons/full/obj16/EnsuranceModelFile.gif create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/icons/full/wizban/NewEnsurance.gif create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/plugin.properties create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/plugin.xml create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/presentation/EnsuranceActionBarContributor.java create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/presentation/EnsuranceEditor.java create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/presentation/EnsuranceEditorPlugin.java create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/presentation/EnsuranceModelWizard.java create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance/.classpath create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance/.project create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance/.settings/org.eclipse.jdt.core.prefs create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance/META-INF/MANIFEST.MF create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance/build.properties create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance/model/ensurance.aird create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance/model/ensurance.ecore create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance/model/ensurance.genmodel create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance/plugin.properties create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance/plugin.xml create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/EnsuranceClient.java create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/EnsuranceDatabase.java create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/EnsuranceFactory.java create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/EnsurancePackage.java create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/Sex.java create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/impl/EnsuranceClientImpl.java create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/impl/EnsuranceDatabaseImpl.java create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/impl/EnsuranceFactoryImpl.java create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/impl/EnsurancePackageImpl.java create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/util/EnsuranceAdapterFactory.java create mode 100644 bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/util/EnsuranceSwitch.java diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/.classpath b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/.classpath new file mode 100644 index 0000000..716f845 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/.project b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/.project new file mode 100644 index 0000000..234ab10 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/.project @@ -0,0 +1,28 @@ + + + edu.kit.ipd.sdq.metamodels.ensurance.edit + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/.settings/org.eclipse.jdt.core.prefs b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..0c68a61 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/META-INF/MANIFEST.MF b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/META-INF/MANIFEST.MF new file mode 100644 index 0000000..8b18523 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: edu.kit.ipd.sdq.metamodels.ensurance.edit;singleton:=true +Automatic-Module-Name: edu.kit.ipd.sdq.metamodels.ensurance.edit +Bundle-Version: 1.2.0.qualifier +Bundle-ClassPath: . +Bundle-Activator: edu.kit.ipd.sdq.metamodels.ensurance.provider.EnsuranceEditPlugin$Implementation +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Export-Package: edu.kit.ipd.sdq.metamodels.ensurance.provider +Require-Bundle: org.eclipse.core.runtime, + edu.kit.ipd.sdq.metamodels.ensurance;visibility:=reexport, + org.eclipse.emf.edit;visibility:=reexport +Bundle-ActivationPolicy: lazy diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/build.properties b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/build.properties new file mode 100644 index 0000000..a3c4e32 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/build.properties @@ -0,0 +1,10 @@ +# + +bin.includes = .,\ + icons/,\ + META-INF/,\ + plugin.xml,\ + plugin.properties +jars.compile.order = . +source.. = src-gen/ +output.. = bin/ diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/icons/full/obj16/EnsuranceClient.gif b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/icons/full/obj16/EnsuranceClient.gif new file mode 100644 index 0000000000000000000000000000000000000000..14af8aaee9f431cebfb2b13249821419380131a3 GIT binary patch literal 129 zcmZ?wbhEHb6krfw*vtS14M4Jip`qcxfddT<4GjN*-2XuK|Nmgt|Nk#8?YX(B=giEs z0}T#}KUo+V7&sYpKsrHYFtF$uob+71*W&e;Zz}u`3thLHvffHb@LI6&tBu~rX=+!^ W%6nF7^6M^V>~uRaQAn7P!5RPxRxsiK literal 0 HcmV?d00001 diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/icons/full/obj16/EnsuranceDatabase.gif b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/icons/full/obj16/EnsuranceDatabase.gif new file mode 100644 index 0000000000000000000000000000000000000000..ef56c140853105ca812564e9b12a76413c8c3fb9 GIT binary patch literal 129 zcmZ?wbhEHb6krfw*vtS14M4Jip`qcxfddT<4GjN*-2XuK|Nmgt|NnblTGDecTm zhXW0YKUo+V7&sYpKsrHYFtF$uob+71*W&e;Zz}u`3thLHvffHb@LI6&tBu~rX=+!^ W%6nF7^6M^V>~uRaQAn7P!5RPvNHF36 literal 0 HcmV?d00001 diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/plugin.properties b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/plugin.properties new file mode 100644 index 0000000..07f212e --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/plugin.properties @@ -0,0 +1,27 @@ +# + +pluginName = Ensurance Edit Support +providerName = KIT SDQ + +_UI_CreateChild_text = {0} +_UI_CreateChild_text2 = {1} {0} +_UI_CreateChild_text3 = {1} +_UI_CreateChild_tooltip = Create New {0} Under {1} Feature +_UI_CreateChild_description = Create a new child of type {0} for the {1} feature of the selected {2}. +_UI_CreateSibling_description = Create a new sibling of type {0} for the selected {2}, under the {1} feature of their parent. + +_UI_PropertyDescriptor_description = The {0} of the {1} + +_UI_EnsuranceDatabase_type = Database +_UI_EnsuranceClient_type = Client +_UI_Unknown_type = Object + +_UI_Unknown_datatype= Value + +_UI_EnsuranceDatabase_ensuranceclient_feature = Ensuranceclient +_UI_EnsuranceClient_name_feature = Name +_UI_EnsuranceClient_socialSecurityNumber_feature = Social Security Number +_UI_Unknown_feature = Unspecified + +_UI_Sex_MALE_literal = MALE +_UI_Sex_FEMALE_literal = FEMALE diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/plugin.xml b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/plugin.xml new file mode 100644 index 0000000..69df969 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/plugin.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/provider/EnsuranceClientItemProvider.java b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/provider/EnsuranceClientItemProvider.java new file mode 100644 index 0000000..25f5097 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/provider/EnsuranceClientItemProvider.java @@ -0,0 +1,171 @@ +/** + */ +package edu.kit.ipd.sdq.metamodels.ensurance.provider; + +import edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceClient; +import edu.kit.ipd.sdq.metamodels.ensurance.EnsurancePackage; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.util.ResourceLocator; + +import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; +import org.eclipse.emf.edit.provider.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; + +/** + * This is the item provider adapter for a {@link edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceClient} object. + * + * + * @generated + */ +public class EnsuranceClientItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, + IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public EnsuranceClientItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + addNamePropertyDescriptor(object); + addSocialSecurityNumberPropertyDescriptor(object); + } + return itemPropertyDescriptors; + } + + /** + * This adds a property descriptor for the Name feature. + * + * + * @generated + */ + protected void addNamePropertyDescriptor(Object object) { + itemPropertyDescriptors + .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), + getResourceLocator(), getString("_UI_EnsuranceClient_name_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_EnsuranceClient_name_feature", + "_UI_EnsuranceClient_type"), + EnsurancePackage.Literals.ENSURANCE_CLIENT__NAME, true, false, false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This adds a property descriptor for the Social Security Number feature. + * + * + * @generated + */ + protected void addSocialSecurityNumberPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor( + ((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), + getString("_UI_EnsuranceClient_socialSecurityNumber_feature"), + getString("_UI_PropertyDescriptor_description", "_UI_EnsuranceClient_socialSecurityNumber_feature", + "_UI_EnsuranceClient_type"), + EnsurancePackage.Literals.ENSURANCE_CLIENT__SOCIAL_SECURITY_NUMBER, true, false, false, + ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); + } + + /** + * This returns EnsuranceClient.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/EnsuranceClient")); + } + + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + String label = ((EnsuranceClient) object).getName(); + return label == null || label.length() == 0 ? getString("_UI_EnsuranceClient_type") + : getString("_UI_EnsuranceClient_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}. + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(EnsuranceClient.class)) { + case EnsurancePackage.ENSURANCE_CLIENT__NAME: + case EnsurancePackage.ENSURANCE_CLIENT__SOCIAL_SECURITY_NUMBER: + 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. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return EnsuranceEditPlugin.INSTANCE; + } + +} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/provider/EnsuranceDatabaseItemProvider.java b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/provider/EnsuranceDatabaseItemProvider.java new file mode 100644 index 0000000..9d36665 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/provider/EnsuranceDatabaseItemProvider.java @@ -0,0 +1,168 @@ +/** + */ +package edu.kit.ipd.sdq.metamodels.ensurance.provider; + +import edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceDatabase; +import edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceFactory; +import edu.kit.ipd.sdq.metamodels.ensurance.EnsurancePackage; + +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.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; + +/** + * This is the item provider adapter for a {@link edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceDatabase} object. + * + * + * @generated + */ +public class EnsuranceDatabaseItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, + IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { + /** + * This constructs an instance from a factory and a notifier. + * + * + * @generated + */ + public EnsuranceDatabaseItemProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * + * + * @generated + */ + @Override + public List getPropertyDescriptors(Object object) { + if (itemPropertyDescriptors == null) { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * 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}. + * + * + * @generated + */ + @Override + public Collection getChildrenFeatures(Object object) { + if (childrenFeatures == null) { + super.getChildrenFeatures(object); + childrenFeatures.add(EnsurancePackage.Literals.ENSURANCE_DATABASE__ENSURANCECLIENT); + } + return childrenFeatures; + } + + /** + * + * + * @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 EnsuranceDatabase.gif. + * + * + * @generated + */ + @Override + public Object getImage(Object object) { + return overlayImage(object, getResourceLocator().getImage("full/obj16/EnsuranceDatabase")); + } + + /** + * + * + * @generated + */ + @Override + protected boolean shouldComposeCreationImage() { + return true; + } + + /** + * This returns the label text for the adapted class. + * + * + * @generated + */ + @Override + public String getText(Object object) { + return getString("_UI_EnsuranceDatabase_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}. + * + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) { + updateChildren(notification); + + switch (notification.getFeatureID(EnsuranceDatabase.class)) { + case EnsurancePackage.ENSURANCE_DATABASE__ENSURANCECLIENT: + 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. + * + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection newChildDescriptors, Object object) { + super.collectNewChildDescriptors(newChildDescriptors, object); + + newChildDescriptors.add(createChildParameter(EnsurancePackage.Literals.ENSURANCE_DATABASE__ENSURANCECLIENT, + EnsuranceFactory.eINSTANCE.createEnsuranceClient())); + } + + /** + * Return the resource locator for this item provider's resources. + * + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() { + return EnsuranceEditPlugin.INSTANCE; + } + +} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/provider/EnsuranceEditPlugin.java b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/provider/EnsuranceEditPlugin.java new file mode 100644 index 0000000..a397837 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/provider/EnsuranceEditPlugin.java @@ -0,0 +1,87 @@ +/** + */ +package edu.kit.ipd.sdq.metamodels.ensurance.provider; + +import org.eclipse.emf.common.EMFPlugin; + +import org.eclipse.emf.common.util.ResourceLocator; + +/** + * This is the central singleton for the Ensurance edit plugin. + * + * + * @generated + */ +public final class EnsuranceEditPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * @generated + */ + public static final EnsuranceEditPlugin INSTANCE = new EnsuranceEditPlugin(); + + /** + * Keep track of the singleton. + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * @generated + */ + public EnsuranceEditPlugin() { + super(new ResourceLocator[] {}); + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() { + return plugin; + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() { + return plugin; + } + + /** + * The actual implementation of the Eclipse Plugin. + * + * + * @generated + */ + public static class Implementation extends EclipsePlugin { + /** + * Creates an instance. + * + * + * @generated + */ + public Implementation() { + super(); + + // Remember the static instance. + // + plugin = this; + } + } + +} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/provider/EnsuranceItemProviderAdapterFactory.java b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/provider/EnsuranceItemProviderAdapterFactory.java new file mode 100644 index 0000000..fecae07 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/provider/EnsuranceItemProviderAdapterFactory.java @@ -0,0 +1,226 @@ +/** + */ +package edu.kit.ipd.sdq.metamodels.ensurance.provider; + +import edu.kit.ipd.sdq.metamodels.ensurance.util.EnsuranceAdapterFactory; + +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; + +/** + * 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. + * + * + * @generated + */ +public class EnsuranceItemProviderAdapterFactory extends EnsuranceAdapterFactory + implements ComposeableAdapterFactory, IChangeNotifier, IDisposable { + /** + * This keeps track of the root adapter factory that delegates to this adapter factory. + * + * + * @generated + */ + protected ComposedAdapterFactory parentAdapterFactory; + + /** + * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. + * + * + * @generated + */ + protected IChangeNotifier changeNotifier = new ChangeNotifier(); + + /** + * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. + * + * + * @generated + */ + protected Collection supportedTypes = new ArrayList(); + + /** + * This constructs an instance. + * + * + * @generated + */ + public EnsuranceItemProviderAdapterFactory() { + 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 edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceDatabase} instances. + * + * + * @generated + */ + protected EnsuranceDatabaseItemProvider ensuranceDatabaseItemProvider; + + /** + * This creates an adapter for a {@link edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceDatabase}. + * + * + * @generated + */ + @Override + public Adapter createEnsuranceDatabaseAdapter() { + if (ensuranceDatabaseItemProvider == null) { + ensuranceDatabaseItemProvider = new EnsuranceDatabaseItemProvider(this); + } + + return ensuranceDatabaseItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceClient} instances. + * + * + * @generated + */ + protected EnsuranceClientItemProvider ensuranceClientItemProvider; + + /** + * This creates an adapter for a {@link edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceClient}. + * + * + * @generated + */ + @Override + public Adapter createEnsuranceClientAdapter() { + if (ensuranceClientItemProvider == null) { + ensuranceClientItemProvider = new EnsuranceClientItemProvider(this); + } + + return ensuranceClientItemProvider; + } + + /** + * This returns the root adapter factory that contains this factory. + * + * + * @generated + */ + public ComposeableAdapterFactory getRootAdapterFactory() { + return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); + } + + /** + * This sets the composed adapter factory that contains this factory. + * + * + * @generated + */ + public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { + this.parentAdapterFactory = parentAdapterFactory; + } + + /** + * + * + * @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. + * + * + * @generated + */ + @Override + public Adapter adapt(Notifier notifier, Object type) { + return super.adapt(notifier, this); + } + + /** + * + * + * @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. + * + * + * @generated + */ + public void addListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.addListener(notifyChangedListener); + } + + /** + * This removes a listener. + * + * + * @generated + */ + public void removeListener(INotifyChangedListener notifyChangedListener) { + changeNotifier.removeListener(notifyChangedListener); + } + + /** + * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. + * + * + * @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. + * + * + * @generated + */ + public void dispose() { + if (ensuranceDatabaseItemProvider != null) + ensuranceDatabaseItemProvider.dispose(); + if (ensuranceClientItemProvider != null) + ensuranceClientItemProvider.dispose(); + } + +} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/.classpath b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/.classpath new file mode 100644 index 0000000..716f845 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/.project b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/.project new file mode 100644 index 0000000..2454f0e --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/.project @@ -0,0 +1,28 @@ + + + edu.kit.ipd.sdq.metamodels.ensurance.editor + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/.settings/org.eclipse.jdt.core.prefs b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..0c68a61 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/META-INF/MANIFEST.MF b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/META-INF/MANIFEST.MF new file mode 100644 index 0000000..cc4c4ee --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/META-INF/MANIFEST.MF @@ -0,0 +1,19 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: edu.kit.ipd.sdq.metamodels.ensurance.editor;singleton:=true +Automatic-Module-Name: edu.kit.ipd.sdq.metamodels.ensurance.editor +Bundle-Version: 1.2.0.qualifier +Bundle-ClassPath: . +Bundle-Activator: edu.kit.ipd.sdq.metamodels.ensurance.presentation.EnsuranceEditorPlugin$Implementation +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Export-Package: edu.kit.ipd.sdq.metamodels.ensurance.presentation +Require-Bundle: org.eclipse.core.runtime, + org.eclipse.core.resources;visibility:=reexport, + edu.kit.ipd.sdq.metamodels.ensurance.edit;visibility:=reexport, + org.eclipse.emf.ecore.xmi;visibility:=reexport, + org.eclipse.emf.edit.ui;visibility:=reexport, + org.eclipse.ui.ide;visibility:=reexport +Bundle-ActivationPolicy: lazy diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/build.properties b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/build.properties new file mode 100644 index 0000000..11a5719 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/build.properties @@ -0,0 +1,10 @@ +# + +bin.includes = .,\ + icons/,\ + META-INF/,\ + plugin.xml,\ + plugin.properties +jars.compile.order = . +source.. = src-gen/ +output.. = bin diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/icons/full/obj16/EnsuranceModelFile.gif b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/icons/full/obj16/EnsuranceModelFile.gif new file mode 100644 index 0000000000000000000000000000000000000000..f33d349a79307906b24c933dfac017c78635b292 GIT binary patch literal 346 zcmZ?wbhEHb6krfwxXQrL(9jScAHRS9{{Q#qA2@IT$YuD?z`*by$o~Hy%=-WT_m8h{ zZXCV8fBvOqm0Kp*0?~$kyEQ!y%e$QxbvVy$b)DYi)?DseSL#Ro4^H&| z{PpMi&);8v{QmUy_lK{)-+ub_>ch|bFMr&5{vBumwSeMJ7DfgJHU=G#fgnFIu$4PB z7kKChDV|Wdq|s6_?*ea&=Ff=rGAj$2UR7D&^qeT9)h_o;U}=QlPEP)&=n%~)w;%2g z8|5Rr#8p&ySzCCU#9f&RT3K2OnOym+cv+_P^LO=3?Pr&QUxrVrF@*2_~*MgGFSrupJRKg literal 0 HcmV?d00001 diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/icons/full/wizban/NewEnsurance.gif b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/icons/full/wizban/NewEnsurance.gif new file mode 100644 index 0000000000000000000000000000000000000000..0ff8c5d5fcaa84b8f75b19637ca65d8cf47ba358 GIT binary patch literal 2462 zcmd6m`8OMg8ivzyXM`x-QPZJfTAHHK&QR5jT4P#9t7t6^##XzkW!$Ks6H6r4G!aW; zt;8;gy<$ls42=?%D3Kz9#?qG288hx*ao_Wt_s8!%-#OoBZEIy>>TM6W1^5Ek&)(kN z+WPj|`WHHLVuΞ?0RA8>{QvW^U=`?iuFp>ATyXR`~tzyNlmc#9DY~--cr?y|b<0 zSSvWj#y7_yApcHK;hmrY$0s6xtFY9X$lobXGwR~d4ZmTVe#0~-7toLeG*nT0dQk_4)PvopJFlV_SKWuJ zW)f-#itAV<`wWsBIW_bVYWpaSIYIB6?BxnrW3#;JrSa*-3894letAZ`CJ?PGNH@ij z^{Wpvu06^$f0%yVBkQ_H=1niO<>P<1z*zg{SovV=e$9miE&$iC73F8~zw0CEbNHuWX1lNFBYKlC>`anK2*V@EI< z)2>ce)e97yyO@tiQ!|Xvw8eTs(zGo6Ane9@+g$yNt%Pcs4*;zPr;^#5evo2?h~PUO4MC_>wMfRQ1Az>G~#;lAyDhiySg_C{I*1Dt?c_;8A8bBu@-WY*Er>dN_ zsj92@@9g=mm!DQXH2lik(?FjO^Lt$sy?fQwoXTgIDJ`D~xr+N>(+p2LsUi*C zac>txg>k1pEzCp%hiO81E#m|`vH6D0(6f5(8AY$c1Ae(7hR2`HMn|b%Dh>x3k50YWRP}KTcp#wME)rfZ7 zGFkijXH&yUh1KVV=wP>mivvM{-0)wnv!Qk@9k}yG`Ps^qdWz~vF|_OWAKV_Ux{^RU z4J-RPT~6jcZaimK!ma1IUi$T9ZxE`4>NY%dD!w67}WWRlaM$}s(PG5 zp-lxt_hi_(hFS^_5_+D{(qS?EXEa)+ueNz6o+qHApB#1u8UJ$Bqmg}6XC_+s?S)Q1 zZmh*2#uUk&i}(;cXlWvF9U7K#=o(;%q#U1kWjV)e)b(OXbLQf-%ivn9=(Y+t?ju7w zvP*lVBL8(ZCFa^sLZGsR(tMU@?d}`w7v*OFrWY}1q5f1cR9Nyo`7fam-D%b>a`}1G z=ykitU+qe-2$DSy3)XJMv2NB_-2n-1#0Z2ayy$4}FO4kJxpeuagKsE&&+g@y?bfzB zu{d0MXC-4!6?#t^C)K>{Bn4Jh$t@Q&thD z0?Y1Q&j7DY^~I##8{cT+8(2D* zn3(KfE8`3!wynk-*7~mY&>@kvp&mLa#f_w4&d;~B+sLhg>FTF@v0?XR_kohzgMXg@ zI5x0TPeH|ZVAUKCA~p{#ATb}~?0XJ#LP?qmM`PFk&$1)Oh7lFuOql}sq4fT$@e9Kx z@@YrCrqucL6eG2s3_l|hVG*`yIvmS^Z2%D{3)YX}rgr+5wK8q(Dqc|AMy({@Nw%nWHUV;KhX?P|iK>#YL1X12|N#TsA!R)sVHe5C3gWs1Tr&(i^!`?|44vYpj!?xore#UhJ- z06pguT-5$^5R~@g_z(A$^=F?S&LC4Gv$Aa-5dVxZk2?-Nfqii6UW&#WA5>%ELDL#r zT^#Z|Cx=?4pa;&o&e;dZm(@D~sb1gO^LsTu*QXx;=7tLi=>$-&^U?LcidRcN00NxI zV-LZ#NCm?Sy1+PZ7}OFkKT!BNw>%R`6y#r*&}gr&t0{CVjVO!0F0D z7#BR+I8tay!VdRS{u`GUc+2nI{e%6AXT4FtkZ9? + + + + + + + + + + + %_UI_EnsuranceModelWizard_description + + + + + + + + + + + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/presentation/EnsuranceActionBarContributor.java b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/presentation/EnsuranceActionBarContributor.java new file mode 100644 index 0000000..580931f --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/presentation/EnsuranceActionBarContributor.java @@ -0,0 +1,423 @@ +/** + */ +package edu.kit.ipd.sdq.metamodels.ensurance.presentation; + +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 Ensurance model editor. + * + * + * @generated + */ +public class EnsuranceActionBarContributor extends EditingDomainActionBarContributor + implements ISelectionChangedListener { + /** + * This keeps track of the active editor. + * + * + * @generated + */ + protected IEditorPart activeEditorPart; + + /** + * This keeps track of the current selection provider. + * + * + * @generated + */ + protected ISelectionProvider selectionProvider; + + /** + * This action opens the Properties view. + * + * + * @generated + */ + protected IAction showPropertiesViewAction = new Action( + EnsuranceEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { + @Override + public void run() { + try { + getPage().showView("org.eclipse.ui.views.PropertySheet"); + } catch (PartInitException exception) { + EnsuranceEditorPlugin.INSTANCE.log(exception); + } + } + }; + + /** + * This action refreshes the viewer of the current editor if the editor + * implements {@link org.eclipse.emf.common.ui.viewer.IViewerProvider}. + * + * + * @generated + */ + protected IAction refreshViewerAction = new Action( + EnsuranceEditorPlugin.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. + * + * + * @generated + */ + protected Collection createChildActions; + + /** + * This is the menu manager into which menu contribution items should be added for CreateChild actions. + * + * + * @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. + * + * + * @generated + */ + protected Collection createSiblingActions; + + /** + * This is the menu manager into which menu contribution items should be added for CreateSibling actions. + * + * + * @generated + */ + protected IMenuManager createSiblingMenuManager; + + /** + * This creates an instance of the contributor. + * + * + * @generated + */ + public EnsuranceActionBarContributor() { + super(ADDITIONS_LAST_STYLE); + loadResourceAction = new LoadResourceAction(); + validateAction = new ValidateAction(); + controlAction = new ControlAction(); + } + + /** + * This adds Separators for editor additions to the tool bar. + * + * + * @generated + */ + @Override + public void contributeToToolBar(IToolBarManager toolBarManager) { + super.contributeToToolBar(toolBarManager); + toolBarManager.add(new Separator("ensurance-settings")); + toolBarManager.add(new Separator("ensurance-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. + * + * + * @generated + */ + @Override + public void contributeToMenu(IMenuManager menuManager) { + super.contributeToMenu(menuManager); + + IMenuManager submenuManager = new MenuManager( + EnsuranceEditorPlugin.INSTANCE.getString("_UI_EnsuranceEditor_menu"), + "edu.kit.ipd.sdq.metamodels.ensuranceMenuID"); + 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(EnsuranceEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + submenuManager.insertBefore("additions", createChildMenuManager); + + // Prepare for CreateSibling item addition or removal. + // + createSiblingMenuManager = new MenuManager( + EnsuranceEditorPlugin.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. + * + * + * @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. + * + * + * @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 descriptors, + * and returns the collection of these actions. + * + * + * @generated + */ + protected Collection generateCreateChildActions(Collection descriptors, ISelection selection) { + Collection actions = new ArrayList(); + 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 descriptors, + * and returns the collection of these actions. + * + * + * @generated + */ + protected Collection generateCreateSiblingActions(Collection descriptors, ISelection selection) { + Collection actions = new ArrayList(); + if (descriptors != null) { + for (Object descriptor : descriptors) { + actions.add(new CreateSiblingAction(activeEditorPart, selection, descriptor)); + } + } + return actions; + } + + /** + * This populates the specified manager with {@link org.eclipse.jface.action.ActionContributionItem}s + * based on the {@link org.eclipse.jface.action.IAction}s contained in the actions collection, + * by inserting them before the specified contribution item contributionID. + * If contributionID is null, they are simply added. + * + * + * @generated + */ + protected void populateManager(IContributionManager manager, Collection 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 manager all {@link org.eclipse.jface.action.ActionContributionItem}s + * based on the {@link org.eclipse.jface.action.IAction}s contained in the actions collection. + * + * + * @generated + */ + protected void depopulateManager(IContributionManager manager, Collection 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. + * + * + * @generated + */ + @Override + public void menuAboutToShow(IMenuManager menuManager) { + super.menuAboutToShow(menuManager); + MenuManager submenuManager = null; + + submenuManager = new MenuManager(EnsuranceEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); + populateManager(submenuManager, createChildActions, null); + menuManager.insertBefore("edit", submenuManager); + + submenuManager = new MenuManager(EnsuranceEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); + populateManager(submenuManager, createSiblingActions, null); + menuManager.insertBefore("edit", submenuManager); + } + + /** + * This inserts global actions before the "additions-end" separator. + * + * + * @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. + * + * + * @generated + */ + @Override + protected boolean removeAllReferencesOnDelete() { + return true; + } + +} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/presentation/EnsuranceEditor.java b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/presentation/EnsuranceEditor.java new file mode 100644 index 0000000..64cbf17 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/presentation/EnsuranceEditor.java @@ -0,0 +1,1777 @@ +/** + */ +package edu.kit.ipd.sdq.metamodels.ensurance.presentation; + +import java.io.IOException; +import java.io.InputStream; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +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.IFile; +import org.eclipse.core.resources.IMarker; +import org.eclipse.core.resources.IResource; +import org.eclipse.core.resources.IResourceChangeEvent; +import org.eclipse.core.resources.IResourceChangeListener; +import org.eclipse.core.resources.IResourceDelta; +import org.eclipse.core.resources.IResourceDeltaVisitor; +import org.eclipse.core.resources.ResourcesPlugin; + +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IPath; +import org.eclipse.core.runtime.IProgressMonitor; +import org.eclipse.core.runtime.NullProgressMonitor; + +import org.eclipse.jface.action.IMenuListener; +import org.eclipse.jface.action.IMenuManager; +import org.eclipse.jface.action.IStatusLineManager; +import org.eclipse.jface.action.IToolBarManager; +import org.eclipse.jface.action.MenuManager; +import org.eclipse.jface.action.Separator; + +import org.eclipse.jface.dialogs.MessageDialog; +import org.eclipse.jface.dialogs.ProgressMonitorDialog; + +import org.eclipse.jface.util.LocalSelectionTransfer; + +import org.eclipse.jface.viewers.ColumnWeightData; +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.ListViewer; +import org.eclipse.jface.viewers.SelectionChangedEvent; +import org.eclipse.jface.viewers.StructuredSelection; +import org.eclipse.jface.viewers.StructuredViewer; +import org.eclipse.jface.viewers.TableLayout; +import org.eclipse.jface.viewers.TableViewer; +import org.eclipse.jface.viewers.TreeViewer; +import org.eclipse.jface.viewers.Viewer; + +import org.eclipse.swt.SWT; + +import org.eclipse.swt.custom.CTabFolder; + +import org.eclipse.swt.dnd.DND; +import org.eclipse.swt.dnd.FileTransfer; +import org.eclipse.swt.dnd.Transfer; + +import org.eclipse.swt.events.ControlAdapter; +import org.eclipse.swt.events.ControlEvent; + +import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.Rectangle; + +import org.eclipse.swt.layout.FillLayout; + +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.Table; +import org.eclipse.swt.widgets.TableColumn; +import org.eclipse.swt.widgets.Tree; +import org.eclipse.swt.widgets.TreeColumn; + +import org.eclipse.ui.IActionBars; +import org.eclipse.ui.IEditorInput; +import org.eclipse.ui.IEditorPart; +import org.eclipse.ui.IEditorSite; +import org.eclipse.ui.IPartListener; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.PartInitException; + +import org.eclipse.ui.dialogs.SaveAsDialog; + +import org.eclipse.ui.ide.IGotoMarker; + +import org.eclipse.ui.part.FileEditorInput; +import org.eclipse.ui.part.MultiPageEditorPart; + +import org.eclipse.ui.views.contentoutline.ContentOutline; +import org.eclipse.ui.views.contentoutline.ContentOutlinePage; +import org.eclipse.ui.views.contentoutline.IContentOutlinePage; + +import org.eclipse.ui.views.properties.IPropertySheetPage; +import org.eclipse.ui.views.properties.PropertySheet; +import org.eclipse.ui.views.properties.PropertySheetPage; + +import org.eclipse.emf.common.command.BasicCommandStack; +import org.eclipse.emf.common.command.Command; +import org.eclipse.emf.common.command.CommandStack; +import org.eclipse.emf.common.command.CommandStackListener; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.common.ui.MarkerHelper; +import org.eclipse.emf.common.ui.ViewerPane; + +import org.eclipse.emf.common.ui.editor.ProblemEditorPart; + +import org.eclipse.emf.common.ui.viewer.IViewerProvider; + +import org.eclipse.emf.common.util.BasicDiagnostic; +import org.eclipse.emf.common.util.Diagnostic; +import org.eclipse.emf.common.util.URI; + +import org.eclipse.emf.ecore.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; + +import org.eclipse.emf.ecore.util.EContentAdapter; +import org.eclipse.emf.ecore.util.EcoreUtil; + +import org.eclipse.emf.edit.domain.AdapterFactoryEditingDomain; +import org.eclipse.emf.edit.domain.EditingDomain; +import org.eclipse.emf.edit.domain.IEditingDomainProvider; + +import org.eclipse.emf.edit.provider.AdapterFactoryItemDelegator; +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.action.EditingDomainActionBarContributor; + +import org.eclipse.emf.edit.ui.celleditor.AdapterFactoryTreeEditor; + +import org.eclipse.emf.edit.ui.dnd.EditingDomainViewerDropAdapter; +import org.eclipse.emf.edit.ui.dnd.LocalTransfer; +import org.eclipse.emf.edit.ui.dnd.ViewerDragAdapter; + +import org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider; +import org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider; +import org.eclipse.emf.edit.ui.provider.UnwrappingSelectionProvider; + +import org.eclipse.emf.edit.ui.util.EditUIMarkerHelper; +import org.eclipse.emf.edit.ui.util.EditUIUtil; + +import org.eclipse.emf.edit.ui.view.ExtendedPropertySheetPage; + +import edu.kit.ipd.sdq.metamodels.ensurance.provider.EnsuranceItemProviderAdapterFactory; + +import org.eclipse.ui.actions.WorkspaceModifyOperation; + +/** + * This is an example of a Ensurance model editor. + * + * + * @generated + */ +public class EnsuranceEditor extends MultiPageEditorPart + implements IEditingDomainProvider, ISelectionProvider, IMenuListener, IViewerProvider, IGotoMarker { + /** + * This keeps track of the editing domain that is used to track all changes to the model. + * + * + * @generated + */ + protected AdapterFactoryEditingDomain editingDomain; + + /** + * This is the one adapter factory used for providing views of the model. + * + * + * @generated + */ + protected ComposedAdapterFactory adapterFactory; + + /** + * This is the content outline page. + * + * + * @generated + */ + protected IContentOutlinePage contentOutlinePage; + + /** + * This is a kludge... + * + * + * @generated + */ + protected IStatusLineManager contentOutlineStatusLineManager; + + /** + * This is the content outline page's viewer. + * + * + * @generated + */ + protected TreeViewer contentOutlineViewer; + + /** + * This is the property sheet page. + * + * + * @generated + */ + protected List propertySheetPages = new ArrayList(); + + /** + * This is the viewer that shadows the selection in the content outline. + * The parent relation must be correctly defined for this to work. + * + * + * @generated + */ + protected TreeViewer selectionViewer; + + /** + * This inverts the roll of parent and child in the content provider and show parents as a tree. + * + * + * @generated + */ + protected TreeViewer parentViewer; + + /** + * This shows how a tree view works. + * + * + * @generated + */ + protected TreeViewer treeViewer; + + /** + * This shows how a list view works. + * A list viewer doesn't support icons. + * + * + * @generated + */ + protected ListViewer listViewer; + + /** + * This shows how a table view works. + * A table can be used as a list with icons. + * + * + * @generated + */ + protected TableViewer tableViewer; + + /** + * This shows how a tree view with columns works. + * + * + * @generated + */ + protected TreeViewer treeViewerWithColumns; + + /** + * This keeps track of the active viewer pane, in the book. + * + * + * @generated + */ + protected ViewerPane currentViewerPane; + + /** + * This keeps track of the active content viewer, which may be either one of the viewers in the pages or the content outline viewer. + * + * + * @generated + */ + protected Viewer currentViewer; + + /** + * This listens to which ever viewer is active. + * + * + * @generated + */ + protected ISelectionChangedListener selectionChangedListener; + + /** + * This keeps track of all the {@link org.eclipse.jface.viewers.ISelectionChangedListener}s that are listening to this editor. + * + * + * @generated + */ + protected Collection selectionChangedListeners = new ArrayList(); + + /** + * This keeps track of the selection of the editor as a whole. + * + * + * @generated + */ + protected ISelection editorSelection = StructuredSelection.EMPTY; + + /** + * The MarkerHelper is responsible for creating workspace resource markers presented + * in Eclipse's Problems View. + * + * + * @generated + */ + protected MarkerHelper markerHelper = new EditUIMarkerHelper(); + + /** + * This listens for when the outline becomes active + * + * + * @generated + */ + protected IPartListener partListener = new IPartListener() { + public void partActivated(IWorkbenchPart p) { + if (p instanceof ContentOutline) { + if (((ContentOutline) p).getCurrentPage() == contentOutlinePage) { + getActionBarContributor().setActiveEditor(EnsuranceEditor.this); + + setCurrentViewer(contentOutlineViewer); + } + } else if (p instanceof PropertySheet) { + if (propertySheetPages.contains(((PropertySheet) p).getCurrentPage())) { + getActionBarContributor().setActiveEditor(EnsuranceEditor.this); + handleActivate(); + } + } else if (p == EnsuranceEditor.this) { + handleActivate(); + } + } + + public void partBroughtToTop(IWorkbenchPart p) { + // Ignore. + } + + public void partClosed(IWorkbenchPart p) { + // Ignore. + } + + public void partDeactivated(IWorkbenchPart p) { + // Ignore. + } + + public void partOpened(IWorkbenchPart p) { + // Ignore. + } + }; + + /** + * Resources that have been removed since last activation. + * + * + * @generated + */ + protected Collection removedResources = new ArrayList(); + + /** + * Resources that have been changed since last activation. + * + * + * @generated + */ + protected Collection changedResources = new ArrayList(); + + /** + * Resources that have been saved. + * + * + * @generated + */ + protected Collection savedResources = new ArrayList(); + + /** + * Map to store the diagnostic associated with a resource. + * + * + * @generated + */ + protected Map resourceToDiagnosticMap = new LinkedHashMap(); + + /** + * Controls whether the problem indication should be updated. + * + * + * @generated + */ + protected boolean updateProblemIndication = true; + + /** + * Adapter used to update the problem indication when resources are demanded loaded. + * + * + * @generated + */ + protected EContentAdapter problemIndicationAdapter = new EContentAdapter() { + protected boolean dispatching; + + @Override + public void notifyChanged(Notification notification) { + if (notification.getNotifier() instanceof Resource) { + switch (notification.getFeatureID(Resource.class)) { + case Resource.RESOURCE__IS_LOADED: + case Resource.RESOURCE__ERRORS: + case Resource.RESOURCE__WARNINGS: { + Resource resource = (Resource) notification.getNotifier(); + Diagnostic diagnostic = analyzeResourceProblems(resource, null); + if (diagnostic.getSeverity() != Diagnostic.OK) { + resourceToDiagnosticMap.put(resource, diagnostic); + } else { + resourceToDiagnosticMap.remove(resource); + } + dispatchUpdateProblemIndication(); + break; + } + } + } else { + super.notifyChanged(notification); + } + } + + protected void dispatchUpdateProblemIndication() { + if (updateProblemIndication && !dispatching) { + dispatching = true; + getSite().getShell().getDisplay().asyncExec(new Runnable() { + public void run() { + dispatching = false; + updateProblemIndication(); + } + }); + } + } + + @Override + protected void setTarget(Resource target) { + basicSetTarget(target); + } + + @Override + protected void unsetTarget(Resource target) { + basicUnsetTarget(target); + resourceToDiagnosticMap.remove(target); + dispatchUpdateProblemIndication(); + } + }; + + /** + * This listens for workspace changes. + * + * + * @generated + */ + protected IResourceChangeListener resourceChangeListener = new IResourceChangeListener() { + public void resourceChanged(IResourceChangeEvent event) { + IResourceDelta delta = event.getDelta(); + try { + class ResourceDeltaVisitor implements IResourceDeltaVisitor { + protected ResourceSet resourceSet = editingDomain.getResourceSet(); + protected Collection changedResources = new ArrayList(); + protected Collection removedResources = new ArrayList(); + + public boolean visit(IResourceDelta delta) { + if (delta.getResource().getType() == IResource.FILE) { + if (delta.getKind() == IResourceDelta.REMOVED || delta.getKind() == IResourceDelta.CHANGED + && delta.getFlags() != IResourceDelta.MARKERS) { + Resource resource = resourceSet.getResource( + URI.createPlatformResourceURI(delta.getFullPath().toString(), true), false); + if (resource != null) { + if (delta.getKind() == IResourceDelta.REMOVED) { + removedResources.add(resource); + } else if (!savedResources.remove(resource)) { + changedResources.add(resource); + } + } + } + return false; + } + + return true; + } + + public Collection getChangedResources() { + return changedResources; + } + + public Collection getRemovedResources() { + return removedResources; + } + } + + final ResourceDeltaVisitor visitor = new ResourceDeltaVisitor(); + delta.accept(visitor); + + if (!visitor.getRemovedResources().isEmpty()) { + getSite().getShell().getDisplay().asyncExec(new Runnable() { + public void run() { + removedResources.addAll(visitor.getRemovedResources()); + if (!isDirty()) { + getSite().getPage().closeEditor(EnsuranceEditor.this, false); + } + } + }); + } + + if (!visitor.getChangedResources().isEmpty()) { + getSite().getShell().getDisplay().asyncExec(new Runnable() { + public void run() { + changedResources.addAll(visitor.getChangedResources()); + if (getSite().getPage().getActiveEditor() == EnsuranceEditor.this) { + handleActivate(); + } + } + }); + } + } catch (CoreException exception) { + EnsuranceEditorPlugin.INSTANCE.log(exception); + } + } + }; + + /** + * Handles activation of the editor or it's associated views. + * + * + * @generated + */ + protected void handleActivate() { + // Recompute the read only state. + // + if (editingDomain.getResourceToReadOnlyMap() != null) { + editingDomain.getResourceToReadOnlyMap().clear(); + + // Refresh any actions that may become enabled or disabled. + // + setSelection(getSelection()); + } + + if (!removedResources.isEmpty()) { + if (handleDirtyConflict()) { + getSite().getPage().closeEditor(EnsuranceEditor.this, false); + } else { + removedResources.clear(); + changedResources.clear(); + savedResources.clear(); + } + } else if (!changedResources.isEmpty()) { + changedResources.removeAll(savedResources); + handleChangedResources(); + changedResources.clear(); + savedResources.clear(); + } + } + + /** + * Handles what to do with changed resources on activation. + * + * + * @generated + */ + protected void handleChangedResources() { + if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) { + ResourceSet resourceSet = editingDomain.getResourceSet(); + if (isDirty()) { + changedResources.addAll(resourceSet.getResources()); + } + editingDomain.getCommandStack().flush(); + + updateProblemIndication = false; + for (Resource resource : changedResources) { + if (resource.isLoaded()) { + resource.unload(); + try { + resource.load(resourceSet.getLoadOptions()); + } catch (IOException exception) { + if (!resourceToDiagnosticMap.containsKey(resource)) { + resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); + } + } + } + } + + if (AdapterFactoryEditingDomain.isStale(editorSelection)) { + setSelection(StructuredSelection.EMPTY); + } + + updateProblemIndication = true; + updateProblemIndication(); + } + } + + /** + * Updates the problems indication with the information described in the specified diagnostic. + * + * + * @generated + */ + protected void updateProblemIndication() { + if (updateProblemIndication) { + BasicDiagnostic diagnostic = new BasicDiagnostic(Diagnostic.OK, + "edu.kit.ipd.sdq.metamodels.ensurance.editor", 0, null, + new Object[] { editingDomain.getResourceSet() }); + for (Diagnostic childDiagnostic : resourceToDiagnosticMap.values()) { + if (childDiagnostic.getSeverity() != Diagnostic.OK) { + diagnostic.add(childDiagnostic); + } + } + + int lastEditorPage = getPageCount() - 1; + if (lastEditorPage >= 0 && getEditor(lastEditorPage) instanceof ProblemEditorPart) { + ((ProblemEditorPart) getEditor(lastEditorPage)).setDiagnostic(diagnostic); + if (diagnostic.getSeverity() != Diagnostic.OK) { + setActivePage(lastEditorPage); + } + } else if (diagnostic.getSeverity() != Diagnostic.OK) { + ProblemEditorPart problemEditorPart = new ProblemEditorPart(); + problemEditorPart.setDiagnostic(diagnostic); + problemEditorPart.setMarkerHelper(markerHelper); + try { + addPage(++lastEditorPage, problemEditorPart, getEditorInput()); + setPageText(lastEditorPage, problemEditorPart.getPartName()); + setActivePage(lastEditorPage); + showTabs(); + } catch (PartInitException exception) { + EnsuranceEditorPlugin.INSTANCE.log(exception); + } + } + + if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { + try { + markerHelper.updateMarkers(diagnostic); + } catch (CoreException exception) { + EnsuranceEditorPlugin.INSTANCE.log(exception); + } + } + } + } + + /** + * Shows a dialog that asks if conflicting changes should be discarded. + * + * + * @generated + */ + protected boolean handleDirtyConflict() { + return MessageDialog.openQuestion(getSite().getShell(), getString("_UI_FileConflict_label"), + getString("_WARN_FileConflict")); + } + + /** + * This creates a model editor. + * + * + * @generated + */ + public EnsuranceEditor() { + super(); + initializeEditingDomain(); + } + + /** + * 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 EnsuranceItemProviderAdapterFactory()); + 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() { + public void commandStackChanged(final EventObject event) { + getContainer().getDisplay().asyncExec(new Runnable() { + public void run() { + firePropertyChange(IEditorPart.PROP_DIRTY); + + // Try to select the affected objects. + // + Command mostRecentCommand = ((CommandStack) event.getSource()).getMostRecentCommand(); + if (mostRecentCommand != null) { + setSelectionToViewer(mostRecentCommand.getAffectedObjects()); + } + for (Iterator i = propertySheetPages.iterator(); i.hasNext();) { + PropertySheetPage propertySheetPage = i.next(); + if (propertySheetPage.getControl() == null || propertySheetPage.getControl().isDisposed()) { + i.remove(); + } else { + propertySheetPage.refresh(); + } + } + } + }); + } + }); + + // Create the editing domain with a special command stack. + // + editingDomain = new AdapterFactoryEditingDomain(adapterFactory, commandStack, new HashMap()); + } + + /** + * This is here for the listener to be able to call it. + * + * + * @generated + */ + @Override + protected void firePropertyChange(int action) { + super.firePropertyChange(action); + } + + /** + * This sets the selection into whichever viewer is active. + * + * + * @generated + */ + public void setSelectionToViewer(Collection collection) { + final Collection theSelection = collection; + // Make sure it's okay. + // + if (theSelection != null && !theSelection.isEmpty()) { + Runnable runnable = new Runnable() { + public void run() { + // Try to select the items in the current content viewer of the editor. + // + if (currentViewer != null) { + currentViewer.setSelection(new StructuredSelection(theSelection.toArray()), true); + } + } + }; + getSite().getShell().getDisplay().asyncExec(runnable); + } + } + + /** + * This returns the editing domain as required by the {@link IEditingDomainProvider} interface. + * This is important for implementing the static methods of {@link AdapterFactoryEditingDomain} + * and for supporting {@link org.eclipse.emf.edit.ui.action.CommandAction}. + * + * + * @generated + */ + public EditingDomain getEditingDomain() { + return editingDomain; + } + + /** + * + * + * @generated + */ + public class ReverseAdapterFactoryContentProvider extends AdapterFactoryContentProvider { + /** + * + * + * @generated + */ + public ReverseAdapterFactoryContentProvider(AdapterFactory adapterFactory) { + super(adapterFactory); + } + + /** + * + * + * @generated + */ + @Override + public Object[] getElements(Object object) { + Object parent = super.getParent(object); + return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); + } + + /** + * + * + * @generated + */ + @Override + public Object[] getChildren(Object object) { + Object parent = super.getParent(object); + return (parent == null ? Collections.EMPTY_SET : Collections.singleton(parent)).toArray(); + } + + /** + * + * + * @generated + */ + @Override + public boolean hasChildren(Object object) { + Object parent = super.getParent(object); + return parent != null; + } + + /** + * + * + * @generated + */ + @Override + public Object getParent(Object object) { + return null; + } + } + + /** + * + * + * @generated + */ + public void setCurrentViewerPane(ViewerPane viewerPane) { + if (currentViewerPane != viewerPane) { + if (currentViewerPane != null) { + currentViewerPane.showFocus(false); + } + currentViewerPane = viewerPane; + } + setCurrentViewer(currentViewerPane.getViewer()); + } + + /** + * This makes sure that one content viewer, either for the current page or the outline view, if it has focus, + * is the current one. + * + * + * @generated + */ + public void setCurrentViewer(Viewer viewer) { + // If it is changing... + // + if (currentViewer != viewer) { + if (selectionChangedListener == null) { + // Create the listener on demand. + // + selectionChangedListener = new ISelectionChangedListener() { + // This just notifies those things that are affected by the section. + // + public void selectionChanged(SelectionChangedEvent selectionChangedEvent) { + setSelection(selectionChangedEvent.getSelection()); + } + }; + } + + // Stop listening to the old one. + // + if (currentViewer != null) { + currentViewer.removeSelectionChangedListener(selectionChangedListener); + } + + // Start listening to the new one. + // + if (viewer != null) { + viewer.addSelectionChangedListener(selectionChangedListener); + } + + // Remember it. + // + currentViewer = viewer; + + // Set the editors selection based on the current viewer's selection. + // + setSelection(currentViewer == null ? StructuredSelection.EMPTY : currentViewer.getSelection()); + } + } + + /** + * This returns the viewer as required by the {@link IViewerProvider} interface. + * + * + * @generated + */ + public Viewer getViewer() { + return currentViewer; + } + + /** + * This creates a context menu for the viewer and adds a listener as well registering the menu for extension. + * + * + * @generated + */ + protected void createContextMenuFor(StructuredViewer viewer) { + MenuManager contextMenu = new MenuManager("#PopUp"); + contextMenu.add(new Separator("additions")); + contextMenu.setRemoveAllWhenShown(true); + contextMenu.addMenuListener(this); + Menu menu = contextMenu.createContextMenu(viewer.getControl()); + viewer.getControl().setMenu(menu); + getSite().registerContextMenu(contextMenu, new UnwrappingSelectionProvider(viewer)); + + int dndOperations = DND.DROP_COPY | DND.DROP_MOVE | DND.DROP_LINK; + Transfer[] transfers = new Transfer[] { LocalTransfer.getInstance(), LocalSelectionTransfer.getTransfer(), + FileTransfer.getInstance() }; + viewer.addDragSupport(dndOperations, transfers, new ViewerDragAdapter(viewer)); + viewer.addDropSupport(dndOperations, transfers, new EditingDomainViewerDropAdapter(editingDomain, viewer)); + } + + /** + * This is the method called to load a resource into the editing domain's resource set based on the editor's input. + * + * + * @generated + */ + public void createModel() { + URI resourceURI = EditUIUtil.getURI(getEditorInput(), editingDomain.getResourceSet().getURIConverter()); + Exception exception = null; + Resource resource = null; + try { + // Load the resource through the editing domain. + // + resource = editingDomain.getResourceSet().getResource(resourceURI, true); + } catch (Exception e) { + exception = e; + resource = editingDomain.getResourceSet().getResource(resourceURI, false); + } + + Diagnostic diagnostic = analyzeResourceProblems(resource, exception); + if (diagnostic.getSeverity() != Diagnostic.OK) { + resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); + } + editingDomain.getResourceSet().eAdapters().add(problemIndicationAdapter); + } + + /** + * 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) { + boolean hasErrors = !resource.getErrors().isEmpty(); + if (hasErrors || !resource.getWarnings().isEmpty()) { + BasicDiagnostic basicDiagnostic = new BasicDiagnostic(hasErrors ? Diagnostic.ERROR : Diagnostic.WARNING, + "edu.kit.ipd.sdq.metamodels.ensurance.editor", 0, + getString("_UI_CreateModelError_message", resource.getURI()), + new Object[] { exception == null ? (Object) resource : exception }); + basicDiagnostic.merge(EcoreUtil.computeDiagnostic(resource, true)); + return basicDiagnostic; + } else if (exception != null) { + return new BasicDiagnostic(Diagnostic.ERROR, "edu.kit.ipd.sdq.metamodels.ensurance.editor", 0, + getString("_UI_CreateModelError_message", resource.getURI()), new Object[] { exception }); + } else { + return Diagnostic.OK_INSTANCE; + } + } + + /** + * This is the method used by the framework to install your own controls. + * + * + * @generated + */ + @Override + public void createPages() { + // Creates the model from the editor input + // + createModel(); + + // Only creates the other pages if there is something that can be edited + // + if (!getEditingDomain().getResourceSet().getResources().isEmpty()) { + // Create a page for the selection tree view. + // + { + ViewerPane viewerPane = new ViewerPane(getSite().getPage(), EnsuranceEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + Tree tree = new Tree(composite, SWT.MULTI); + TreeViewer newTreeViewer = new TreeViewer(tree); + return newTreeViewer; + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + + selectionViewer = (TreeViewer) viewerPane.getViewer(); + selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + selectionViewer.setUseHashlookup(true); + + selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + selectionViewer.setInput(editingDomain.getResourceSet()); + selectionViewer.setSelection( + new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); + viewerPane.setTitle(editingDomain.getResourceSet()); + + new AdapterFactoryTreeEditor(selectionViewer.getTree(), adapterFactory); + + createContextMenuFor(selectionViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_SelectionPage_label")); + } + + // Create a page for the parent tree view. + // + { + ViewerPane viewerPane = new ViewerPane(getSite().getPage(), EnsuranceEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + Tree tree = new Tree(composite, SWT.MULTI); + TreeViewer newTreeViewer = new TreeViewer(tree); + return newTreeViewer; + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + + parentViewer = (TreeViewer) viewerPane.getViewer(); + parentViewer.setAutoExpandLevel(30); + parentViewer.setContentProvider(new ReverseAdapterFactoryContentProvider(adapterFactory)); + parentViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + createContextMenuFor(parentViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_ParentPage_label")); + } + + // This is the page for the list viewer + // + { + ViewerPane viewerPane = new ViewerPane(getSite().getPage(), EnsuranceEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + return new ListViewer(composite); + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + listViewer = (ListViewer) viewerPane.getViewer(); + listViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + listViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + createContextMenuFor(listViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_ListPage_label")); + } + + // This is the page for the tree viewer + // + { + ViewerPane viewerPane = new ViewerPane(getSite().getPage(), EnsuranceEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + return new TreeViewer(composite); + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + treeViewer = (TreeViewer) viewerPane.getViewer(); + treeViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + treeViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + new AdapterFactoryTreeEditor(treeViewer.getTree(), adapterFactory); + + createContextMenuFor(treeViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_TreePage_label")); + } + + // This is the page for the table viewer. + // + { + ViewerPane viewerPane = new ViewerPane(getSite().getPage(), EnsuranceEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + return new TableViewer(composite); + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + tableViewer = (TableViewer) viewerPane.getViewer(); + + Table table = tableViewer.getTable(); + TableLayout layout = new TableLayout(); + table.setLayout(layout); + table.setHeaderVisible(true); + table.setLinesVisible(true); + + TableColumn objectColumn = new TableColumn(table, SWT.NONE); + layout.addColumnData(new ColumnWeightData(3, 100, true)); + objectColumn.setText(getString("_UI_ObjectColumn_label")); + objectColumn.setResizable(true); + + TableColumn selfColumn = new TableColumn(table, SWT.NONE); + layout.addColumnData(new ColumnWeightData(2, 100, true)); + selfColumn.setText(getString("_UI_SelfColumn_label")); + selfColumn.setResizable(true); + + tableViewer.setColumnProperties(new String[] { "a", "b" }); + tableViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + tableViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + createContextMenuFor(tableViewer); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_TablePage_label")); + } + + // This is the page for the table tree viewer. + // + { + ViewerPane viewerPane = new ViewerPane(getSite().getPage(), EnsuranceEditor.this) { + @Override + public Viewer createViewer(Composite composite) { + return new TreeViewer(composite); + } + + @Override + public void requestActivation() { + super.requestActivation(); + setCurrentViewerPane(this); + } + }; + viewerPane.createControl(getContainer()); + + treeViewerWithColumns = (TreeViewer) viewerPane.getViewer(); + + Tree tree = treeViewerWithColumns.getTree(); + tree.setLayoutData(new FillLayout()); + tree.setHeaderVisible(true); + tree.setLinesVisible(true); + + TreeColumn objectColumn = new TreeColumn(tree, SWT.NONE); + objectColumn.setText(getString("_UI_ObjectColumn_label")); + objectColumn.setResizable(true); + objectColumn.setWidth(250); + + TreeColumn selfColumn = new TreeColumn(tree, SWT.NONE); + selfColumn.setText(getString("_UI_SelfColumn_label")); + selfColumn.setResizable(true); + selfColumn.setWidth(200); + + treeViewerWithColumns.setColumnProperties(new String[] { "a", "b" }); + treeViewerWithColumns.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + treeViewerWithColumns.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + + createContextMenuFor(treeViewerWithColumns); + int pageIndex = addPage(viewerPane.getControl()); + setPageText(pageIndex, getString("_UI_TreeWithColumnsPage_label")); + } + + getSite().getShell().getDisplay().asyncExec(new Runnable() { + public void run() { + if (!getContainer().isDisposed()) { + setActivePage(0); + } + } + }); + } + + // Ensures that this editor will only display the page's tab + // area if there are more than one page + // + getContainer().addControlListener(new ControlAdapter() { + boolean guard = false; + + @Override + public void controlResized(ControlEvent event) { + if (!guard) { + guard = true; + hideTabs(); + guard = false; + } + } + }); + + getSite().getShell().getDisplay().asyncExec(new Runnable() { + public void run() { + updateProblemIndication(); + } + }); + } + + /** + * If there is just one page in the multi-page editor part, + * this hides the single tab at the bottom. + * + * + * @generated + */ + protected void hideTabs() { + if (getPageCount() <= 1) { + setPageText(0, ""); + if (getContainer() instanceof CTabFolder) { + Point point = getContainer().getSize(); + Rectangle clientArea = getContainer().getClientArea(); + getContainer().setSize(point.x, 2 * point.y - clientArea.height - clientArea.y); + } + } + } + + /** + * If there is more than one page in the multi-page editor part, + * this shows the tabs at the bottom. + * + * + * @generated + */ + protected void showTabs() { + if (getPageCount() > 1) { + setPageText(0, getString("_UI_SelectionPage_label")); + if (getContainer() instanceof CTabFolder) { + Point point = getContainer().getSize(); + Rectangle clientArea = getContainer().getClientArea(); + getContainer().setSize(point.x, clientArea.height + clientArea.y); + } + } + } + + /** + * This is used to track the active viewer. + * + * + * @generated + */ + @Override + protected void pageChange(int pageIndex) { + super.pageChange(pageIndex); + + if (contentOutlinePage != null) { + handleContentOutlineSelection(contentOutlinePage.getSelection()); + } + } + + /** + * This is how the framework determines which interfaces we implement. + * + * + * @generated + */ + @Override + public T getAdapter(Class key) { + if (key.equals(IContentOutlinePage.class)) { + return showOutlineView() ? key.cast(getContentOutlinePage()) : null; + } else if (key.equals(IPropertySheetPage.class)) { + return key.cast(getPropertySheetPage()); + } else if (key.equals(IGotoMarker.class)) { + return key.cast(this); + } else { + return super.getAdapter(key); + } + } + + /** + * This accesses a cached version of the content outliner. + * + * + * @generated + */ + public IContentOutlinePage getContentOutlinePage() { + if (contentOutlinePage == null) { + // The content outline is just a tree. + // + class MyContentOutlinePage extends ContentOutlinePage { + @Override + public void createControl(Composite parent) { + super.createControl(parent); + contentOutlineViewer = getTreeViewer(); + contentOutlineViewer.addSelectionChangedListener(this); + + // Set up the tree viewer. + // + contentOutlineViewer.setUseHashlookup(true); + contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); + contentOutlineViewer.setInput(editingDomain.getResourceSet()); + + // Make sure our popups work. + // + createContextMenuFor(contentOutlineViewer); + + if (!editingDomain.getResourceSet().getResources().isEmpty()) { + // Select the root object in the view. + // + contentOutlineViewer.setSelection( + new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true); + } + } + + @Override + public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, + IStatusLineManager statusLineManager) { + super.makeContributions(menuManager, toolBarManager, statusLineManager); + contentOutlineStatusLineManager = statusLineManager; + } + + @Override + public void setActionBars(IActionBars actionBars) { + super.setActionBars(actionBars); + getActionBarContributor().shareGlobalActions(this, actionBars); + } + } + + contentOutlinePage = new MyContentOutlinePage(); + + // Listen to selection so that we can handle it is a special way. + // + contentOutlinePage.addSelectionChangedListener(new ISelectionChangedListener() { + // This ensures that we handle selections correctly. + // + public void selectionChanged(SelectionChangedEvent event) { + handleContentOutlineSelection(event.getSelection()); + } + }); + } + + return contentOutlinePage; + } + + /** + * This accesses a cached version of the property sheet. + * + * + * @generated + */ + public IPropertySheetPage getPropertySheetPage() { + PropertySheetPage propertySheetPage = new ExtendedPropertySheetPage(editingDomain, + ExtendedPropertySheetPage.Decoration.NONE, null, 0, false) { + @Override + public void setSelectionToViewer(List selection) { + EnsuranceEditor.this.setSelectionToViewer(selection); + EnsuranceEditor.this.setFocus(); + } + + @Override + public void setActionBars(IActionBars actionBars) { + super.setActionBars(actionBars); + getActionBarContributor().shareGlobalActions(this, actionBars); + } + }; + propertySheetPage.setPropertySourceProvider(new AdapterFactoryContentProvider(adapterFactory)); + propertySheetPages.add(propertySheetPage); + + return propertySheetPage; + } + + /** + * This deals with how we want selection in the outliner to affect the other views. + * + * + * @generated + */ + public void handleContentOutlineSelection(ISelection selection) { + if (currentViewerPane != null && !selection.isEmpty() && selection instanceof IStructuredSelection) { + Iterator selectedElements = ((IStructuredSelection) selection).iterator(); + if (selectedElements.hasNext()) { + // Get the first selected element. + // + Object selectedElement = selectedElements.next(); + + // If it's the selection viewer, then we want it to select the same selection as this selection. + // + if (currentViewerPane.getViewer() == selectionViewer) { + ArrayList selectionList = new ArrayList(); + selectionList.add(selectedElement); + while (selectedElements.hasNext()) { + selectionList.add(selectedElements.next()); + } + + // Set the selection to the widget. + // + selectionViewer.setSelection(new StructuredSelection(selectionList)); + } else { + // Set the input to the widget. + // + if (currentViewerPane.getViewer().getInput() != selectedElement) { + currentViewerPane.getViewer().setInput(selectedElement); + currentViewerPane.setTitle(selectedElement); + } + } + } + } + } + + /** + * This is for implementing {@link IEditorPart} and simply tests the command stack. + * + * + * @generated + */ + @Override + public boolean isDirty() { + return ((BasicCommandStack) editingDomain.getCommandStack()).isSaveNeeded(); + } + + /** + * This is for implementing {@link IEditorPart} and simply saves the model file. + * + * + * @generated + */ + @Override + public void doSave(IProgressMonitor progressMonitor) { + // Save only resources that have actually changed. + // + final Map saveOptions = new HashMap(); + saveOptions.put(Resource.OPTION_SAVE_ONLY_IF_CHANGED, Resource.OPTION_SAVE_ONLY_IF_CHANGED_MEMORY_BUFFER); + saveOptions.put(Resource.OPTION_LINE_DELIMITER, Resource.OPTION_LINE_DELIMITER_UNSPECIFIED); + + // 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; + List resources = editingDomain.getResourceSet().getResources(); + for (int i = 0; i < resources.size(); ++i) { + Resource resource = resources.get(i); + if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) + && !editingDomain.isReadOnly(resource)) { + try { + long timeStamp = resource.getTimeStamp(); + resource.save(saveOptions); + if (resource.getTimeStamp() != timeStamp) { + savedResources.add(resource); + } + } catch (Exception exception) { + resourceToDiagnosticMap.put(resource, analyzeResourceProblems(resource, exception)); + } + first = false; + } + } + } + }; + + updateProblemIndication = false; + try { + // This runs the options, and shows progress. + // + new ProgressMonitorDialog(getSite().getShell()).run(true, false, operation); + + // Refresh the necessary state. + // + ((BasicCommandStack) editingDomain.getCommandStack()).saveIsDone(); + firePropertyChange(IEditorPart.PROP_DIRTY); + } catch (Exception exception) { + // Something went wrong that shouldn't. + // + EnsuranceEditorPlugin.INSTANCE.log(exception); + } + updateProblemIndication = true; + updateProblemIndication(); + } + + /** + * 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; + } + + /** + * This always returns true because it is not currently supported. + * + * + * @generated + */ + @Override + public boolean isSaveAsAllowed() { + return true; + } + + /** + * This also changes the editor's input. + * + * + * @generated + */ + @Override + public void doSaveAs() { + SaveAsDialog saveAsDialog = new SaveAsDialog(getSite().getShell()); + saveAsDialog.open(); + IPath path = saveAsDialog.getResult(); + if (path != null) { + IFile file = ResourcesPlugin.getWorkspace().getRoot().getFile(path); + if (file != null) { + doSaveAs(URI.createPlatformResourceURI(file.getFullPath().toString(), true), new FileEditorInput(file)); + } + } + } + + /** + * + * + * @generated + */ + protected void doSaveAs(URI uri, IEditorInput editorInput) { + (editingDomain.getResourceSet().getResources().get(0)).setURI(uri); + setInputWithNotify(editorInput); + setPartName(editorInput.getName()); + IProgressMonitor progressMonitor = getActionBars().getStatusLineManager() != null + ? getActionBars().getStatusLineManager().getProgressMonitor() + : new NullProgressMonitor(); + doSave(progressMonitor); + } + + /** + * + * + * @generated + */ + public void gotoMarker(IMarker marker) { + List targetObjects = markerHelper.getTargetObjects(editingDomain, marker); + if (!targetObjects.isEmpty()) { + setSelectionToViewer(targetObjects); + } + } + + /** + * This is called during startup. + * + * + * @generated + */ + @Override + public void init(IEditorSite site, IEditorInput editorInput) { + setSite(site); + setInputWithNotify(editorInput); + setPartName(editorInput.getName()); + site.setSelectionProvider(this); + site.getPage().addPartListener(partListener); + ResourcesPlugin.getWorkspace().addResourceChangeListener(resourceChangeListener, + IResourceChangeEvent.POST_CHANGE); + } + + /** + * + * + * @generated + */ + @Override + public void setFocus() { + if (currentViewerPane != null) { + currentViewerPane.setFocus(); + } else { + getControl(getActivePage()).setFocus(); + } + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. + * + * + * @generated + */ + public void addSelectionChangedListener(ISelectionChangedListener listener) { + selectionChangedListeners.add(listener); + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. + * + * + * @generated + */ + public void removeSelectionChangedListener(ISelectionChangedListener listener) { + selectionChangedListeners.remove(listener); + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection. + * + * + * @generated + */ + public ISelection getSelection() { + return editorSelection; + } + + /** + * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to set this editor's overall selection. + * Calling this result will notify the listeners. + * + * + * @generated + */ + public void setSelection(ISelection selection) { + editorSelection = selection; + + for (ISelectionChangedListener listener : selectionChangedListeners) { + listener.selectionChanged(new SelectionChangedEvent(this, selection)); + } + setStatusLineManager(selection); + } + + /** + * + * + * @generated + */ + public void setStatusLineManager(ISelection selection) { + IStatusLineManager statusLineManager = currentViewer != null && currentViewer == contentOutlineViewer + ? contentOutlineStatusLineManager + : getActionBars().getStatusLineManager(); + + if (statusLineManager != null) { + if (selection instanceof IStructuredSelection) { + Collection collection = ((IStructuredSelection) selection).toList(); + switch (collection.size()) { + case 0: { + statusLineManager.setMessage(getString("_UI_NoObjectSelected")); + break; + } + case 1: { + String text = new AdapterFactoryItemDelegator(adapterFactory).getText(collection.iterator().next()); + statusLineManager.setMessage(getString("_UI_SingleObjectSelected", text)); + break; + } + default: { + statusLineManager + .setMessage(getString("_UI_MultiObjectSelected", Integer.toString(collection.size()))); + break; + } + } + } else { + statusLineManager.setMessage(""); + } + } + } + + /** + * This looks up a string in the plugin's plugin.properties file. + * + * + * @generated + */ + private static String getString(String key) { + return EnsuranceEditorPlugin.INSTANCE.getString(key); + } + + /** + * This looks up a string in plugin.properties, making a substitution. + * + * + * @generated + */ + private static String getString(String key, Object s1) { + return EnsuranceEditorPlugin.INSTANCE.getString(key, new Object[] { s1 }); + } + + /** + * This implements {@link org.eclipse.jface.action.IMenuListener} to help fill the context menus with contributions from the Edit menu. + * + * + * @generated + */ + public void menuAboutToShow(IMenuManager menuManager) { + ((IMenuListener) getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager); + } + + /** + * + * + * @generated + */ + public EditingDomainActionBarContributor getActionBarContributor() { + return (EditingDomainActionBarContributor) getEditorSite().getActionBarContributor(); + } + + /** + * + * + * @generated + */ + public IActionBars getActionBars() { + return getActionBarContributor().getActionBars(); + } + + /** + * + * + * @generated + */ + public AdapterFactory getAdapterFactory() { + return adapterFactory; + } + + /** + * + * + * @generated + */ + @Override + public void dispose() { + updateProblemIndication = false; + + ResourcesPlugin.getWorkspace().removeResourceChangeListener(resourceChangeListener); + + getSite().getPage().removePartListener(partListener); + + adapterFactory.dispose(); + + if (getActionBarContributor().getActiveEditor() == this) { + getActionBarContributor().setActiveEditor(null); + } + + for (PropertySheetPage propertySheetPage : propertySheetPages) { + propertySheetPage.dispose(); + } + + if (contentOutlinePage != null) { + contentOutlinePage.dispose(); + } + + super.dispose(); + } + + /** + * Returns whether the outline view should be presented to the user. + * + * + * @generated + */ + protected boolean showOutlineView() { + return true; + } +} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/presentation/EnsuranceEditorPlugin.java b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/presentation/EnsuranceEditorPlugin.java new file mode 100644 index 0000000..834c4c7 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/presentation/EnsuranceEditorPlugin.java @@ -0,0 +1,89 @@ +/** + */ +package edu.kit.ipd.sdq.metamodels.ensurance.presentation; + +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 Ensurance editor plugin. + * + * + * @generated + */ +public final class EnsuranceEditorPlugin extends EMFPlugin { + /** + * Keep track of the singleton. + * + * + * @generated + */ + public static final EnsuranceEditorPlugin INSTANCE = new EnsuranceEditorPlugin(); + + /** + * Keep track of the singleton. + * + * + * @generated + */ + private static Implementation plugin; + + /** + * Create the instance. + * + * + * @generated + */ + public EnsuranceEditorPlugin() { + super(new ResourceLocator[] {}); + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + @Override + public ResourceLocator getPluginResourceLocator() { + return plugin; + } + + /** + * Returns the singleton instance of the Eclipse plugin. + * + * + * @return the singleton instance. + * @generated + */ + public static Implementation getPlugin() { + return plugin; + } + + /** + * The actual implementation of the Eclipse Plugin. + * + * + * @generated + */ + public static class Implementation extends EclipseUIPlugin { + /** + * Creates an instance. + * + * + * @generated + */ + public Implementation() { + super(); + + // Remember the static instance. + // + plugin = this; + } + } + +} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/presentation/EnsuranceModelWizard.java b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/presentation/EnsuranceModelWizard.java new file mode 100644 index 0000000..6857e73 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/presentation/EnsuranceModelWizard.java @@ -0,0 +1,625 @@ +/** + */ +package edu.kit.ipd.sdq.metamodels.ensurance.presentation; + +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 java.util.MissingResourceException; +import java.util.StringTokenizer; + +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.resource.Resource; +import org.eclipse.emf.ecore.resource.ResourceSet; + +import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl; + +import org.eclipse.emf.ecore.EObject; + +import org.eclipse.emf.ecore.xmi.XMLResource; + +import org.eclipse.emf.edit.ui.provider.ExtendedImageRegistry; + +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.jface.dialogs.MessageDialog; + +import org.eclipse.jface.viewers.IStructuredSelection; + +import org.eclipse.jface.wizard.Wizard; +import org.eclipse.jface.wizard.WizardPage; + +import org.eclipse.swt.SWT; + +import org.eclipse.swt.events.ModifyListener; +import org.eclipse.swt.events.ModifyEvent; + +import org.eclipse.swt.layout.GridData; +import org.eclipse.swt.layout.GridLayout; + +import org.eclipse.swt.widgets.Combo; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Label; + +import org.eclipse.ui.INewWizard; +import org.eclipse.ui.IWorkbench; + +import org.eclipse.ui.actions.WorkspaceModifyOperation; + +import org.eclipse.ui.dialogs.WizardNewFileCreationPage; + +import org.eclipse.ui.part.FileEditorInput; +import org.eclipse.ui.part.ISetSelectionTarget; + +import edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceFactory; +import edu.kit.ipd.sdq.metamodels.ensurance.EnsurancePackage; +import edu.kit.ipd.sdq.metamodels.ensurance.provider.EnsuranceEditPlugin; + +import org.eclipse.core.runtime.Path; + +import org.eclipse.jface.viewers.ISelection; +import org.eclipse.jface.viewers.StructuredSelection; + +import org.eclipse.ui.IWorkbenchPage; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.PartInitException; + +/** + * This is a simple wizard for creating a new model file. + * + * + * @generated + */ +public class EnsuranceModelWizard extends Wizard implements INewWizard { + /** + * The supported extensions for created files. + * + * + * @generated + */ + public static final List FILE_EXTENSIONS = Collections.unmodifiableList(Arrays.asList( + EnsuranceEditorPlugin.INSTANCE.getString("_UI_EnsuranceEditorFilenameExtensions").split("\\s*,\\s*"))); + + /** + * A formatted list of supported file extensions, suitable for display. + * + * + * @generated + */ + public static final String FORMATTED_FILE_EXTENSIONS = EnsuranceEditorPlugin.INSTANCE + .getString("_UI_EnsuranceEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); + + /** + * This caches an instance of the model package. + * + * + * @generated + */ + protected EnsurancePackage ensurancePackage = EnsurancePackage.eINSTANCE; + + /** + * This caches an instance of the model factory. + * + * + * @generated + */ + protected EnsuranceFactory ensuranceFactory = ensurancePackage.getEnsuranceFactory(); + + /** + * This is the file creation page. + * + * + * @generated + */ + protected EnsuranceModelWizardNewFileCreationPage newFileCreationPage; + + /** + * This is the initial object creation page. + * + * + * @generated + */ + protected EnsuranceModelWizardInitialObjectCreationPage initialObjectCreationPage; + + /** + * Remember the selection during initialization for populating the default container. + * + * + * @generated + */ + protected IStructuredSelection selection; + + /** + * Remember the workbench during initialization. + * + * + * @generated + */ + protected IWorkbench workbench; + + /** + * Caches the names of the types that can be created as the root object. + * + * + * @generated + */ + protected List initialObjectNames; + + /** + * This just records the information. + * + * + * @generated + */ + public void init(IWorkbench workbench, IStructuredSelection selection) { + this.workbench = workbench; + this.selection = selection; + setWindowTitle(EnsuranceEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); + setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE + .getImageDescriptor(EnsuranceEditorPlugin.INSTANCE.getImage("full/wizban/NewEnsurance"))); + } + + /** + * Returns the names of the types that can be created as the root object. + * + * + * @generated + */ + protected Collection getInitialObjectNames() { + if (initialObjectNames == null) { + initialObjectNames = new ArrayList(); + for (EClassifier eClassifier : ensurancePackage.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. + * + * + * @generated + */ + protected EObject createInitialModel() { + EClass eClass = (EClass) ensurancePackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); + EObject rootObject = ensuranceFactory.create(eClass); + return rootObject; + } + + /** + * Do the work after everything is specified. + * + * + * @generated + */ + @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 options = new HashMap(); + options.put(XMLResource.OPTION_ENCODING, initialObjectCreationPage.getEncoding()); + resource.save(options); + } catch (Exception exception) { + EnsuranceEditorPlugin.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(), + EnsuranceEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); + return false; + } + + return true; + } catch (Exception exception) { + EnsuranceEditorPlugin.INSTANCE.log(exception); + return false; + } + } + + /** + * This is the one page of the wizard. + * + * + * @generated + */ + public class EnsuranceModelWizardNewFileCreationPage extends WizardNewFileCreationPage { + /** + * Pass in the selection. + * + * + * @generated + */ + public EnsuranceModelWizardNewFileCreationPage(String pageId, IStructuredSelection selection) { + super(pageId, selection); + } + + /** + * The framework calls this to see if the file is correct. + * + * + * @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( + EnsuranceEditorPlugin.INSTANCE.getString(key, new Object[] { FORMATTED_FILE_EXTENSIONS })); + return false; + } + return true; + } + return false; + } + + /** + * + * + * @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. + * + * + * @generated + */ + public class EnsuranceModelWizardInitialObjectCreationPage extends WizardPage { + /** + * + * + * @generated + */ + protected Combo initialObjectField; + + /** + * @generated + * + * + */ + protected List encodings; + + /** + * + * + * @generated + */ + protected Combo encodingField; + + /** + * Pass in the selection. + * + * + * @generated + */ + public EnsuranceModelWizardInitialObjectCreationPage(String pageId) { + super(pageId); + } + + /** + * + * + * @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(EnsuranceEditorPlugin.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(EnsuranceEditorPlugin.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); + } + + /** + * + * + * @generated + */ + protected ModifyListener validator = new ModifyListener() { + public void modifyText(ModifyEvent e) { + setPageComplete(validatePage()); + } + }; + + /** + * + * + * @generated + */ + protected boolean validatePage() { + return getInitialObjectName() != null && getEncodings().contains(encodingField.getText()); + } + + /** + * + * + * @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(); + } + } + } + + /** + * + * + * @generated + */ + public String getInitialObjectName() { + String label = initialObjectField.getText(); + + for (String name : getInitialObjectNames()) { + if (getLabel(name).equals(label)) { + return name; + } + } + return null; + } + + /** + * + * + * @generated + */ + public String getEncoding() { + return encodingField.getText(); + } + + /** + * Returns the label for the specified type name. + * + * + * @generated + */ + protected String getLabel(String typeName) { + try { + return EnsuranceEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); + } catch (MissingResourceException mre) { + EnsuranceEditorPlugin.INSTANCE.log(mre); + } + return typeName; + } + + /** + * + * + * @generated + */ + protected Collection getEncodings() { + if (encodings == null) { + encodings = new ArrayList(); + for (StringTokenizer stringTokenizer = new StringTokenizer( + EnsuranceEditorPlugin.INSTANCE.getString("_UI_XMLEncodingChoices")); stringTokenizer + .hasMoreTokens();) { + encodings.add(stringTokenizer.nextToken()); + } + } + return encodings; + } + } + + /** + * The framework calls this to create the contents of the wizard. + * + * + * @generated + */ + @Override + public void addPages() { + // Create a page, set the title, and the initial model file name. + // + newFileCreationPage = new EnsuranceModelWizardNewFileCreationPage("Whatever", selection); + newFileCreationPage.setTitle(EnsuranceEditorPlugin.INSTANCE.getString("_UI_EnsuranceModelWizard_label")); + newFileCreationPage + .setDescription(EnsuranceEditorPlugin.INSTANCE.getString("_UI_EnsuranceModelWizard_description")); + newFileCreationPage + .setFileName(EnsuranceEditorPlugin.INSTANCE.getString("_UI_EnsuranceEditorFilenameDefaultBase") + "." + + 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 = EnsuranceEditorPlugin.INSTANCE + .getString("_UI_EnsuranceEditorFilenameDefaultBase"); + 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 EnsuranceModelWizardInitialObjectCreationPage("Whatever2"); + initialObjectCreationPage.setTitle(EnsuranceEditorPlugin.INSTANCE.getString("_UI_EnsuranceModelWizard_label")); + initialObjectCreationPage + .setDescription(EnsuranceEditorPlugin.INSTANCE.getString("_UI_Wizard_initial_object_description")); + addPage(initialObjectCreationPage); + } + + /** + * Get the file from the page. + * + * + * @generated + */ + public IFile getModelFile() { + return newFileCreationPage.getModelFile(); + } + +} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance/.classpath b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/.classpath new file mode 100644 index 0000000..716f845 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/.classpath @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance/.project b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/.project new file mode 100644 index 0000000..9fbc05c --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/.project @@ -0,0 +1,29 @@ + + + edu.kit.ipd.sdq.metamodels.ensurance + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.sirius.nature.modelingproject + org.eclipse.jdt.core.javanature + org.eclipse.pde.PluginNature + + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance/.settings/org.eclipse.jdt.core.prefs b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..0c68a61 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,7 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8 +org.eclipse.jdt.core.compiler.compliance=1.8 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.8 diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance/META-INF/MANIFEST.MF b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/META-INF/MANIFEST.MF new file mode 100644 index 0000000..de23838 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/META-INF/MANIFEST.MF @@ -0,0 +1,16 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: %pluginName +Bundle-SymbolicName: edu.kit.ipd.sdq.metamodels.ensurance;singleton:=true +Automatic-Module-Name: edu.kit.ipd.sdq.metamodels.ensurance +Bundle-Version: 1.2.0.qualifier +Bundle-ClassPath: . +Bundle-Vendor: %providerName +Bundle-Localization: plugin +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Export-Package: edu.kit.ipd.sdq.metamodels.ensurance, + edu.kit.ipd.sdq.metamodels.ensurance.impl, + edu.kit.ipd.sdq.metamodels.ensurance.util +Require-Bundle: org.eclipse.emf.ecore;visibility:=reexport, + org.eclipse.core.runtime +Bundle-ActivationPolicy: lazy diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance/build.properties b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/build.properties new file mode 100644 index 0000000..697ca96 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/build.properties @@ -0,0 +1,10 @@ +# + +bin.includes = .,\ + model/,\ + META-INF/,\ + plugin.xml,\ + plugin.properties +jars.compile.order = . +source.. = src-gen/ +output.. = bin/ diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance/model/ensurance.aird b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/model/ensurance.aird new file mode 100644 index 0000000..def1912 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/model/ensurance.aird @@ -0,0 +1,168 @@ + + + + ensurance.ecore + ensurance.genmodel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + labelSize + + + labelSize + + + + + + + + + + + + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance/model/ensurance.ecore b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/model/ensurance.ecore new file mode 100644 index 0000000..c432c4f --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/model/ensurance.ecore @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance/model/ensurance.genmodel b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/model/ensurance.genmodel new file mode 100644 index 0000000..b6b50b3 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/model/ensurance.genmodel @@ -0,0 +1,26 @@ + + + ensurance.ecore + + + + + + + + + + + + + + + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance/plugin.properties b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/plugin.properties new file mode 100644 index 0000000..a69aa08 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/plugin.properties @@ -0,0 +1,4 @@ +# + +pluginName = Ensurance Metamodel +providerName = KIT SDQ diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance/plugin.xml b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/plugin.xml new file mode 100644 index 0000000..9574a9d --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/plugin.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/EnsuranceClient.java b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/EnsuranceClient.java new file mode 100644 index 0000000..2692f0b --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/EnsuranceClient.java @@ -0,0 +1,69 @@ +/** + */ +package edu.kit.ipd.sdq.metamodels.ensurance; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Client'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceClient#getName Name}
  • + *
  • {@link edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceClient#getSocialSecurityNumber Social Security Number}
  • + *
+ * + * @see edu.kit.ipd.sdq.metamodels.ensurance.EnsurancePackage#getEnsuranceClient() + * @model + * @generated + */ +public interface EnsuranceClient extends EObject { + /** + * Returns the value of the 'Name' attribute. + * + * + * @return the value of the 'Name' attribute. + * @see #setName(String) + * @see edu.kit.ipd.sdq.metamodels.ensurance.EnsurancePackage#getEnsuranceClient_Name() + * @model + * @generated + */ + String getName(); + + /** + * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceClient#getName Name}' attribute. + * + * + * @param value the new value of the 'Name' attribute. + * @see #getName() + * @generated + */ + void setName(String value); + + /** + * Returns the value of the 'Social Security Number' attribute. + * + * + * @return the value of the 'Social Security Number' attribute. + * @see #setSocialSecurityNumber(String) + * @see edu.kit.ipd.sdq.metamodels.ensurance.EnsurancePackage#getEnsuranceClient_SocialSecurityNumber() + * @model + * @generated + */ + String getSocialSecurityNumber(); + + /** + * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceClient#getSocialSecurityNumber Social Security Number}' attribute. + * + * + * @param value the new value of the 'Social Security Number' attribute. + * @see #getSocialSecurityNumber() + * @generated + */ + void setSocialSecurityNumber(String value); + +} // EnsuranceClient diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/EnsuranceDatabase.java b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/EnsuranceDatabase.java new file mode 100644 index 0000000..4c04ebd --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/EnsuranceDatabase.java @@ -0,0 +1,38 @@ +/** + */ +package edu.kit.ipd.sdq.metamodels.ensurance; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EObject; + +/** + * + * A representation of the model object 'Database'. + * + * + *

+ * The following features are supported: + *

+ *
    + *
  • {@link edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceDatabase#getEnsuranceclient Ensuranceclient}
  • + *
+ * + * @see edu.kit.ipd.sdq.metamodels.ensurance.EnsurancePackage#getEnsuranceDatabase() + * @model + * @generated + */ +public interface EnsuranceDatabase extends EObject { + /** + * Returns the value of the 'Ensuranceclient' containment reference list. + * The list contents are of type {@link edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceClient}. + * + * + * @return the value of the 'Ensuranceclient' containment reference list. + * @see edu.kit.ipd.sdq.metamodels.ensurance.EnsurancePackage#getEnsuranceDatabase_Ensuranceclient() + * @model containment="true" + * @generated + */ + EList getEnsuranceclient(); + +} // EnsuranceDatabase diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/EnsuranceFactory.java b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/EnsuranceFactory.java new file mode 100644 index 0000000..1ff381a --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/EnsuranceFactory.java @@ -0,0 +1,51 @@ +/** + */ +package edu.kit.ipd.sdq.metamodels.ensurance; + +import org.eclipse.emf.ecore.EFactory; + +/** + * + * The Factory for the model. + * It provides a create method for each non-abstract class of the model. + * + * @see edu.kit.ipd.sdq.metamodels.ensurance.EnsurancePackage + * @generated + */ +public interface EnsuranceFactory extends EFactory { + /** + * The singleton instance of the factory. + * + * + * @generated + */ + EnsuranceFactory eINSTANCE = edu.kit.ipd.sdq.metamodels.ensurance.impl.EnsuranceFactoryImpl.init(); + + /** + * Returns a new object of class 'Database'. + * + * + * @return a new object of class 'Database'. + * @generated + */ + EnsuranceDatabase createEnsuranceDatabase(); + + /** + * Returns a new object of class 'Client'. + * + * + * @return a new object of class 'Client'. + * @generated + */ + EnsuranceClient createEnsuranceClient(); + + /** + * Returns the package supported by this factory. + * + * + * @return the package supported by this factory. + * @generated + */ + EnsurancePackage getEnsurancePackage(); + +} //EnsuranceFactory diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/EnsurancePackage.java b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/EnsurancePackage.java new file mode 100644 index 0000000..47733eb --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/EnsurancePackage.java @@ -0,0 +1,295 @@ +/** + */ +package edu.kit.ipd.sdq.metamodels.ensurance; + +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; + +/** + * + * The Package for the model. + * It contains accessors for the meta objects to represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each operation of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @see edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceFactory + * @model kind="package" + * @generated + */ +public interface EnsurancePackage extends EPackage { + /** + * The package name. + * + * + * @generated + */ + String eNAME = "ensurance"; + + /** + * The package namespace URI. + * + * + * @generated + */ + String eNS_URI = "edu.kit.ipd.sdq.metamodels.ensurance"; + + /** + * The package namespace name. + * + * + * @generated + */ + String eNS_PREFIX = "ensurance"; + + /** + * The singleton instance of the package. + * + * + * @generated + */ + EnsurancePackage eINSTANCE = edu.kit.ipd.sdq.metamodels.ensurance.impl.EnsurancePackageImpl.init(); + + /** + * The meta object id for the '{@link edu.kit.ipd.sdq.metamodels.ensurance.impl.EnsuranceDatabaseImpl Database}' class. + * + * + * @see edu.kit.ipd.sdq.metamodels.ensurance.impl.EnsuranceDatabaseImpl + * @see edu.kit.ipd.sdq.metamodels.ensurance.impl.EnsurancePackageImpl#getEnsuranceDatabase() + * @generated + */ + int ENSURANCE_DATABASE = 0; + + /** + * The feature id for the 'Ensuranceclient' containment reference list. + * + * + * @generated + * @ordered + */ + int ENSURANCE_DATABASE__ENSURANCECLIENT = 0; + + /** + * The number of structural features of the 'Database' class. + * + * + * @generated + * @ordered + */ + int ENSURANCE_DATABASE_FEATURE_COUNT = 1; + + /** + * The number of operations of the 'Database' class. + * + * + * @generated + * @ordered + */ + int ENSURANCE_DATABASE_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link edu.kit.ipd.sdq.metamodels.ensurance.impl.EnsuranceClientImpl Client}' class. + * + * + * @see edu.kit.ipd.sdq.metamodels.ensurance.impl.EnsuranceClientImpl + * @see edu.kit.ipd.sdq.metamodels.ensurance.impl.EnsurancePackageImpl#getEnsuranceClient() + * @generated + */ + int ENSURANCE_CLIENT = 1; + + /** + * The feature id for the 'Name' attribute. + * + * + * @generated + * @ordered + */ + int ENSURANCE_CLIENT__NAME = 0; + + /** + * The feature id for the 'Social Security Number' attribute. + * + * + * @generated + * @ordered + */ + int ENSURANCE_CLIENT__SOCIAL_SECURITY_NUMBER = 1; + + /** + * The number of structural features of the 'Client' class. + * + * + * @generated + * @ordered + */ + int ENSURANCE_CLIENT_FEATURE_COUNT = 2; + + /** + * The number of operations of the 'Client' class. + * + * + * @generated + * @ordered + */ + int ENSURANCE_CLIENT_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link edu.kit.ipd.sdq.metamodels.ensurance.Sex Sex}' enum. + * + * + * @see edu.kit.ipd.sdq.metamodels.ensurance.Sex + * @see edu.kit.ipd.sdq.metamodels.ensurance.impl.EnsurancePackageImpl#getSex() + * @generated + */ + int SEX = 2; + + /** + * Returns the meta object for class '{@link edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceDatabase Database}'. + * + * + * @return the meta object for class 'Database'. + * @see edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceDatabase + * @generated + */ + EClass getEnsuranceDatabase(); + + /** + * Returns the meta object for the containment reference list '{@link edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceDatabase#getEnsuranceclient Ensuranceclient}'. + * + * + * @return the meta object for the containment reference list 'Ensuranceclient'. + * @see edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceDatabase#getEnsuranceclient() + * @see #getEnsuranceDatabase() + * @generated + */ + EReference getEnsuranceDatabase_Ensuranceclient(); + + /** + * Returns the meta object for class '{@link edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceClient Client}'. + * + * + * @return the meta object for class 'Client'. + * @see edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceClient + * @generated + */ + EClass getEnsuranceClient(); + + /** + * Returns the meta object for the attribute '{@link edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceClient#getName Name}'. + * + * + * @return the meta object for the attribute 'Name'. + * @see edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceClient#getName() + * @see #getEnsuranceClient() + * @generated + */ + EAttribute getEnsuranceClient_Name(); + + /** + * Returns the meta object for the attribute '{@link edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceClient#getSocialSecurityNumber Social Security Number}'. + * + * + * @return the meta object for the attribute 'Social Security Number'. + * @see edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceClient#getSocialSecurityNumber() + * @see #getEnsuranceClient() + * @generated + */ + EAttribute getEnsuranceClient_SocialSecurityNumber(); + + /** + * Returns the meta object for enum '{@link edu.kit.ipd.sdq.metamodels.ensurance.Sex Sex}'. + * + * + * @return the meta object for enum 'Sex'. + * @see edu.kit.ipd.sdq.metamodels.ensurance.Sex + * @generated + */ + EEnum getSex(); + + /** + * Returns the factory that creates the instances of the model. + * + * + * @return the factory that creates the instances of the model. + * @generated + */ + EnsuranceFactory getEnsuranceFactory(); + + /** + * + * Defines literals for the meta objects that represent + *
    + *
  • each class,
  • + *
  • each feature of each class,
  • + *
  • each operation of each class,
  • + *
  • each enum,
  • + *
  • and each data type
  • + *
+ * + * @generated + */ + interface Literals { + /** + * The meta object literal for the '{@link edu.kit.ipd.sdq.metamodels.ensurance.impl.EnsuranceDatabaseImpl Database}' class. + * + * + * @see edu.kit.ipd.sdq.metamodels.ensurance.impl.EnsuranceDatabaseImpl + * @see edu.kit.ipd.sdq.metamodels.ensurance.impl.EnsurancePackageImpl#getEnsuranceDatabase() + * @generated + */ + EClass ENSURANCE_DATABASE = eINSTANCE.getEnsuranceDatabase(); + + /** + * The meta object literal for the 'Ensuranceclient' containment reference list feature. + * + * + * @generated + */ + EReference ENSURANCE_DATABASE__ENSURANCECLIENT = eINSTANCE.getEnsuranceDatabase_Ensuranceclient(); + + /** + * The meta object literal for the '{@link edu.kit.ipd.sdq.metamodels.ensurance.impl.EnsuranceClientImpl Client}' class. + * + * + * @see edu.kit.ipd.sdq.metamodels.ensurance.impl.EnsuranceClientImpl + * @see edu.kit.ipd.sdq.metamodels.ensurance.impl.EnsurancePackageImpl#getEnsuranceClient() + * @generated + */ + EClass ENSURANCE_CLIENT = eINSTANCE.getEnsuranceClient(); + + /** + * The meta object literal for the 'Name' attribute feature. + * + * + * @generated + */ + EAttribute ENSURANCE_CLIENT__NAME = eINSTANCE.getEnsuranceClient_Name(); + + /** + * The meta object literal for the 'Social Security Number' attribute feature. + * + * + * @generated + */ + EAttribute ENSURANCE_CLIENT__SOCIAL_SECURITY_NUMBER = eINSTANCE.getEnsuranceClient_SocialSecurityNumber(); + + /** + * The meta object literal for the '{@link edu.kit.ipd.sdq.metamodels.ensurance.Sex Sex}' enum. + * + * + * @see edu.kit.ipd.sdq.metamodels.ensurance.Sex + * @see edu.kit.ipd.sdq.metamodels.ensurance.impl.EnsurancePackageImpl#getSex() + * @generated + */ + EEnum SEX = eINSTANCE.getSex(); + + } + +} //EnsurancePackage diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/Sex.java b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/Sex.java new file mode 100644 index 0000000..c0d95cb --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/Sex.java @@ -0,0 +1,204 @@ +/** + */ +package edu.kit.ipd.sdq.metamodels.ensurance; + +import java.util.Arrays; +import java.util.Collections; +import java.util.List; + +import org.eclipse.emf.common.util.Enumerator; + +/** + * + * A representation of the literals of the enumeration 'Sex', + * and utility methods for working with them. + * + * @see edu.kit.ipd.sdq.metamodels.ensurance.EnsurancePackage#getSex() + * @model + * @generated + */ +public enum Sex implements Enumerator { + /** + * The 'MALE' literal object. + * + * + * @see #MALE_VALUE + * @generated + * @ordered + */ + MALE(0, "MALE", "MALE"), + + /** + * The 'FEMALE' literal object. + * + * + * @see #FEMALE_VALUE + * @generated + * @ordered + */ + FEMALE(1, "FEMALE", "FEMALE"); + + /** + * The 'MALE' literal value. + * + * + * @see #MALE + * @model + * @generated + * @ordered + */ + public static final int MALE_VALUE = 0; + + /** + * The 'FEMALE' literal value. + * + * + * @see #FEMALE + * @model + * @generated + * @ordered + */ + public static final int FEMALE_VALUE = 1; + + /** + * An array of all the 'Sex' enumerators. + * + * + * @generated + */ + private static final Sex[] VALUES_ARRAY = new Sex[] { MALE, FEMALE, }; + + /** + * A public read-only list of all the 'Sex' enumerators. + * + * + * @generated + */ + public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); + + /** + * Returns the 'Sex' literal with the specified literal value. + * + * + * @param literal the literal. + * @return the matching enumerator or null. + * @generated + */ + public static Sex get(String literal) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + Sex result = VALUES_ARRAY[i]; + if (result.toString().equals(literal)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Sex' literal with the specified name. + * + * + * @param name the name. + * @return the matching enumerator or null. + * @generated + */ + public static Sex getByName(String name) { + for (int i = 0; i < VALUES_ARRAY.length; ++i) { + Sex result = VALUES_ARRAY[i]; + if (result.getName().equals(name)) { + return result; + } + } + return null; + } + + /** + * Returns the 'Sex' literal with the specified integer value. + * + * + * @param value the integer value. + * @return the matching enumerator or null. + * @generated + */ + public static Sex get(int value) { + switch (value) { + case MALE_VALUE: + return MALE; + case FEMALE_VALUE: + return FEMALE; + } + return null; + } + + /** + * + * + * @generated + */ + private final int value; + + /** + * + * + * @generated + */ + private final String name; + + /** + * + * + * @generated + */ + private final String literal; + + /** + * Only this class can construct instances. + * + * + * @generated + */ + private Sex(int value, String name, String literal) { + this.value = value; + this.name = name; + this.literal = literal; + } + + /** + * + * + * @generated + */ + public int getValue() { + return value; + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public String getLiteral() { + return literal; + } + + /** + * Returns the literal value of the enumerator, which is its string representation. + * + * + * @generated + */ + @Override + public String toString() { + return literal; + } + +} //Sex diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/impl/EnsuranceClientImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/impl/EnsuranceClientImpl.java new file mode 100644 index 0000000..a9704b2 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/impl/EnsuranceClientImpl.java @@ -0,0 +1,222 @@ +/** + */ +package edu.kit.ipd.sdq.metamodels.ensurance.impl; + +import edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceClient; +import edu.kit.ipd.sdq.metamodels.ensurance.EnsurancePackage; + +import org.eclipse.emf.common.notify.Notification; + +import org.eclipse.emf.ecore.EClass; + +import org.eclipse.emf.ecore.impl.ENotificationImpl; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +/** + * + * An implementation of the model object 'Client'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link edu.kit.ipd.sdq.metamodels.ensurance.impl.EnsuranceClientImpl#getName Name}
  • + *
  • {@link edu.kit.ipd.sdq.metamodels.ensurance.impl.EnsuranceClientImpl#getSocialSecurityNumber Social Security Number}
  • + *
+ * + * @generated + */ +public class EnsuranceClientImpl extends MinimalEObjectImpl.Container implements EnsuranceClient { + /** + * The default value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected static final String NAME_EDEFAULT = null; + + /** + * The cached value of the '{@link #getName() Name}' attribute. + * + * + * @see #getName() + * @generated + * @ordered + */ + protected String name = NAME_EDEFAULT; + + /** + * The default value of the '{@link #getSocialSecurityNumber() Social Security Number}' attribute. + * + * + * @see #getSocialSecurityNumber() + * @generated + * @ordered + */ + protected static final String SOCIAL_SECURITY_NUMBER_EDEFAULT = null; + + /** + * The cached value of the '{@link #getSocialSecurityNumber() Social Security Number}' attribute. + * + * + * @see #getSocialSecurityNumber() + * @generated + * @ordered + */ + protected String socialSecurityNumber = SOCIAL_SECURITY_NUMBER_EDEFAULT; + + /** + * + * + * @generated + */ + protected EnsuranceClientImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return EnsurancePackage.Literals.ENSURANCE_CLIENT; + } + + /** + * + * + * @generated + */ + public String getName() { + return name; + } + + /** + * + * + * @generated + */ + public void setName(String newName) { + String oldName = name; + name = newName; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, EnsurancePackage.ENSURANCE_CLIENT__NAME, oldName, + name)); + } + + /** + * + * + * @generated + */ + public String getSocialSecurityNumber() { + return socialSecurityNumber; + } + + /** + * + * + * @generated + */ + public void setSocialSecurityNumber(String newSocialSecurityNumber) { + String oldSocialSecurityNumber = socialSecurityNumber; + socialSecurityNumber = newSocialSecurityNumber; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, + EnsurancePackage.ENSURANCE_CLIENT__SOCIAL_SECURITY_NUMBER, oldSocialSecurityNumber, + socialSecurityNumber)); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case EnsurancePackage.ENSURANCE_CLIENT__NAME: + return getName(); + case EnsurancePackage.ENSURANCE_CLIENT__SOCIAL_SECURITY_NUMBER: + return getSocialSecurityNumber(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case EnsurancePackage.ENSURANCE_CLIENT__NAME: + setName((String) newValue); + return; + case EnsurancePackage.ENSURANCE_CLIENT__SOCIAL_SECURITY_NUMBER: + setSocialSecurityNumber((String) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case EnsurancePackage.ENSURANCE_CLIENT__NAME: + setName(NAME_EDEFAULT); + return; + case EnsurancePackage.ENSURANCE_CLIENT__SOCIAL_SECURITY_NUMBER: + setSocialSecurityNumber(SOCIAL_SECURITY_NUMBER_EDEFAULT); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case EnsurancePackage.ENSURANCE_CLIENT__NAME: + return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); + case EnsurancePackage.ENSURANCE_CLIENT__SOCIAL_SECURITY_NUMBER: + return SOCIAL_SECURITY_NUMBER_EDEFAULT == null ? socialSecurityNumber != null + : !SOCIAL_SECURITY_NUMBER_EDEFAULT.equals(socialSecurityNumber); + } + return super.eIsSet(featureID); + } + + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (name: "); + result.append(name); + result.append(", socialSecurityNumber: "); + result.append(socialSecurityNumber); + result.append(')'); + return result.toString(); + } + +} //EnsuranceClientImpl diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/impl/EnsuranceDatabaseImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/impl/EnsuranceDatabaseImpl.java new file mode 100644 index 0000000..d52f433 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/impl/EnsuranceDatabaseImpl.java @@ -0,0 +1,153 @@ +/** + */ +package edu.kit.ipd.sdq.metamodels.ensurance.impl; + +import edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceClient; +import edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceDatabase; +import edu.kit.ipd.sdq.metamodels.ensurance.EnsurancePackage; + +import java.util.Collection; + +import org.eclipse.emf.common.notify.NotificationChain; + +import org.eclipse.emf.common.util.EList; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.InternalEObject; + +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; + +import org.eclipse.emf.ecore.util.EObjectContainmentEList; +import org.eclipse.emf.ecore.util.InternalEList; + +/** + * + * An implementation of the model object 'Database'. + * + *

+ * The following features are implemented: + *

+ *
    + *
  • {@link edu.kit.ipd.sdq.metamodels.ensurance.impl.EnsuranceDatabaseImpl#getEnsuranceclient Ensuranceclient}
  • + *
+ * + * @generated + */ +public class EnsuranceDatabaseImpl extends MinimalEObjectImpl.Container implements EnsuranceDatabase { + /** + * The cached value of the '{@link #getEnsuranceclient() Ensuranceclient}' containment reference list. + * + * + * @see #getEnsuranceclient() + * @generated + * @ordered + */ + protected EList ensuranceclient; + + /** + * + * + * @generated + */ + protected EnsuranceDatabaseImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + protected EClass eStaticClass() { + return EnsurancePackage.Literals.ENSURANCE_DATABASE; + } + + /** + * + * + * @generated + */ + public EList getEnsuranceclient() { + if (ensuranceclient == null) { + ensuranceclient = new EObjectContainmentEList(EnsuranceClient.class, this, + EnsurancePackage.ENSURANCE_DATABASE__ENSURANCECLIENT); + } + return ensuranceclient; + } + + /** + * + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { + switch (featureID) { + case EnsurancePackage.ENSURANCE_DATABASE__ENSURANCECLIENT: + return ((InternalEList) getEnsuranceclient()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) { + switch (featureID) { + case EnsurancePackage.ENSURANCE_DATABASE__ENSURANCECLIENT: + return getEnsuranceclient(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) { + switch (featureID) { + case EnsurancePackage.ENSURANCE_DATABASE__ENSURANCECLIENT: + getEnsuranceclient().clear(); + getEnsuranceclient().addAll((Collection) newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * + * + * @generated + */ + @Override + public void eUnset(int featureID) { + switch (featureID) { + case EnsurancePackage.ENSURANCE_DATABASE__ENSURANCECLIENT: + getEnsuranceclient().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) { + switch (featureID) { + case EnsurancePackage.ENSURANCE_DATABASE__ENSURANCECLIENT: + return ensuranceclient != null && !ensuranceclient.isEmpty(); + } + return super.eIsSet(featureID); + } + +} //EnsuranceDatabaseImpl diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/impl/EnsuranceFactoryImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/impl/EnsuranceFactoryImpl.java new file mode 100644 index 0000000..391670d --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/impl/EnsuranceFactoryImpl.java @@ -0,0 +1,161 @@ +/** + */ +package edu.kit.ipd.sdq.metamodels.ensurance.impl; + +import edu.kit.ipd.sdq.metamodels.ensurance.*; + +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; + +/** + * + * An implementation of the model Factory. + * + * @generated + */ +public class EnsuranceFactoryImpl extends EFactoryImpl implements EnsuranceFactory { + /** + * Creates the default factory implementation. + * + * + * @generated + */ + public static EnsuranceFactory init() { + try { + EnsuranceFactory theEnsuranceFactory = (EnsuranceFactory) EPackage.Registry.INSTANCE + .getEFactory(EnsurancePackage.eNS_URI); + if (theEnsuranceFactory != null) { + return theEnsuranceFactory; + } + } catch (Exception exception) { + EcorePlugin.INSTANCE.log(exception); + } + return new EnsuranceFactoryImpl(); + } + + /** + * Creates an instance of the factory. + * + * + * @generated + */ + public EnsuranceFactoryImpl() { + super(); + } + + /** + * + * + * @generated + */ + @Override + public EObject create(EClass eClass) { + switch (eClass.getClassifierID()) { + case EnsurancePackage.ENSURANCE_DATABASE: + return createEnsuranceDatabase(); + case EnsurancePackage.ENSURANCE_CLIENT: + return createEnsuranceClient(); + default: + throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public Object createFromString(EDataType eDataType, String initialValue) { + switch (eDataType.getClassifierID()) { + case EnsurancePackage.SEX: + return createSexFromString(eDataType, initialValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + @Override + public String convertToString(EDataType eDataType, Object instanceValue) { + switch (eDataType.getClassifierID()) { + case EnsurancePackage.SEX: + return convertSexToString(eDataType, instanceValue); + default: + throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); + } + } + + /** + * + * + * @generated + */ + public EnsuranceDatabase createEnsuranceDatabase() { + EnsuranceDatabaseImpl ensuranceDatabase = new EnsuranceDatabaseImpl(); + return ensuranceDatabase; + } + + /** + * + * + * @generated + */ + public EnsuranceClient createEnsuranceClient() { + EnsuranceClientImpl ensuranceClient = new EnsuranceClientImpl(); + return ensuranceClient; + } + + /** + * + * + * @generated + */ + public Sex createSexFromString(EDataType eDataType, String initialValue) { + Sex result = Sex.get(initialValue); + if (result == null) + throw new IllegalArgumentException( + "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); + return result; + } + + /** + * + * + * @generated + */ + public String convertSexToString(EDataType eDataType, Object instanceValue) { + return instanceValue == null ? null : instanceValue.toString(); + } + + /** + * + * + * @generated + */ + public EnsurancePackage getEnsurancePackage() { + return (EnsurancePackage) getEPackage(); + } + + /** + * + * + * @deprecated + * @generated + */ + @Deprecated + public static EnsurancePackage getPackage() { + return EnsurancePackage.eINSTANCE; + } + +} //EnsuranceFactoryImpl diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/impl/EnsurancePackageImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/impl/EnsurancePackageImpl.java new file mode 100644 index 0000000..37e6f71 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/impl/EnsurancePackageImpl.java @@ -0,0 +1,259 @@ +/** + */ +package edu.kit.ipd.sdq.metamodels.ensurance.impl; + +import edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceClient; +import edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceDatabase; +import edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceFactory; +import edu.kit.ipd.sdq.metamodels.ensurance.EnsurancePackage; +import edu.kit.ipd.sdq.metamodels.ensurance.Sex; + +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; + +/** + * + * An implementation of the model Package. + * + * @generated + */ +public class EnsurancePackageImpl extends EPackageImpl implements EnsurancePackage { + /** + * + * + * @generated + */ + private EClass ensuranceDatabaseEClass = null; + + /** + * + * + * @generated + */ + private EClass ensuranceClientEClass = null; + + /** + * + * + * @generated + */ + private EEnum sexEEnum = null; + + /** + * Creates an instance of the model Package, registered with + * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package + * package URI value. + *

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. + * + * + * @see org.eclipse.emf.ecore.EPackage.Registry + * @see edu.kit.ipd.sdq.metamodels.ensurance.EnsurancePackage#eNS_URI + * @see #init() + * @generated + */ + private EnsurancePackageImpl() { + super(eNS_URI, EnsuranceFactory.eINSTANCE); + } + + /** + * + * + * @generated + */ + private static boolean isInited = false; + + /** + * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. + * + *

This method is used to initialize {@link EnsurancePackage#eINSTANCE} when that field is accessed. + * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. + * + * + * @see #eNS_URI + * @see #createPackageContents() + * @see #initializePackageContents() + * @generated + */ + public static EnsurancePackage init() { + if (isInited) + return (EnsurancePackage) EPackage.Registry.INSTANCE.getEPackage(EnsurancePackage.eNS_URI); + + // Obtain or create and register package + Object registeredEnsurancePackage = EPackage.Registry.INSTANCE.get(eNS_URI); + EnsurancePackageImpl theEnsurancePackage = registeredEnsurancePackage instanceof EnsurancePackageImpl + ? (EnsurancePackageImpl) registeredEnsurancePackage + : new EnsurancePackageImpl(); + + isInited = true; + + // Create package meta-data objects + theEnsurancePackage.createPackageContents(); + + // Initialize created meta-data + theEnsurancePackage.initializePackageContents(); + + // Mark meta-data to indicate it can't be changed + theEnsurancePackage.freeze(); + + // Update the registry and return the package + EPackage.Registry.INSTANCE.put(EnsurancePackage.eNS_URI, theEnsurancePackage); + return theEnsurancePackage; + } + + /** + * + * + * @generated + */ + public EClass getEnsuranceDatabase() { + return ensuranceDatabaseEClass; + } + + /** + * + * + * @generated + */ + public EReference getEnsuranceDatabase_Ensuranceclient() { + return (EReference) ensuranceDatabaseEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EClass getEnsuranceClient() { + return ensuranceClientEClass; + } + + /** + * + * + * @generated + */ + public EAttribute getEnsuranceClient_Name() { + return (EAttribute) ensuranceClientEClass.getEStructuralFeatures().get(0); + } + + /** + * + * + * @generated + */ + public EAttribute getEnsuranceClient_SocialSecurityNumber() { + return (EAttribute) ensuranceClientEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + public EEnum getSex() { + return sexEEnum; + } + + /** + * + * + * @generated + */ + public EnsuranceFactory getEnsuranceFactory() { + return (EnsuranceFactory) getEFactoryInstance(); + } + + /** + * + * + * @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. + * + * + * @generated + */ + public void createPackageContents() { + if (isCreated) + return; + isCreated = true; + + // Create classes and their features + ensuranceDatabaseEClass = createEClass(ENSURANCE_DATABASE); + createEReference(ensuranceDatabaseEClass, ENSURANCE_DATABASE__ENSURANCECLIENT); + + ensuranceClientEClass = createEClass(ENSURANCE_CLIENT); + createEAttribute(ensuranceClientEClass, ENSURANCE_CLIENT__NAME); + createEAttribute(ensuranceClientEClass, ENSURANCE_CLIENT__SOCIAL_SECURITY_NUMBER); + + // Create enums + sexEEnum = createEEnum(SEX); + } + + /** + * + * + * @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. + * + * + * @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 + + // Initialize classes, features, and operations; add parameters + initEClass(ensuranceDatabaseEClass, EnsuranceDatabase.class, "EnsuranceDatabase", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEReference(getEnsuranceDatabase_Ensuranceclient(), this.getEnsuranceClient(), null, "ensuranceclient", null, + 0, -1, EnsuranceDatabase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, + !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + initEClass(ensuranceClientEClass, EnsuranceClient.class, "EnsuranceClient", !IS_ABSTRACT, !IS_INTERFACE, + IS_GENERATED_INSTANCE_CLASS); + initEAttribute(getEnsuranceClient_Name(), ecorePackage.getEString(), "name", null, 0, 1, EnsuranceClient.class, + !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getEnsuranceClient_SocialSecurityNumber(), ecorePackage.getEString(), "socialSecurityNumber", + null, 0, 1, EnsuranceClient.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, + IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + + // Initialize enums and add enum literals + initEEnum(sexEEnum, Sex.class, "Sex"); + addEEnumLiteral(sexEEnum, Sex.MALE); + addEEnumLiteral(sexEEnum, Sex.FEMALE); + + // Create resource + createResource(eNS_URI); + } + +} //EnsurancePackageImpl diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/util/EnsuranceAdapterFactory.java b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/util/EnsuranceAdapterFactory.java new file mode 100644 index 0000000..f942895 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/util/EnsuranceAdapterFactory.java @@ -0,0 +1,138 @@ +/** + */ +package edu.kit.ipd.sdq.metamodels.ensurance.util; + +import edu.kit.ipd.sdq.metamodels.ensurance.*; + +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; + +/** + * + * The Adapter Factory for the model. + * It provides an adapter createXXX method for each class of the model. + * + * @see edu.kit.ipd.sdq.metamodels.ensurance.EnsurancePackage + * @generated + */ +public class EnsuranceAdapterFactory extends AdapterFactoryImpl { + /** + * The cached model package. + * + * + * @generated + */ + protected static EnsurancePackage modelPackage; + + /** + * Creates an instance of the adapter factory. + * + * + * @generated + */ + public EnsuranceAdapterFactory() { + if (modelPackage == null) { + modelPackage = EnsurancePackage.eINSTANCE; + } + } + + /** + * Returns whether this factory is applicable for the type of the object. + * + * This implementation returns true if the object is either the model's package or is an instance object of the model. + * + * @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 createXXX methods. + * + * + * @generated + */ + protected EnsuranceSwitch modelSwitch = new EnsuranceSwitch() { + @Override + public Adapter caseEnsuranceDatabase(EnsuranceDatabase object) { + return createEnsuranceDatabaseAdapter(); + } + + @Override + public Adapter caseEnsuranceClient(EnsuranceClient object) { + return createEnsuranceClientAdapter(); + } + + @Override + public Adapter defaultCase(EObject object) { + return createEObjectAdapter(); + } + }; + + /** + * Creates an adapter for the target. + * + * + * @param target the object to adapt. + * @return the adapter for the target. + * @generated + */ + @Override + public Adapter createAdapter(Notifier target) { + return modelSwitch.doSwitch((EObject) target); + } + + /** + * Creates a new adapter for an object of class '{@link edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceDatabase Database}'. + * + * 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. + * + * @return the new adapter. + * @see edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceDatabase + * @generated + */ + public Adapter createEnsuranceDatabaseAdapter() { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceClient Client}'. + * + * 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. + * + * @return the new adapter. + * @see edu.kit.ipd.sdq.metamodels.ensurance.EnsuranceClient + * @generated + */ + public Adapter createEnsuranceClientAdapter() { + return null; + } + + /** + * Creates a new adapter for the default case. + * + * This default implementation returns null. + * + * @return the new adapter. + * @generated + */ + public Adapter createEObjectAdapter() { + return null; + } + +} //EnsuranceAdapterFactory diff --git a/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/util/EnsuranceSwitch.java b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/util/EnsuranceSwitch.java new file mode 100644 index 0000000..38115c7 --- /dev/null +++ b/bundles/edu.kit.ipd.sdq.metamodels.ensurance/src-gen/edu/kit/ipd/sdq/metamodels/ensurance/util/EnsuranceSwitch.java @@ -0,0 +1,134 @@ +/** + */ +package edu.kit.ipd.sdq.metamodels.ensurance.util; + +import edu.kit.ipd.sdq.metamodels.ensurance.*; + +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.EPackage; + +import org.eclipse.emf.ecore.util.Switch; + +/** + * + * The Switch for the model's inheritance hierarchy. + * It supports the call {@link #doSwitch(EObject) doSwitch(object)} + * to invoke the caseXXX 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. + * + * @see edu.kit.ipd.sdq.metamodels.ensurance.EnsurancePackage + * @generated + */ +public class EnsuranceSwitch extends Switch { + /** + * The cached model package + * + * + * @generated + */ + protected static EnsurancePackage modelPackage; + + /** + * Creates an instance of the switch. + * + * + * @generated + */ + public EnsuranceSwitch() { + if (modelPackage == null) { + modelPackage = EnsurancePackage.eINSTANCE; + } + } + + /** + * Checks whether this is a switch for the given package. + * + * + * @param ePackage the package in question. + * @return whether this is a switch for the given package. + * @generated + */ + @Override + protected boolean isSwitchFor(EPackage ePackage) { + return ePackage == modelPackage; + } + + /** + * Calls caseXXX for each class of the model until one returns a non null result; it yields that result. + * + * + * @return the first non-null result returned by a caseXXX call. + * @generated + */ + @Override + protected T doSwitch(int classifierID, EObject theEObject) { + switch (classifierID) { + case EnsurancePackage.ENSURANCE_DATABASE: { + EnsuranceDatabase ensuranceDatabase = (EnsuranceDatabase) theEObject; + T result = caseEnsuranceDatabase(ensuranceDatabase); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case EnsurancePackage.ENSURANCE_CLIENT: { + EnsuranceClient ensuranceClient = (EnsuranceClient) theEObject; + T result = caseEnsuranceClient(ensuranceClient); + if (result == null) + result = defaultCase(theEObject); + return result; + } + default: + return defaultCase(theEObject); + } + } + + /** + * Returns the result of interpreting the object as an instance of 'Database'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Database'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseEnsuranceDatabase(EnsuranceDatabase object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'Client'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'Client'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseEnsuranceClient(EnsuranceClient object) { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of 'EObject'. + * + * This implementation returns null; + * returning a non-null result will terminate the switch, but this is the last case anyway. + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of 'EObject'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) + * @generated + */ + @Override + public T defaultCase(EObject object) { + return null; + } + +} //EnsuranceSwitch diff --git a/releng/edu.kit.ipd.sdq.metamodels.demo.updatesite/category.xml b/releng/edu.kit.ipd.sdq.metamodels.demo.updatesite/category.xml index 92c4694..28164cd 100644 --- a/releng/edu.kit.ipd.sdq.metamodels.demo.updatesite/category.xml +++ b/releng/edu.kit.ipd.sdq.metamodels.demo.updatesite/category.xml @@ -24,6 +24,12 @@ + + + + + + Ecore metamodels based on EMF for demonstrating MDSD techniques From 663ba674669a7f4a9bab7393c531ae07f16bcca0 Mon Sep 17 00:00:00 2001 From: Heiko Klare Date: Fri, 20 Mar 2020 17:56:48 +0100 Subject: [PATCH 2/7] Add feature for ensurance metamodel --- .../.project | 17 ++ .../build.properties | 5 + .../epl-v10.html | 261 ++++++++++++++++++ .../feature.properties | 131 +++++++++ .../feature.xml | 46 +++ .../license.html | 107 +++++++ 6 files changed, 567 insertions(+) create mode 100644 features/edu.kit.ipd.sdq.metamodels.ensurance.feature/.project create mode 100644 features/edu.kit.ipd.sdq.metamodels.ensurance.feature/build.properties create mode 100644 features/edu.kit.ipd.sdq.metamodels.ensurance.feature/epl-v10.html create mode 100644 features/edu.kit.ipd.sdq.metamodels.ensurance.feature/feature.properties create mode 100644 features/edu.kit.ipd.sdq.metamodels.ensurance.feature/feature.xml create mode 100644 features/edu.kit.ipd.sdq.metamodels.ensurance.feature/license.html diff --git a/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/.project b/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/.project new file mode 100644 index 0000000..ee5be99 --- /dev/null +++ b/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/.project @@ -0,0 +1,17 @@ + + + edu.kit.ipd.sdq.metamodels.ensurance.feature + + + + + + org.eclipse.pde.FeatureBuilder + + + + + + org.eclipse.pde.FeatureNature + + diff --git a/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/build.properties b/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/build.properties new file mode 100644 index 0000000..d1ae250 --- /dev/null +++ b/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/build.properties @@ -0,0 +1,5 @@ +bin.includes = feature.xml,\ + feature.properties,\ + build.properties,\ + license.html,\ + epl-v10.html diff --git a/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/epl-v10.html b/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/epl-v10.html new file mode 100644 index 0000000..fd39122 --- /dev/null +++ b/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/epl-v10.html @@ -0,0 +1,261 @@ + + + + + + +Eclipse Public License - Version 1.0 + + + + + + +

Eclipse Public License - v 1.0

+ +

THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS ECLIPSE +PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR +DISTRIBUTION OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS +AGREEMENT.

+ +

1. DEFINITIONS

+ +

"Contribution" means:

+ +

a) in the case of the initial Contributor, the initial +code and documentation distributed under this Agreement, and

+

b) in the case of each subsequent Contributor:

+

i) changes to the Program, and

+

ii) additions to the Program;

+

where such changes and/or additions to the Program +originate from and are distributed by that particular Contributor. A +Contribution 'originates' from a Contributor if it was added to the +Program by such Contributor itself or anyone acting on such +Contributor's behalf. Contributions do not include additions to the +Program which: (i) are separate modules of software distributed in +conjunction with the Program under their own license agreement, and (ii) +are not derivative works of the Program.

+ +

"Contributor" means any person or entity that distributes +the Program.

+ +

"Licensed Patents" mean patent claims licensable by a +Contributor which are necessarily infringed by the use or sale of its +Contribution alone or when combined with the Program.

+ +

"Program" means the Contributions distributed in accordance +with this Agreement.

+ +

"Recipient" means anyone who receives the Program under +this Agreement, including all Contributors.

+ +

2. GRANT OF RIGHTS

+ +

a) Subject to the terms of this Agreement, each +Contributor hereby grants Recipient a non-exclusive, worldwide, +royalty-free copyright license to reproduce, prepare derivative works +of, publicly display, publicly perform, distribute and sublicense the +Contribution of such Contributor, if any, and such derivative works, in +source code and object code form.

+ +

b) Subject to the terms of this Agreement, each +Contributor hereby grants Recipient a non-exclusive, worldwide, +royalty-free patent license under Licensed Patents to make, use, sell, +offer to sell, import and otherwise transfer the Contribution of such +Contributor, if any, in source code and object code form. This patent +license shall apply to the combination of the Contribution and the +Program if, at the time the Contribution is added by the Contributor, +such addition of the Contribution causes such combination to be covered +by the Licensed Patents. The patent license shall not apply to any other +combinations which include the Contribution. No hardware per se is +licensed hereunder.

+ +

c) Recipient understands that although each Contributor +grants the licenses to its Contributions set forth herein, no assurances +are provided by any Contributor that the Program does not infringe the +patent or other intellectual property rights of any other entity. Each +Contributor disclaims any liability to Recipient for claims brought by +any other entity based on infringement of intellectual property rights +or otherwise. As a condition to exercising the rights and licenses +granted hereunder, each Recipient hereby assumes sole responsibility to +secure any other intellectual property rights needed, if any. For +example, if a third party patent license is required to allow Recipient +to distribute the Program, it is Recipient's responsibility to acquire +that license before distributing the Program.

+ +

d) Each Contributor represents that to its knowledge it +has sufficient copyright rights in its Contribution, if any, to grant +the copyright license set forth in this Agreement.

+ +

3. REQUIREMENTS

+ +

A Contributor may choose to distribute the Program in object code +form under its own license agreement, provided that:

+ +

a) it complies with the terms and conditions of this +Agreement; and

+ +

b) its license agreement:

+ +

i) effectively disclaims on behalf of all Contributors +all warranties and conditions, express and implied, including warranties +or conditions of title and non-infringement, and implied warranties or +conditions of merchantability and fitness for a particular purpose;

+ +

ii) effectively excludes on behalf of all Contributors +all liability for damages, including direct, indirect, special, +incidental and consequential damages, such as lost profits;

+ +

iii) states that any provisions which differ from this +Agreement are offered by that Contributor alone and not by any other +party; and

+ +

iv) states that source code for the Program is available +from such Contributor, and informs licensees how to obtain it in a +reasonable manner on or through a medium customarily used for software +exchange.

+ +

When the Program is made available in source code form:

+ +

a) it must be made available under this Agreement; and

+ +

b) a copy of this Agreement must be included with each +copy of the Program.

+ +

Contributors may not remove or alter any copyright notices contained +within the Program.

+ +

Each Contributor must identify itself as the originator of its +Contribution, if any, in a manner that reasonably allows subsequent +Recipients to identify the originator of the Contribution.

+ +

4. COMMERCIAL DISTRIBUTION

+ +

Commercial distributors of software may accept certain +responsibilities with respect to end users, business partners and the +like. While this license is intended to facilitate the commercial use of +the Program, the Contributor who includes the Program in a commercial +product offering should do so in a manner which does not create +potential liability for other Contributors. Therefore, if a Contributor +includes the Program in a commercial product offering, such Contributor +("Commercial Contributor") hereby agrees to defend and +indemnify every other Contributor ("Indemnified Contributor") +against any losses, damages and costs (collectively "Losses") +arising from claims, lawsuits and other legal actions brought by a third +party against the Indemnified Contributor to the extent caused by the +acts or omissions of such Commercial Contributor in connection with its +distribution of the Program in a commercial product offering. The +obligations in this section do not apply to any claims or Losses +relating to any actual or alleged intellectual property infringement. In +order to qualify, an Indemnified Contributor must: a) promptly notify +the Commercial Contributor in writing of such claim, and b) allow the +Commercial Contributor to control, and cooperate with the Commercial +Contributor in, the defense and any related settlement negotiations. The +Indemnified Contributor may participate in any such claim at its own +expense.

+ +

For example, a Contributor might include the Program in a commercial +product offering, Product X. That Contributor is then a Commercial +Contributor. If that Commercial Contributor then makes performance +claims, or offers warranties related to Product X, those performance +claims and warranties are such Commercial Contributor's responsibility +alone. Under this section, the Commercial Contributor would have to +defend claims against the other Contributors related to those +performance claims and warranties, and if a court requires any other +Contributor to pay any damages as a result, the Commercial Contributor +must pay those damages.

+ +

5. NO WARRANTY

+ +

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS +PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS +OF ANY KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, +ANY WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY +OR FITNESS FOR A PARTICULAR PURPOSE. Each Recipient is solely +responsible for determining the appropriateness of using and +distributing the Program and assumes all risks associated with its +exercise of rights under this Agreement , including but not limited to +the risks and costs of program errors, compliance with applicable laws, +damage to or loss of data, programs or equipment, and unavailability or +interruption of operations.

+ +

6. DISCLAIMER OF LIABILITY

+ +

EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT +NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING +WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF +LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR +DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED +HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

+ +

7. GENERAL

+ +

If any provision of this Agreement is invalid or unenforceable under +applicable law, it shall not affect the validity or enforceability of +the remainder of the terms of this Agreement, and without further action +by the parties hereto, such provision shall be reformed to the minimum +extent necessary to make such provision valid and enforceable.

+ +

If Recipient institutes patent litigation against any entity +(including a cross-claim or counterclaim in a lawsuit) alleging that the +Program itself (excluding combinations of the Program with other +software or hardware) infringes such Recipient's patent(s), then such +Recipient's rights granted under Section 2(b) shall terminate as of the +date such litigation is filed.

+ +

All Recipient's rights under this Agreement shall terminate if it +fails to comply with any of the material terms or conditions of this +Agreement and does not cure such failure in a reasonable period of time +after becoming aware of such noncompliance. If all Recipient's rights +under this Agreement terminate, Recipient agrees to cease use and +distribution of the Program as soon as reasonably practicable. However, +Recipient's obligations under this Agreement and any licenses granted by +Recipient relating to the Program shall continue and survive.

+ +

Everyone is permitted to copy and distribute copies of this +Agreement, but in order to avoid inconsistency the Agreement is +copyrighted and may only be modified in the following manner. The +Agreement Steward reserves the right to publish new versions (including +revisions) of this Agreement from time to time. No one other than the +Agreement Steward has the right to modify this Agreement. The Eclipse +Foundation is the initial Agreement Steward. The Eclipse Foundation may +assign the responsibility to serve as the Agreement Steward to a +suitable separate entity. Each new version of the Agreement will be +given a distinguishing version number. The Program (including +Contributions) may always be distributed subject to the version of the +Agreement under which it was received. In addition, after a new version +of the Agreement is published, Contributor may elect to distribute the +Program (including its Contributions) under the new version. Except as +expressly stated in Sections 2(a) and 2(b) above, Recipient receives no +rights or licenses to the intellectual property of any Contributor under +this Agreement, whether expressly, by implication, estoppel or +otherwise. All rights in the Program not expressly granted under this +Agreement are reserved.

+ +

This Agreement is governed by the laws of the State of New York and +the intellectual property laws of the United States of America. No party +to this Agreement will bring a legal action under this Agreement more +than one year after the cause of action arose. Each party waives its +rights to a jury trial in any resulting litigation.

+ + + + diff --git a/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/feature.properties b/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/feature.properties new file mode 100644 index 0000000..137820a --- /dev/null +++ b/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/feature.properties @@ -0,0 +1,131 @@ +featureName=Ensurance Metamodel +description=A simple metamodel for an ensurance database +providerName=KIT SDQ +copyrightURL=https://sdqweb.ipd.kit.edu/ +copyright=\ +Copyright (c) 2014-2020 SDQ\n\ +Karlsruhe Institute of Technology (KIT), Software Design and Quality, Karlsruhe, Germany +licenseURL=license.html +license=\ +Eclipse Foundation Software User Agreement\n\ +April 9, 2014\n\ +\n\ +Usage Of Content\n\ +\n\ +THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR\n\ +OTHER MATERIALS FOR OPEN SOURCE PROJECTS (COLLECTIVELY "CONTENT").\n\ +USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS\n\ +AGREEMENT AND/OR THE TERMS AND CONDITIONS OF LICENSE AGREEMENTS OR\n\ +NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU\n\ +AGREE THAT YOUR USE OF THE CONTENT IS GOVERNED BY THIS AGREEMENT\n\ +AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS\n\ +OR NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE\n\ +TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND CONDITIONS\n\ +OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED\n\ +BELOW, THEN YOU MAY NOT USE THE CONTENT.\n\ +\n\ +Applicable Licenses\n\ +\n\ +Unless otherwise indicated, all Content made available by the\n\ +Eclipse Foundation is provided to you under the terms and conditions of\n\ +the Eclipse Public License Version 1.0 ("EPL"). A copy of the EPL is\n\ +provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html.\n\ +For purposes of the EPL, "Program" will mean the Content.\n\ +\n\ +Content includes, but is not limited to, source code, object code,\n\ +documentation and other files maintained in the Eclipse Foundation source code\n\ +repository ("Repository") in software modules ("Modules") and made available\n\ +as downloadable archives ("Downloads").\n\ +\n\ +\t- Content may be structured and packaged into modules to facilitate delivering,\n\ +\t extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"),\n\ +\t plug-in fragments ("Fragments"), and features ("Features").\n\ +\t- Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java(TM) ARchive)\n\ +\t in a directory named "plugins".\n\ +\t- A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material.\n\ +\t Each Feature may be packaged as a sub-directory in a directory named "features".\n\ +\t Within a Feature, files named "feature.xml" may contain a list of the names and version\n\ +\t numbers of the Plug-ins and/or Fragments associated with that Feature.\n\ +\t- Features may also include other Features ("Included Features"). Within a Feature, files\n\ +\t named "feature.xml" may contain a list of the names and version numbers of Included Features.\n\ +\n\ +The terms and conditions governing Plug-ins and Fragments should be\n\ +contained in files named "about.html" ("Abouts"). The terms and\n\ +conditions governing Features and Included Features should be contained\n\ +in files named "license.html" ("Feature Licenses"). Abouts and Feature\n\ +Licenses may be located in any directory of a Download or Module\n\ +including, but not limited to the following locations:\n\ +\n\ +\t- The top-level (root) directory\n\ +\t- Plug-in and Fragment directories\n\ +\t- Inside Plug-ins and Fragments packaged as JARs\n\ +\t- Sub-directories of the directory named "src" of certain Plug-ins\n\ +\t- Feature directories\n\ +\n\ +Note: if a Feature made available by the Eclipse Foundation is installed using the\n\ +Provisioning Technology (as defined below), you must agree to a license ("Feature \n\ +Update License") during the installation process. If the Feature contains\n\ +Included Features, the Feature Update License should either provide you\n\ +with the terms and conditions governing the Included Features or inform\n\ +you where you can locate them. Feature Update Licenses may be found in\n\ +the "license" property of files named "feature.properties" found within a Feature.\n\ +Such Abouts, Feature Licenses, and Feature Update Licenses contain the\n\ +terms and conditions (or references to such terms and conditions) that\n\ +govern your use of the associated Content in that directory.\n\ +\n\ +THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER\n\ +TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS.\n\ +SOME OF THESE OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):\n\ +\n\ +\t- Eclipse Distribution License Version 1.0 (available at http://www.eclipse.org/licenses/edl-v1.0.html)\n\ +\t- Common Public License Version 1.0 (available at http://www.eclipse.org/legal/cpl-v10.html)\n\ +\t- Apache Software License 1.1 (available at http://www.apache.org/licenses/LICENSE)\n\ +\t- Apache Software License 2.0 (available at http://www.apache.org/licenses/LICENSE-2.0)\n\ +\t- Mozilla Public License Version 1.1 (available at http://www.mozilla.org/MPL/MPL-1.1.html)\n\ +\n\ +IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR\n\ +TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License\n\ +is provided, please contact the Eclipse Foundation to determine what terms and conditions\n\ +govern that particular Content.\n\ +\n\ +\n\Use of Provisioning Technology\n\ +\n\ +The Eclipse Foundation makes available provisioning software, examples of which include,\n\ +but are not limited to, p2 and the Eclipse Update Manager ("Provisioning Technology") for\n\ +the purpose of allowing users to install software, documentation, information and/or\n\ +other materials (collectively "Installable Software"). This capability is provided with\n\ +the intent of allowing such users to install, extend and update Eclipse-based products.\n\ +Information about packaging Installable Software is available at\n\ +http://eclipse.org/equinox/p2/repository_packaging.html ("Specification").\n\ +\n\ +You may use Provisioning Technology to allow other parties to install Installable Software.\n\ +You shall be responsible for enabling the applicable license agreements relating to the\n\ +Installable Software to be presented to, and accepted by, the users of the Provisioning Technology\n\ +in accordance with the Specification. By using Provisioning Technology in such a manner and\n\ +making it available in accordance with the Specification, you further acknowledge your\n\ +agreement to, and the acquisition of all necessary rights to permit the following:\n\ +\n\ +\t1. A series of actions may occur ("Provisioning Process") in which a user may execute\n\ +\t the Provisioning Technology on a machine ("Target Machine") with the intent of installing,\n\ +\t extending or updating the functionality of an Eclipse-based product.\n\ +\t2. During the Provisioning Process, the Provisioning Technology may cause third party\n\ +\t Installable Software or a portion thereof to be accessed and copied to the Target Machine.\n\ +\t3. Pursuant to the Specification, you will provide to the user the terms and conditions that\n\ +\t govern the use of the Installable Software ("Installable Software Agreement") and such\n\ +\t Installable Software Agreement shall be accessed from the Target Machine in accordance\n\ +\t with the Specification. Such Installable Software Agreement must inform the user of the\n\ +\t terms and conditions that govern the Installable Software and must solicit acceptance by\n\ +\t the end user in the manner prescribed in such Installable Software Agreement. Upon such\n\ +\t indication of agreement by the user, the provisioning Technology will complete installation\n\ +\t of the Installable Software.\n\ +\n\ +Cryptography\n\ +\n\ +Content may contain encryption software. The country in which you are\n\ +currently may have restrictions on the import, possession, and use,\n\ +and/or re-export to another country, of encryption software. BEFORE\n\ +using any encryption software, please check the country's laws,\n\ +regulations and policies concerning the import, possession, or use, and\n\ +re-export of encryption software, to see if this is permitted.\n\ +\n\ +Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.\n \ No newline at end of file diff --git a/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/feature.xml b/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/feature.xml new file mode 100644 index 0000000..83b2afe --- /dev/null +++ b/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/feature.xml @@ -0,0 +1,46 @@ + + + + + %description + + + + %copyright + + + + %license + + + + + + + + + + + + + + diff --git a/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/license.html b/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/license.html new file mode 100644 index 0000000..c3d34c3 --- /dev/null +++ b/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/license.html @@ -0,0 +1,107 @@ + + + + + +Eclipse Foundation Software User Agreement + + + +

Eclipse Foundation Software User Agreement

+

April 9, 2014

+ +

Usage Of Content

+ +

THE ECLIPSE FOUNDATION MAKES AVAILABLE SOFTWARE, DOCUMENTATION, INFORMATION AND/OR OTHER MATERIALS FOR OPEN SOURCE PROJECTS + (COLLECTIVELY "CONTENT"). USE OF THE CONTENT IS GOVERNED BY THE TERMS AND CONDITIONS OF THIS AGREEMENT AND/OR THE TERMS AND + CONDITIONS OF LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW. BY USING THE CONTENT, YOU AGREE THAT YOUR USE + OF THE CONTENT IS GOVERNED BY THIS AGREEMENT AND/OR THE TERMS AND CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR + NOTICES INDICATED OR REFERENCED BELOW. IF YOU DO NOT AGREE TO THE TERMS AND CONDITIONS OF THIS AGREEMENT AND THE TERMS AND + CONDITIONS OF ANY APPLICABLE LICENSE AGREEMENTS OR NOTICES INDICATED OR REFERENCED BELOW, THEN YOU MAY NOT USE THE CONTENT.

+ +

Applicable Licenses

+ +

Unless otherwise indicated, all Content made available by the Eclipse Foundation is provided to you under the terms and conditions of the Eclipse Public License Version 1.0 + ("EPL"). A copy of the EPL is provided with this Content and is also available at http://www.eclipse.org/legal/epl-v10.html. + For purposes of the EPL, "Program" will mean the Content.

+ +

Content includes, but is not limited to, source code, object code, documentation and other files maintained in the Eclipse Foundation source code + repository ("Repository") in software modules ("Modules") and made available as downloadable archives ("Downloads").

+ +
    +
  • Content may be structured and packaged into modules to facilitate delivering, extending, and upgrading the Content. Typical modules may include plug-ins ("Plug-ins"), plug-in fragments ("Fragments"), and features ("Features").
  • +
  • Each Plug-in or Fragment may be packaged as a sub-directory or JAR (Java™ ARchive) in a directory named "plugins".
  • +
  • A Feature is a bundle of one or more Plug-ins and/or Fragments and associated material. Each Feature may be packaged as a sub-directory in a directory named "features". Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of the Plug-ins + and/or Fragments associated with that Feature.
  • +
  • Features may also include other Features ("Included Features"). Within a Feature, files named "feature.xml" may contain a list of the names and version numbers of Included Features.
  • +
+ +

The terms and conditions governing Plug-ins and Fragments should be contained in files named "about.html" ("Abouts"). The terms and conditions governing Features and +Included Features should be contained in files named "license.html" ("Feature Licenses"). Abouts and Feature Licenses may be located in any directory of a Download or Module +including, but not limited to the following locations:

+ +
    +
  • The top-level (root) directory
  • +
  • Plug-in and Fragment directories
  • +
  • Inside Plug-ins and Fragments packaged as JARs
  • +
  • Sub-directories of the directory named "src" of certain Plug-ins
  • +
  • Feature directories
  • +
+ +

Note: if a Feature made available by the Eclipse Foundation is installed using the Provisioning Technology (as defined below), you must agree to a license ("Feature Update License") during the +installation process. If the Feature contains Included Features, the Feature Update License should either provide you with the terms and conditions governing the Included Features or +inform you where you can locate them. Feature Update Licenses may be found in the "license" property of files named "feature.properties" found within a Feature. +Such Abouts, Feature Licenses, and Feature Update Licenses contain the terms and conditions (or references to such terms and conditions) that govern your use of the associated Content in +that directory.

+ +

THE ABOUTS, FEATURE LICENSES, AND FEATURE UPDATE LICENSES MAY REFER TO THE EPL OR OTHER LICENSE AGREEMENTS, NOTICES OR TERMS AND CONDITIONS. SOME OF THESE +OTHER LICENSE AGREEMENTS MAY INCLUDE (BUT ARE NOT LIMITED TO):

+ + + +

IT IS YOUR OBLIGATION TO READ AND ACCEPT ALL SUCH TERMS AND CONDITIONS PRIOR TO USE OF THE CONTENT. If no About, Feature License, or Feature Update License is provided, please +contact the Eclipse Foundation to determine what terms and conditions govern that particular Content.

+ + +

Use of Provisioning Technology

+ +

The Eclipse Foundation makes available provisioning software, examples of which include, but are not limited to, p2 and the Eclipse + Update Manager ("Provisioning Technology") for the purpose of allowing users to install software, documentation, information and/or + other materials (collectively "Installable Software"). This capability is provided with the intent of allowing such users to + install, extend and update Eclipse-based products. Information about packaging Installable Software is available at http://eclipse.org/equinox/p2/repository_packaging.html + ("Specification").

+ +

You may use Provisioning Technology to allow other parties to install Installable Software. You shall be responsible for enabling the + applicable license agreements relating to the Installable Software to be presented to, and accepted by, the users of the Provisioning Technology + in accordance with the Specification. By using Provisioning Technology in such a manner and making it available in accordance with the + Specification, you further acknowledge your agreement to, and the acquisition of all necessary rights to permit the following:

+ +
    +
  1. A series of actions may occur ("Provisioning Process") in which a user may execute the Provisioning Technology + on a machine ("Target Machine") with the intent of installing, extending or updating the functionality of an Eclipse-based + product.
  2. +
  3. During the Provisioning Process, the Provisioning Technology may cause third party Installable Software or a portion thereof to be + accessed and copied to the Target Machine.
  4. +
  5. Pursuant to the Specification, you will provide to the user the terms and conditions that govern the use of the Installable + Software ("Installable Software Agreement") and such Installable Software Agreement shall be accessed from the Target + Machine in accordance with the Specification. Such Installable Software Agreement must inform the user of the terms and conditions that govern + the Installable Software and must solicit acceptance by the end user in the manner prescribed in such Installable Software Agreement. Upon such + indication of agreement by the user, the provisioning Technology will complete installation of the Installable Software.
  6. +
+ +

Cryptography

+ +

Content may contain encryption software. The country in which you are currently may have restrictions on the import, possession, and use, and/or re-export to + another country, of encryption software. BEFORE using any encryption software, please check the country's laws, regulations and policies concerning the import, + possession, or use, and re-export of encryption software, to see if this is permitted.

+ +

Java and all Java-based trademarks are trademarks of Oracle Corporation in the United States, other countries, or both.

+ + From cc0281b4ceb92b0ee8ede3196dd5c4e8a8794895 Mon Sep 17 00:00:00 2001 From: Heiko Klare Date: Fri, 20 Mar 2020 17:57:47 +0100 Subject: [PATCH 3/7] Add ensurance metamodel to build --- releng/edu.kit.ipd.sdq.metamodels.demo.aggregator/pom.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/releng/edu.kit.ipd.sdq.metamodels.demo.aggregator/pom.xml b/releng/edu.kit.ipd.sdq.metamodels.demo.aggregator/pom.xml index 46b7066..85e0819 100644 --- a/releng/edu.kit.ipd.sdq.metamodels.demo.aggregator/pom.xml +++ b/releng/edu.kit.ipd.sdq.metamodels.demo.aggregator/pom.xml @@ -14,6 +14,9 @@ ../../bundles/edu.kit.ipd.sdq.metamodels.addresses ../../bundles/edu.kit.ipd.sdq.metamodels.addresses.edit ../../bundles/edu.kit.ipd.sdq.metamodels.addresses.editor + ../../bundles/edu.kit.ipd.sdq.metamodels.ensurance + ../../bundles/edu.kit.ipd.sdq.metamodels.ensurance.edit + ../../bundles/edu.kit.ipd.sdq.metamodels.ensurance.editor ../../bundles/edu.kit.ipd.sdq.metamodels.recipients ../../bundles/edu.kit.ipd.sdq.metamodels.recipients.edit ../../bundles/edu.kit.ipd.sdq.metamodels.recipients.editor @@ -24,6 +27,7 @@ ../../bundles/edu.kit.ipd.sdq.metamodels.persons.edit ../../bundles/edu.kit.ipd.sdq.metamodels.persons.editor ../../features/edu.kit.ipd.sdq.metamodels.addresses.feature + ../../features/edu.kit.ipd.sdq.metamodels.ensurance.feature ../../features/edu.kit.ipd.sdq.metamodels.recipients.feature ../../features/edu.kit.ipd.sdq.metamodels.families.feature ../../features/edu.kit.ipd.sdq.metamodels.persons.feature From d575ae08989078f511a262cf141fff75854680bf Mon Sep 17 00:00:00 2001 From: Heiko Klare Date: Fri, 20 Mar 2020 17:58:46 +0100 Subject: [PATCH 4/7] Improve Tycho version and Eclipse dependency --- releng/edu.kit.ipd.sdq.metamodels.demo.parent/pom.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/releng/edu.kit.ipd.sdq.metamodels.demo.parent/pom.xml b/releng/edu.kit.ipd.sdq.metamodels.demo.parent/pom.xml index 89bd90d..14b3a35 100644 --- a/releng/edu.kit.ipd.sdq.metamodels.demo.parent/pom.xml +++ b/releng/edu.kit.ipd.sdq.metamodels.demo.parent/pom.xml @@ -10,16 +10,16 @@ UTF-8 UTF-8 1.8 - 1.3.0 + 1.5.1 1.8 1.8 - Eclipse 4.10 (2018-12) + Eclipse 2019-12 p2 - - http://ftp-stud.hs-esslingen.de/pub/Mirrors/eclipse/releases/2018-12/ + + http://ftp-stud.hs-esslingen.de/pub/Mirrors/eclipse/releases/2019-12/ From 50ba3af1d254ca46c3570d80e4a21f0a69d0e29a Mon Sep 17 00:00:00 2001 From: Heiko Klare Date: Fri, 20 Mar 2020 17:59:03 +0100 Subject: [PATCH 5/7] Improve Xtend dependency version in features --- .../feature.properties | 2 +- .../edu.kit.ipd.sdq.metamodels.addresses.feature/feature.xml | 2 +- .../feature.properties | 2 +- .../edu.kit.ipd.sdq.metamodels.families.feature/feature.xml | 2 +- .../feature.properties | 2 +- features/edu.kit.ipd.sdq.metamodels.persons.feature/feature.xml | 2 +- .../feature.properties | 2 +- .../edu.kit.ipd.sdq.metamodels.recipients.feature/feature.xml | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/features/edu.kit.ipd.sdq.metamodels.addresses.feature/feature.properties b/features/edu.kit.ipd.sdq.metamodels.addresses.feature/feature.properties index 0a2a2cb..9c0cf15 100644 --- a/features/edu.kit.ipd.sdq.metamodels.addresses.feature/feature.properties +++ b/features/edu.kit.ipd.sdq.metamodels.addresses.feature/feature.properties @@ -3,7 +3,7 @@ description=An addresses demo metamodel providerName=KIT SDQ copyrightURL=https://sdqweb.ipd.kit.edu/ copyright=\ -Copyright (c) 2014-2018 SDQ\n\ +Copyright (c) 2014-2020 SDQ\n\ Karlsruhe Institute of Technology (KIT), Software Design and Quality, Karlsruhe, Germany licenseURL=license.html license=\ diff --git a/features/edu.kit.ipd.sdq.metamodels.addresses.feature/feature.xml b/features/edu.kit.ipd.sdq.metamodels.addresses.feature/feature.xml index 8c29775..d924dc8 100644 --- a/features/edu.kit.ipd.sdq.metamodels.addresses.feature/feature.xml +++ b/features/edu.kit.ipd.sdq.metamodels.addresses.feature/feature.xml @@ -18,7 +18,7 @@ - + diff --git a/features/edu.kit.ipd.sdq.metamodels.families.feature/feature.properties b/features/edu.kit.ipd.sdq.metamodels.families.feature/feature.properties index 9f16348..86af056 100644 --- a/features/edu.kit.ipd.sdq.metamodels.families.feature/feature.properties +++ b/features/edu.kit.ipd.sdq.metamodels.families.feature/feature.properties @@ -3,7 +3,7 @@ description=The families metamodels known from ATL demonstrations providerName=KIT SDQ copyrightURL=https://sdqweb.ipd.kit.edu/ copyright=\ -Copyright (c) 2014-2018 SDQ\n\ +Copyright (c) 2014-2020 SDQ\n\ Karlsruhe Institute of Technology (KIT), Software Design and Quality, Karlsruhe, Germany licenseURL=license.html license=\ diff --git a/features/edu.kit.ipd.sdq.metamodels.families.feature/feature.xml b/features/edu.kit.ipd.sdq.metamodels.families.feature/feature.xml index 07cccd4..9bbab0f 100644 --- a/features/edu.kit.ipd.sdq.metamodels.families.feature/feature.xml +++ b/features/edu.kit.ipd.sdq.metamodels.families.feature/feature.xml @@ -18,7 +18,7 @@ - + diff --git a/features/edu.kit.ipd.sdq.metamodels.persons.feature/feature.properties b/features/edu.kit.ipd.sdq.metamodels.persons.feature/feature.properties index 99d77ea..cc8f1c7 100644 --- a/features/edu.kit.ipd.sdq.metamodels.persons.feature/feature.properties +++ b/features/edu.kit.ipd.sdq.metamodels.persons.feature/feature.properties @@ -3,7 +3,7 @@ description=The persons metamodels known from ATL demonstrations providerName=KIT SDQ copyrightURL=https://sdqweb.ipd.kit.edu/ copyright=\ -Copyright (c) 2014-2018 SDQ\n\ +Copyright (c) 2014-2020 SDQ\n\ Karlsruhe Institute of Technology (KIT), Software Design and Quality, Karlsruhe, Germany licenseURL=license.html license=\ diff --git a/features/edu.kit.ipd.sdq.metamodels.persons.feature/feature.xml b/features/edu.kit.ipd.sdq.metamodels.persons.feature/feature.xml index 27f6193..88aa261 100644 --- a/features/edu.kit.ipd.sdq.metamodels.persons.feature/feature.xml +++ b/features/edu.kit.ipd.sdq.metamodels.persons.feature/feature.xml @@ -18,7 +18,7 @@ - + diff --git a/features/edu.kit.ipd.sdq.metamodels.recipients.feature/feature.properties b/features/edu.kit.ipd.sdq.metamodels.recipients.feature/feature.properties index 5e26f53..15d4f26 100644 --- a/features/edu.kit.ipd.sdq.metamodels.recipients.feature/feature.properties +++ b/features/edu.kit.ipd.sdq.metamodels.recipients.feature/feature.properties @@ -3,7 +3,7 @@ description=A recipients demo metamodel providerName=KIT SDQ copyrightURL=https://sdqweb.ipd.kit.edu/ copyright=\ -Copyright (c) 2014-2018 SDQ\n\ +Copyright (c) 2014-2020 SDQ\n\ Karlsruhe Institute of Technology (KIT), Software Design and Quality, Karlsruhe, Germany licenseURL=license.html license=\ diff --git a/features/edu.kit.ipd.sdq.metamodels.recipients.feature/feature.xml b/features/edu.kit.ipd.sdq.metamodels.recipients.feature/feature.xml index 33d93e4..ebc9866 100644 --- a/features/edu.kit.ipd.sdq.metamodels.recipients.feature/feature.xml +++ b/features/edu.kit.ipd.sdq.metamodels.recipients.feature/feature.xml @@ -18,7 +18,7 @@ - + From 36bf86dd4ddbebf4f45711d789c66f081aaaec4c Mon Sep 17 00:00:00 2001 From: Heiko Klare Date: Fri, 20 Mar 2020 18:04:09 +0100 Subject: [PATCH 6/7] Regenerate metamodel code with current EMF version --- .../META-INF/MANIFEST.MF | 1 + .../AddressesItemProviderAdapterFactory.java | 6 + .../META-INF/MANIFEST.MF | 1 + .../AddressesActionBarContributor.java | 3 + .../presentation/AddressesEditor.java | 56 ++++++--- .../presentation/AddressesModelWizard.java | 4 + .../META-INF/MANIFEST.MF | 1 + .../addresses/impl/AddressImpl.java | 10 +- .../addresses/impl/AddressesFactoryImpl.java | 3 + .../addresses/impl/AddressesImpl.java | 1 + .../addresses/impl/AddressesPackageImpl.java | 16 ++- .../addresses/impl/IdentifiedElementImpl.java | 4 +- .../META-INF/MANIFEST.MF | 1 + .../FamiliesItemProviderAdapterFactory.java | 6 + .../META-INF/MANIFEST.MF | 1 + .../FamiliesActionBarContributor.java | 3 + .../families/presentation/FamiliesEditor.java | 109 +++++++++++------- .../presentation/FamiliesModelWizard.java | 7 +- .../META-INF/MANIFEST.MF | 1 + .../model/families.genmodel | 7 +- .../families/impl/FamiliesFactoryImpl.java | 4 + .../families/impl/FamiliesPackageImpl.java | 22 +++- .../metamodels/families/impl/FamilyImpl.java | 10 +- .../families/impl/FamilyRegisterImpl.java | 5 +- .../metamodels/families/impl/MemberImpl.java | 12 +- .../META-INF/MANIFEST.MF | 1 + .../PersonsItemProviderAdapterFactory.java | 6 + .../META-INF/MANIFEST.MF | 1 + .../PersonsActionBarContributor.java | 3 + .../persons/presentation/PersonsEditor.java | 109 +++++++++++------- .../presentation/PersonsModelWizard.java | 7 +- .../META-INF/MANIFEST.MF | 1 + .../model/persons.genmodel | 8 +- .../metamodels/persons/impl/PersonImpl.java | 6 +- .../persons/impl/PersonRegisterImpl.java | 5 +- .../persons/impl/PersonsFactoryImpl.java | 4 + .../persons/impl/PersonsPackageImpl.java | 15 ++- .../META-INF/MANIFEST.MF | 1 + .../RecipientsItemProviderAdapterFactory.java | 6 + .../META-INF/MANIFEST.MF | 1 + .../RecipientsActionBarContributor.java | 3 + .../presentation/RecipientsEditor.java | 56 ++++++--- .../presentation/RecipientsModelWizard.java | 4 + .../META-INF/MANIFEST.MF | 1 + .../model/recipients.genmodel | 3 + .../metamodels/recipients/impl/CityImpl.java | 6 +- .../impl/IdentifiedElementImpl.java | 4 +- .../recipients/impl/LocationImpl.java | 8 +- .../recipients/impl/RecipientImpl.java | 10 +- .../impl/RecipientsFactoryImpl.java | 5 + .../recipients/impl/RecipientsImpl.java | 1 + .../impl/RecipientsPackageImpl.java | 23 +++- 52 files changed, 451 insertions(+), 141 deletions(-) diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/META-INF/MANIFEST.MF b/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/META-INF/MANIFEST.MF index 6a9d816..79dac7f 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/META-INF/MANIFEST.MF +++ b/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/META-INF/MANIFEST.MF @@ -13,3 +13,4 @@ Require-Bundle: org.eclipse.core.runtime, edu.kit.ipd.sdq.metamodels.addresses;visibility:=reexport, org.eclipse.emf.edit;visibility:=reexport Bundle-ActivationPolicy: lazy +Automatic-Module-Name: edu.kit.ipd.sdq.metamodels.addresses.edit diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/src/edu/kit/ipd/sdq/metamodels/addresses/provider/AddressesItemProviderAdapterFactory.java b/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/src/edu/kit/ipd/sdq/metamodels/addresses/provider/AddressesItemProviderAdapterFactory.java index c06cd0f..ef941d6 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/src/edu/kit/ipd/sdq/metamodels/addresses/provider/AddressesItemProviderAdapterFactory.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/src/edu/kit/ipd/sdq/metamodels/addresses/provider/AddressesItemProviderAdapterFactory.java @@ -123,6 +123,7 @@ public Adapter createAddressAdapter() { * * @generated */ + @Override public ComposeableAdapterFactory getRootAdapterFactory() { return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); } @@ -133,6 +134,7 @@ public ComposeableAdapterFactory getRootAdapterFactory() { * * @generated */ + @Override public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { this.parentAdapterFactory = parentAdapterFactory; } @@ -181,6 +183,7 @@ public Object adapt(Object object, Object type) { * * @generated */ + @Override public void addListener(INotifyChangedListener notifyChangedListener) { changeNotifier.addListener(notifyChangedListener); } @@ -191,6 +194,7 @@ public void addListener(INotifyChangedListener notifyChangedListener) { * * @generated */ + @Override public void removeListener(INotifyChangedListener notifyChangedListener) { changeNotifier.removeListener(notifyChangedListener); } @@ -201,6 +205,7 @@ public void removeListener(INotifyChangedListener notifyChangedListener) { * * @generated */ + @Override public void fireNotifyChanged(Notification notification) { changeNotifier.fireNotifyChanged(notification); @@ -215,6 +220,7 @@ public void fireNotifyChanged(Notification notification) { * * @generated */ + @Override public void dispose() { if (addressesItemProvider != null) addressesItemProvider.dispose(); if (addressItemProvider != null) addressItemProvider.dispose(); diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/META-INF/MANIFEST.MF b/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/META-INF/MANIFEST.MF index e372be8..b4cc8fb 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/META-INF/MANIFEST.MF +++ b/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/META-INF/MANIFEST.MF @@ -16,3 +16,4 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.emf.edit.ui;visibility:=reexport, org.eclipse.ui.ide;visibility:=reexport Bundle-ActivationPolicy: lazy +Automatic-Module-Name: edu.kit.ipd.sdq.metamodels.addresses.editor diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/src/edu/kit/ipd/sdq/metamodels/addresses/presentation/AddressesActionBarContributor.java b/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/src/edu/kit/ipd/sdq/metamodels/addresses/presentation/AddressesActionBarContributor.java index 7ba95f1..a6a3229 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/src/edu/kit/ipd/sdq/metamodels/addresses/presentation/AddressesActionBarContributor.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/src/edu/kit/ipd/sdq/metamodels/addresses/presentation/AddressesActionBarContributor.java @@ -163,6 +163,7 @@ public AddressesActionBarContributor() { */ @Override public void contributeToToolBar(IToolBarManager toolBarManager) { + super.contributeToToolBar(toolBarManager); toolBarManager.add(new Separator("addresses-settings")); toolBarManager.add(new Separator("addresses-additions")); } @@ -199,6 +200,7 @@ public void contributeToMenu(IMenuManager menuManager) { // submenuManager.addMenuListener (new IMenuListener() { + @Override public void menuAboutToShow(IMenuManager menuManager) { menuManager.updateAll(true); } @@ -246,6 +248,7 @@ public void setActiveEditor(IEditorPart part) { * * @generated */ + @Override public void selectionChanged(SelectionChangedEvent event) { // Remove any menu items for old selection. // diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/src/edu/kit/ipd/sdq/metamodels/addresses/presentation/AddressesEditor.java b/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/src/edu/kit/ipd/sdq/metamodels/addresses/presentation/AddressesEditor.java index 44db856..b0690fb 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/src/edu/kit/ipd/sdq/metamodels/addresses/presentation/AddressesEditor.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/src/edu/kit/ipd/sdq/metamodels/addresses/presentation/AddressesEditor.java @@ -69,6 +69,7 @@ import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Composite; @@ -324,6 +325,7 @@ public class AddressesEditor */ protected IPartListener partListener = new IPartListener() { + @Override public void partActivated(IWorkbenchPart p) { if (p instanceof ContentOutline) { if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { @@ -342,15 +344,19 @@ else if (p == AddressesEditor.this) { handleActivate(); } } + @Override public void partBroughtToTop(IWorkbenchPart p) { // Ignore. } + @Override public void partClosed(IWorkbenchPart p) { // Ignore. } + @Override public void partDeactivated(IWorkbenchPart p) { // Ignore. } + @Override public void partOpened(IWorkbenchPart p) { // Ignore. } @@ -436,6 +442,7 @@ protected void dispatchUpdateProblemIndication() { dispatching = true; getSite().getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { dispatching = false; updateProblemIndication(); @@ -465,6 +472,7 @@ protected void unsetTarget(Resource target) { */ protected IResourceChangeListener resourceChangeListener = new IResourceChangeListener() { + @Override public void resourceChanged(IResourceChangeEvent event) { IResourceDelta delta = event.getDelta(); try { @@ -473,6 +481,7 @@ class ResourceDeltaVisitor implements IResourceDeltaVisitor { protected Collection changedResources = new ArrayList(); protected Collection removedResources = new ArrayList(); + @Override public boolean visit(IResourceDelta delta) { if (delta.getResource().getType() == IResource.FILE) { if (delta.getKind() == IResourceDelta.REMOVED || @@ -508,6 +517,7 @@ public Collection getRemovedResources() { if (!visitor.getRemovedResources().isEmpty()) { getSite().getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { removedResources.addAll(visitor.getRemovedResources()); if (!isDirty()) { @@ -520,6 +530,7 @@ public void run() { if (!visitor.getChangedResources().isEmpty()) { getSite().getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { changedResources.addAll(visitor.getChangedResources()); if (getSite().getPage().getActiveEditor() == AddressesEditor.this) { @@ -578,8 +589,9 @@ else if (!changedResources.isEmpty()) { */ protected void handleChangedResources() { if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) { + ResourceSet resourceSet = editingDomain.getResourceSet(); if (isDirty()) { - changedResources.addAll(editingDomain.getResourceSet().getResources()); + changedResources.addAll(resourceSet.getResources()); } editingDomain.getCommandStack().flush(); @@ -588,7 +600,7 @@ protected void handleChangedResources() { if (resource.isLoaded()) { resource.unload(); try { - resource.load(Collections.EMPTY_MAP); + resource.load(resourceSet.getLoadOptions()); } catch (IOException exception) { if (!resourceToDiagnosticMap.containsKey(resource)) { @@ -709,9 +721,11 @@ protected void initializeEditingDomain() { // commandStack.addCommandStackListener (new CommandStackListener() { + @Override public void commandStackChanged(final EventObject event) { getContainer().getDisplay().asyncExec (new Runnable() { + @Override public void run() { firePropertyChange(IEditorPart.PROP_DIRTY); @@ -723,7 +737,7 @@ public void run() { } for (Iterator i = propertySheetPages.iterator(); i.hasNext(); ) { PropertySheetPage propertySheetPage = i.next(); - if (propertySheetPage.getControl().isDisposed()) { + if (propertySheetPage.getControl() == null || propertySheetPage.getControl().isDisposed()) { i.remove(); } else { @@ -764,6 +778,7 @@ public void setSelectionToViewer(Collection collection) { if (theSelection != null && !theSelection.isEmpty()) { Runnable runnable = new Runnable() { + @Override public void run() { // Try to select the items in the current content viewer of the editor. // @@ -784,6 +799,7 @@ public void run() { * * @generated */ + @Override public EditingDomain getEditingDomain() { return editingDomain; } @@ -880,6 +896,7 @@ public void setCurrentViewer(Viewer viewer) { new ISelectionChangedListener() { // This just notifies those things that are affected by the section. // + @Override public void selectionChanged(SelectionChangedEvent selectionChangedEvent) { setSelection(selectionChangedEvent.getSelection()); } @@ -914,6 +931,7 @@ public void selectionChanged(SelectionChangedEvent selectionChangedEvent) { * * @generated */ + @Override public Viewer getViewer() { return currentViewer; } @@ -1219,8 +1237,11 @@ public void requestActivation() { getSite().getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { - setActivePage(0); + if (!getContainer().isDisposed()) { + setActivePage(0); + } } }); } @@ -1243,6 +1264,7 @@ public void controlResized(ControlEvent event) { getSite().getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { updateProblemIndication(); } @@ -1260,9 +1282,9 @@ protected void hideTabs() { if (getPageCount() <= 1) { setPageText(0, ""); if (getContainer() instanceof CTabFolder) { - ((CTabFolder)getContainer()).setTabHeight(1); Point point = getContainer().getSize(); - getContainer().setSize(point.x, point.y + 6); + Rectangle clientArea = getContainer().getClientArea(); + getContainer().setSize(point.x, 2 * point.y - clientArea.height - clientArea.y); } } } @@ -1278,9 +1300,9 @@ protected void showTabs() { if (getPageCount() > 1) { setPageText(0, getString("_UI_SelectionPage_label")); if (getContainer() instanceof CTabFolder) { - ((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT); Point point = getContainer().getSize(); - getContainer().setSize(point.x, point.y - 6); + Rectangle clientArea = getContainer().getClientArea(); + getContainer().setSize(point.x, clientArea.height + clientArea.y); } } } @@ -1306,17 +1328,16 @@ protected void pageChange(int pageIndex) { * * @generated */ - @SuppressWarnings("rawtypes") @Override - public Object getAdapter(Class key) { + public T getAdapter(Class key) { if (key.equals(IContentOutlinePage.class)) { - return showOutlineView() ? getContentOutlinePage() : null; + return showOutlineView() ? key.cast(getContentOutlinePage()) : null; } else if (key.equals(IPropertySheetPage.class)) { - return getPropertySheetPage(); + return key.cast(getPropertySheetPage()); } else if (key.equals(IGotoMarker.class)) { - return this; + return key.cast(this); } else { return super.getAdapter(key); @@ -1379,6 +1400,7 @@ public void setActionBars(IActionBars actionBars) { (new ISelectionChangedListener() { // This ensures that we handle selections correctly. // + @Override public void selectionChanged(SelectionChangedEvent event) { handleContentOutlineSelection(event.getSelection()); } @@ -1396,7 +1418,7 @@ public void selectionChanged(SelectionChangedEvent event) { */ public IPropertySheetPage getPropertySheetPage() { PropertySheetPage propertySheetPage = - new ExtendedPropertySheetPage(editingDomain) { + new ExtendedPropertySheetPage(editingDomain, ExtendedPropertySheetPage.Decoration.NONE, null, 0, false) { @Override public void setSelectionToViewer(List selection) { AddressesEditor.this.setSelectionToViewer(selection); @@ -1603,6 +1625,7 @@ protected void doSaveAs(URI uri, IEditorInput editorInput) { * * @generated */ + @Override public void gotoMarker(IMarker marker) { List targetObjects = markerHelper.getTargetObjects(editingDomain, marker); if (!targetObjects.isEmpty()) { @@ -1647,6 +1670,7 @@ public void setFocus() { * * @generated */ + @Override public void addSelectionChangedListener(ISelectionChangedListener listener) { selectionChangedListeners.add(listener); } @@ -1657,6 +1681,7 @@ public void addSelectionChangedListener(ISelectionChangedListener listener) { * * @generated */ + @Override public void removeSelectionChangedListener(ISelectionChangedListener listener) { selectionChangedListeners.remove(listener); } @@ -1667,6 +1692,7 @@ public void removeSelectionChangedListener(ISelectionChangedListener listener) { * * @generated */ + @Override public ISelection getSelection() { return editorSelection; } @@ -1678,6 +1704,7 @@ public ISelection getSelection() { * * @generated */ + @Override public void setSelection(ISelection selection) { editorSelection = selection; @@ -1747,6 +1774,7 @@ private static String getString(String key, Object s1) { * * @generated */ + @Override public void menuAboutToShow(IMenuManager menuManager) { ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager); } diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/src/edu/kit/ipd/sdq/metamodels/addresses/presentation/AddressesModelWizard.java b/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/src/edu/kit/ipd/sdq/metamodels/addresses/presentation/AddressesModelWizard.java index 83718ac..133aa5d 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/src/edu/kit/ipd/sdq/metamodels/addresses/presentation/AddressesModelWizard.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/src/edu/kit/ipd/sdq/metamodels/addresses/presentation/AddressesModelWizard.java @@ -172,6 +172,7 @@ public class AddressesModelWizard extends Wizard implements INewWizard { * * @generated */ + @Override public void init(IWorkbench workbench, IStructuredSelection selection) { this.workbench = workbench; this.selection = selection; @@ -278,6 +279,7 @@ protected void execute(IProgressMonitor progressMonitor) { final ISelection targetSelection = new StructuredSelection(modelFile); getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { ((ISetSelectionTarget)activePart).selectReveal(targetSelection); } @@ -394,6 +396,7 @@ public AddressesModelWizardInitialObjectCreationPage(String pageId) { * * @generated */ + @Override public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); { GridLayout layout = new GridLayout(); @@ -468,6 +471,7 @@ public void createControl(Composite parent) { */ protected ModifyListener validator = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { setPageComplete(validatePage()); } diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses/META-INF/MANIFEST.MF b/bundles/edu.kit.ipd.sdq.metamodels.addresses/META-INF/MANIFEST.MF index 3738ecf..7cee820 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses/META-INF/MANIFEST.MF +++ b/bundles/edu.kit.ipd.sdq.metamodels.addresses/META-INF/MANIFEST.MF @@ -13,3 +13,4 @@ Export-Package: edu.kit.ipd.sdq.metamodels.addresses, Require-Bundle: org.eclipse.core.runtime, org.eclipse.emf.ecore;visibility:=reexport Bundle-ActivationPolicy: lazy +Automatic-Module-Name: edu.kit.ipd.sdq.metamodels.addresses diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/AddressImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/AddressImpl.java index eb206c3..b75fe94 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/AddressImpl.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/AddressImpl.java @@ -116,6 +116,7 @@ protected EClass eStaticClass() { * * @generated */ + @Override public Addresses getParent() { if (eContainerFeatureID() != AddressesPackage.ADDRESS__PARENT) return null; return (Addresses)eInternalContainer(); @@ -136,6 +137,7 @@ public NotificationChain basicSetParent(Addresses newParent, NotificationChain m * * @generated */ + @Override public void setParent(Addresses newParent) { if (newParent != eInternalContainer() || (eContainerFeatureID() != AddressesPackage.ADDRESS__PARENT && newParent != null)) { if (EcoreUtil.isAncestor(this, newParent)) @@ -157,6 +159,7 @@ else if (eNotificationRequired()) * * @generated */ + @Override public int getNumber() { return number; } @@ -166,6 +169,7 @@ public int getNumber() { * * @generated */ + @Override public void setNumber(int newNumber) { int oldNumber = number; number = newNumber; @@ -178,6 +182,7 @@ public void setNumber(int newNumber) { * * @generated */ + @Override public String getStreet() { return street; } @@ -187,6 +192,7 @@ public String getStreet() { * * @generated */ + @Override public void setStreet(String newStreet) { String oldStreet = street; street = newStreet; @@ -199,6 +205,7 @@ public void setStreet(String newStreet) { * * @generated */ + @Override public String getZipCode() { return zipCode; } @@ -208,6 +215,7 @@ public String getZipCode() { * * @generated */ + @Override public void setZipCode(String newZipCode) { String oldZipCode = zipCode; zipCode = newZipCode; @@ -356,7 +364,7 @@ public boolean eIsSet(int featureID) { public String toString() { if (eIsProxy()) return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); + StringBuilder result = new StringBuilder(super.toString()); result.append(" (number: "); result.append(number); result.append(", street: "); diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/AddressesFactoryImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/AddressesFactoryImpl.java index e5b759a..f9fa016 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/AddressesFactoryImpl.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/AddressesFactoryImpl.java @@ -68,6 +68,7 @@ public EObject create(EClass eClass) { * * @generated */ + @Override public Addresses createAddresses() { AddressesImpl addresses = new AddressesImpl(); return addresses; @@ -78,6 +79,7 @@ public Addresses createAddresses() { * * @generated */ + @Override public Address createAddress() { AddressImpl address = new AddressImpl(); return address; @@ -88,6 +90,7 @@ public Address createAddress() { * * @generated */ + @Override public AddressesPackage getAddressesPackage() { return (AddressesPackage)getEPackage(); } diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/AddressesImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/AddressesImpl.java index 14395ea..cf1e783 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/AddressesImpl.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/AddressesImpl.java @@ -65,6 +65,7 @@ protected EClass eStaticClass() { * * @generated */ + @Override public EList
getAddresses() { if (addresses == null) { addresses = new EObjectContainmentWithInverseEList
(Address.class, this, AddressesPackage.ADDRESSES__ADDRESSES, AddressesPackage.ADDRESS__PARENT); diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/AddressesPackageImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/AddressesPackageImpl.java index 9ff8795..02f596f 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/AddressesPackageImpl.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/AddressesPackageImpl.java @@ -71,7 +71,7 @@ private AddressesPackageImpl() { /** * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. - * + * *

This method is used to initialize {@link AddressesPackage#eINSTANCE} when that field is accessed. * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. * @@ -85,7 +85,8 @@ public static AddressesPackage init() { if (isInited) return (AddressesPackage)EPackage.Registry.INSTANCE.getEPackage(AddressesPackage.eNS_URI); // Obtain or create and register package - AddressesPackageImpl theAddressesPackage = (AddressesPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof AddressesPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new AddressesPackageImpl()); + Object registeredAddressesPackage = EPackage.Registry.INSTANCE.get(eNS_URI); + AddressesPackageImpl theAddressesPackage = registeredAddressesPackage instanceof AddressesPackageImpl ? (AddressesPackageImpl)registeredAddressesPackage : new AddressesPackageImpl(); isInited = true; @@ -98,7 +99,6 @@ public static AddressesPackage init() { // Mark meta-data to indicate it can't be changed theAddressesPackage.freeze(); - // Update the registry and return the package EPackage.Registry.INSTANCE.put(AddressesPackage.eNS_URI, theAddressesPackage); return theAddressesPackage; @@ -109,6 +109,7 @@ public static AddressesPackage init() { * * @generated */ + @Override public EClass getIdentifiedElement() { return identifiedElementEClass; } @@ -118,6 +119,7 @@ public EClass getIdentifiedElement() { * * @generated */ + @Override public EAttribute getIdentifiedElement_Id() { return (EAttribute)identifiedElementEClass.getEStructuralFeatures().get(0); } @@ -127,6 +129,7 @@ public EAttribute getIdentifiedElement_Id() { * * @generated */ + @Override public EClass getAddresses() { return addressesEClass; } @@ -136,6 +139,7 @@ public EClass getAddresses() { * * @generated */ + @Override public EReference getAddresses_Addresses() { return (EReference)addressesEClass.getEStructuralFeatures().get(0); } @@ -145,6 +149,7 @@ public EReference getAddresses_Addresses() { * * @generated */ + @Override public EClass getAddress() { return addressEClass; } @@ -154,6 +159,7 @@ public EClass getAddress() { * * @generated */ + @Override public EReference getAddress_Parent() { return (EReference)addressEClass.getEStructuralFeatures().get(0); } @@ -163,6 +169,7 @@ public EReference getAddress_Parent() { * * @generated */ + @Override public EAttribute getAddress_Number() { return (EAttribute)addressEClass.getEStructuralFeatures().get(1); } @@ -172,6 +179,7 @@ public EAttribute getAddress_Number() { * * @generated */ + @Override public EAttribute getAddress_Street() { return (EAttribute)addressEClass.getEStructuralFeatures().get(2); } @@ -181,6 +189,7 @@ public EAttribute getAddress_Street() { * * @generated */ + @Override public EAttribute getAddress_ZipCode() { return (EAttribute)addressEClass.getEStructuralFeatures().get(3); } @@ -190,6 +199,7 @@ public EAttribute getAddress_ZipCode() { * * @generated */ + @Override public AddressesFactory getAddressesFactory() { return (AddressesFactory)getEFactoryInstance(); } diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/IdentifiedElementImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/IdentifiedElementImpl.java index 90563ce..7064c01 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/IdentifiedElementImpl.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/IdentifiedElementImpl.java @@ -70,6 +70,7 @@ protected EClass eStaticClass() { * * @generated */ + @Override public String getId() { return id; } @@ -79,6 +80,7 @@ public String getId() { * * @generated */ + @Override public void setId(String newId) { String oldId = id; id = newId; @@ -153,7 +155,7 @@ public boolean eIsSet(int featureID) { public String toString() { if (eIsProxy()) return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); + StringBuilder result = new StringBuilder(super.toString()); result.append(" (id: "); result.append(id); result.append(')'); diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families.edit/META-INF/MANIFEST.MF b/bundles/edu.kit.ipd.sdq.metamodels.families.edit/META-INF/MANIFEST.MF index b345e68..047c8b7 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.families.edit/META-INF/MANIFEST.MF +++ b/bundles/edu.kit.ipd.sdq.metamodels.families.edit/META-INF/MANIFEST.MF @@ -13,3 +13,4 @@ Require-Bundle: org.eclipse.core.runtime, edu.kit.ipd.sdq.metamodels.families;visibility:=reexport, org.eclipse.emf.edit;visibility:=reexport Bundle-ActivationPolicy: lazy +Automatic-Module-Name: edu.kit.ipd.sdq.metamodels.families.edit diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families.edit/src/edu/kit/ipd/sdq/metamodels/families/provider/FamiliesItemProviderAdapterFactory.java b/bundles/edu.kit.ipd.sdq.metamodels.families.edit/src/edu/kit/ipd/sdq/metamodels/families/provider/FamiliesItemProviderAdapterFactory.java index 017d405..72eaff6 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.families.edit/src/edu/kit/ipd/sdq/metamodels/families/provider/FamiliesItemProviderAdapterFactory.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.families.edit/src/edu/kit/ipd/sdq/metamodels/families/provider/FamiliesItemProviderAdapterFactory.java @@ -146,6 +146,7 @@ public Adapter createMemberAdapter() { * * @generated */ + @Override public ComposeableAdapterFactory getRootAdapterFactory() { return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); } @@ -156,6 +157,7 @@ public ComposeableAdapterFactory getRootAdapterFactory() { * * @generated */ + @Override public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { this.parentAdapterFactory = parentAdapterFactory; } @@ -204,6 +206,7 @@ public Object adapt(Object object, Object type) { * * @generated */ + @Override public void addListener(INotifyChangedListener notifyChangedListener) { changeNotifier.addListener(notifyChangedListener); } @@ -214,6 +217,7 @@ public void addListener(INotifyChangedListener notifyChangedListener) { * * @generated */ + @Override public void removeListener(INotifyChangedListener notifyChangedListener) { changeNotifier.removeListener(notifyChangedListener); } @@ -224,6 +228,7 @@ public void removeListener(INotifyChangedListener notifyChangedListener) { * * @generated */ + @Override public void fireNotifyChanged(Notification notification) { changeNotifier.fireNotifyChanged(notification); @@ -238,6 +243,7 @@ public void fireNotifyChanged(Notification notification) { * * @generated */ + @Override public void dispose() { if (familyRegisterItemProvider != null) familyRegisterItemProvider.dispose(); if (familyItemProvider != null) familyItemProvider.dispose(); diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families.editor/META-INF/MANIFEST.MF b/bundles/edu.kit.ipd.sdq.metamodels.families.editor/META-INF/MANIFEST.MF index 5c61409..edb9ade 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.families.editor/META-INF/MANIFEST.MF +++ b/bundles/edu.kit.ipd.sdq.metamodels.families.editor/META-INF/MANIFEST.MF @@ -16,3 +16,4 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.emf.edit.ui;visibility:=reexport, org.eclipse.ui.ide;visibility:=reexport Bundle-ActivationPolicy: lazy +Automatic-Module-Name: edu.kit.ipd.sdq.metamodels.families.editor diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families.editor/src/edu/kit/ipd/sdq/metamodels/families/presentation/FamiliesActionBarContributor.java b/bundles/edu.kit.ipd.sdq.metamodels.families.editor/src/edu/kit/ipd/sdq/metamodels/families/presentation/FamiliesActionBarContributor.java index 8e115b6..d493791 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.families.editor/src/edu/kit/ipd/sdq/metamodels/families/presentation/FamiliesActionBarContributor.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.families.editor/src/edu/kit/ipd/sdq/metamodels/families/presentation/FamiliesActionBarContributor.java @@ -163,6 +163,7 @@ public FamiliesActionBarContributor() { */ @Override public void contributeToToolBar(IToolBarManager toolBarManager) { + super.contributeToToolBar(toolBarManager); toolBarManager.add(new Separator("families-settings")); toolBarManager.add(new Separator("families-additions")); } @@ -199,6 +200,7 @@ public void contributeToMenu(IMenuManager menuManager) { // submenuManager.addMenuListener (new IMenuListener() { + @Override public void menuAboutToShow(IMenuManager menuManager) { menuManager.updateAll(true); } @@ -246,6 +248,7 @@ public void setActiveEditor(IEditorPart part) { * * @generated */ + @Override public void selectionChanged(SelectionChangedEvent event) { // Remove any menu items for old selection. // diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families.editor/src/edu/kit/ipd/sdq/metamodels/families/presentation/FamiliesEditor.java b/bundles/edu.kit.ipd.sdq.metamodels.families.editor/src/edu/kit/ipd/sdq/metamodels/families/presentation/FamiliesEditor.java index f6d4175..6098844 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.families.editor/src/edu/kit/ipd/sdq/metamodels/families/presentation/FamiliesEditor.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.families.editor/src/edu/kit/ipd/sdq/metamodels/families/presentation/FamiliesEditor.java @@ -69,6 +69,7 @@ import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Composite; @@ -324,6 +325,7 @@ public class FamiliesEditor */ protected IPartListener partListener = new IPartListener() { + @Override public void partActivated(IWorkbenchPart p) { if (p instanceof ContentOutline) { if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { @@ -342,15 +344,19 @@ else if (p == FamiliesEditor.this) { handleActivate(); } } + @Override public void partBroughtToTop(IWorkbenchPart p) { // Ignore. } + @Override public void partClosed(IWorkbenchPart p) { // Ignore. } + @Override public void partDeactivated(IWorkbenchPart p) { // Ignore. } + @Override public void partOpened(IWorkbenchPart p) { // Ignore. } @@ -404,6 +410,8 @@ public void partOpened(IWorkbenchPart p) { */ protected EContentAdapter problemIndicationAdapter = new EContentAdapter() { + protected boolean dispatching; + @Override public void notifyChanged(Notification notification) { if (notification.getNotifier() instanceof Resource) { @@ -419,15 +427,7 @@ public void notifyChanged(Notification notification) { else { resourceToDiagnosticMap.remove(resource); } - - if (updateProblemIndication) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - public void run() { - updateProblemIndication(); - } - }); - } + dispatchUpdateProblemIndication(); break; } } @@ -437,6 +437,20 @@ public void run() { } } + protected void dispatchUpdateProblemIndication() { + if (updateProblemIndication && !dispatching) { + dispatching = true; + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + dispatching = false; + updateProblemIndication(); + } + }); + } + } + @Override protected void setTarget(Resource target) { basicSetTarget(target); @@ -446,14 +460,7 @@ protected void setTarget(Resource target) { protected void unsetTarget(Resource target) { basicUnsetTarget(target); resourceToDiagnosticMap.remove(target); - if (updateProblemIndication) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - public void run() { - updateProblemIndication(); - } - }); - } + dispatchUpdateProblemIndication(); } }; @@ -465,6 +472,7 @@ public void run() { */ protected IResourceChangeListener resourceChangeListener = new IResourceChangeListener() { + @Override public void resourceChanged(IResourceChangeEvent event) { IResourceDelta delta = event.getDelta(); try { @@ -473,6 +481,7 @@ class ResourceDeltaVisitor implements IResourceDeltaVisitor { protected Collection changedResources = new ArrayList(); protected Collection removedResources = new ArrayList(); + @Override public boolean visit(IResourceDelta delta) { if (delta.getResource().getType() == IResource.FILE) { if (delta.getKind() == IResourceDelta.REMOVED || @@ -508,6 +517,7 @@ public Collection getRemovedResources() { if (!visitor.getRemovedResources().isEmpty()) { getSite().getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { removedResources.addAll(visitor.getRemovedResources()); if (!isDirty()) { @@ -520,6 +530,7 @@ public void run() { if (!visitor.getChangedResources().isEmpty()) { getSite().getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { changedResources.addAll(visitor.getChangedResources()); if (getSite().getPage().getActiveEditor() == FamiliesEditor.this) { @@ -578,8 +589,9 @@ else if (!changedResources.isEmpty()) { */ protected void handleChangedResources() { if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) { + ResourceSet resourceSet = editingDomain.getResourceSet(); if (isDirty()) { - changedResources.addAll(editingDomain.getResourceSet().getResources()); + changedResources.addAll(resourceSet.getResources()); } editingDomain.getCommandStack().flush(); @@ -588,7 +600,7 @@ protected void handleChangedResources() { if (resource.isLoaded()) { resource.unload(); try { - resource.load(Collections.EMPTY_MAP); + resource.load(resourceSet.getLoadOptions()); } catch (IOException exception) { if (!resourceToDiagnosticMap.containsKey(resource)) { @@ -651,14 +663,11 @@ else if (diagnostic.getSeverity() != Diagnostic.OK) { } if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { - markerHelper.deleteMarkers(editingDomain.getResourceSet()); - if (diagnostic.getSeverity() != Diagnostic.OK) { - try { - markerHelper.createMarkers(diagnostic); - } - catch (CoreException exception) { - FamiliesEditorPlugin.INSTANCE.log(exception); - } + try { + markerHelper.updateMarkers(diagnostic); + } + catch (CoreException exception) { + FamiliesEditorPlugin.INSTANCE.log(exception); } } } @@ -712,9 +721,11 @@ protected void initializeEditingDomain() { // commandStack.addCommandStackListener (new CommandStackListener() { + @Override public void commandStackChanged(final EventObject event) { getContainer().getDisplay().asyncExec (new Runnable() { + @Override public void run() { firePropertyChange(IEditorPart.PROP_DIRTY); @@ -726,7 +737,7 @@ public void run() { } for (Iterator i = propertySheetPages.iterator(); i.hasNext(); ) { PropertySheetPage propertySheetPage = i.next(); - if (propertySheetPage.getControl().isDisposed()) { + if (propertySheetPage.getControl() == null || propertySheetPage.getControl().isDisposed()) { i.remove(); } else { @@ -767,6 +778,7 @@ public void setSelectionToViewer(Collection collection) { if (theSelection != null && !theSelection.isEmpty()) { Runnable runnable = new Runnable() { + @Override public void run() { // Try to select the items in the current content viewer of the editor. // @@ -787,6 +799,7 @@ public void run() { * * @generated */ + @Override public EditingDomain getEditingDomain() { return editingDomain; } @@ -883,6 +896,7 @@ public void setCurrentViewer(Viewer viewer) { new ISelectionChangedListener() { // This just notifies those things that are affected by the section. // + @Override public void selectionChanged(SelectionChangedEvent selectionChangedEvent) { setSelection(selectionChangedEvent.getSelection()); } @@ -917,6 +931,7 @@ public void selectionChanged(SelectionChangedEvent selectionChangedEvent) { * * @generated */ + @Override public Viewer getViewer() { return currentViewer; } @@ -1039,6 +1054,7 @@ public void requestActivation() { selectionViewer = (TreeViewer)viewerPane.getViewer(); selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + selectionViewer.setUseHashlookup(true); selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); selectionViewer.setInput(editingDomain.getResourceSet()); @@ -1221,8 +1237,11 @@ public void requestActivation() { getSite().getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { - setActivePage(0); + if (!getContainer().isDisposed()) { + setActivePage(0); + } } }); } @@ -1245,6 +1264,7 @@ public void controlResized(ControlEvent event) { getSite().getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { updateProblemIndication(); } @@ -1262,9 +1282,9 @@ protected void hideTabs() { if (getPageCount() <= 1) { setPageText(0, ""); if (getContainer() instanceof CTabFolder) { - ((CTabFolder)getContainer()).setTabHeight(1); Point point = getContainer().getSize(); - getContainer().setSize(point.x, point.y + 6); + Rectangle clientArea = getContainer().getClientArea(); + getContainer().setSize(point.x, 2 * point.y - clientArea.height - clientArea.y); } } } @@ -1280,9 +1300,9 @@ protected void showTabs() { if (getPageCount() > 1) { setPageText(0, getString("_UI_SelectionPage_label")); if (getContainer() instanceof CTabFolder) { - ((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT); Point point = getContainer().getSize(); - getContainer().setSize(point.x, point.y - 6); + Rectangle clientArea = getContainer().getClientArea(); + getContainer().setSize(point.x, clientArea.height + clientArea.y); } } } @@ -1308,17 +1328,16 @@ protected void pageChange(int pageIndex) { * * @generated */ - @SuppressWarnings("rawtypes") @Override - public Object getAdapter(Class key) { + public T getAdapter(Class key) { if (key.equals(IContentOutlinePage.class)) { - return showOutlineView() ? getContentOutlinePage() : null; + return showOutlineView() ? key.cast(getContentOutlinePage()) : null; } else if (key.equals(IPropertySheetPage.class)) { - return getPropertySheetPage(); + return key.cast(getPropertySheetPage()); } else if (key.equals(IGotoMarker.class)) { - return this; + return key.cast(this); } else { return super.getAdapter(key); @@ -1344,6 +1363,7 @@ public void createControl(Composite parent) { // Set up the tree viewer. // + contentOutlineViewer.setUseHashlookup(true); contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); contentOutlineViewer.setInput(editingDomain.getResourceSet()); @@ -1380,6 +1400,7 @@ public void setActionBars(IActionBars actionBars) { (new ISelectionChangedListener() { // This ensures that we handle selections correctly. // + @Override public void selectionChanged(SelectionChangedEvent event) { handleContentOutlineSelection(event.getSelection()); } @@ -1397,7 +1418,7 @@ public void selectionChanged(SelectionChangedEvent event) { */ public IPropertySheetPage getPropertySheetPage() { PropertySheetPage propertySheetPage = - new ExtendedPropertySheetPage(editingDomain) { + new ExtendedPropertySheetPage(editingDomain, ExtendedPropertySheetPage.Decoration.NONE, null, 0, false) { @Override public void setSelectionToViewer(List selection) { FamiliesEditor.this.setSelectionToViewer(selection); @@ -1491,7 +1512,9 @@ public void execute(IProgressMonitor monitor) { // Save the resources to the file system. // boolean first = true; - for (Resource resource : editingDomain.getResourceSet().getResources()) { + List resources = editingDomain.getResourceSet().getResources(); + for (int i = 0; i < resources.size(); ++i) { + Resource resource = resources.get(i); if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) { try { long timeStamp = resource.getTimeStamp(); @@ -1602,6 +1625,7 @@ protected void doSaveAs(URI uri, IEditorInput editorInput) { * * @generated */ + @Override public void gotoMarker(IMarker marker) { List targetObjects = markerHelper.getTargetObjects(editingDomain, marker); if (!targetObjects.isEmpty()) { @@ -1646,6 +1670,7 @@ public void setFocus() { * * @generated */ + @Override public void addSelectionChangedListener(ISelectionChangedListener listener) { selectionChangedListeners.add(listener); } @@ -1656,6 +1681,7 @@ public void addSelectionChangedListener(ISelectionChangedListener listener) { * * @generated */ + @Override public void removeSelectionChangedListener(ISelectionChangedListener listener) { selectionChangedListeners.remove(listener); } @@ -1666,6 +1692,7 @@ public void removeSelectionChangedListener(ISelectionChangedListener listener) { * * @generated */ + @Override public ISelection getSelection() { return editorSelection; } @@ -1677,6 +1704,7 @@ public ISelection getSelection() { * * @generated */ + @Override public void setSelection(ISelection selection) { editorSelection = selection; @@ -1746,6 +1774,7 @@ private static String getString(String key, Object s1) { * * @generated */ + @Override public void menuAboutToShow(IMenuManager menuManager) { ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager); } diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families.editor/src/edu/kit/ipd/sdq/metamodels/families/presentation/FamiliesModelWizard.java b/bundles/edu.kit.ipd.sdq.metamodels.families.editor/src/edu/kit/ipd/sdq/metamodels/families/presentation/FamiliesModelWizard.java index d784375..3b6b767 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.families.editor/src/edu/kit/ipd/sdq/metamodels/families/presentation/FamiliesModelWizard.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.families.editor/src/edu/kit/ipd/sdq/metamodels/families/presentation/FamiliesModelWizard.java @@ -172,6 +172,7 @@ public class FamiliesModelWizard extends Wizard implements INewWizard { * * @generated */ + @Override public void init(IWorkbench workbench, IStructuredSelection selection) { this.workbench = workbench; this.selection = selection; @@ -278,6 +279,7 @@ protected void execute(IProgressMonitor progressMonitor) { final ISelection targetSelection = new StructuredSelection(modelFile); getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { ((ISetSelectionTarget)activePart).selectReveal(targetSelection); } @@ -394,9 +396,9 @@ public FamiliesModelWizardInitialObjectCreationPage(String pageId) { * * @generated */ + @Override public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - { + Composite composite = new Composite(parent, SWT.NONE); { GridLayout layout = new GridLayout(); layout.numColumns = 1; layout.verticalSpacing = 12; @@ -469,6 +471,7 @@ public void createControl(Composite parent) { */ protected ModifyListener validator = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { setPageComplete(validatePage()); } diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families/META-INF/MANIFEST.MF b/bundles/edu.kit.ipd.sdq.metamodels.families/META-INF/MANIFEST.MF index 23c2f4b..079b33b 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/META-INF/MANIFEST.MF +++ b/bundles/edu.kit.ipd.sdq.metamodels.families/META-INF/MANIFEST.MF @@ -13,3 +13,4 @@ Export-Package: edu.kit.ipd.sdq.metamodels.families, Require-Bundle: org.eclipse.core.runtime, org.eclipse.emf.ecore;visibility:=reexport Bundle-ActivationPolicy: lazy +Automatic-Module-Name: edu.kit.ipd.sdq.metamodels.families diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families/model/families.genmodel b/bundles/edu.kit.ipd.sdq.metamodels.families/model/families.genmodel index c09dc10..df90ac6 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/model/families.genmodel +++ b/bundles/edu.kit.ipd.sdq.metamodels.families/model/families.genmodel @@ -7,6 +7,10 @@ families.ecore + + + + @@ -21,8 +25,5 @@ - - - diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/FamiliesFactoryImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/FamiliesFactoryImpl.java index c6a2892..e7a489c 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/FamiliesFactoryImpl.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/FamiliesFactoryImpl.java @@ -69,6 +69,7 @@ public EObject create(EClass eClass) { * * @generated */ + @Override public FamilyRegister createFamilyRegister() { FamilyRegisterImpl familyRegister = new FamilyRegisterImpl(); return familyRegister; @@ -79,6 +80,7 @@ public FamilyRegister createFamilyRegister() { * * @generated */ + @Override public Family createFamily() { FamilyImpl family = new FamilyImpl(); return family; @@ -89,6 +91,7 @@ public Family createFamily() { * * @generated */ + @Override public Member createMember() { MemberImpl member = new MemberImpl(); return member; @@ -99,6 +102,7 @@ public Member createMember() { * * @generated */ + @Override public FamiliesPackage getFamiliesPackage() { return (FamiliesPackage)getEPackage(); } diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/FamiliesPackageImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/FamiliesPackageImpl.java index dd1fc0d..f809f15 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/FamiliesPackageImpl.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/FamiliesPackageImpl.java @@ -71,7 +71,7 @@ private FamiliesPackageImpl() { /** * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. - * + * *

This method is used to initialize {@link FamiliesPackage#eINSTANCE} when that field is accessed. * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. * @@ -85,7 +85,8 @@ public static FamiliesPackage init() { if (isInited) return (FamiliesPackage)EPackage.Registry.INSTANCE.getEPackage(FamiliesPackage.eNS_URI); // Obtain or create and register package - FamiliesPackageImpl theFamiliesPackage = (FamiliesPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof FamiliesPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new FamiliesPackageImpl()); + Object registeredFamiliesPackage = EPackage.Registry.INSTANCE.get(eNS_URI); + FamiliesPackageImpl theFamiliesPackage = registeredFamiliesPackage instanceof FamiliesPackageImpl ? (FamiliesPackageImpl)registeredFamiliesPackage : new FamiliesPackageImpl(); isInited = true; @@ -98,7 +99,6 @@ public static FamiliesPackage init() { // Mark meta-data to indicate it can't be changed theFamiliesPackage.freeze(); - // Update the registry and return the package EPackage.Registry.INSTANCE.put(FamiliesPackage.eNS_URI, theFamiliesPackage); return theFamiliesPackage; @@ -109,6 +109,7 @@ public static FamiliesPackage init() { * * @generated */ + @Override public EClass getFamilyRegister() { return familyRegisterEClass; } @@ -118,6 +119,7 @@ public EClass getFamilyRegister() { * * @generated */ + @Override public EReference getFamilyRegister_Families() { return (EReference)familyRegisterEClass.getEStructuralFeatures().get(0); } @@ -127,6 +129,7 @@ public EReference getFamilyRegister_Families() { * * @generated */ + @Override public EAttribute getFamilyRegister_Id() { return (EAttribute)familyRegisterEClass.getEStructuralFeatures().get(1); } @@ -136,6 +139,7 @@ public EAttribute getFamilyRegister_Id() { * * @generated */ + @Override public EClass getFamily() { return familyEClass; } @@ -145,6 +149,7 @@ public EClass getFamily() { * * @generated */ + @Override public EAttribute getFamily_LastName() { return (EAttribute)familyEClass.getEStructuralFeatures().get(0); } @@ -154,6 +159,7 @@ public EAttribute getFamily_LastName() { * * @generated */ + @Override public EReference getFamily_Sons() { return (EReference)familyEClass.getEStructuralFeatures().get(1); } @@ -163,6 +169,7 @@ public EReference getFamily_Sons() { * * @generated */ + @Override public EReference getFamily_Daughters() { return (EReference)familyEClass.getEStructuralFeatures().get(2); } @@ -172,6 +179,7 @@ public EReference getFamily_Daughters() { * * @generated */ + @Override public EReference getFamily_Father() { return (EReference)familyEClass.getEStructuralFeatures().get(3); } @@ -181,6 +189,7 @@ public EReference getFamily_Father() { * * @generated */ + @Override public EReference getFamily_Mother() { return (EReference)familyEClass.getEStructuralFeatures().get(4); } @@ -190,6 +199,7 @@ public EReference getFamily_Mother() { * * @generated */ + @Override public EClass getMember() { return memberEClass; } @@ -199,6 +209,7 @@ public EClass getMember() { * * @generated */ + @Override public EAttribute getMember_FirstName() { return (EAttribute)memberEClass.getEStructuralFeatures().get(0); } @@ -208,6 +219,7 @@ public EAttribute getMember_FirstName() { * * @generated */ + @Override public EReference getMember_FamilySon() { return (EReference)memberEClass.getEStructuralFeatures().get(1); } @@ -217,6 +229,7 @@ public EReference getMember_FamilySon() { * * @generated */ + @Override public EReference getMember_FamilyDaughter() { return (EReference)memberEClass.getEStructuralFeatures().get(2); } @@ -226,6 +239,7 @@ public EReference getMember_FamilyDaughter() { * * @generated */ + @Override public EReference getMember_FamilyFather() { return (EReference)memberEClass.getEStructuralFeatures().get(3); } @@ -235,6 +249,7 @@ public EReference getMember_FamilyFather() { * * @generated */ + @Override public EReference getMember_FamilyMother() { return (EReference)memberEClass.getEStructuralFeatures().get(4); } @@ -244,6 +259,7 @@ public EReference getMember_FamilyMother() { * * @generated */ + @Override public FamiliesFactory getFamiliesFactory() { return (FamiliesFactory)getEFactoryInstance(); } diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/FamilyImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/FamilyImpl.java index 494ee1a..22bfb9d 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/FamilyImpl.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/FamilyImpl.java @@ -124,6 +124,7 @@ protected EClass eStaticClass() { * * @generated */ + @Override public String getLastName() { return lastName; } @@ -133,6 +134,7 @@ public String getLastName() { * * @generated */ + @Override public void setLastName(String newLastName) { String oldLastName = lastName; lastName = newLastName; @@ -145,6 +147,7 @@ public void setLastName(String newLastName) { * * @generated */ + @Override public EList getSons() { if (sons == null) { sons = new EObjectContainmentWithInverseEList(Member.class, this, FamiliesPackage.FAMILY__SONS, FamiliesPackage.MEMBER__FAMILY_SON); @@ -157,6 +160,7 @@ public EList getSons() { * * @generated */ + @Override public EList getDaughters() { if (daughters == null) { daughters = new EObjectContainmentWithInverseEList(Member.class, this, FamiliesPackage.FAMILY__DAUGHTERS, FamiliesPackage.MEMBER__FAMILY_DAUGHTER); @@ -169,6 +173,7 @@ public EList getDaughters() { * * @generated */ + @Override public Member getFather() { return father; } @@ -193,6 +198,7 @@ public NotificationChain basicSetFather(Member newFather, NotificationChain msgs * * @generated */ + @Override public void setFather(Member newFather) { if (newFather != father) { NotificationChain msgs = null; @@ -212,6 +218,7 @@ else if (eNotificationRequired()) * * @generated */ + @Override public Member getMother() { return mother; } @@ -236,6 +243,7 @@ public NotificationChain basicSetMother(Member newMother, NotificationChain msgs * * @generated */ + @Override public void setMother(Member newMother) { if (newMother != mother) { NotificationChain msgs = null; @@ -405,7 +413,7 @@ public boolean eIsSet(int featureID) { public String toString() { if (eIsProxy()) return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); + StringBuilder result = new StringBuilder(super.toString()); result.append(" (lastName: "); result.append(lastName); result.append(')'); diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/FamilyRegisterImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/FamilyRegisterImpl.java index 2a08f13..7eb5f2e 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/FamilyRegisterImpl.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/FamilyRegisterImpl.java @@ -90,6 +90,7 @@ protected EClass eStaticClass() { * * @generated */ + @Override public EList getFamilies() { if (families == null) { families = new EObjectContainmentEList(Family.class, this, FamiliesPackage.FAMILY_REGISTER__FAMILIES); @@ -102,6 +103,7 @@ public EList getFamilies() { * * @generated */ + @Override public String getId() { return id; } @@ -111,6 +113,7 @@ public String getId() { * * @generated */ + @Override public void setId(String newId) { String oldId = id; id = newId; @@ -211,7 +214,7 @@ public boolean eIsSet(int featureID) { public String toString() { if (eIsProxy()) return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); + StringBuilder result = new StringBuilder(super.toString()); result.append(" (id: "); result.append(id); result.append(')'); diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/MemberImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/MemberImpl.java index b180100..70b25f3 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/MemberImpl.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/MemberImpl.java @@ -79,6 +79,7 @@ protected EClass eStaticClass() { * * @generated */ + @Override public String getFirstName() { return firstName; } @@ -88,6 +89,7 @@ public String getFirstName() { * * @generated */ + @Override public void setFirstName(String newFirstName) { String oldFirstName = firstName; firstName = newFirstName; @@ -100,6 +102,7 @@ public void setFirstName(String newFirstName) { * * @generated */ + @Override public Family getFamilySon() { if (eContainerFeatureID() != FamiliesPackage.MEMBER__FAMILY_SON) return null; return (Family)eInternalContainer(); @@ -120,6 +123,7 @@ public NotificationChain basicSetFamilySon(Family newFamilySon, NotificationChai * * @generated */ + @Override public void setFamilySon(Family newFamilySon) { if (newFamilySon != eInternalContainer() || (eContainerFeatureID() != FamiliesPackage.MEMBER__FAMILY_SON && newFamilySon != null)) { if (EcoreUtil.isAncestor(this, newFamilySon)) @@ -141,6 +145,7 @@ else if (eNotificationRequired()) * * @generated */ + @Override public Family getFamilyDaughter() { if (eContainerFeatureID() != FamiliesPackage.MEMBER__FAMILY_DAUGHTER) return null; return (Family)eInternalContainer(); @@ -161,6 +166,7 @@ public NotificationChain basicSetFamilyDaughter(Family newFamilyDaughter, Notifi * * @generated */ + @Override public void setFamilyDaughter(Family newFamilyDaughter) { if (newFamilyDaughter != eInternalContainer() || (eContainerFeatureID() != FamiliesPackage.MEMBER__FAMILY_DAUGHTER && newFamilyDaughter != null)) { if (EcoreUtil.isAncestor(this, newFamilyDaughter)) @@ -182,6 +188,7 @@ else if (eNotificationRequired()) * * @generated */ + @Override public Family getFamilyFather() { if (eContainerFeatureID() != FamiliesPackage.MEMBER__FAMILY_FATHER) return null; return (Family)eInternalContainer(); @@ -202,6 +209,7 @@ public NotificationChain basicSetFamilyFather(Family newFamilyFather, Notificati * * @generated */ + @Override public void setFamilyFather(Family newFamilyFather) { if (newFamilyFather != eInternalContainer() || (eContainerFeatureID() != FamiliesPackage.MEMBER__FAMILY_FATHER && newFamilyFather != null)) { if (EcoreUtil.isAncestor(this, newFamilyFather)) @@ -223,6 +231,7 @@ else if (eNotificationRequired()) * * @generated */ + @Override public Family getFamilyMother() { if (eContainerFeatureID() != FamiliesPackage.MEMBER__FAMILY_MOTHER) return null; return (Family)eInternalContainer(); @@ -243,6 +252,7 @@ public NotificationChain basicSetFamilyMother(Family newFamilyMother, Notificati * * @generated */ + @Override public void setFamilyMother(Family newFamilyMother) { if (newFamilyMother != eInternalContainer() || (eContainerFeatureID() != FamiliesPackage.MEMBER__FAMILY_MOTHER && newFamilyMother != null)) { if (EcoreUtil.isAncestor(this, newFamilyMother)) @@ -434,7 +444,7 @@ public boolean eIsSet(int featureID) { public String toString() { if (eIsProxy()) return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); + StringBuilder result = new StringBuilder(super.toString()); result.append(" (firstName: "); result.append(firstName); result.append(')'); diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/META-INF/MANIFEST.MF b/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/META-INF/MANIFEST.MF index 83c1959..1be3ec8 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/META-INF/MANIFEST.MF +++ b/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/META-INF/MANIFEST.MF @@ -13,3 +13,4 @@ Require-Bundle: org.eclipse.core.runtime, edu.kit.ipd.sdq.metamodels.persons;visibility:=reexport, org.eclipse.emf.edit;visibility:=reexport Bundle-ActivationPolicy: lazy +Automatic-Module-Name: edu.kit.ipd.sdq.metamodels.persons.edit diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/src/edu/kit/ipd/sdq/metamodels/persons/provider/PersonsItemProviderAdapterFactory.java b/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/src/edu/kit/ipd/sdq/metamodels/persons/provider/PersonsItemProviderAdapterFactory.java index 6683dad..698e6d3 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/src/edu/kit/ipd/sdq/metamodels/persons/provider/PersonsItemProviderAdapterFactory.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/src/edu/kit/ipd/sdq/metamodels/persons/provider/PersonsItemProviderAdapterFactory.java @@ -146,6 +146,7 @@ public Adapter createFemaleAdapter() { * * @generated */ + @Override public ComposeableAdapterFactory getRootAdapterFactory() { return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); } @@ -156,6 +157,7 @@ public ComposeableAdapterFactory getRootAdapterFactory() { * * @generated */ + @Override public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { this.parentAdapterFactory = parentAdapterFactory; } @@ -204,6 +206,7 @@ public Object adapt(Object object, Object type) { * * @generated */ + @Override public void addListener(INotifyChangedListener notifyChangedListener) { changeNotifier.addListener(notifyChangedListener); } @@ -214,6 +217,7 @@ public void addListener(INotifyChangedListener notifyChangedListener) { * * @generated */ + @Override public void removeListener(INotifyChangedListener notifyChangedListener) { changeNotifier.removeListener(notifyChangedListener); } @@ -224,6 +228,7 @@ public void removeListener(INotifyChangedListener notifyChangedListener) { * * @generated */ + @Override public void fireNotifyChanged(Notification notification) { changeNotifier.fireNotifyChanged(notification); @@ -238,6 +243,7 @@ public void fireNotifyChanged(Notification notification) { * * @generated */ + @Override public void dispose() { if (personRegisterItemProvider != null) personRegisterItemProvider.dispose(); if (maleItemProvider != null) maleItemProvider.dispose(); diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/META-INF/MANIFEST.MF b/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/META-INF/MANIFEST.MF index 8c291b9..90b6aa5 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/META-INF/MANIFEST.MF +++ b/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/META-INF/MANIFEST.MF @@ -16,3 +16,4 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.emf.edit.ui;visibility:=reexport, org.eclipse.ui.ide;visibility:=reexport Bundle-ActivationPolicy: lazy +Automatic-Module-Name: edu.kit.ipd.sdq.metamodels.persons.editor diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/src/edu/kit/ipd/sdq/metamodels/persons/presentation/PersonsActionBarContributor.java b/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/src/edu/kit/ipd/sdq/metamodels/persons/presentation/PersonsActionBarContributor.java index ce133b5..f7aa068 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/src/edu/kit/ipd/sdq/metamodels/persons/presentation/PersonsActionBarContributor.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/src/edu/kit/ipd/sdq/metamodels/persons/presentation/PersonsActionBarContributor.java @@ -163,6 +163,7 @@ public PersonsActionBarContributor() { */ @Override public void contributeToToolBar(IToolBarManager toolBarManager) { + super.contributeToToolBar(toolBarManager); toolBarManager.add(new Separator("persons-settings")); toolBarManager.add(new Separator("persons-additions")); } @@ -199,6 +200,7 @@ public void contributeToMenu(IMenuManager menuManager) { // submenuManager.addMenuListener (new IMenuListener() { + @Override public void menuAboutToShow(IMenuManager menuManager) { menuManager.updateAll(true); } @@ -246,6 +248,7 @@ public void setActiveEditor(IEditorPart part) { * * @generated */ + @Override public void selectionChanged(SelectionChangedEvent event) { // Remove any menu items for old selection. // diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/src/edu/kit/ipd/sdq/metamodels/persons/presentation/PersonsEditor.java b/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/src/edu/kit/ipd/sdq/metamodels/persons/presentation/PersonsEditor.java index 6744596..bf558b0 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/src/edu/kit/ipd/sdq/metamodels/persons/presentation/PersonsEditor.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/src/edu/kit/ipd/sdq/metamodels/persons/presentation/PersonsEditor.java @@ -69,6 +69,7 @@ import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Composite; @@ -324,6 +325,7 @@ public class PersonsEditor */ protected IPartListener partListener = new IPartListener() { + @Override public void partActivated(IWorkbenchPart p) { if (p instanceof ContentOutline) { if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { @@ -342,15 +344,19 @@ else if (p == PersonsEditor.this) { handleActivate(); } } + @Override public void partBroughtToTop(IWorkbenchPart p) { // Ignore. } + @Override public void partClosed(IWorkbenchPart p) { // Ignore. } + @Override public void partDeactivated(IWorkbenchPart p) { // Ignore. } + @Override public void partOpened(IWorkbenchPart p) { // Ignore. } @@ -404,6 +410,8 @@ public void partOpened(IWorkbenchPart p) { */ protected EContentAdapter problemIndicationAdapter = new EContentAdapter() { + protected boolean dispatching; + @Override public void notifyChanged(Notification notification) { if (notification.getNotifier() instanceof Resource) { @@ -419,15 +427,7 @@ public void notifyChanged(Notification notification) { else { resourceToDiagnosticMap.remove(resource); } - - if (updateProblemIndication) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - public void run() { - updateProblemIndication(); - } - }); - } + dispatchUpdateProblemIndication(); break; } } @@ -437,6 +437,20 @@ public void run() { } } + protected void dispatchUpdateProblemIndication() { + if (updateProblemIndication && !dispatching) { + dispatching = true; + getSite().getShell().getDisplay().asyncExec + (new Runnable() { + @Override + public void run() { + dispatching = false; + updateProblemIndication(); + } + }); + } + } + @Override protected void setTarget(Resource target) { basicSetTarget(target); @@ -446,14 +460,7 @@ protected void setTarget(Resource target) { protected void unsetTarget(Resource target) { basicUnsetTarget(target); resourceToDiagnosticMap.remove(target); - if (updateProblemIndication) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - public void run() { - updateProblemIndication(); - } - }); - } + dispatchUpdateProblemIndication(); } }; @@ -465,6 +472,7 @@ public void run() { */ protected IResourceChangeListener resourceChangeListener = new IResourceChangeListener() { + @Override public void resourceChanged(IResourceChangeEvent event) { IResourceDelta delta = event.getDelta(); try { @@ -473,6 +481,7 @@ class ResourceDeltaVisitor implements IResourceDeltaVisitor { protected Collection changedResources = new ArrayList(); protected Collection removedResources = new ArrayList(); + @Override public boolean visit(IResourceDelta delta) { if (delta.getResource().getType() == IResource.FILE) { if (delta.getKind() == IResourceDelta.REMOVED || @@ -508,6 +517,7 @@ public Collection getRemovedResources() { if (!visitor.getRemovedResources().isEmpty()) { getSite().getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { removedResources.addAll(visitor.getRemovedResources()); if (!isDirty()) { @@ -520,6 +530,7 @@ public void run() { if (!visitor.getChangedResources().isEmpty()) { getSite().getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { changedResources.addAll(visitor.getChangedResources()); if (getSite().getPage().getActiveEditor() == PersonsEditor.this) { @@ -578,8 +589,9 @@ else if (!changedResources.isEmpty()) { */ protected void handleChangedResources() { if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) { + ResourceSet resourceSet = editingDomain.getResourceSet(); if (isDirty()) { - changedResources.addAll(editingDomain.getResourceSet().getResources()); + changedResources.addAll(resourceSet.getResources()); } editingDomain.getCommandStack().flush(); @@ -588,7 +600,7 @@ protected void handleChangedResources() { if (resource.isLoaded()) { resource.unload(); try { - resource.load(Collections.EMPTY_MAP); + resource.load(resourceSet.getLoadOptions()); } catch (IOException exception) { if (!resourceToDiagnosticMap.containsKey(resource)) { @@ -651,14 +663,11 @@ else if (diagnostic.getSeverity() != Diagnostic.OK) { } if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { - markerHelper.deleteMarkers(editingDomain.getResourceSet()); - if (diagnostic.getSeverity() != Diagnostic.OK) { - try { - markerHelper.createMarkers(diagnostic); - } - catch (CoreException exception) { - PersonsEditorPlugin.INSTANCE.log(exception); - } + try { + markerHelper.updateMarkers(diagnostic); + } + catch (CoreException exception) { + PersonsEditorPlugin.INSTANCE.log(exception); } } } @@ -712,9 +721,11 @@ protected void initializeEditingDomain() { // commandStack.addCommandStackListener (new CommandStackListener() { + @Override public void commandStackChanged(final EventObject event) { getContainer().getDisplay().asyncExec (new Runnable() { + @Override public void run() { firePropertyChange(IEditorPart.PROP_DIRTY); @@ -726,7 +737,7 @@ public void run() { } for (Iterator i = propertySheetPages.iterator(); i.hasNext(); ) { PropertySheetPage propertySheetPage = i.next(); - if (propertySheetPage.getControl().isDisposed()) { + if (propertySheetPage.getControl() == null || propertySheetPage.getControl().isDisposed()) { i.remove(); } else { @@ -767,6 +778,7 @@ public void setSelectionToViewer(Collection collection) { if (theSelection != null && !theSelection.isEmpty()) { Runnable runnable = new Runnable() { + @Override public void run() { // Try to select the items in the current content viewer of the editor. // @@ -787,6 +799,7 @@ public void run() { * * @generated */ + @Override public EditingDomain getEditingDomain() { return editingDomain; } @@ -883,6 +896,7 @@ public void setCurrentViewer(Viewer viewer) { new ISelectionChangedListener() { // This just notifies those things that are affected by the section. // + @Override public void selectionChanged(SelectionChangedEvent selectionChangedEvent) { setSelection(selectionChangedEvent.getSelection()); } @@ -917,6 +931,7 @@ public void selectionChanged(SelectionChangedEvent selectionChangedEvent) { * * @generated */ + @Override public Viewer getViewer() { return currentViewer; } @@ -1039,6 +1054,7 @@ public void requestActivation() { selectionViewer = (TreeViewer)viewerPane.getViewer(); selectionViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); + selectionViewer.setUseHashlookup(true); selectionViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); selectionViewer.setInput(editingDomain.getResourceSet()); @@ -1221,8 +1237,11 @@ public void requestActivation() { getSite().getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { - setActivePage(0); + if (!getContainer().isDisposed()) { + setActivePage(0); + } } }); } @@ -1245,6 +1264,7 @@ public void controlResized(ControlEvent event) { getSite().getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { updateProblemIndication(); } @@ -1262,9 +1282,9 @@ protected void hideTabs() { if (getPageCount() <= 1) { setPageText(0, ""); if (getContainer() instanceof CTabFolder) { - ((CTabFolder)getContainer()).setTabHeight(1); Point point = getContainer().getSize(); - getContainer().setSize(point.x, point.y + 6); + Rectangle clientArea = getContainer().getClientArea(); + getContainer().setSize(point.x, 2 * point.y - clientArea.height - clientArea.y); } } } @@ -1280,9 +1300,9 @@ protected void showTabs() { if (getPageCount() > 1) { setPageText(0, getString("_UI_SelectionPage_label")); if (getContainer() instanceof CTabFolder) { - ((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT); Point point = getContainer().getSize(); - getContainer().setSize(point.x, point.y - 6); + Rectangle clientArea = getContainer().getClientArea(); + getContainer().setSize(point.x, clientArea.height + clientArea.y); } } } @@ -1308,17 +1328,16 @@ protected void pageChange(int pageIndex) { * * @generated */ - @SuppressWarnings("rawtypes") @Override - public Object getAdapter(Class key) { + public T getAdapter(Class key) { if (key.equals(IContentOutlinePage.class)) { - return showOutlineView() ? getContentOutlinePage() : null; + return showOutlineView() ? key.cast(getContentOutlinePage()) : null; } else if (key.equals(IPropertySheetPage.class)) { - return getPropertySheetPage(); + return key.cast(getPropertySheetPage()); } else if (key.equals(IGotoMarker.class)) { - return this; + return key.cast(this); } else { return super.getAdapter(key); @@ -1344,6 +1363,7 @@ public void createControl(Composite parent) { // Set up the tree viewer. // + contentOutlineViewer.setUseHashlookup(true); contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory)); contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory)); contentOutlineViewer.setInput(editingDomain.getResourceSet()); @@ -1380,6 +1400,7 @@ public void setActionBars(IActionBars actionBars) { (new ISelectionChangedListener() { // This ensures that we handle selections correctly. // + @Override public void selectionChanged(SelectionChangedEvent event) { handleContentOutlineSelection(event.getSelection()); } @@ -1397,7 +1418,7 @@ public void selectionChanged(SelectionChangedEvent event) { */ public IPropertySheetPage getPropertySheetPage() { PropertySheetPage propertySheetPage = - new ExtendedPropertySheetPage(editingDomain) { + new ExtendedPropertySheetPage(editingDomain, ExtendedPropertySheetPage.Decoration.NONE, null, 0, false) { @Override public void setSelectionToViewer(List selection) { PersonsEditor.this.setSelectionToViewer(selection); @@ -1491,7 +1512,9 @@ public void execute(IProgressMonitor monitor) { // Save the resources to the file system. // boolean first = true; - for (Resource resource : editingDomain.getResourceSet().getResources()) { + List resources = editingDomain.getResourceSet().getResources(); + for (int i = 0; i < resources.size(); ++i) { + Resource resource = resources.get(i); if ((first || !resource.getContents().isEmpty() || isPersisted(resource)) && !editingDomain.isReadOnly(resource)) { try { long timeStamp = resource.getTimeStamp(); @@ -1602,6 +1625,7 @@ protected void doSaveAs(URI uri, IEditorInput editorInput) { * * @generated */ + @Override public void gotoMarker(IMarker marker) { List targetObjects = markerHelper.getTargetObjects(editingDomain, marker); if (!targetObjects.isEmpty()) { @@ -1646,6 +1670,7 @@ public void setFocus() { * * @generated */ + @Override public void addSelectionChangedListener(ISelectionChangedListener listener) { selectionChangedListeners.add(listener); } @@ -1656,6 +1681,7 @@ public void addSelectionChangedListener(ISelectionChangedListener listener) { * * @generated */ + @Override public void removeSelectionChangedListener(ISelectionChangedListener listener) { selectionChangedListeners.remove(listener); } @@ -1666,6 +1692,7 @@ public void removeSelectionChangedListener(ISelectionChangedListener listener) { * * @generated */ + @Override public ISelection getSelection() { return editorSelection; } @@ -1677,6 +1704,7 @@ public ISelection getSelection() { * * @generated */ + @Override public void setSelection(ISelection selection) { editorSelection = selection; @@ -1746,6 +1774,7 @@ private static String getString(String key, Object s1) { * * @generated */ + @Override public void menuAboutToShow(IMenuManager menuManager) { ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager); } diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/src/edu/kit/ipd/sdq/metamodels/persons/presentation/PersonsModelWizard.java b/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/src/edu/kit/ipd/sdq/metamodels/persons/presentation/PersonsModelWizard.java index b3174a4..32b2576 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/src/edu/kit/ipd/sdq/metamodels/persons/presentation/PersonsModelWizard.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/src/edu/kit/ipd/sdq/metamodels/persons/presentation/PersonsModelWizard.java @@ -172,6 +172,7 @@ public class PersonsModelWizard extends Wizard implements INewWizard { * * @generated */ + @Override public void init(IWorkbench workbench, IStructuredSelection selection) { this.workbench = workbench; this.selection = selection; @@ -278,6 +279,7 @@ protected void execute(IProgressMonitor progressMonitor) { final ISelection targetSelection = new StructuredSelection(modelFile); getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { ((ISetSelectionTarget)activePart).selectReveal(targetSelection); } @@ -394,9 +396,9 @@ public PersonsModelWizardInitialObjectCreationPage(String pageId) { * * @generated */ + @Override public void createControl(Composite parent) { - Composite composite = new Composite(parent, SWT.NONE); - { + Composite composite = new Composite(parent, SWT.NONE); { GridLayout layout = new GridLayout(); layout.numColumns = 1; layout.verticalSpacing = 12; @@ -469,6 +471,7 @@ public void createControl(Composite parent) { */ protected ModifyListener validator = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { setPageComplete(validatePage()); } diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons/META-INF/MANIFEST.MF b/bundles/edu.kit.ipd.sdq.metamodels.persons/META-INF/MANIFEST.MF index b613011..936318c 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/META-INF/MANIFEST.MF +++ b/bundles/edu.kit.ipd.sdq.metamodels.persons/META-INF/MANIFEST.MF @@ -13,3 +13,4 @@ Export-Package: edu.kit.ipd.sdq.metamodels.persons, Require-Bundle: org.eclipse.core.runtime, org.eclipse.emf.ecore;visibility:=reexport Bundle-ActivationPolicy: lazy +Automatic-Module-Name: edu.kit.ipd.sdq.metamodels.persons diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons/model/persons.genmodel b/bundles/edu.kit.ipd.sdq.metamodels.persons/model/persons.genmodel index 4023217..65752ee 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/model/persons.genmodel +++ b/bundles/edu.kit.ipd.sdq.metamodels.persons/model/persons.genmodel @@ -7,13 +7,15 @@ persons.ecore + + + + + - - - diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/PersonImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/PersonImpl.java index e20ad29..31533c1 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/PersonImpl.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/PersonImpl.java @@ -92,6 +92,7 @@ protected EClass eStaticClass() { * * @generated */ + @Override public String getFullName() { return fullName; } @@ -101,6 +102,7 @@ public String getFullName() { * * @generated */ + @Override public void setFullName(String newFullName) { String oldFullName = fullName; fullName = newFullName; @@ -113,6 +115,7 @@ public void setFullName(String newFullName) { * * @generated */ + @Override public Date getBirthday() { return birthday; } @@ -122,6 +125,7 @@ public Date getBirthday() { * * @generated */ + @Override public void setBirthday(Date newBirthday) { Date oldBirthday = birthday; birthday = newBirthday; @@ -206,7 +210,7 @@ public boolean eIsSet(int featureID) { public String toString() { if (eIsProxy()) return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); + StringBuilder result = new StringBuilder(super.toString()); result.append(" (fullName: "); result.append(fullName); result.append(", birthday: "); diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/PersonRegisterImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/PersonRegisterImpl.java index 722daa3..a1b2fbc 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/PersonRegisterImpl.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/PersonRegisterImpl.java @@ -90,6 +90,7 @@ protected EClass eStaticClass() { * * @generated */ + @Override public EList getPersons() { if (persons == null) { persons = new EObjectContainmentEList(Person.class, this, PersonsPackage.PERSON_REGISTER__PERSONS); @@ -102,6 +103,7 @@ public EList getPersons() { * * @generated */ + @Override public String getId() { return id; } @@ -111,6 +113,7 @@ public String getId() { * * @generated */ + @Override public void setId(String newId) { String oldId = id; id = newId; @@ -211,7 +214,7 @@ public boolean eIsSet(int featureID) { public String toString() { if (eIsProxy()) return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); + StringBuilder result = new StringBuilder(super.toString()); result.append(" (id: "); result.append(id); result.append(')'); diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/PersonsFactoryImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/PersonsFactoryImpl.java index 7e527ce..beba7d5 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/PersonsFactoryImpl.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/PersonsFactoryImpl.java @@ -69,6 +69,7 @@ public EObject create(EClass eClass) { * * @generated */ + @Override public PersonRegister createPersonRegister() { PersonRegisterImpl personRegister = new PersonRegisterImpl(); return personRegister; @@ -79,6 +80,7 @@ public PersonRegister createPersonRegister() { * * @generated */ + @Override public Male createMale() { MaleImpl male = new MaleImpl(); return male; @@ -89,6 +91,7 @@ public Male createMale() { * * @generated */ + @Override public Female createFemale() { FemaleImpl female = new FemaleImpl(); return female; @@ -99,6 +102,7 @@ public Female createFemale() { * * @generated */ + @Override public PersonsPackage getPersonsPackage() { return (PersonsPackage)getEPackage(); } diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/PersonsPackageImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/PersonsPackageImpl.java index 3bd9bb9..d174cc7 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/PersonsPackageImpl.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/PersonsPackageImpl.java @@ -78,7 +78,7 @@ private PersonsPackageImpl() { /** * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. - * + * *

This method is used to initialize {@link PersonsPackage#eINSTANCE} when that field is accessed. * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. * @@ -92,7 +92,8 @@ public static PersonsPackage init() { if (isInited) return (PersonsPackage)EPackage.Registry.INSTANCE.getEPackage(PersonsPackage.eNS_URI); // Obtain or create and register package - PersonsPackageImpl thePersonsPackage = (PersonsPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof PersonsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new PersonsPackageImpl()); + Object registeredPersonsPackage = EPackage.Registry.INSTANCE.get(eNS_URI); + PersonsPackageImpl thePersonsPackage = registeredPersonsPackage instanceof PersonsPackageImpl ? (PersonsPackageImpl)registeredPersonsPackage : new PersonsPackageImpl(); isInited = true; @@ -105,7 +106,6 @@ public static PersonsPackage init() { // Mark meta-data to indicate it can't be changed thePersonsPackage.freeze(); - // Update the registry and return the package EPackage.Registry.INSTANCE.put(PersonsPackage.eNS_URI, thePersonsPackage); return thePersonsPackage; @@ -116,6 +116,7 @@ public static PersonsPackage init() { * * @generated */ + @Override public EClass getPersonRegister() { return personRegisterEClass; } @@ -125,6 +126,7 @@ public EClass getPersonRegister() { * * @generated */ + @Override public EReference getPersonRegister_Persons() { return (EReference)personRegisterEClass.getEStructuralFeatures().get(0); } @@ -134,6 +136,7 @@ public EReference getPersonRegister_Persons() { * * @generated */ + @Override public EAttribute getPersonRegister_Id() { return (EAttribute)personRegisterEClass.getEStructuralFeatures().get(1); } @@ -143,6 +146,7 @@ public EAttribute getPersonRegister_Id() { * * @generated */ + @Override public EClass getPerson() { return personEClass; } @@ -152,6 +156,7 @@ public EClass getPerson() { * * @generated */ + @Override public EAttribute getPerson_FullName() { return (EAttribute)personEClass.getEStructuralFeatures().get(0); } @@ -161,6 +166,7 @@ public EAttribute getPerson_FullName() { * * @generated */ + @Override public EAttribute getPerson_Birthday() { return (EAttribute)personEClass.getEStructuralFeatures().get(1); } @@ -170,6 +176,7 @@ public EAttribute getPerson_Birthday() { * * @generated */ + @Override public EClass getMale() { return maleEClass; } @@ -179,6 +186,7 @@ public EClass getMale() { * * @generated */ + @Override public EClass getFemale() { return femaleEClass; } @@ -188,6 +196,7 @@ public EClass getFemale() { * * @generated */ + @Override public PersonsFactory getPersonsFactory() { return (PersonsFactory)getEFactoryInstance(); } diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/META-INF/MANIFEST.MF b/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/META-INF/MANIFEST.MF index 6c51b91..0701623 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/META-INF/MANIFEST.MF +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/META-INF/MANIFEST.MF @@ -13,3 +13,4 @@ Require-Bundle: org.eclipse.core.runtime, edu.kit.ipd.sdq.metamodels.recipients;visibility:=reexport, org.eclipse.emf.edit;visibility:=reexport Bundle-ActivationPolicy: lazy +Automatic-Module-Name: edu.kit.ipd.sdq.metamodels.recipients.edit diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/RecipientsItemProviderAdapterFactory.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/RecipientsItemProviderAdapterFactory.java index d88abee..74f569b 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/RecipientsItemProviderAdapterFactory.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/RecipientsItemProviderAdapterFactory.java @@ -169,6 +169,7 @@ public Adapter createRecipientsAdapter() { * * @generated */ + @Override public ComposeableAdapterFactory getRootAdapterFactory() { return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); } @@ -179,6 +180,7 @@ public ComposeableAdapterFactory getRootAdapterFactory() { * * @generated */ + @Override public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) { this.parentAdapterFactory = parentAdapterFactory; } @@ -227,6 +229,7 @@ public Object adapt(Object object, Object type) { * * @generated */ + @Override public void addListener(INotifyChangedListener notifyChangedListener) { changeNotifier.addListener(notifyChangedListener); } @@ -237,6 +240,7 @@ public void addListener(INotifyChangedListener notifyChangedListener) { * * @generated */ + @Override public void removeListener(INotifyChangedListener notifyChangedListener) { changeNotifier.removeListener(notifyChangedListener); } @@ -247,6 +251,7 @@ public void removeListener(INotifyChangedListener notifyChangedListener) { * * @generated */ + @Override public void fireNotifyChanged(Notification notification) { changeNotifier.fireNotifyChanged(notification); @@ -261,6 +266,7 @@ public void fireNotifyChanged(Notification notification) { * * @generated */ + @Override public void dispose() { if (recipientsItemProvider != null) recipientsItemProvider.dispose(); if (recipientItemProvider != null) recipientItemProvider.dispose(); diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/META-INF/MANIFEST.MF b/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/META-INF/MANIFEST.MF index 940a764..7151dc6 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/META-INF/MANIFEST.MF +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/META-INF/MANIFEST.MF @@ -16,3 +16,4 @@ Require-Bundle: org.eclipse.core.runtime, org.eclipse.emf.edit.ui;visibility:=reexport, org.eclipse.ui.ide;visibility:=reexport Bundle-ActivationPolicy: lazy +Automatic-Module-Name: edu.kit.ipd.sdq.metamodels.recipients.editor diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/src/edu/kit/ipd/sdq/metamodels/recipients/presentation/RecipientsActionBarContributor.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/src/edu/kit/ipd/sdq/metamodels/recipients/presentation/RecipientsActionBarContributor.java index 9a584b7..c0093b4 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/src/edu/kit/ipd/sdq/metamodels/recipients/presentation/RecipientsActionBarContributor.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/src/edu/kit/ipd/sdq/metamodels/recipients/presentation/RecipientsActionBarContributor.java @@ -163,6 +163,7 @@ public RecipientsActionBarContributor() { */ @Override public void contributeToToolBar(IToolBarManager toolBarManager) { + super.contributeToToolBar(toolBarManager); toolBarManager.add(new Separator("recipients-settings")); toolBarManager.add(new Separator("recipients-additions")); } @@ -199,6 +200,7 @@ public void contributeToMenu(IMenuManager menuManager) { // submenuManager.addMenuListener (new IMenuListener() { + @Override public void menuAboutToShow(IMenuManager menuManager) { menuManager.updateAll(true); } @@ -246,6 +248,7 @@ public void setActiveEditor(IEditorPart part) { * * @generated */ + @Override public void selectionChanged(SelectionChangedEvent event) { // Remove any menu items for old selection. // diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/src/edu/kit/ipd/sdq/metamodels/recipients/presentation/RecipientsEditor.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/src/edu/kit/ipd/sdq/metamodels/recipients/presentation/RecipientsEditor.java index 4c68e22..91fba5b 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/src/edu/kit/ipd/sdq/metamodels/recipients/presentation/RecipientsEditor.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/src/edu/kit/ipd/sdq/metamodels/recipients/presentation/RecipientsEditor.java @@ -69,6 +69,7 @@ import org.eclipse.swt.graphics.Point; +import org.eclipse.swt.graphics.Rectangle; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Composite; @@ -324,6 +325,7 @@ public class RecipientsEditor */ protected IPartListener partListener = new IPartListener() { + @Override public void partActivated(IWorkbenchPart p) { if (p instanceof ContentOutline) { if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { @@ -342,15 +344,19 @@ else if (p == RecipientsEditor.this) { handleActivate(); } } + @Override public void partBroughtToTop(IWorkbenchPart p) { // Ignore. } + @Override public void partClosed(IWorkbenchPart p) { // Ignore. } + @Override public void partDeactivated(IWorkbenchPart p) { // Ignore. } + @Override public void partOpened(IWorkbenchPart p) { // Ignore. } @@ -436,6 +442,7 @@ protected void dispatchUpdateProblemIndication() { dispatching = true; getSite().getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { dispatching = false; updateProblemIndication(); @@ -465,6 +472,7 @@ protected void unsetTarget(Resource target) { */ protected IResourceChangeListener resourceChangeListener = new IResourceChangeListener() { + @Override public void resourceChanged(IResourceChangeEvent event) { IResourceDelta delta = event.getDelta(); try { @@ -473,6 +481,7 @@ class ResourceDeltaVisitor implements IResourceDeltaVisitor { protected Collection changedResources = new ArrayList(); protected Collection removedResources = new ArrayList(); + @Override public boolean visit(IResourceDelta delta) { if (delta.getResource().getType() == IResource.FILE) { if (delta.getKind() == IResourceDelta.REMOVED || @@ -508,6 +517,7 @@ public Collection getRemovedResources() { if (!visitor.getRemovedResources().isEmpty()) { getSite().getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { removedResources.addAll(visitor.getRemovedResources()); if (!isDirty()) { @@ -520,6 +530,7 @@ public void run() { if (!visitor.getChangedResources().isEmpty()) { getSite().getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { changedResources.addAll(visitor.getChangedResources()); if (getSite().getPage().getActiveEditor() == RecipientsEditor.this) { @@ -578,8 +589,9 @@ else if (!changedResources.isEmpty()) { */ protected void handleChangedResources() { if (!changedResources.isEmpty() && (!isDirty() || handleDirtyConflict())) { + ResourceSet resourceSet = editingDomain.getResourceSet(); if (isDirty()) { - changedResources.addAll(editingDomain.getResourceSet().getResources()); + changedResources.addAll(resourceSet.getResources()); } editingDomain.getCommandStack().flush(); @@ -588,7 +600,7 @@ protected void handleChangedResources() { if (resource.isLoaded()) { resource.unload(); try { - resource.load(Collections.EMPTY_MAP); + resource.load(resourceSet.getLoadOptions()); } catch (IOException exception) { if (!resourceToDiagnosticMap.containsKey(resource)) { @@ -709,9 +721,11 @@ protected void initializeEditingDomain() { // commandStack.addCommandStackListener (new CommandStackListener() { + @Override public void commandStackChanged(final EventObject event) { getContainer().getDisplay().asyncExec (new Runnable() { + @Override public void run() { firePropertyChange(IEditorPart.PROP_DIRTY); @@ -723,7 +737,7 @@ public void run() { } for (Iterator i = propertySheetPages.iterator(); i.hasNext(); ) { PropertySheetPage propertySheetPage = i.next(); - if (propertySheetPage.getControl().isDisposed()) { + if (propertySheetPage.getControl() == null || propertySheetPage.getControl().isDisposed()) { i.remove(); } else { @@ -764,6 +778,7 @@ public void setSelectionToViewer(Collection collection) { if (theSelection != null && !theSelection.isEmpty()) { Runnable runnable = new Runnable() { + @Override public void run() { // Try to select the items in the current content viewer of the editor. // @@ -784,6 +799,7 @@ public void run() { * * @generated */ + @Override public EditingDomain getEditingDomain() { return editingDomain; } @@ -880,6 +896,7 @@ public void setCurrentViewer(Viewer viewer) { new ISelectionChangedListener() { // This just notifies those things that are affected by the section. // + @Override public void selectionChanged(SelectionChangedEvent selectionChangedEvent) { setSelection(selectionChangedEvent.getSelection()); } @@ -914,6 +931,7 @@ public void selectionChanged(SelectionChangedEvent selectionChangedEvent) { * * @generated */ + @Override public Viewer getViewer() { return currentViewer; } @@ -1219,8 +1237,11 @@ public void requestActivation() { getSite().getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { - setActivePage(0); + if (!getContainer().isDisposed()) { + setActivePage(0); + } } }); } @@ -1243,6 +1264,7 @@ public void controlResized(ControlEvent event) { getSite().getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { updateProblemIndication(); } @@ -1260,9 +1282,9 @@ protected void hideTabs() { if (getPageCount() <= 1) { setPageText(0, ""); if (getContainer() instanceof CTabFolder) { - ((CTabFolder)getContainer()).setTabHeight(1); Point point = getContainer().getSize(); - getContainer().setSize(point.x, point.y + 6); + Rectangle clientArea = getContainer().getClientArea(); + getContainer().setSize(point.x, 2 * point.y - clientArea.height - clientArea.y); } } } @@ -1278,9 +1300,9 @@ protected void showTabs() { if (getPageCount() > 1) { setPageText(0, getString("_UI_SelectionPage_label")); if (getContainer() instanceof CTabFolder) { - ((CTabFolder)getContainer()).setTabHeight(SWT.DEFAULT); Point point = getContainer().getSize(); - getContainer().setSize(point.x, point.y - 6); + Rectangle clientArea = getContainer().getClientArea(); + getContainer().setSize(point.x, clientArea.height + clientArea.y); } } } @@ -1306,17 +1328,16 @@ protected void pageChange(int pageIndex) { * * @generated */ - @SuppressWarnings("rawtypes") @Override - public Object getAdapter(Class key) { + public T getAdapter(Class key) { if (key.equals(IContentOutlinePage.class)) { - return showOutlineView() ? getContentOutlinePage() : null; + return showOutlineView() ? key.cast(getContentOutlinePage()) : null; } else if (key.equals(IPropertySheetPage.class)) { - return getPropertySheetPage(); + return key.cast(getPropertySheetPage()); } else if (key.equals(IGotoMarker.class)) { - return this; + return key.cast(this); } else { return super.getAdapter(key); @@ -1379,6 +1400,7 @@ public void setActionBars(IActionBars actionBars) { (new ISelectionChangedListener() { // This ensures that we handle selections correctly. // + @Override public void selectionChanged(SelectionChangedEvent event) { handleContentOutlineSelection(event.getSelection()); } @@ -1396,7 +1418,7 @@ public void selectionChanged(SelectionChangedEvent event) { */ public IPropertySheetPage getPropertySheetPage() { PropertySheetPage propertySheetPage = - new ExtendedPropertySheetPage(editingDomain) { + new ExtendedPropertySheetPage(editingDomain, ExtendedPropertySheetPage.Decoration.NONE, null, 0, false) { @Override public void setSelectionToViewer(List selection) { RecipientsEditor.this.setSelectionToViewer(selection); @@ -1603,6 +1625,7 @@ protected void doSaveAs(URI uri, IEditorInput editorInput) { * * @generated */ + @Override public void gotoMarker(IMarker marker) { List targetObjects = markerHelper.getTargetObjects(editingDomain, marker); if (!targetObjects.isEmpty()) { @@ -1647,6 +1670,7 @@ public void setFocus() { * * @generated */ + @Override public void addSelectionChangedListener(ISelectionChangedListener listener) { selectionChangedListeners.add(listener); } @@ -1657,6 +1681,7 @@ public void addSelectionChangedListener(ISelectionChangedListener listener) { * * @generated */ + @Override public void removeSelectionChangedListener(ISelectionChangedListener listener) { selectionChangedListeners.remove(listener); } @@ -1667,6 +1692,7 @@ public void removeSelectionChangedListener(ISelectionChangedListener listener) { * * @generated */ + @Override public ISelection getSelection() { return editorSelection; } @@ -1678,6 +1704,7 @@ public ISelection getSelection() { * * @generated */ + @Override public void setSelection(ISelection selection) { editorSelection = selection; @@ -1747,6 +1774,7 @@ private static String getString(String key, Object s1) { * * @generated */ + @Override public void menuAboutToShow(IMenuManager menuManager) { ((IMenuListener)getEditorSite().getActionBarContributor()).menuAboutToShow(menuManager); } diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/src/edu/kit/ipd/sdq/metamodels/recipients/presentation/RecipientsModelWizard.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/src/edu/kit/ipd/sdq/metamodels/recipients/presentation/RecipientsModelWizard.java index e7962fb..629fb67 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/src/edu/kit/ipd/sdq/metamodels/recipients/presentation/RecipientsModelWizard.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/src/edu/kit/ipd/sdq/metamodels/recipients/presentation/RecipientsModelWizard.java @@ -172,6 +172,7 @@ public class RecipientsModelWizard extends Wizard implements INewWizard { * * @generated */ + @Override public void init(IWorkbench workbench, IStructuredSelection selection) { this.workbench = workbench; this.selection = selection; @@ -278,6 +279,7 @@ protected void execute(IProgressMonitor progressMonitor) { final ISelection targetSelection = new StructuredSelection(modelFile); getShell().getDisplay().asyncExec (new Runnable() { + @Override public void run() { ((ISetSelectionTarget)activePart).selectReveal(targetSelection); } @@ -394,6 +396,7 @@ public RecipientsModelWizardInitialObjectCreationPage(String pageId) { * * @generated */ + @Override public void createControl(Composite parent) { Composite composite = new Composite(parent, SWT.NONE); { GridLayout layout = new GridLayout(); @@ -468,6 +471,7 @@ public void createControl(Composite parent) { */ protected ModifyListener validator = new ModifyListener() { + @Override public void modifyText(ModifyEvent e) { setPageComplete(validatePage()); } diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients/META-INF/MANIFEST.MF b/bundles/edu.kit.ipd.sdq.metamodels.recipients/META-INF/MANIFEST.MF index c584953..02495a6 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/META-INF/MANIFEST.MF +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients/META-INF/MANIFEST.MF @@ -13,3 +13,4 @@ Export-Package: edu.kit.ipd.sdq.metamodels.recipients, Require-Bundle: org.eclipse.core.runtime, org.eclipse.emf.ecore;visibility:=reexport Bundle-ActivationPolicy: lazy +Automatic-Module-Name: edu.kit.ipd.sdq.metamodels.recipients diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients/model/recipients.genmodel b/bundles/edu.kit.ipd.sdq.metamodels.recipients/model/recipients.genmodel index 7171383..e895f5e 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/model/recipients.genmodel +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients/model/recipients.genmodel @@ -14,15 +14,18 @@ + + + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/CityImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/CityImpl.java index c12e4a9..7b6474b 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/CityImpl.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/CityImpl.java @@ -74,6 +74,7 @@ protected EClass eStaticClass() { * * @generated */ + @Override public Recipient getParent() { if (eContainerFeatureID() != RecipientsPackage.CITY__PARENT) return null; return (Recipient)eInternalContainer(); @@ -94,6 +95,7 @@ public NotificationChain basicSetParent(Recipient newParent, NotificationChain m * * @generated */ + @Override public void setParent(Recipient newParent) { if (newParent != eInternalContainer() || (eContainerFeatureID() != RecipientsPackage.CITY__PARENT && newParent != null)) { if (EcoreUtil.isAncestor(this, newParent)) @@ -115,6 +117,7 @@ else if (eNotificationRequired()) * * @generated */ + @Override public String getZipCode() { return zipCode; } @@ -124,6 +127,7 @@ public String getZipCode() { * * @generated */ + @Override public void setZipCode(String newZipCode) { String oldZipCode = zipCode; zipCode = newZipCode; @@ -252,7 +256,7 @@ public boolean eIsSet(int featureID) { public String toString() { if (eIsProxy()) return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); + StringBuilder result = new StringBuilder(super.toString()); result.append(" (zipCode: "); result.append(zipCode); result.append(')'); diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/IdentifiedElementImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/IdentifiedElementImpl.java index ac73914..102d7d6 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/IdentifiedElementImpl.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/IdentifiedElementImpl.java @@ -72,6 +72,7 @@ protected EClass eStaticClass() { * * @generated */ + @Override public String getId() { return id; } @@ -81,6 +82,7 @@ public String getId() { * * @generated */ + @Override public void setId(String newId) { String oldId = id; id = newId; @@ -155,7 +157,7 @@ public boolean eIsSet(int featureID) { public String toString() { if (eIsProxy()) return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); + StringBuilder result = new StringBuilder(super.toString()); result.append(" (id: "); result.append(id); result.append(')'); diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/LocationImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/LocationImpl.java index 07b4e53..4f86b29 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/LocationImpl.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/LocationImpl.java @@ -95,6 +95,7 @@ protected EClass eStaticClass() { * * @generated */ + @Override public Recipient getParent() { if (eContainerFeatureID() != RecipientsPackage.LOCATION__PARENT) return null; return (Recipient)eInternalContainer(); @@ -115,6 +116,7 @@ public NotificationChain basicSetParent(Recipient newParent, NotificationChain m * * @generated */ + @Override public void setParent(Recipient newParent) { if (newParent != eInternalContainer() || (eContainerFeatureID() != RecipientsPackage.LOCATION__PARENT && newParent != null)) { if (EcoreUtil.isAncestor(this, newParent)) @@ -136,6 +138,7 @@ else if (eNotificationRequired()) * * @generated */ + @Override public int getNumber() { return number; } @@ -145,6 +148,7 @@ public int getNumber() { * * @generated */ + @Override public void setNumber(int newNumber) { int oldNumber = number; number = newNumber; @@ -157,6 +161,7 @@ public void setNumber(int newNumber) { * * @generated */ + @Override public String getStreet() { return street; } @@ -166,6 +171,7 @@ public String getStreet() { * * @generated */ + @Override public void setStreet(String newStreet) { String oldStreet = street; street = newStreet; @@ -304,7 +310,7 @@ public boolean eIsSet(int featureID) { public String toString() { if (eIsProxy()) return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); + StringBuilder result = new StringBuilder(super.toString()); result.append(" (number: "); result.append(number); result.append(", street: "); diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/RecipientImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/RecipientImpl.java index 87fa11c..a3bbe06 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/RecipientImpl.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/RecipientImpl.java @@ -98,6 +98,7 @@ protected EClass eStaticClass() { * * @generated */ + @Override public Recipients getParent() { if (eContainerFeatureID() != RecipientsPackage.RECIPIENT__PARENT) return null; return (Recipients)eInternalContainer(); @@ -118,6 +119,7 @@ public NotificationChain basicSetParent(Recipients newParent, NotificationChain * * @generated */ + @Override public void setParent(Recipients newParent) { if (newParent != eInternalContainer() || (eContainerFeatureID() != RecipientsPackage.RECIPIENT__PARENT && newParent != null)) { if (EcoreUtil.isAncestor(this, newParent)) @@ -139,6 +141,7 @@ else if (eNotificationRequired()) * * @generated */ + @Override public boolean isBusiness() { return business; } @@ -148,6 +151,7 @@ public boolean isBusiness() { * * @generated */ + @Override public void setBusiness(boolean newBusiness) { boolean oldBusiness = business; business = newBusiness; @@ -160,6 +164,7 @@ public void setBusiness(boolean newBusiness) { * * @generated */ + @Override public Location getLocatedAt() { return locatedAt; } @@ -184,6 +189,7 @@ public NotificationChain basicSetLocatedAt(Location newLocatedAt, NotificationCh * * @generated */ + @Override public void setLocatedAt(Location newLocatedAt) { if (newLocatedAt != locatedAt) { NotificationChain msgs = null; @@ -203,6 +209,7 @@ else if (eNotificationRequired()) * * @generated */ + @Override public City getLocatedIn() { return locatedIn; } @@ -227,6 +234,7 @@ public NotificationChain basicSetLocatedIn(City newLocatedIn, NotificationChain * * @generated */ + @Override public void setLocatedIn(City newLocatedIn) { if (newLocatedIn != locatedIn) { NotificationChain msgs = null; @@ -394,7 +402,7 @@ public boolean eIsSet(int featureID) { public String toString() { if (eIsProxy()) return super.toString(); - StringBuffer result = new StringBuffer(super.toString()); + StringBuilder result = new StringBuilder(super.toString()); result.append(" (business: "); result.append(business); result.append(')'); diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/RecipientsFactoryImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/RecipientsFactoryImpl.java index 0cfc6c7..97e8b3c 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/RecipientsFactoryImpl.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/RecipientsFactoryImpl.java @@ -70,6 +70,7 @@ public EObject create(EClass eClass) { * * @generated */ + @Override public Recipient createRecipient() { RecipientImpl recipient = new RecipientImpl(); return recipient; @@ -80,6 +81,7 @@ public Recipient createRecipient() { * * @generated */ + @Override public Location createLocation() { LocationImpl location = new LocationImpl(); return location; @@ -90,6 +92,7 @@ public Location createLocation() { * * @generated */ + @Override public City createCity() { CityImpl city = new CityImpl(); return city; @@ -100,6 +103,7 @@ public City createCity() { * * @generated */ + @Override public Recipients createRecipients() { RecipientsImpl recipients = new RecipientsImpl(); return recipients; @@ -110,6 +114,7 @@ public Recipients createRecipients() { * * @generated */ + @Override public RecipientsPackage getRecipientsPackage() { return (RecipientsPackage)getEPackage(); } diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/RecipientsImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/RecipientsImpl.java index fc9acec..d5b11c8 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/RecipientsImpl.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/RecipientsImpl.java @@ -65,6 +65,7 @@ protected EClass eStaticClass() { * * @generated */ + @Override public EList getRecipients() { if (recipients == null) { recipients = new EObjectContainmentWithInverseEList(Recipient.class, this, RecipientsPackage.RECIPIENTS__RECIPIENTS, RecipientsPackage.RECIPIENT__PARENT); diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/RecipientsPackageImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/RecipientsPackageImpl.java index 8670d05..46891f6 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/RecipientsPackageImpl.java +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/RecipientsPackageImpl.java @@ -87,7 +87,7 @@ private RecipientsPackageImpl() { /** * Creates, registers, and initializes the Package for this model, and for any others upon which it depends. - * + * *

This method is used to initialize {@link RecipientsPackage#eINSTANCE} when that field is accessed. * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. * @@ -101,7 +101,8 @@ public static RecipientsPackage init() { if (isInited) return (RecipientsPackage)EPackage.Registry.INSTANCE.getEPackage(RecipientsPackage.eNS_URI); // Obtain or create and register package - RecipientsPackageImpl theRecipientsPackage = (RecipientsPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof RecipientsPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new RecipientsPackageImpl()); + Object registeredRecipientsPackage = EPackage.Registry.INSTANCE.get(eNS_URI); + RecipientsPackageImpl theRecipientsPackage = registeredRecipientsPackage instanceof RecipientsPackageImpl ? (RecipientsPackageImpl)registeredRecipientsPackage : new RecipientsPackageImpl(); isInited = true; @@ -114,7 +115,6 @@ public static RecipientsPackage init() { // Mark meta-data to indicate it can't be changed theRecipientsPackage.freeze(); - // Update the registry and return the package EPackage.Registry.INSTANCE.put(RecipientsPackage.eNS_URI, theRecipientsPackage); return theRecipientsPackage; @@ -125,6 +125,7 @@ public static RecipientsPackage init() { * * @generated */ + @Override public EClass getIdentifiedElement() { return identifiedElementEClass; } @@ -134,6 +135,7 @@ public EClass getIdentifiedElement() { * * @generated */ + @Override public EAttribute getIdentifiedElement_Id() { return (EAttribute)identifiedElementEClass.getEStructuralFeatures().get(0); } @@ -143,6 +145,7 @@ public EAttribute getIdentifiedElement_Id() { * * @generated */ + @Override public EClass getRecipient() { return recipientEClass; } @@ -152,6 +155,7 @@ public EClass getRecipient() { * * @generated */ + @Override public EReference getRecipient_Parent() { return (EReference)recipientEClass.getEStructuralFeatures().get(0); } @@ -161,6 +165,7 @@ public EReference getRecipient_Parent() { * * @generated */ + @Override public EAttribute getRecipient_Business() { return (EAttribute)recipientEClass.getEStructuralFeatures().get(1); } @@ -170,6 +175,7 @@ public EAttribute getRecipient_Business() { * * @generated */ + @Override public EReference getRecipient_LocatedAt() { return (EReference)recipientEClass.getEStructuralFeatures().get(2); } @@ -179,6 +185,7 @@ public EReference getRecipient_LocatedAt() { * * @generated */ + @Override public EReference getRecipient_LocatedIn() { return (EReference)recipientEClass.getEStructuralFeatures().get(3); } @@ -188,6 +195,7 @@ public EReference getRecipient_LocatedIn() { * * @generated */ + @Override public EClass getLocation() { return locationEClass; } @@ -197,6 +205,7 @@ public EClass getLocation() { * * @generated */ + @Override public EReference getLocation_Parent() { return (EReference)locationEClass.getEStructuralFeatures().get(0); } @@ -206,6 +215,7 @@ public EReference getLocation_Parent() { * * @generated */ + @Override public EAttribute getLocation_Number() { return (EAttribute)locationEClass.getEStructuralFeatures().get(1); } @@ -215,6 +225,7 @@ public EAttribute getLocation_Number() { * * @generated */ + @Override public EAttribute getLocation_Street() { return (EAttribute)locationEClass.getEStructuralFeatures().get(2); } @@ -224,6 +235,7 @@ public EAttribute getLocation_Street() { * * @generated */ + @Override public EClass getCity() { return cityEClass; } @@ -233,6 +245,7 @@ public EClass getCity() { * * @generated */ + @Override public EReference getCity_Parent() { return (EReference)cityEClass.getEStructuralFeatures().get(0); } @@ -242,6 +255,7 @@ public EReference getCity_Parent() { * * @generated */ + @Override public EAttribute getCity_ZipCode() { return (EAttribute)cityEClass.getEStructuralFeatures().get(1); } @@ -251,6 +265,7 @@ public EAttribute getCity_ZipCode() { * * @generated */ + @Override public EClass getRecipients() { return recipientsEClass; } @@ -260,6 +275,7 @@ public EClass getRecipients() { * * @generated */ + @Override public EReference getRecipients_Recipients() { return (EReference)recipientsEClass.getEStructuralFeatures().get(0); } @@ -269,6 +285,7 @@ public EReference getRecipients_Recipients() { * * @generated */ + @Override public RecipientsFactory getRecipientsFactory() { return (RecipientsFactory)getEFactoryInstance(); } From 18917d67cd259321ac057c648049bb3f84ad3013 Mon Sep 17 00:00:00 2001 From: Heiko Klare Date: Fri, 20 Mar 2020 18:11:48 +0100 Subject: [PATCH 7/7] Correct faulty feature name for ensurance metmaodel --- .../edu.kit.ipd.sdq.metamodels.ensurance.feature/feature.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/feature.xml b/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/feature.xml index 83b2afe..354d89d 100644 --- a/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/feature.xml +++ b/features/edu.kit.ipd.sdq.metamodels.ensurance.feature/feature.xml @@ -1,6 +1,6 @@