diff --git a/.gitignore b/.gitignore index f00240d..f4b878a 100644 --- a/.gitignore +++ b/.gitignore @@ -7,10 +7,8 @@ tmp/ *.swp *.class -# Xtend -xtend-gen/ -*._trace -*.xtendbin +# EMF +src-gen/ # Maven target/ diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/.classpath b/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/.classpath index 555c5b6..19e7b34 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/.classpath +++ b/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/.classpath @@ -1,6 +1,6 @@ - + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/build.properties b/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/build.properties index 3a5d565..7d1cb86 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/build.properties +++ b/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/build.properties @@ -6,5 +6,5 @@ bin.includes = .,\ plugin.xml,\ plugin.properties jars.compile.order = . -source.. = src/ +source.. = src-gen/ output.. = target/classes/ diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/src/edu/kit/ipd/sdq/metamodels/addresses/provider/AddressItemProvider.java b/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/src/edu/kit/ipd/sdq/metamodels/addresses/provider/AddressItemProvider.java deleted file mode 100644 index 926e4db..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/src/edu/kit/ipd/sdq/metamodels/addresses/provider/AddressItemProvider.java +++ /dev/null @@ -1,180 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.addresses.provider; - - -import edu.kit.ipd.sdq.metamodels.addresses.Address; -import edu.kit.ipd.sdq.metamodels.addresses.AddressesPackage; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; - -/** - * This is the item provider adapter for a {@link edu.kit.ipd.sdq.metamodels.addresses.Address} object. - * - * - * @generated - */ -public class AddressItemProvider - extends IdentifiedElementItemProvider { - /** - * This constructs an instance from a factory and a notifier. - * - * - * @generated - */ - public AddressItemProvider(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); - - addNumberPropertyDescriptor(object); - addStreetPropertyDescriptor(object); - addZipCodePropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Number feature. - * - * - * @generated - */ - protected void addNumberPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_Address_number_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_Address_number_feature", "_UI_Address_type"), - AddressesPackage.Literals.ADDRESS__NUMBER, - true, - false, - false, - ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Street feature. - * - * - * @generated - */ - protected void addStreetPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_Address_street_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_Address_street_feature", "_UI_Address_type"), - AddressesPackage.Literals.ADDRESS__STREET, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Zip Code feature. - * - * - * @generated - */ - protected void addZipCodePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_Address_zipCode_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_Address_zipCode_feature", "_UI_Address_type"), - AddressesPackage.Literals.ADDRESS__ZIP_CODE, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This returns Address.gif. - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/Address")); - } - - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((Address)object).getId(); - return label == null || label.length() == 0 ? - getString("_UI_Address_type") : - getString("_UI_Address_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(Address.class)) { - case AddressesPackage.ADDRESS__NUMBER: - case AddressesPackage.ADDRESS__STREET: - case AddressesPackage.ADDRESS__ZIP_CODE: - 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); - } - -} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/src/edu/kit/ipd/sdq/metamodels/addresses/provider/AddressesEditPlugin.java b/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/src/edu/kit/ipd/sdq/metamodels/addresses/provider/AddressesEditPlugin.java deleted file mode 100644 index 6702d3b..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/src/edu/kit/ipd/sdq/metamodels/addresses/provider/AddressesEditPlugin.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.addresses.provider; - -import org.eclipse.emf.common.EMFPlugin; - -import org.eclipse.emf.common.util.ResourceLocator; - -/** - * This is the central singleton for the Addresses edit plugin. - * - * - * @generated - */ -public final class AddressesEditPlugin extends EMFPlugin { - /** - * Keep track of the singleton. - * - * - * @generated - */ - public static final AddressesEditPlugin INSTANCE = new AddressesEditPlugin(); - - /** - * Keep track of the singleton. - * - * - * @generated - */ - private static Implementation plugin; - - /** - * Create the instance. - * - * - * @generated - */ - public AddressesEditPlugin() { - 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.addresses.edit/src/edu/kit/ipd/sdq/metamodels/addresses/provider/AddressesItemProvider.java b/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/src/edu/kit/ipd/sdq/metamodels/addresses/provider/AddressesItemProvider.java deleted file mode 100644 index ae1eb3c..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/src/edu/kit/ipd/sdq/metamodels/addresses/provider/AddressesItemProvider.java +++ /dev/null @@ -1,144 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.addresses.provider; - - -import edu.kit.ipd.sdq.metamodels.addresses.Addresses; -import edu.kit.ipd.sdq.metamodels.addresses.AddressesFactory; -import edu.kit.ipd.sdq.metamodels.addresses.AddressesPackage; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.ecore.EStructuralFeature; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; - -/** - * This is the item provider adapter for a {@link edu.kit.ipd.sdq.metamodels.addresses.Addresses} object. - * - * - * @generated - */ -public class AddressesItemProvider - extends IdentifiedElementItemProvider { - /** - * This constructs an instance from a factory and a notifier. - * - * - * @generated - */ - public AddressesItemProvider(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(AddressesPackage.Literals.ADDRESSES__ADDRESSES); - } - 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 Addresses.gif. - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/Addresses")); - } - - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((Addresses)object).getId(); - return label == null || label.length() == 0 ? - getString("_UI_Addresses_type") : - getString("_UI_Addresses_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(Addresses.class)) { - case AddressesPackage.ADDRESSES__ADDRESSES: - 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 - (AddressesPackage.Literals.ADDRESSES__ADDRESSES, - AddressesFactory.eINSTANCE.createAddress())); - } - -} 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 deleted file mode 100644 index ef941d6..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/src/edu/kit/ipd/sdq/metamodels/addresses/provider/AddressesItemProviderAdapterFactory.java +++ /dev/null @@ -1,229 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.addresses.provider; - -import edu.kit.ipd.sdq.metamodels.addresses.util.AddressesAdapterFactory; - -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 AddressesItemProviderAdapterFactory extends AddressesAdapterFactory 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 AddressesItemProviderAdapterFactory() { - 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.addresses.Addresses} instances. - * - * - * @generated - */ - protected AddressesItemProvider addressesItemProvider; - - /** - * This creates an adapter for a {@link edu.kit.ipd.sdq.metamodels.addresses.Addresses}. - * - * - * @generated - */ - @Override - public Adapter createAddressesAdapter() { - if (addressesItemProvider == null) { - addressesItemProvider = new AddressesItemProvider(this); - } - - return addressesItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link edu.kit.ipd.sdq.metamodels.addresses.Address} instances. - * - * - * @generated - */ - protected AddressItemProvider addressItemProvider; - - /** - * This creates an adapter for a {@link edu.kit.ipd.sdq.metamodels.addresses.Address}. - * - * - * @generated - */ - @Override - public Adapter createAddressAdapter() { - if (addressItemProvider == null) { - addressItemProvider = new AddressItemProvider(this); - } - - return addressItemProvider; - } - - /** - * This returns the root adapter factory that contains this factory. - * - * - * @generated - */ - @Override - public ComposeableAdapterFactory getRootAdapterFactory() { - return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); - } - - /** - * This sets the composed adapter factory that contains this factory. - * - * - * @generated - */ - @Override - 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 - */ - @Override - public void addListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.addListener(notifyChangedListener); - } - - /** - * This removes a listener. - * - * - * @generated - */ - @Override - public void removeListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.removeListener(notifyChangedListener); - } - - /** - * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. - * - * - * @generated - */ - @Override - 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 - */ - @Override - public void dispose() { - if (addressesItemProvider != null) addressesItemProvider.dispose(); - if (addressItemProvider != null) addressItemProvider.dispose(); - } - -} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/src/edu/kit/ipd/sdq/metamodels/addresses/provider/IdentifiedElementItemProvider.java b/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/src/edu/kit/ipd/sdq/metamodels/addresses/provider/IdentifiedElementItemProvider.java deleted file mode 100644 index 3babbb3..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses.edit/src/edu/kit/ipd/sdq/metamodels/addresses/provider/IdentifiedElementItemProvider.java +++ /dev/null @@ -1,147 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.addresses.provider; - - -import edu.kit.ipd.sdq.metamodels.addresses.AddressesPackage; -import edu.kit.ipd.sdq.metamodels.addresses.IdentifiedElement; - -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.addresses.IdentifiedElement} object. - * - * - * @generated - */ -public class IdentifiedElementItemProvider - extends ItemProviderAdapter - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * @generated - */ - public IdentifiedElementItemProvider(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); - - addIdPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Id feature. - * - * - * @generated - */ - protected void addIdPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_IdentifiedElement_id_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_IdentifiedElement_id_feature", "_UI_IdentifiedElement_type"), - AddressesPackage.Literals.IDENTIFIED_ELEMENT__ID, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((IdentifiedElement)object).getId(); - return label == null || label.length() == 0 ? - getString("_UI_IdentifiedElement_type") : - getString("_UI_IdentifiedElement_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(IdentifiedElement.class)) { - case AddressesPackage.IDENTIFIED_ELEMENT__ID: - 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 AddressesEditPlugin.INSTANCE; - } - -} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/.classpath b/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/.classpath index 555c5b6..19e7b34 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/.classpath +++ b/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/.classpath @@ -1,6 +1,6 @@ - + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/build.properties b/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/build.properties index 3a5d565..7d1cb86 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/build.properties +++ b/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/build.properties @@ -6,5 +6,5 @@ bin.includes = .,\ plugin.xml,\ plugin.properties jars.compile.order = . -source.. = src/ +source.. = src-gen/ output.. = target/classes/ 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 deleted file mode 100644 index a6a3229..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/src/edu/kit/ipd/sdq/metamodels/addresses/presentation/AddressesActionBarContributor.java +++ /dev/null @@ -1,426 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.addresses.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 Addresses model editor. - * - * - * @generated - */ -public class AddressesActionBarContributor - 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(AddressesEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { - @Override - public void run() { - try { - getPage().showView("org.eclipse.ui.views.PropertySheet"); - } - catch (PartInitException exception) { - AddressesEditorPlugin.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(AddressesEditorPlugin.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 AddressesActionBarContributor() { - 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("addresses-settings")); - toolBarManager.add(new Separator("addresses-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(AddressesEditorPlugin.INSTANCE.getString("_UI_AddressesEditor_menu"), "edu.kit.ipd.sdq.metamodels.addressesMenuID"); - 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(AddressesEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - submenuManager.insertBefore("additions", createChildMenuManager); - - // Prepare for CreateSibling item addition or removal. - // - createSiblingMenuManager = new MenuManager(AddressesEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); - submenuManager.insertBefore("additions", createSiblingMenuManager); - - // Force an update because Eclipse hides empty menus now. - // - submenuManager.addMenuListener - (new IMenuListener() { - @Override - 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 - */ - @Override - 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(AddressesEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - populateManager(submenuManager, createChildActions, null); - menuManager.insertBefore("edit", submenuManager); - - submenuManager = new MenuManager(AddressesEditorPlugin.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.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 deleted file mode 100644 index b0690fb..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/src/edu/kit/ipd/sdq/metamodels/addresses/presentation/AddressesEditor.java +++ /dev/null @@ -1,1848 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.addresses.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.addresses.provider.AddressesItemProviderAdapterFactory; - -import org.eclipse.ui.actions.WorkspaceModifyOperation; - - -/** - * This is an example of a Addresses model editor. - * - * - * @generated - */ -public class AddressesEditor - 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() { - @Override - public void partActivated(IWorkbenchPart p) { - if (p instanceof ContentOutline) { - if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { - getActionBarContributor().setActiveEditor(AddressesEditor.this); - - setCurrentViewer(contentOutlineViewer); - } - } - else if (p instanceof PropertySheet) { - if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { - getActionBarContributor().setActiveEditor(AddressesEditor.this); - handleActivate(); - } - } - 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. - } - }; - - /** - * 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() { - @Override - 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() { - @Override - 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(); - - @Override - 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() { - @Override - public void run() { - removedResources.addAll(visitor.getRemovedResources()); - if (!isDirty()) { - getSite().getPage().closeEditor(AddressesEditor.this, false); - } - } - }); - } - - if (!visitor.getChangedResources().isEmpty()) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - changedResources.addAll(visitor.getChangedResources()); - if (getSite().getPage().getActiveEditor() == AddressesEditor.this) { - handleActivate(); - } - } - }); - } - } - catch (CoreException exception) { - AddressesEditorPlugin.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(AddressesEditor.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.addresses.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) { - AddressesEditorPlugin.INSTANCE.log(exception); - } - } - - if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { - try { - markerHelper.updateMarkers(diagnostic); - } - catch (CoreException exception) { - AddressesEditorPlugin.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 AddressesEditor() { - 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 AddressesItemProviderAdapterFactory()); - 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() { - @Override - public void commandStackChanged(final EventObject event) { - getContainer().getDisplay().asyncExec - (new Runnable() { - @Override - 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() { - @Override - 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 - */ - @Override - 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. - // - @Override - 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 - */ - @Override - 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.addresses.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.addresses.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(), AddressesEditor.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(), AddressesEditor.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(), AddressesEditor.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(), AddressesEditor.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(), AddressesEditor.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(), AddressesEditor.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() { - @Override - 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() { - @Override - 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. - // - @Override - 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) { - AddressesEditor.this.setSelectionToViewer(selection); - AddressesEditor.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. - // - AddressesEditorPlugin.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 - */ - @Override - 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 - */ - @Override - public void addSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.add(listener); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. - * - * - * @generated - */ - @Override - public void removeSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.remove(listener); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection. - * - * - * @generated - */ - @Override - 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 - */ - @Override - 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 AddressesEditorPlugin.INSTANCE.getString(key); - } - - /** - * This looks up a string in plugin.properties, making a substitution. - * - * - * @generated - */ - private static String getString(String key, Object s1) { - return AddressesEditorPlugin.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 - */ - @Override - 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.addresses.editor/src/edu/kit/ipd/sdq/metamodels/addresses/presentation/AddressesEditorPlugin.java b/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/src/edu/kit/ipd/sdq/metamodels/addresses/presentation/AddressesEditorPlugin.java deleted file mode 100644 index 771eaa4..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/src/edu/kit/ipd/sdq/metamodels/addresses/presentation/AddressesEditorPlugin.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.addresses.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 Addresses editor plugin. - * - * - * @generated - */ -public final class AddressesEditorPlugin extends EMFPlugin { - /** - * Keep track of the singleton. - * - * - * @generated - */ - public static final AddressesEditorPlugin INSTANCE = new AddressesEditorPlugin(); - - /** - * Keep track of the singleton. - * - * - * @generated - */ - private static Implementation plugin; - - /** - * Create the instance. - * - * - * @generated - */ - public AddressesEditorPlugin() { - 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.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 deleted file mode 100644 index 133aa5d..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses.editor/src/edu/kit/ipd/sdq/metamodels/addresses/presentation/AddressesModelWizard.java +++ /dev/null @@ -1,631 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.addresses.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.addresses.AddressesFactory; -import edu.kit.ipd.sdq.metamodels.addresses.AddressesPackage; -import edu.kit.ipd.sdq.metamodels.addresses.provider.AddressesEditPlugin; - - -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 AddressesModelWizard extends Wizard implements INewWizard { - /** - * The supported extensions for created files. - * - * - * @generated - */ - public static final List FILE_EXTENSIONS = - Collections.unmodifiableList(Arrays.asList(AddressesEditorPlugin.INSTANCE.getString("_UI_AddressesEditorFilenameExtensions").split("\\s*,\\s*"))); - - /** - * A formatted list of supported file extensions, suitable for display. - * - * - * @generated - */ - public static final String FORMATTED_FILE_EXTENSIONS = - AddressesEditorPlugin.INSTANCE.getString("_UI_AddressesEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); - - /** - * This caches an instance of the model package. - * - * - * @generated - */ - protected AddressesPackage addressesPackage = AddressesPackage.eINSTANCE; - - /** - * This caches an instance of the model factory. - * - * - * @generated - */ - protected AddressesFactory addressesFactory = addressesPackage.getAddressesFactory(); - - /** - * This is the file creation page. - * - * - * @generated - */ - protected AddressesModelWizardNewFileCreationPage newFileCreationPage; - - /** - * This is the initial object creation page. - * - * - * @generated - */ - protected AddressesModelWizardInitialObjectCreationPage 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 - */ - @Override - public void init(IWorkbench workbench, IStructuredSelection selection) { - this.workbench = workbench; - this.selection = selection; - setWindowTitle(AddressesEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); - setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(AddressesEditorPlugin.INSTANCE.getImage("full/wizban/NewAddresses"))); - } - - /** - * 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 : addressesPackage.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)addressesPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); - EObject rootObject = addressesFactory.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) { - AddressesEditorPlugin.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() { - @Override - 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(), AddressesEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); - return false; - } - - return true; - } - catch (Exception exception) { - AddressesEditorPlugin.INSTANCE.log(exception); - return false; - } - } - - /** - * This is the one page of the wizard. - * - * - * @generated - */ - public class AddressesModelWizardNewFileCreationPage extends WizardNewFileCreationPage { - /** - * Pass in the selection. - * - * - * @generated - */ - public AddressesModelWizardNewFileCreationPage(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(AddressesEditorPlugin.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 AddressesModelWizardInitialObjectCreationPage extends WizardPage { - /** - * - * - * @generated - */ - protected Combo initialObjectField; - - /** - * @generated - * - * - */ - protected List encodings; - - /** - * - * - * @generated - */ - protected Combo encodingField; - - /** - * Pass in the selection. - * - * - * @generated - */ - public AddressesModelWizardInitialObjectCreationPage(String pageId) { - super(pageId); - } - - /** - * - * - * @generated - */ - @Override - 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(AddressesEditorPlugin.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(AddressesEditorPlugin.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() { - @Override - 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 AddressesEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); - } - catch(MissingResourceException mre) { - AddressesEditorPlugin.INSTANCE.log(mre); - } - return typeName; - } - - /** - * - * - * @generated - */ - protected Collection getEncodings() { - if (encodings == null) { - encodings = new ArrayList(); - for (StringTokenizer stringTokenizer = new StringTokenizer(AddressesEditorPlugin.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 AddressesModelWizardNewFileCreationPage("Whatever", selection); - newFileCreationPage.setTitle(AddressesEditorPlugin.INSTANCE.getString("_UI_AddressesModelWizard_label")); - newFileCreationPage.setDescription(AddressesEditorPlugin.INSTANCE.getString("_UI_AddressesModelWizard_description")); - newFileCreationPage.setFileName(AddressesEditorPlugin.INSTANCE.getString("_UI_AddressesEditorFilenameDefaultBase") + "." + 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 = AddressesEditorPlugin.INSTANCE.getString("_UI_AddressesEditorFilenameDefaultBase"); - 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 AddressesModelWizardInitialObjectCreationPage("Whatever2"); - initialObjectCreationPage.setTitle(AddressesEditorPlugin.INSTANCE.getString("_UI_AddressesModelWizard_label")); - initialObjectCreationPage.setDescription(AddressesEditorPlugin.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.addresses/.classpath b/bundles/edu.kit.ipd.sdq.metamodels.addresses/.classpath index 685a699..5c68515 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses/.classpath +++ b/bundles/edu.kit.ipd.sdq.metamodels.addresses/.classpath @@ -6,6 +6,6 @@ - + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses/build.properties b/bundles/edu.kit.ipd.sdq.metamodels.addresses/build.properties index 7e8f70d..e981b6a 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses/build.properties +++ b/bundles/edu.kit.ipd.sdq.metamodels.addresses/build.properties @@ -6,5 +6,5 @@ bin.includes = .,\ plugin.xml,\ plugin.properties jars.compile.order = . -source.. = src/ +source.. = src-gen/ output.. = target/classes/ diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses/model/addresses.genmodel b/bundles/edu.kit.ipd.sdq.metamodels.addresses/model/addresses.genmodel index d7e0310..1fcc75c 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses/model/addresses.genmodel +++ b/bundles/edu.kit.ipd.sdq.metamodels.addresses/model/addresses.genmodel @@ -1,10 +1,12 @@ + rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" testsDirectory="/edu.kit.ipd.sdq.metamodels.addresses.tests/src-gen" + importerID="org.eclipse.emf.importer.ecore" complianceLevel="8.0" copyrightFields="false" + editPluginID="edu.kit.ipd.sdq.metamodels.addresses.edit" operationReflection="true" + importOrganizing="true"> addresses.ecore diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/Address.java b/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/Address.java deleted file mode 100644 index a6ed46a..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/Address.java +++ /dev/null @@ -1,131 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.addresses; - -/** - * - * A representation of the model object 'Address'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.addresses.Address#getParent Parent}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.addresses.Address#getNumber Number}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.addresses.Address#getStreet Street}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.addresses.Address#getZipCode Zip Code}
  • - *
- * - * @see edu.kit.ipd.sdq.metamodels.addresses.AddressesPackage#getAddress() - * @model - * @generated - */ -public interface Address extends IdentifiedElement { - /** - * Returns the value of the 'Parent' container reference. - * It is bidirectional and its opposite is '{@link edu.kit.ipd.sdq.metamodels.addresses.Addresses#getAddresses Addresses}'. - * - *

- * If the meaning of the 'Parent' container reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Parent' container reference. - * @see #setParent(Addresses) - * @see edu.kit.ipd.sdq.metamodels.addresses.AddressesPackage#getAddress_Parent() - * @see edu.kit.ipd.sdq.metamodels.addresses.Addresses#getAddresses - * @model opposite="addresses" required="true" transient="false" - * @generated - */ - Addresses getParent(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.addresses.Address#getParent Parent}' container reference. - * - * - * @param value the new value of the 'Parent' container reference. - * @see #getParent() - * @generated - */ - void setParent(Addresses value); - - /** - * Returns the value of the 'Number' attribute. - * - *

- * If the meaning of the 'Number' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Number' attribute. - * @see #setNumber(int) - * @see edu.kit.ipd.sdq.metamodels.addresses.AddressesPackage#getAddress_Number() - * @model required="true" - * @generated - */ - int getNumber(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.addresses.Address#getNumber Number}' attribute. - * - * - * @param value the new value of the 'Number' attribute. - * @see #getNumber() - * @generated - */ - void setNumber(int value); - - /** - * Returns the value of the 'Street' attribute. - * - *

- * If the meaning of the 'Street' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Street' attribute. - * @see #setStreet(String) - * @see edu.kit.ipd.sdq.metamodels.addresses.AddressesPackage#getAddress_Street() - * @model required="true" - * @generated - */ - String getStreet(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.addresses.Address#getStreet Street}' attribute. - * - * - * @param value the new value of the 'Street' attribute. - * @see #getStreet() - * @generated - */ - void setStreet(String value); - - /** - * Returns the value of the 'Zip Code' attribute. - * - *

- * If the meaning of the 'Zip Code' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Zip Code' attribute. - * @see #setZipCode(String) - * @see edu.kit.ipd.sdq.metamodels.addresses.AddressesPackage#getAddress_ZipCode() - * @model required="true" - * @generated - */ - String getZipCode(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.addresses.Address#getZipCode Zip Code}' attribute. - * - * - * @param value the new value of the 'Zip Code' attribute. - * @see #getZipCode() - * @generated - */ - void setZipCode(String value); - -} // Address diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/Addresses.java b/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/Addresses.java deleted file mode 100644 index 557a9bb..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/Addresses.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.addresses; - -import org.eclipse.emf.common.util.EList; - -/** - * - * A representation of the model object 'Addresses'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.addresses.Addresses#getAddresses Addresses}
  • - *
- * - * @see edu.kit.ipd.sdq.metamodels.addresses.AddressesPackage#getAddresses() - * @model - * @generated - */ -public interface Addresses extends IdentifiedElement { - /** - * Returns the value of the 'Addresses' containment reference list. - * The list contents are of type {@link edu.kit.ipd.sdq.metamodels.addresses.Address}. - * It is bidirectional and its opposite is '{@link edu.kit.ipd.sdq.metamodels.addresses.Address#getParent Parent}'. - * - *

- * If the meaning of the 'Addresses' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Addresses' containment reference list. - * @see edu.kit.ipd.sdq.metamodels.addresses.AddressesPackage#getAddresses_Addresses() - * @see edu.kit.ipd.sdq.metamodels.addresses.Address#getParent - * @model opposite="parent" containment="true" - * @generated - */ - EList
getAddresses(); - -} // Addresses diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/AddressesFactory.java b/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/AddressesFactory.java deleted file mode 100644 index 3d751b2..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/AddressesFactory.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.addresses; - -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.addresses.AddressesPackage - * @generated - */ -public interface AddressesFactory extends EFactory { - /** - * The singleton instance of the factory. - * - * - * @generated - */ - AddressesFactory eINSTANCE = edu.kit.ipd.sdq.metamodels.addresses.impl.AddressesFactoryImpl.init(); - - /** - * Returns a new object of class 'Addresses'. - * - * - * @return a new object of class 'Addresses'. - * @generated - */ - Addresses createAddresses(); - - /** - * Returns a new object of class 'Address'. - * - * - * @return a new object of class 'Address'. - * @generated - */ - Address createAddress(); - - /** - * Returns the package supported by this factory. - * - * - * @return the package supported by this factory. - * @generated - */ - AddressesPackage getAddressesPackage(); - -} //AddressesFactory diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/AddressesPackage.java b/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/AddressesPackage.java deleted file mode 100644 index 06bc2d4..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/AddressesPackage.java +++ /dev/null @@ -1,415 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.addresses; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -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.addresses.AddressesFactory - * @model kind="package" - * @generated - */ -public interface AddressesPackage extends EPackage { - /** - * The package name. - * - * - * @generated - */ - String eNAME = "addresses"; - - /** - * The package namespace URI. - * - * - * @generated - */ - String eNS_URI = "edu.kit.ipd.sdq.metamodels.addresses"; - - /** - * The package namespace name. - * - * - * @generated - */ - String eNS_PREFIX = "addresses"; - - /** - * The singleton instance of the package. - * - * - * @generated - */ - AddressesPackage eINSTANCE = edu.kit.ipd.sdq.metamodels.addresses.impl.AddressesPackageImpl.init(); - - /** - * The meta object id for the '{@link edu.kit.ipd.sdq.metamodels.addresses.impl.IdentifiedElementImpl Identified Element}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.addresses.impl.IdentifiedElementImpl - * @see edu.kit.ipd.sdq.metamodels.addresses.impl.AddressesPackageImpl#getIdentifiedElement() - * @generated - */ - int IDENTIFIED_ELEMENT = 0; - - /** - * The feature id for the 'Id' attribute. - * - * - * @generated - * @ordered - */ - int IDENTIFIED_ELEMENT__ID = 0; - - /** - * The number of structural features of the 'Identified Element' class. - * - * - * @generated - * @ordered - */ - int IDENTIFIED_ELEMENT_FEATURE_COUNT = 1; - - /** - * The number of operations of the 'Identified Element' class. - * - * - * @generated - * @ordered - */ - int IDENTIFIED_ELEMENT_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link edu.kit.ipd.sdq.metamodels.addresses.impl.AddressesImpl Addresses}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.addresses.impl.AddressesImpl - * @see edu.kit.ipd.sdq.metamodels.addresses.impl.AddressesPackageImpl#getAddresses() - * @generated - */ - int ADDRESSES = 1; - - /** - * The feature id for the 'Id' attribute. - * - * - * @generated - * @ordered - */ - int ADDRESSES__ID = IDENTIFIED_ELEMENT__ID; - - /** - * The feature id for the 'Addresses' containment reference list. - * - * - * @generated - * @ordered - */ - int ADDRESSES__ADDRESSES = IDENTIFIED_ELEMENT_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Addresses' class. - * - * - * @generated - * @ordered - */ - int ADDRESSES_FEATURE_COUNT = IDENTIFIED_ELEMENT_FEATURE_COUNT + 1; - - /** - * The number of operations of the 'Addresses' class. - * - * - * @generated - * @ordered - */ - int ADDRESSES_OPERATION_COUNT = IDENTIFIED_ELEMENT_OPERATION_COUNT + 0; - - /** - * The meta object id for the '{@link edu.kit.ipd.sdq.metamodels.addresses.impl.AddressImpl Address}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.addresses.impl.AddressImpl - * @see edu.kit.ipd.sdq.metamodels.addresses.impl.AddressesPackageImpl#getAddress() - * @generated - */ - int ADDRESS = 2; - - /** - * The feature id for the 'Id' attribute. - * - * - * @generated - * @ordered - */ - int ADDRESS__ID = IDENTIFIED_ELEMENT__ID; - - /** - * The feature id for the 'Parent' container reference. - * - * - * @generated - * @ordered - */ - int ADDRESS__PARENT = IDENTIFIED_ELEMENT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Number' attribute. - * - * - * @generated - * @ordered - */ - int ADDRESS__NUMBER = IDENTIFIED_ELEMENT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Street' attribute. - * - * - * @generated - * @ordered - */ - int ADDRESS__STREET = IDENTIFIED_ELEMENT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Zip Code' attribute. - * - * - * @generated - * @ordered - */ - int ADDRESS__ZIP_CODE = IDENTIFIED_ELEMENT_FEATURE_COUNT + 3; - - /** - * The number of structural features of the 'Address' class. - * - * - * @generated - * @ordered - */ - int ADDRESS_FEATURE_COUNT = IDENTIFIED_ELEMENT_FEATURE_COUNT + 4; - - /** - * The number of operations of the 'Address' class. - * - * - * @generated - * @ordered - */ - int ADDRESS_OPERATION_COUNT = IDENTIFIED_ELEMENT_OPERATION_COUNT + 0; - - - /** - * Returns the meta object for class '{@link edu.kit.ipd.sdq.metamodels.addresses.IdentifiedElement Identified Element}'. - * - * - * @return the meta object for class 'Identified Element'. - * @see edu.kit.ipd.sdq.metamodels.addresses.IdentifiedElement - * @generated - */ - EClass getIdentifiedElement(); - - /** - * Returns the meta object for the attribute '{@link edu.kit.ipd.sdq.metamodels.addresses.IdentifiedElement#getId Id}'. - * - * - * @return the meta object for the attribute 'Id'. - * @see edu.kit.ipd.sdq.metamodels.addresses.IdentifiedElement#getId() - * @see #getIdentifiedElement() - * @generated - */ - EAttribute getIdentifiedElement_Id(); - - /** - * Returns the meta object for class '{@link edu.kit.ipd.sdq.metamodels.addresses.Addresses Addresses}'. - * - * - * @return the meta object for class 'Addresses'. - * @see edu.kit.ipd.sdq.metamodels.addresses.Addresses - * @generated - */ - EClass getAddresses(); - - /** - * Returns the meta object for the containment reference list '{@link edu.kit.ipd.sdq.metamodels.addresses.Addresses#getAddresses Addresses}'. - * - * - * @return the meta object for the containment reference list 'Addresses'. - * @see edu.kit.ipd.sdq.metamodels.addresses.Addresses#getAddresses() - * @see #getAddresses() - * @generated - */ - EReference getAddresses_Addresses(); - - /** - * Returns the meta object for class '{@link edu.kit.ipd.sdq.metamodels.addresses.Address Address}'. - * - * - * @return the meta object for class 'Address'. - * @see edu.kit.ipd.sdq.metamodels.addresses.Address - * @generated - */ - EClass getAddress(); - - /** - * Returns the meta object for the container reference '{@link edu.kit.ipd.sdq.metamodels.addresses.Address#getParent Parent}'. - * - * - * @return the meta object for the container reference 'Parent'. - * @see edu.kit.ipd.sdq.metamodels.addresses.Address#getParent() - * @see #getAddress() - * @generated - */ - EReference getAddress_Parent(); - - /** - * Returns the meta object for the attribute '{@link edu.kit.ipd.sdq.metamodels.addresses.Address#getNumber Number}'. - * - * - * @return the meta object for the attribute 'Number'. - * @see edu.kit.ipd.sdq.metamodels.addresses.Address#getNumber() - * @see #getAddress() - * @generated - */ - EAttribute getAddress_Number(); - - /** - * Returns the meta object for the attribute '{@link edu.kit.ipd.sdq.metamodels.addresses.Address#getStreet Street}'. - * - * - * @return the meta object for the attribute 'Street'. - * @see edu.kit.ipd.sdq.metamodels.addresses.Address#getStreet() - * @see #getAddress() - * @generated - */ - EAttribute getAddress_Street(); - - /** - * Returns the meta object for the attribute '{@link edu.kit.ipd.sdq.metamodels.addresses.Address#getZipCode Zip Code}'. - * - * - * @return the meta object for the attribute 'Zip Code'. - * @see edu.kit.ipd.sdq.metamodels.addresses.Address#getZipCode() - * @see #getAddress() - * @generated - */ - EAttribute getAddress_ZipCode(); - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - AddressesFactory getAddressesFactory(); - - /** - * - * 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.addresses.impl.IdentifiedElementImpl Identified Element}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.addresses.impl.IdentifiedElementImpl - * @see edu.kit.ipd.sdq.metamodels.addresses.impl.AddressesPackageImpl#getIdentifiedElement() - * @generated - */ - EClass IDENTIFIED_ELEMENT = eINSTANCE.getIdentifiedElement(); - - /** - * The meta object literal for the 'Id' attribute feature. - * - * - * @generated - */ - EAttribute IDENTIFIED_ELEMENT__ID = eINSTANCE.getIdentifiedElement_Id(); - - /** - * The meta object literal for the '{@link edu.kit.ipd.sdq.metamodels.addresses.impl.AddressesImpl Addresses}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.addresses.impl.AddressesImpl - * @see edu.kit.ipd.sdq.metamodels.addresses.impl.AddressesPackageImpl#getAddresses() - * @generated - */ - EClass ADDRESSES = eINSTANCE.getAddresses(); - - /** - * The meta object literal for the 'Addresses' containment reference list feature. - * - * - * @generated - */ - EReference ADDRESSES__ADDRESSES = eINSTANCE.getAddresses_Addresses(); - - /** - * The meta object literal for the '{@link edu.kit.ipd.sdq.metamodels.addresses.impl.AddressImpl Address}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.addresses.impl.AddressImpl - * @see edu.kit.ipd.sdq.metamodels.addresses.impl.AddressesPackageImpl#getAddress() - * @generated - */ - EClass ADDRESS = eINSTANCE.getAddress(); - - /** - * The meta object literal for the 'Parent' container reference feature. - * - * - * @generated - */ - EReference ADDRESS__PARENT = eINSTANCE.getAddress_Parent(); - - /** - * The meta object literal for the 'Number' attribute feature. - * - * - * @generated - */ - EAttribute ADDRESS__NUMBER = eINSTANCE.getAddress_Number(); - - /** - * The meta object literal for the 'Street' attribute feature. - * - * - * @generated - */ - EAttribute ADDRESS__STREET = eINSTANCE.getAddress_Street(); - - /** - * The meta object literal for the 'Zip Code' attribute feature. - * - * - * @generated - */ - EAttribute ADDRESS__ZIP_CODE = eINSTANCE.getAddress_ZipCode(); - - } - -} //AddressesPackage diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/IdentifiedElement.java b/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/IdentifiedElement.java deleted file mode 100644 index 742e626..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/IdentifiedElement.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.addresses; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Identified Element'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.addresses.IdentifiedElement#getId Id}
  • - *
- * - * @see edu.kit.ipd.sdq.metamodels.addresses.AddressesPackage#getIdentifiedElement() - * @model abstract="true" - * @generated - */ -public interface IdentifiedElement extends EObject { - /** - * Returns the value of the 'Id' attribute. - * - *

- * If the meaning of the 'Id' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Id' attribute. - * @see #setId(String) - * @see edu.kit.ipd.sdq.metamodels.addresses.AddressesPackage#getIdentifiedElement_Id() - * @model id="true" required="true" - * @generated - */ - String getId(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.addresses.IdentifiedElement#getId Id}' attribute. - * - * - * @param value the new value of the 'Id' attribute. - * @see #getId() - * @generated - */ - void setId(String value); - -} // IdentifiedElement 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 deleted file mode 100644 index b75fe94..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/AddressImpl.java +++ /dev/null @@ -1,378 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.addresses.impl; - -import edu.kit.ipd.sdq.metamodels.addresses.Address; -import edu.kit.ipd.sdq.metamodels.addresses.Addresses; -import edu.kit.ipd.sdq.metamodels.addresses.AddressesPackage; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; - -/** - * - * An implementation of the model object 'Address'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.addresses.impl.AddressImpl#getParent Parent}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.addresses.impl.AddressImpl#getNumber Number}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.addresses.impl.AddressImpl#getStreet Street}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.addresses.impl.AddressImpl#getZipCode Zip Code}
  • - *
- * - * @generated - */ -public class AddressImpl extends IdentifiedElementImpl implements Address { - /** - * The default value of the '{@link #getNumber() Number}' attribute. - * - * - * @see #getNumber() - * @generated - * @ordered - */ - protected static final int NUMBER_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getNumber() Number}' attribute. - * - * - * @see #getNumber() - * @generated - * @ordered - */ - protected int number = NUMBER_EDEFAULT; - - /** - * The default value of the '{@link #getStreet() Street}' attribute. - * - * - * @see #getStreet() - * @generated - * @ordered - */ - protected static final String STREET_EDEFAULT = null; - - /** - * The cached value of the '{@link #getStreet() Street}' attribute. - * - * - * @see #getStreet() - * @generated - * @ordered - */ - protected String street = STREET_EDEFAULT; - - /** - * The default value of the '{@link #getZipCode() Zip Code}' attribute. - * - * - * @see #getZipCode() - * @generated - * @ordered - */ - protected static final String ZIP_CODE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getZipCode() Zip Code}' attribute. - * - * - * @see #getZipCode() - * @generated - * @ordered - */ - protected String zipCode = ZIP_CODE_EDEFAULT; - - /** - * - * - * @generated - */ - protected AddressImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return AddressesPackage.Literals.ADDRESS; - } - - /** - * - * - * @generated - */ - @Override - public Addresses getParent() { - if (eContainerFeatureID() != AddressesPackage.ADDRESS__PARENT) return null; - return (Addresses)eInternalContainer(); - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetParent(Addresses newParent, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject)newParent, AddressesPackage.ADDRESS__PARENT, msgs); - return msgs; - } - - /** - * - * - * @generated - */ - @Override - public void setParent(Addresses newParent) { - if (newParent != eInternalContainer() || (eContainerFeatureID() != AddressesPackage.ADDRESS__PARENT && newParent != null)) { - if (EcoreUtil.isAncestor(this, newParent)) - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - NotificationChain msgs = null; - if (eInternalContainer() != null) - msgs = eBasicRemoveFromContainer(msgs); - if (newParent != null) - msgs = ((InternalEObject)newParent).eInverseAdd(this, AddressesPackage.ADDRESSES__ADDRESSES, Addresses.class, msgs); - msgs = basicSetParent(newParent, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, AddressesPackage.ADDRESS__PARENT, newParent, newParent)); - } - - /** - * - * - * @generated - */ - @Override - public int getNumber() { - return number; - } - - /** - * - * - * @generated - */ - @Override - public void setNumber(int newNumber) { - int oldNumber = number; - number = newNumber; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, AddressesPackage.ADDRESS__NUMBER, oldNumber, number)); - } - - /** - * - * - * @generated - */ - @Override - public String getStreet() { - return street; - } - - /** - * - * - * @generated - */ - @Override - public void setStreet(String newStreet) { - String oldStreet = street; - street = newStreet; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, AddressesPackage.ADDRESS__STREET, oldStreet, street)); - } - - /** - * - * - * @generated - */ - @Override - public String getZipCode() { - return zipCode; - } - - /** - * - * - * @generated - */ - @Override - public void setZipCode(String newZipCode) { - String oldZipCode = zipCode; - zipCode = newZipCode; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, AddressesPackage.ADDRESS__ZIP_CODE, oldZipCode, zipCode)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case AddressesPackage.ADDRESS__PARENT: - if (eInternalContainer() != null) - msgs = eBasicRemoveFromContainer(msgs); - return basicSetParent((Addresses)otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case AddressesPackage.ADDRESS__PARENT: - return basicSetParent(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID()) { - case AddressesPackage.ADDRESS__PARENT: - return eInternalContainer().eInverseRemove(this, AddressesPackage.ADDRESSES__ADDRESSES, Addresses.class, msgs); - } - return super.eBasicRemoveFromContainerFeature(msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case AddressesPackage.ADDRESS__PARENT: - return getParent(); - case AddressesPackage.ADDRESS__NUMBER: - return getNumber(); - case AddressesPackage.ADDRESS__STREET: - return getStreet(); - case AddressesPackage.ADDRESS__ZIP_CODE: - return getZipCode(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case AddressesPackage.ADDRESS__PARENT: - setParent((Addresses)newValue); - return; - case AddressesPackage.ADDRESS__NUMBER: - setNumber((Integer)newValue); - return; - case AddressesPackage.ADDRESS__STREET: - setStreet((String)newValue); - return; - case AddressesPackage.ADDRESS__ZIP_CODE: - setZipCode((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case AddressesPackage.ADDRESS__PARENT: - setParent((Addresses)null); - return; - case AddressesPackage.ADDRESS__NUMBER: - setNumber(NUMBER_EDEFAULT); - return; - case AddressesPackage.ADDRESS__STREET: - setStreet(STREET_EDEFAULT); - return; - case AddressesPackage.ADDRESS__ZIP_CODE: - setZipCode(ZIP_CODE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case AddressesPackage.ADDRESS__PARENT: - return getParent() != null; - case AddressesPackage.ADDRESS__NUMBER: - return number != NUMBER_EDEFAULT; - case AddressesPackage.ADDRESS__STREET: - return STREET_EDEFAULT == null ? street != null : !STREET_EDEFAULT.equals(street); - case AddressesPackage.ADDRESS__ZIP_CODE: - return ZIP_CODE_EDEFAULT == null ? zipCode != null : !ZIP_CODE_EDEFAULT.equals(zipCode); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuilder result = new StringBuilder(super.toString()); - result.append(" (number: "); - result.append(number); - result.append(", street: "); - result.append(street); - result.append(", zipCode: "); - result.append(zipCode); - result.append(')'); - return result.toString(); - } - -} //AddressImpl 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 deleted file mode 100644 index f9fa016..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/AddressesFactoryImpl.java +++ /dev/null @@ -1,109 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.addresses.impl; - -import edu.kit.ipd.sdq.metamodels.addresses.*; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.impl.EFactoryImpl; - -import org.eclipse.emf.ecore.plugin.EcorePlugin; - -/** - * - * An implementation of the model Factory. - * - * @generated - */ -public class AddressesFactoryImpl extends EFactoryImpl implements AddressesFactory { - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static AddressesFactory init() { - try { - AddressesFactory theAddressesFactory = (AddressesFactory)EPackage.Registry.INSTANCE.getEFactory(AddressesPackage.eNS_URI); - if (theAddressesFactory != null) { - return theAddressesFactory; - } - } - catch (Exception exception) { - EcorePlugin.INSTANCE.log(exception); - } - return new AddressesFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public AddressesFactoryImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - public EObject create(EClass eClass) { - switch (eClass.getClassifierID()) { - case AddressesPackage.ADDRESSES: return createAddresses(); - case AddressesPackage.ADDRESS: return createAddress(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - @Override - public Addresses createAddresses() { - AddressesImpl addresses = new AddressesImpl(); - return addresses; - } - - /** - * - * - * @generated - */ - @Override - public Address createAddress() { - AddressImpl address = new AddressImpl(); - return address; - } - - /** - * - * - * @generated - */ - @Override - public AddressesPackage getAddressesPackage() { - return (AddressesPackage)getEPackage(); - } - - /** - * - * - * @deprecated - * @generated - */ - @Deprecated - public static AddressesPackage getPackage() { - return AddressesPackage.eINSTANCE; - } - -} //AddressesFactoryImpl 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 deleted file mode 100644 index cf1e783..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/AddressesImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.addresses.impl; - -import edu.kit.ipd.sdq.metamodels.addresses.Address; -import edu.kit.ipd.sdq.metamodels.addresses.Addresses; -import edu.kit.ipd.sdq.metamodels.addresses.AddressesPackage; - -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.util.EObjectContainmentWithInverseEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * - * An implementation of the model object 'Addresses'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.addresses.impl.AddressesImpl#getAddresses Addresses}
  • - *
- * - * @generated - */ -public class AddressesImpl extends IdentifiedElementImpl implements Addresses { - /** - * The cached value of the '{@link #getAddresses() Addresses}' containment reference list. - * - * - * @see #getAddresses() - * @generated - * @ordered - */ - protected EList
addresses; - - /** - * - * - * @generated - */ - protected AddressesImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return AddressesPackage.Literals.ADDRESSES; - } - - /** - * - * - * @generated - */ - @Override - public EList
getAddresses() { - if (addresses == null) { - addresses = new EObjectContainmentWithInverseEList
(Address.class, this, AddressesPackage.ADDRESSES__ADDRESSES, AddressesPackage.ADDRESS__PARENT); - } - return addresses; - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case AddressesPackage.ADDRESSES__ADDRESSES: - return ((InternalEList)(InternalEList)getAddresses()).basicAdd(otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case AddressesPackage.ADDRESSES__ADDRESSES: - return ((InternalEList)getAddresses()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case AddressesPackage.ADDRESSES__ADDRESSES: - return getAddresses(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case AddressesPackage.ADDRESSES__ADDRESSES: - getAddresses().clear(); - getAddresses().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case AddressesPackage.ADDRESSES__ADDRESSES: - getAddresses().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case AddressesPackage.ADDRESSES__ADDRESSES: - return addresses != null && !addresses.isEmpty(); - } - return super.eIsSet(featureID); - } - -} //AddressesImpl 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 deleted file mode 100644 index 02f596f..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/AddressesPackageImpl.java +++ /dev/null @@ -1,287 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.addresses.impl; - -import edu.kit.ipd.sdq.metamodels.addresses.Address; -import edu.kit.ipd.sdq.metamodels.addresses.Addresses; -import edu.kit.ipd.sdq.metamodels.addresses.AddressesFactory; -import edu.kit.ipd.sdq.metamodels.addresses.AddressesPackage; - -import edu.kit.ipd.sdq.metamodels.addresses.IdentifiedElement; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - -import org.eclipse.emf.ecore.impl.EPackageImpl; - -/** - * - * An implementation of the model Package. - * - * @generated - */ -public class AddressesPackageImpl extends EPackageImpl implements AddressesPackage { - /** - * - * - * @generated - */ - private EClass identifiedElementEClass = null; - - /** - * - * - * @generated - */ - private EClass addressesEClass = null; - - /** - * - * - * @generated - */ - private EClass addressEClass = 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.addresses.AddressesPackage#eNS_URI - * @see #init() - * @generated - */ - private AddressesPackageImpl() { - super(eNS_URI, AddressesFactory.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 AddressesPackage#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 AddressesPackage init() { - if (isInited) return (AddressesPackage)EPackage.Registry.INSTANCE.getEPackage(AddressesPackage.eNS_URI); - - // Obtain or create and register package - Object registeredAddressesPackage = EPackage.Registry.INSTANCE.get(eNS_URI); - AddressesPackageImpl theAddressesPackage = registeredAddressesPackage instanceof AddressesPackageImpl ? (AddressesPackageImpl)registeredAddressesPackage : new AddressesPackageImpl(); - - isInited = true; - - // Create package meta-data objects - theAddressesPackage.createPackageContents(); - - // Initialize created meta-data - theAddressesPackage.initializePackageContents(); - - // 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; - } - - /** - * - * - * @generated - */ - @Override - public EClass getIdentifiedElement() { - return identifiedElementEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getIdentifiedElement_Id() { - return (EAttribute)identifiedElementEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getAddresses() { - return addressesEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getAddresses_Addresses() { - return (EReference)addressesEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getAddress() { - return addressEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getAddress_Parent() { - return (EReference)addressEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getAddress_Number() { - return (EAttribute)addressEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getAddress_Street() { - return (EAttribute)addressEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getAddress_ZipCode() { - return (EAttribute)addressEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - @Override - public AddressesFactory getAddressesFactory() { - return (AddressesFactory)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 - identifiedElementEClass = createEClass(IDENTIFIED_ELEMENT); - createEAttribute(identifiedElementEClass, IDENTIFIED_ELEMENT__ID); - - addressesEClass = createEClass(ADDRESSES); - createEReference(addressesEClass, ADDRESSES__ADDRESSES); - - addressEClass = createEClass(ADDRESS); - createEReference(addressEClass, ADDRESS__PARENT); - createEAttribute(addressEClass, ADDRESS__NUMBER); - createEAttribute(addressEClass, ADDRESS__STREET); - createEAttribute(addressEClass, ADDRESS__ZIP_CODE); - } - - /** - * - * - * @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 - addressesEClass.getESuperTypes().add(this.getIdentifiedElement()); - addressEClass.getESuperTypes().add(this.getIdentifiedElement()); - - // Initialize classes, features, and operations; add parameters - initEClass(identifiedElementEClass, IdentifiedElement.class, "IdentifiedElement", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getIdentifiedElement_Id(), ecorePackage.getEString(), "id", null, 1, 1, IdentifiedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(addressesEClass, Addresses.class, "Addresses", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getAddresses_Addresses(), this.getAddress(), this.getAddress_Parent(), "addresses", null, 0, -1, Addresses.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(addressEClass, Address.class, "Address", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getAddress_Parent(), this.getAddresses(), this.getAddresses_Addresses(), "parent", null, 1, 1, Address.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getAddress_Number(), ecorePackage.getEInt(), "number", null, 1, 1, Address.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getAddress_Street(), ecorePackage.getEString(), "street", null, 1, 1, Address.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getAddress_ZipCode(), ecorePackage.getEString(), "zipCode", null, 1, 1, Address.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - // Create resource - createResource(eNS_URI); - } - -} //AddressesPackageImpl 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 deleted file mode 100644 index 7064c01..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/impl/IdentifiedElementImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.addresses.impl; - -import edu.kit.ipd.sdq.metamodels.addresses.AddressesPackage; -import edu.kit.ipd.sdq.metamodels.addresses.IdentifiedElement; - -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 'Identified Element'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.addresses.impl.IdentifiedElementImpl#getId Id}
  • - *
- * - * @generated - */ -public abstract class IdentifiedElementImpl extends MinimalEObjectImpl.Container implements IdentifiedElement { - /** - * The default value of the '{@link #getId() Id}' attribute. - * - * - * @see #getId() - * @generated - * @ordered - */ - protected static final String ID_EDEFAULT = null; - - /** - * The cached value of the '{@link #getId() Id}' attribute. - * - * - * @see #getId() - * @generated - * @ordered - */ - protected String id = ID_EDEFAULT; - - /** - * - * - * @generated - */ - protected IdentifiedElementImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return AddressesPackage.Literals.IDENTIFIED_ELEMENT; - } - - /** - * - * - * @generated - */ - @Override - public String getId() { - return id; - } - - /** - * - * - * @generated - */ - @Override - public void setId(String newId) { - String oldId = id; - id = newId; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, AddressesPackage.IDENTIFIED_ELEMENT__ID, oldId, id)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case AddressesPackage.IDENTIFIED_ELEMENT__ID: - return getId(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case AddressesPackage.IDENTIFIED_ELEMENT__ID: - setId((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case AddressesPackage.IDENTIFIED_ELEMENT__ID: - setId(ID_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case AddressesPackage.IDENTIFIED_ELEMENT__ID: - return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuilder result = new StringBuilder(super.toString()); - result.append(" (id: "); - result.append(id); - result.append(')'); - return result.toString(); - } - -} //IdentifiedElementImpl diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/util/AddressesAdapterFactory.java b/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/util/AddressesAdapterFactory.java deleted file mode 100644 index 0658add..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/util/AddressesAdapterFactory.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.addresses.util; - -import edu.kit.ipd.sdq.metamodels.addresses.*; - -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.addresses.AddressesPackage - * @generated - */ -public class AddressesAdapterFactory extends AdapterFactoryImpl { - /** - * The cached model package. - * - * - * @generated - */ - protected static AddressesPackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * - * - * @generated - */ - public AddressesAdapterFactory() { - if (modelPackage == null) { - modelPackage = AddressesPackage.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 AddressesSwitch modelSwitch = - new AddressesSwitch() { - @Override - public Adapter caseIdentifiedElement(IdentifiedElement object) { - return createIdentifiedElementAdapter(); - } - @Override - public Adapter caseAddresses(Addresses object) { - return createAddressesAdapter(); - } - @Override - public Adapter caseAddress(Address object) { - return createAddressAdapter(); - } - @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.addresses.IdentifiedElement Identified Element}'. - * - * 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.addresses.IdentifiedElement - * @generated - */ - public Adapter createIdentifiedElementAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link edu.kit.ipd.sdq.metamodels.addresses.Addresses Addresses}'. - * - * 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.addresses.Addresses - * @generated - */ - public Adapter createAddressesAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link edu.kit.ipd.sdq.metamodels.addresses.Address Address}'. - * - * 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.addresses.Address - * @generated - */ - public Adapter createAddressAdapter() { - 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; - } - -} //AddressesAdapterFactory diff --git a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/util/AddressesSwitch.java b/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/util/AddressesSwitch.java deleted file mode 100644 index 2087f77..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.addresses/src/edu/kit/ipd/sdq/metamodels/addresses/util/AddressesSwitch.java +++ /dev/null @@ -1,154 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.addresses.util; - -import edu.kit.ipd.sdq.metamodels.addresses.*; - -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.addresses.AddressesPackage - * @generated - */ -public class AddressesSwitch extends Switch { - /** - * The cached model package - * - * - * @generated - */ - protected static AddressesPackage modelPackage; - - /** - * Creates an instance of the switch. - * - * - * @generated - */ - public AddressesSwitch() { - if (modelPackage == null) { - modelPackage = AddressesPackage.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 AddressesPackage.IDENTIFIED_ELEMENT: { - IdentifiedElement identifiedElement = (IdentifiedElement)theEObject; - T result = caseIdentifiedElement(identifiedElement); - if (result == null) result = defaultCase(theEObject); - return result; - } - case AddressesPackage.ADDRESSES: { - Addresses addresses = (Addresses)theEObject; - T result = caseAddresses(addresses); - if (result == null) result = caseIdentifiedElement(addresses); - if (result == null) result = defaultCase(theEObject); - return result; - } - case AddressesPackage.ADDRESS: { - Address address = (Address)theEObject; - T result = caseAddress(address); - if (result == null) result = caseIdentifiedElement(address); - if (result == null) result = defaultCase(theEObject); - return result; - } - default: return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpreting the object as an instance of 'Identified Element'. - * - * 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 'Identified Element'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIdentifiedElement(IdentifiedElement object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Addresses'. - * - * 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 'Addresses'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseAddresses(Addresses object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Address'. - * - * 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 'Address'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseAddress(Address 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; - } - -} //AddressesSwitch diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families.edit/.classpath b/bundles/edu.kit.ipd.sdq.metamodels.families.edit/.classpath index 555c5b6..19e7b34 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.families.edit/.classpath +++ b/bundles/edu.kit.ipd.sdq.metamodels.families.edit/.classpath @@ -1,6 +1,6 @@ - + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families.edit/build.properties b/bundles/edu.kit.ipd.sdq.metamodels.families.edit/build.properties index 3a5d565..7d1cb86 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.families.edit/build.properties +++ b/bundles/edu.kit.ipd.sdq.metamodels.families.edit/build.properties @@ -6,5 +6,5 @@ bin.includes = .,\ plugin.xml,\ plugin.properties jars.compile.order = . -source.. = src/ +source.. = src-gen/ output.. = target/classes/ diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families.edit/src/edu/kit/ipd/sdq/metamodels/families/provider/FamiliesEditPlugin.java b/bundles/edu.kit.ipd.sdq.metamodels.families.edit/src/edu/kit/ipd/sdq/metamodels/families/provider/FamiliesEditPlugin.java deleted file mode 100644 index a544c20..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.families.edit/src/edu/kit/ipd/sdq/metamodels/families/provider/FamiliesEditPlugin.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.families.provider; - -import org.eclipse.emf.common.EMFPlugin; - -import org.eclipse.emf.common.util.ResourceLocator; - -/** - * This is the central singleton for the Families edit plugin. - * - * - * @generated - */ -public final class FamiliesEditPlugin extends EMFPlugin { - /** - * Keep track of the singleton. - * - * - * @generated - */ - public static final FamiliesEditPlugin INSTANCE = new FamiliesEditPlugin(); - - /** - * Keep track of the singleton. - * - * - * @generated - */ - private static Implementation plugin; - - /** - * Create the instance. - * - * - * @generated - */ - public FamiliesEditPlugin() { - 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.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 deleted file mode 100644 index 72eaff6..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.families.edit/src/edu/kit/ipd/sdq/metamodels/families/provider/FamiliesItemProviderAdapterFactory.java +++ /dev/null @@ -1,253 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.families.provider; - -import edu.kit.ipd.sdq.metamodels.families.util.FamiliesAdapterFactory; - -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 FamiliesItemProviderAdapterFactory extends FamiliesAdapterFactory 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 FamiliesItemProviderAdapterFactory() { - 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.families.FamilyRegister} instances. - * - * - * @generated - */ - protected FamilyRegisterItemProvider familyRegisterItemProvider; - - /** - * This creates an adapter for a {@link edu.kit.ipd.sdq.metamodels.families.FamilyRegister}. - * - * - * @generated - */ - @Override - public Adapter createFamilyRegisterAdapter() { - if (familyRegisterItemProvider == null) { - familyRegisterItemProvider = new FamilyRegisterItemProvider(this); - } - - return familyRegisterItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link edu.kit.ipd.sdq.metamodels.families.Family} instances. - * - * - * @generated - */ - protected FamilyItemProvider familyItemProvider; - - /** - * This creates an adapter for a {@link edu.kit.ipd.sdq.metamodels.families.Family}. - * - * - * @generated - */ - @Override - public Adapter createFamilyAdapter() { - if (familyItemProvider == null) { - familyItemProvider = new FamilyItemProvider(this); - } - - return familyItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link edu.kit.ipd.sdq.metamodels.families.Member} instances. - * - * - * @generated - */ - protected MemberItemProvider memberItemProvider; - - /** - * This creates an adapter for a {@link edu.kit.ipd.sdq.metamodels.families.Member}. - * - * - * @generated - */ - @Override - public Adapter createMemberAdapter() { - if (memberItemProvider == null) { - memberItemProvider = new MemberItemProvider(this); - } - - return memberItemProvider; - } - - /** - * This returns the root adapter factory that contains this factory. - * - * - * @generated - */ - @Override - public ComposeableAdapterFactory getRootAdapterFactory() { - return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); - } - - /** - * This sets the composed adapter factory that contains this factory. - * - * - * @generated - */ - @Override - 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 - */ - @Override - public void addListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.addListener(notifyChangedListener); - } - - /** - * This removes a listener. - * - * - * @generated - */ - @Override - public void removeListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.removeListener(notifyChangedListener); - } - - /** - * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. - * - * - * @generated - */ - @Override - 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 - */ - @Override - public void dispose() { - if (familyRegisterItemProvider != null) familyRegisterItemProvider.dispose(); - if (familyItemProvider != null) familyItemProvider.dispose(); - if (memberItemProvider != null) memberItemProvider.dispose(); - } - -} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families.edit/src/edu/kit/ipd/sdq/metamodels/families/provider/FamilyItemProvider.java b/bundles/edu.kit.ipd.sdq.metamodels.families.edit/src/edu/kit/ipd/sdq/metamodels/families/provider/FamilyItemProvider.java deleted file mode 100644 index 2aa07d4..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.families.edit/src/edu/kit/ipd/sdq/metamodels/families/provider/FamilyItemProvider.java +++ /dev/null @@ -1,245 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.families.provider; - - -import edu.kit.ipd.sdq.metamodels.families.FamiliesFactory; -import edu.kit.ipd.sdq.metamodels.families.FamiliesPackage; -import edu.kit.ipd.sdq.metamodels.families.Family; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.common.util.ResourceLocator; - -import org.eclipse.emf.ecore.EStructuralFeature; - -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.emf.edit.provider.ViewerNotification; - -/** - * This is the item provider adapter for a {@link edu.kit.ipd.sdq.metamodels.families.Family} object. - * - * - * @generated - */ -public class FamilyItemProvider - extends ItemProviderAdapter - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * @generated - */ - public FamilyItemProvider(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); - - addLastNamePropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Last Name feature. - * - * - * @generated - */ - protected void addLastNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_Family_lastName_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_Family_lastName_feature", "_UI_Family_type"), - FamiliesPackage.Literals.FAMILY__LAST_NAME, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an - * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. - * - * - * @generated - */ - @Override - public Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(FamiliesPackage.Literals.FAMILY__SONS); - childrenFeatures.add(FamiliesPackage.Literals.FAMILY__DAUGHTERS); - childrenFeatures.add(FamiliesPackage.Literals.FAMILY__FATHER); - childrenFeatures.add(FamiliesPackage.Literals.FAMILY__MOTHER); - } - 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 Family.gif. - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/Family")); - } - - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((Family)object).getLastName(); - return label == null || label.length() == 0 ? - getString("_UI_Family_type") : - getString("_UI_Family_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(Family.class)) { - case FamiliesPackage.FAMILY__LAST_NAME: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - case FamiliesPackage.FAMILY__SONS: - case FamiliesPackage.FAMILY__DAUGHTERS: - case FamiliesPackage.FAMILY__FATHER: - case FamiliesPackage.FAMILY__MOTHER: - 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 - (FamiliesPackage.Literals.FAMILY__SONS, - FamiliesFactory.eINSTANCE.createMember())); - - newChildDescriptors.add - (createChildParameter - (FamiliesPackage.Literals.FAMILY__DAUGHTERS, - FamiliesFactory.eINSTANCE.createMember())); - - newChildDescriptors.add - (createChildParameter - (FamiliesPackage.Literals.FAMILY__FATHER, - FamiliesFactory.eINSTANCE.createMember())); - - newChildDescriptors.add - (createChildParameter - (FamiliesPackage.Literals.FAMILY__MOTHER, - FamiliesFactory.eINSTANCE.createMember())); - } - - /** - * This returns the label text for {@link org.eclipse.emf.edit.command.CreateChildCommand}. - * - * - * @generated - */ - @Override - public String getCreateChildText(Object owner, Object feature, Object child, Collection selection) { - Object childFeature = feature; - Object childObject = child; - - boolean qualify = - childFeature == FamiliesPackage.Literals.FAMILY__SONS || - childFeature == FamiliesPackage.Literals.FAMILY__DAUGHTERS || - childFeature == FamiliesPackage.Literals.FAMILY__FATHER || - childFeature == FamiliesPackage.Literals.FAMILY__MOTHER; - - if (qualify) { - return getString - ("_UI_CreateChild_text2", - new Object[] { getTypeText(childObject), getFeatureText(childFeature), getTypeText(owner) }); - } - return super.getCreateChildText(owner, feature, child, selection); - } - - /** - * Return the resource locator for this item provider's resources. - * - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return FamiliesEditPlugin.INSTANCE; - } - -} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families.edit/src/edu/kit/ipd/sdq/metamodels/families/provider/FamilyRegisterItemProvider.java b/bundles/edu.kit.ipd.sdq.metamodels.families.edit/src/edu/kit/ipd/sdq/metamodels/families/provider/FamilyRegisterItemProvider.java deleted file mode 100644 index 1374295..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.families.edit/src/edu/kit/ipd/sdq/metamodels/families/provider/FamilyRegisterItemProvider.java +++ /dev/null @@ -1,199 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.families.provider; - - -import edu.kit.ipd.sdq.metamodels.families.FamiliesFactory; -import edu.kit.ipd.sdq.metamodels.families.FamiliesPackage; -import edu.kit.ipd.sdq.metamodels.families.FamilyRegister; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.common.util.ResourceLocator; - -import org.eclipse.emf.ecore.EStructuralFeature; - -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.emf.edit.provider.ViewerNotification; - -/** - * This is the item provider adapter for a {@link edu.kit.ipd.sdq.metamodels.families.FamilyRegister} object. - * - * - * @generated - */ -public class FamilyRegisterItemProvider - extends ItemProviderAdapter - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * @generated - */ - public FamilyRegisterItemProvider(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); - - addIdPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Id feature. - * - * - * @generated - */ - protected void addIdPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_FamilyRegister_id_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_FamilyRegister_id_feature", "_UI_FamilyRegister_type"), - FamiliesPackage.Literals.FAMILY_REGISTER__ID, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an - * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. - * - * - * @generated - */ - @Override - public Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(FamiliesPackage.Literals.FAMILY_REGISTER__FAMILIES); - } - 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 FamilyRegister.gif. - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/FamilyRegister")); - } - - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((FamilyRegister)object).getId(); - return label == null || label.length() == 0 ? - getString("_UI_FamilyRegister_type") : - getString("_UI_FamilyRegister_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(FamilyRegister.class)) { - case FamiliesPackage.FAMILY_REGISTER__ID: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - case FamiliesPackage.FAMILY_REGISTER__FAMILIES: - 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 - (FamiliesPackage.Literals.FAMILY_REGISTER__FAMILIES, - FamiliesFactory.eINSTANCE.createFamily())); - } - - /** - * Return the resource locator for this item provider's resources. - * - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return FamiliesEditPlugin.INSTANCE; - } - -} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families.edit/src/edu/kit/ipd/sdq/metamodels/families/provider/MemberItemProvider.java b/bundles/edu.kit.ipd.sdq.metamodels.families.edit/src/edu/kit/ipd/sdq/metamodels/families/provider/MemberItemProvider.java deleted file mode 100644 index 02e9aa5..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.families.edit/src/edu/kit/ipd/sdq/metamodels/families/provider/MemberItemProvider.java +++ /dev/null @@ -1,158 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.families.provider; - - -import edu.kit.ipd.sdq.metamodels.families.FamiliesPackage; -import edu.kit.ipd.sdq.metamodels.families.Member; - -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.families.Member} object. - * - * - * @generated - */ -public class MemberItemProvider - extends ItemProviderAdapter - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * @generated - */ - public MemberItemProvider(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); - - addFirstNamePropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the First Name feature. - * - * - * @generated - */ - protected void addFirstNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_Member_firstName_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_Member_firstName_feature", "_UI_Member_type"), - FamiliesPackage.Literals.MEMBER__FIRST_NAME, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This returns Member.gif. - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/Member")); - } - - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((Member)object).getFirstName(); - return label == null || label.length() == 0 ? - getString("_UI_Member_type") : - getString("_UI_Member_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(Member.class)) { - case FamiliesPackage.MEMBER__FIRST_NAME: - 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 FamiliesEditPlugin.INSTANCE; - } - -} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families.editor/.classpath b/bundles/edu.kit.ipd.sdq.metamodels.families.editor/.classpath index 555c5b6..19e7b34 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.families.editor/.classpath +++ b/bundles/edu.kit.ipd.sdq.metamodels.families.editor/.classpath @@ -1,6 +1,6 @@ - + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families.editor/build.properties b/bundles/edu.kit.ipd.sdq.metamodels.families.editor/build.properties index 3a5d565..7d1cb86 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.families.editor/build.properties +++ b/bundles/edu.kit.ipd.sdq.metamodels.families.editor/build.properties @@ -6,5 +6,5 @@ bin.includes = .,\ plugin.xml,\ plugin.properties jars.compile.order = . -source.. = src/ +source.. = src-gen/ output.. = target/classes/ 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 deleted file mode 100644 index d493791..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.families.editor/src/edu/kit/ipd/sdq/metamodels/families/presentation/FamiliesActionBarContributor.java +++ /dev/null @@ -1,426 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.families.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 Families model editor. - * - * - * @generated - */ -public class FamiliesActionBarContributor - 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(FamiliesEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { - @Override - public void run() { - try { - getPage().showView("org.eclipse.ui.views.PropertySheet"); - } - catch (PartInitException exception) { - FamiliesEditorPlugin.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(FamiliesEditorPlugin.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 FamiliesActionBarContributor() { - 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("families-settings")); - toolBarManager.add(new Separator("families-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(FamiliesEditorPlugin.INSTANCE.getString("_UI_FamiliesEditor_menu"), "edu.kit.ipd.sdq.metamodels.familiesMenuID"); - 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(FamiliesEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - submenuManager.insertBefore("additions", createChildMenuManager); - - // Prepare for CreateSibling item addition or removal. - // - createSiblingMenuManager = new MenuManager(FamiliesEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); - submenuManager.insertBefore("additions", createSiblingMenuManager); - - // Force an update because Eclipse hides empty menus now. - // - submenuManager.addMenuListener - (new IMenuListener() { - @Override - 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 - */ - @Override - 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(FamiliesEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - populateManager(submenuManager, createChildActions, null); - menuManager.insertBefore("edit", submenuManager); - - submenuManager = new MenuManager(FamiliesEditorPlugin.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.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 deleted file mode 100644 index 6098844..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.families.editor/src/edu/kit/ipd/sdq/metamodels/families/presentation/FamiliesEditor.java +++ /dev/null @@ -1,1848 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.families.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.families.provider.FamiliesItemProviderAdapterFactory; - -import org.eclipse.ui.actions.WorkspaceModifyOperation; - - -/** - * This is an example of a Families model editor. - * - * - * @generated - */ -public class FamiliesEditor - 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() { - @Override - public void partActivated(IWorkbenchPart p) { - if (p instanceof ContentOutline) { - if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { - getActionBarContributor().setActiveEditor(FamiliesEditor.this); - - setCurrentViewer(contentOutlineViewer); - } - } - else if (p instanceof PropertySheet) { - if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { - getActionBarContributor().setActiveEditor(FamiliesEditor.this); - handleActivate(); - } - } - 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. - } - }; - - /** - * 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() { - @Override - 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() { - @Override - 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(); - - @Override - 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() { - @Override - public void run() { - removedResources.addAll(visitor.getRemovedResources()); - if (!isDirty()) { - getSite().getPage().closeEditor(FamiliesEditor.this, false); - } - } - }); - } - - if (!visitor.getChangedResources().isEmpty()) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - changedResources.addAll(visitor.getChangedResources()); - if (getSite().getPage().getActiveEditor() == FamiliesEditor.this) { - handleActivate(); - } - } - }); - } - } - catch (CoreException exception) { - FamiliesEditorPlugin.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(FamiliesEditor.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.families.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) { - FamiliesEditorPlugin.INSTANCE.log(exception); - } - } - - if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { - try { - markerHelper.updateMarkers(diagnostic); - } - catch (CoreException exception) { - FamiliesEditorPlugin.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 FamiliesEditor() { - 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 FamiliesItemProviderAdapterFactory()); - 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() { - @Override - public void commandStackChanged(final EventObject event) { - getContainer().getDisplay().asyncExec - (new Runnable() { - @Override - 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() { - @Override - 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 - */ - @Override - 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. - // - @Override - 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 - */ - @Override - 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.families.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.families.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(), FamiliesEditor.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(), FamiliesEditor.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(), FamiliesEditor.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(), FamiliesEditor.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(), FamiliesEditor.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(), FamiliesEditor.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() { - @Override - 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() { - @Override - 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. - // - @Override - 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) { - FamiliesEditor.this.setSelectionToViewer(selection); - FamiliesEditor.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. - // - FamiliesEditorPlugin.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 - */ - @Override - 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 - */ - @Override - public void addSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.add(listener); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. - * - * - * @generated - */ - @Override - public void removeSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.remove(listener); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection. - * - * - * @generated - */ - @Override - 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 - */ - @Override - 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 FamiliesEditorPlugin.INSTANCE.getString(key); - } - - /** - * This looks up a string in plugin.properties, making a substitution. - * - * - * @generated - */ - private static String getString(String key, Object s1) { - return FamiliesEditorPlugin.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 - */ - @Override - 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.families.editor/src/edu/kit/ipd/sdq/metamodels/families/presentation/FamiliesEditorPlugin.java b/bundles/edu.kit.ipd.sdq.metamodels.families.editor/src/edu/kit/ipd/sdq/metamodels/families/presentation/FamiliesEditorPlugin.java deleted file mode 100644 index 65c40cd..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.families.editor/src/edu/kit/ipd/sdq/metamodels/families/presentation/FamiliesEditorPlugin.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.families.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 Families editor plugin. - * - * - * @generated - */ -public final class FamiliesEditorPlugin extends EMFPlugin { - /** - * Keep track of the singleton. - * - * - * @generated - */ - public static final FamiliesEditorPlugin INSTANCE = new FamiliesEditorPlugin(); - - /** - * Keep track of the singleton. - * - * - * @generated - */ - private static Implementation plugin; - - /** - * Create the instance. - * - * - * @generated - */ - public FamiliesEditorPlugin() { - 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.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 deleted file mode 100644 index 3b6b767..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.families.editor/src/edu/kit/ipd/sdq/metamodels/families/presentation/FamiliesModelWizard.java +++ /dev/null @@ -1,631 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.families.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.families.FamiliesFactory; -import edu.kit.ipd.sdq.metamodels.families.FamiliesPackage; -import edu.kit.ipd.sdq.metamodels.families.provider.FamiliesEditPlugin; - - -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 FamiliesModelWizard extends Wizard implements INewWizard { - /** - * The supported extensions for created files. - * - * - * @generated - */ - public static final List FILE_EXTENSIONS = - Collections.unmodifiableList(Arrays.asList(FamiliesEditorPlugin.INSTANCE.getString("_UI_FamiliesEditorFilenameExtensions").split("\\s*,\\s*"))); - - /** - * A formatted list of supported file extensions, suitable for display. - * - * - * @generated - */ - public static final String FORMATTED_FILE_EXTENSIONS = - FamiliesEditorPlugin.INSTANCE.getString("_UI_FamiliesEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); - - /** - * This caches an instance of the model package. - * - * - * @generated - */ - protected FamiliesPackage familiesPackage = FamiliesPackage.eINSTANCE; - - /** - * This caches an instance of the model factory. - * - * - * @generated - */ - protected FamiliesFactory familiesFactory = familiesPackage.getFamiliesFactory(); - - /** - * This is the file creation page. - * - * - * @generated - */ - protected FamiliesModelWizardNewFileCreationPage newFileCreationPage; - - /** - * This is the initial object creation page. - * - * - * @generated - */ - protected FamiliesModelWizardInitialObjectCreationPage 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 - */ - @Override - public void init(IWorkbench workbench, IStructuredSelection selection) { - this.workbench = workbench; - this.selection = selection; - setWindowTitle(FamiliesEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); - setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(FamiliesEditorPlugin.INSTANCE.getImage("full/wizban/NewFamilies"))); - } - - /** - * 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 : familiesPackage.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)familiesPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); - EObject rootObject = familiesFactory.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) { - FamiliesEditorPlugin.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() { - @Override - 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(), FamiliesEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); - return false; - } - - return true; - } - catch (Exception exception) { - FamiliesEditorPlugin.INSTANCE.log(exception); - return false; - } - } - - /** - * This is the one page of the wizard. - * - * - * @generated - */ - public class FamiliesModelWizardNewFileCreationPage extends WizardNewFileCreationPage { - /** - * Pass in the selection. - * - * - * @generated - */ - public FamiliesModelWizardNewFileCreationPage(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(FamiliesEditorPlugin.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 FamiliesModelWizardInitialObjectCreationPage extends WizardPage { - /** - * - * - * @generated - */ - protected Combo initialObjectField; - - /** - * @generated - * - * - */ - protected List encodings; - - /** - * - * - * @generated - */ - protected Combo encodingField; - - /** - * Pass in the selection. - * - * - * @generated - */ - public FamiliesModelWizardInitialObjectCreationPage(String pageId) { - super(pageId); - } - - /** - * - * - * @generated - */ - @Override - 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(FamiliesEditorPlugin.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(FamiliesEditorPlugin.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() { - @Override - 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 FamiliesEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); - } - catch(MissingResourceException mre) { - FamiliesEditorPlugin.INSTANCE.log(mre); - } - return typeName; - } - - /** - * - * - * @generated - */ - protected Collection getEncodings() { - if (encodings == null) { - encodings = new ArrayList(); - for (StringTokenizer stringTokenizer = new StringTokenizer(FamiliesEditorPlugin.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 FamiliesModelWizardNewFileCreationPage("Whatever", selection); - newFileCreationPage.setTitle(FamiliesEditorPlugin.INSTANCE.getString("_UI_FamiliesModelWizard_label")); - newFileCreationPage.setDescription(FamiliesEditorPlugin.INSTANCE.getString("_UI_FamiliesModelWizard_description")); - newFileCreationPage.setFileName(FamiliesEditorPlugin.INSTANCE.getString("_UI_FamiliesEditorFilenameDefaultBase") + "." + 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 = FamiliesEditorPlugin.INSTANCE.getString("_UI_FamiliesEditorFilenameDefaultBase"); - 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 FamiliesModelWizardInitialObjectCreationPage("Whatever2"); - initialObjectCreationPage.setTitle(FamiliesEditorPlugin.INSTANCE.getString("_UI_FamiliesModelWizard_label")); - initialObjectCreationPage.setDescription(FamiliesEditorPlugin.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.families/.classpath b/bundles/edu.kit.ipd.sdq.metamodels.families/.classpath index 555c5b6..19e7b34 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/.classpath +++ b/bundles/edu.kit.ipd.sdq.metamodels.families/.classpath @@ -1,6 +1,6 @@ - + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families/build.properties b/bundles/edu.kit.ipd.sdq.metamodels.families/build.properties index 7e8f70d..e981b6a 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/build.properties +++ b/bundles/edu.kit.ipd.sdq.metamodels.families/build.properties @@ -6,5 +6,5 @@ bin.includes = .,\ plugin.xml,\ plugin.properties jars.compile.order = . -source.. = src/ +source.. = src-gen/ output.. = target/classes/ 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 df90ac6..8d09bee 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/model/families.genmodel +++ b/bundles/edu.kit.ipd.sdq.metamodels.families/model/families.genmodel @@ -1,9 +1,10 @@ + testsDirectory="/edu.kit.ipd.sdq.metamodels.families.tests/src-gen" importerID="org.eclipse.emf.importer.ecore" + complianceLevel="8.0" copyrightFields="false" operationReflection="true" importOrganizing="true"> families.ecore diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/FamiliesFactory.java b/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/FamiliesFactory.java deleted file mode 100644 index 9d18cc9..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/FamiliesFactory.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.families; - -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.families.FamiliesPackage - * @generated - */ -public interface FamiliesFactory extends EFactory { - /** - * The singleton instance of the factory. - * - * - * @generated - */ - FamiliesFactory eINSTANCE = edu.kit.ipd.sdq.metamodels.families.impl.FamiliesFactoryImpl.init(); - - /** - * Returns a new object of class 'Family Register'. - * - * - * @return a new object of class 'Family Register'. - * @generated - */ - FamilyRegister createFamilyRegister(); - - /** - * Returns a new object of class 'Family'. - * - * - * @return a new object of class 'Family'. - * @generated - */ - Family createFamily(); - - /** - * Returns a new object of class 'Member'. - * - * - * @return a new object of class 'Member'. - * @generated - */ - Member createMember(); - - /** - * Returns the package supported by this factory. - * - * - * @return the package supported by this factory. - * @generated - */ - FamiliesPackage getFamiliesPackage(); - -} //FamiliesFactory diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/FamiliesPackage.java b/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/FamiliesPackage.java deleted file mode 100644 index 227a966..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/FamiliesPackage.java +++ /dev/null @@ -1,565 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.families; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -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.families.FamiliesFactory - * @model kind="package" - * @generated - */ -public interface FamiliesPackage extends EPackage { - /** - * The package name. - * - * - * @generated - */ - String eNAME = "families"; - - /** - * The package namespace URI. - * - * - * @generated - */ - String eNS_URI = "edu.kit.ipd.sdq.metamodels.families"; - - /** - * The package namespace name. - * - * - * @generated - */ - String eNS_PREFIX = "families"; - - /** - * The singleton instance of the package. - * - * - * @generated - */ - FamiliesPackage eINSTANCE = edu.kit.ipd.sdq.metamodels.families.impl.FamiliesPackageImpl.init(); - - /** - * The meta object id for the '{@link edu.kit.ipd.sdq.metamodels.families.impl.FamilyRegisterImpl Family Register}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.families.impl.FamilyRegisterImpl - * @see edu.kit.ipd.sdq.metamodels.families.impl.FamiliesPackageImpl#getFamilyRegister() - * @generated - */ - int FAMILY_REGISTER = 0; - - /** - * The feature id for the 'Families' containment reference list. - * - * - * @generated - * @ordered - */ - int FAMILY_REGISTER__FAMILIES = 0; - - /** - * The feature id for the 'Id' attribute. - * - * - * @generated - * @ordered - */ - int FAMILY_REGISTER__ID = 1; - - /** - * The number of structural features of the 'Family Register' class. - * - * - * @generated - * @ordered - */ - int FAMILY_REGISTER_FEATURE_COUNT = 2; - - /** - * The number of operations of the 'Family Register' class. - * - * - * @generated - * @ordered - */ - int FAMILY_REGISTER_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link edu.kit.ipd.sdq.metamodels.families.impl.FamilyImpl Family}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.families.impl.FamilyImpl - * @see edu.kit.ipd.sdq.metamodels.families.impl.FamiliesPackageImpl#getFamily() - * @generated - */ - int FAMILY = 1; - - /** - * The feature id for the 'Last Name' attribute. - * - * - * @generated - * @ordered - */ - int FAMILY__LAST_NAME = 0; - - /** - * The feature id for the 'Sons' containment reference list. - * - * - * @generated - * @ordered - */ - int FAMILY__SONS = 1; - - /** - * The feature id for the 'Daughters' containment reference list. - * - * - * @generated - * @ordered - */ - int FAMILY__DAUGHTERS = 2; - - /** - * The feature id for the 'Father' containment reference. - * - * - * @generated - * @ordered - */ - int FAMILY__FATHER = 3; - - /** - * The feature id for the 'Mother' containment reference. - * - * - * @generated - * @ordered - */ - int FAMILY__MOTHER = 4; - - /** - * The number of structural features of the 'Family' class. - * - * - * @generated - * @ordered - */ - int FAMILY_FEATURE_COUNT = 5; - - /** - * The number of operations of the 'Family' class. - * - * - * @generated - * @ordered - */ - int FAMILY_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link edu.kit.ipd.sdq.metamodels.families.impl.MemberImpl Member}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.families.impl.MemberImpl - * @see edu.kit.ipd.sdq.metamodels.families.impl.FamiliesPackageImpl#getMember() - * @generated - */ - int MEMBER = 2; - - /** - * The feature id for the 'First Name' attribute. - * - * - * @generated - * @ordered - */ - int MEMBER__FIRST_NAME = 0; - - /** - * The feature id for the 'Family Son' container reference. - * - * - * @generated - * @ordered - */ - int MEMBER__FAMILY_SON = 1; - - /** - * The feature id for the 'Family Daughter' container reference. - * - * - * @generated - * @ordered - */ - int MEMBER__FAMILY_DAUGHTER = 2; - - /** - * The feature id for the 'Family Father' container reference. - * - * - * @generated - * @ordered - */ - int MEMBER__FAMILY_FATHER = 3; - - /** - * The feature id for the 'Family Mother' container reference. - * - * - * @generated - * @ordered - */ - int MEMBER__FAMILY_MOTHER = 4; - - /** - * The number of structural features of the 'Member' class. - * - * - * @generated - * @ordered - */ - int MEMBER_FEATURE_COUNT = 5; - - /** - * The number of operations of the 'Member' class. - * - * - * @generated - * @ordered - */ - int MEMBER_OPERATION_COUNT = 0; - - - /** - * Returns the meta object for class '{@link edu.kit.ipd.sdq.metamodels.families.FamilyRegister Family Register}'. - * - * - * @return the meta object for class 'Family Register'. - * @see edu.kit.ipd.sdq.metamodels.families.FamilyRegister - * @generated - */ - EClass getFamilyRegister(); - - /** - * Returns the meta object for the containment reference list '{@link edu.kit.ipd.sdq.metamodels.families.FamilyRegister#getFamilies Families}'. - * - * - * @return the meta object for the containment reference list 'Families'. - * @see edu.kit.ipd.sdq.metamodels.families.FamilyRegister#getFamilies() - * @see #getFamilyRegister() - * @generated - */ - EReference getFamilyRegister_Families(); - - /** - * Returns the meta object for the attribute '{@link edu.kit.ipd.sdq.metamodels.families.FamilyRegister#getId Id}'. - * - * - * @return the meta object for the attribute 'Id'. - * @see edu.kit.ipd.sdq.metamodels.families.FamilyRegister#getId() - * @see #getFamilyRegister() - * @generated - */ - EAttribute getFamilyRegister_Id(); - - /** - * Returns the meta object for class '{@link edu.kit.ipd.sdq.metamodels.families.Family Family}'. - * - * - * @return the meta object for class 'Family'. - * @see edu.kit.ipd.sdq.metamodels.families.Family - * @generated - */ - EClass getFamily(); - - /** - * Returns the meta object for the attribute '{@link edu.kit.ipd.sdq.metamodels.families.Family#getLastName Last Name}'. - * - * - * @return the meta object for the attribute 'Last Name'. - * @see edu.kit.ipd.sdq.metamodels.families.Family#getLastName() - * @see #getFamily() - * @generated - */ - EAttribute getFamily_LastName(); - - /** - * Returns the meta object for the containment reference list '{@link edu.kit.ipd.sdq.metamodels.families.Family#getSons Sons}'. - * - * - * @return the meta object for the containment reference list 'Sons'. - * @see edu.kit.ipd.sdq.metamodels.families.Family#getSons() - * @see #getFamily() - * @generated - */ - EReference getFamily_Sons(); - - /** - * Returns the meta object for the containment reference list '{@link edu.kit.ipd.sdq.metamodels.families.Family#getDaughters Daughters}'. - * - * - * @return the meta object for the containment reference list 'Daughters'. - * @see edu.kit.ipd.sdq.metamodels.families.Family#getDaughters() - * @see #getFamily() - * @generated - */ - EReference getFamily_Daughters(); - - /** - * Returns the meta object for the containment reference '{@link edu.kit.ipd.sdq.metamodels.families.Family#getFather Father}'. - * - * - * @return the meta object for the containment reference 'Father'. - * @see edu.kit.ipd.sdq.metamodels.families.Family#getFather() - * @see #getFamily() - * @generated - */ - EReference getFamily_Father(); - - /** - * Returns the meta object for the containment reference '{@link edu.kit.ipd.sdq.metamodels.families.Family#getMother Mother}'. - * - * - * @return the meta object for the containment reference 'Mother'. - * @see edu.kit.ipd.sdq.metamodels.families.Family#getMother() - * @see #getFamily() - * @generated - */ - EReference getFamily_Mother(); - - /** - * Returns the meta object for class '{@link edu.kit.ipd.sdq.metamodels.families.Member Member}'. - * - * - * @return the meta object for class 'Member'. - * @see edu.kit.ipd.sdq.metamodels.families.Member - * @generated - */ - EClass getMember(); - - /** - * Returns the meta object for the attribute '{@link edu.kit.ipd.sdq.metamodels.families.Member#getFirstName First Name}'. - * - * - * @return the meta object for the attribute 'First Name'. - * @see edu.kit.ipd.sdq.metamodels.families.Member#getFirstName() - * @see #getMember() - * @generated - */ - EAttribute getMember_FirstName(); - - /** - * Returns the meta object for the container reference '{@link edu.kit.ipd.sdq.metamodels.families.Member#getFamilySon Family Son}'. - * - * - * @return the meta object for the container reference 'Family Son'. - * @see edu.kit.ipd.sdq.metamodels.families.Member#getFamilySon() - * @see #getMember() - * @generated - */ - EReference getMember_FamilySon(); - - /** - * Returns the meta object for the container reference '{@link edu.kit.ipd.sdq.metamodels.families.Member#getFamilyDaughter Family Daughter}'. - * - * - * @return the meta object for the container reference 'Family Daughter'. - * @see edu.kit.ipd.sdq.metamodels.families.Member#getFamilyDaughter() - * @see #getMember() - * @generated - */ - EReference getMember_FamilyDaughter(); - - /** - * Returns the meta object for the container reference '{@link edu.kit.ipd.sdq.metamodels.families.Member#getFamilyFather Family Father}'. - * - * - * @return the meta object for the container reference 'Family Father'. - * @see edu.kit.ipd.sdq.metamodels.families.Member#getFamilyFather() - * @see #getMember() - * @generated - */ - EReference getMember_FamilyFather(); - - /** - * Returns the meta object for the container reference '{@link edu.kit.ipd.sdq.metamodels.families.Member#getFamilyMother Family Mother}'. - * - * - * @return the meta object for the container reference 'Family Mother'. - * @see edu.kit.ipd.sdq.metamodels.families.Member#getFamilyMother() - * @see #getMember() - * @generated - */ - EReference getMember_FamilyMother(); - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - FamiliesFactory getFamiliesFactory(); - - /** - * - * 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.families.impl.FamilyRegisterImpl Family Register}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.families.impl.FamilyRegisterImpl - * @see edu.kit.ipd.sdq.metamodels.families.impl.FamiliesPackageImpl#getFamilyRegister() - * @generated - */ - EClass FAMILY_REGISTER = eINSTANCE.getFamilyRegister(); - - /** - * The meta object literal for the 'Families' containment reference list feature. - * - * - * @generated - */ - EReference FAMILY_REGISTER__FAMILIES = eINSTANCE.getFamilyRegister_Families(); - - /** - * The meta object literal for the 'Id' attribute feature. - * - * - * @generated - */ - EAttribute FAMILY_REGISTER__ID = eINSTANCE.getFamilyRegister_Id(); - - /** - * The meta object literal for the '{@link edu.kit.ipd.sdq.metamodels.families.impl.FamilyImpl Family}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.families.impl.FamilyImpl - * @see edu.kit.ipd.sdq.metamodels.families.impl.FamiliesPackageImpl#getFamily() - * @generated - */ - EClass FAMILY = eINSTANCE.getFamily(); - - /** - * The meta object literal for the 'Last Name' attribute feature. - * - * - * @generated - */ - EAttribute FAMILY__LAST_NAME = eINSTANCE.getFamily_LastName(); - - /** - * The meta object literal for the 'Sons' containment reference list feature. - * - * - * @generated - */ - EReference FAMILY__SONS = eINSTANCE.getFamily_Sons(); - - /** - * The meta object literal for the 'Daughters' containment reference list feature. - * - * - * @generated - */ - EReference FAMILY__DAUGHTERS = eINSTANCE.getFamily_Daughters(); - - /** - * The meta object literal for the 'Father' containment reference feature. - * - * - * @generated - */ - EReference FAMILY__FATHER = eINSTANCE.getFamily_Father(); - - /** - * The meta object literal for the 'Mother' containment reference feature. - * - * - * @generated - */ - EReference FAMILY__MOTHER = eINSTANCE.getFamily_Mother(); - - /** - * The meta object literal for the '{@link edu.kit.ipd.sdq.metamodels.families.impl.MemberImpl Member}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.families.impl.MemberImpl - * @see edu.kit.ipd.sdq.metamodels.families.impl.FamiliesPackageImpl#getMember() - * @generated - */ - EClass MEMBER = eINSTANCE.getMember(); - - /** - * The meta object literal for the 'First Name' attribute feature. - * - * - * @generated - */ - EAttribute MEMBER__FIRST_NAME = eINSTANCE.getMember_FirstName(); - - /** - * The meta object literal for the 'Family Son' container reference feature. - * - * - * @generated - */ - EReference MEMBER__FAMILY_SON = eINSTANCE.getMember_FamilySon(); - - /** - * The meta object literal for the 'Family Daughter' container reference feature. - * - * - * @generated - */ - EReference MEMBER__FAMILY_DAUGHTER = eINSTANCE.getMember_FamilyDaughter(); - - /** - * The meta object literal for the 'Family Father' container reference feature. - * - * - * @generated - */ - EReference MEMBER__FAMILY_FATHER = eINSTANCE.getMember_FamilyFather(); - - /** - * The meta object literal for the 'Family Mother' container reference feature. - * - * - * @generated - */ - EReference MEMBER__FAMILY_MOTHER = eINSTANCE.getMember_FamilyMother(); - - } - -} //FamiliesPackage diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/Family.java b/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/Family.java deleted file mode 100644 index c459dc1..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/Family.java +++ /dev/null @@ -1,148 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.families; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Family'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.families.Family#getLastName Last Name}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.families.Family#getSons Sons}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.families.Family#getDaughters Daughters}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.families.Family#getFather Father}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.families.Family#getMother Mother}
  • - *
- * - * @see edu.kit.ipd.sdq.metamodels.families.FamiliesPackage#getFamily() - * @model - * @generated - */ -public interface Family extends EObject { - /** - * Returns the value of the 'Last Name' attribute. - * - *

- * If the meaning of the 'Last Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Last Name' attribute. - * @see #setLastName(String) - * @see edu.kit.ipd.sdq.metamodels.families.FamiliesPackage#getFamily_LastName() - * @model required="true" - * @generated - */ - String getLastName(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.families.Family#getLastName Last Name}' attribute. - * - * - * @param value the new value of the 'Last Name' attribute. - * @see #getLastName() - * @generated - */ - void setLastName(String value); - - /** - * Returns the value of the 'Sons' containment reference list. - * The list contents are of type {@link edu.kit.ipd.sdq.metamodels.families.Member}. - * It is bidirectional and its opposite is '{@link edu.kit.ipd.sdq.metamodels.families.Member#getFamilySon Family Son}'. - * - *

- * If the meaning of the 'Sons' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Sons' containment reference list. - * @see edu.kit.ipd.sdq.metamodels.families.FamiliesPackage#getFamily_Sons() - * @see edu.kit.ipd.sdq.metamodels.families.Member#getFamilySon - * @model opposite="familySon" containment="true" ordered="false" - * @generated - */ - EList getSons(); - - /** - * Returns the value of the 'Daughters' containment reference list. - * The list contents are of type {@link edu.kit.ipd.sdq.metamodels.families.Member}. - * It is bidirectional and its opposite is '{@link edu.kit.ipd.sdq.metamodels.families.Member#getFamilyDaughter Family Daughter}'. - * - *

- * If the meaning of the 'Daughters' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Daughters' containment reference list. - * @see edu.kit.ipd.sdq.metamodels.families.FamiliesPackage#getFamily_Daughters() - * @see edu.kit.ipd.sdq.metamodels.families.Member#getFamilyDaughter - * @model opposite="familyDaughter" containment="true" ordered="false" - * @generated - */ - EList getDaughters(); - - /** - * Returns the value of the 'Father' containment reference. - * It is bidirectional and its opposite is '{@link edu.kit.ipd.sdq.metamodels.families.Member#getFamilyFather Family Father}'. - * - *

- * If the meaning of the 'Father' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Father' containment reference. - * @see #setFather(Member) - * @see edu.kit.ipd.sdq.metamodels.families.FamiliesPackage#getFamily_Father() - * @see edu.kit.ipd.sdq.metamodels.families.Member#getFamilyFather - * @model opposite="familyFather" containment="true" ordered="false" - * @generated - */ - Member getFather(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.families.Family#getFather Father}' containment reference. - * - * - * @param value the new value of the 'Father' containment reference. - * @see #getFather() - * @generated - */ - void setFather(Member value); - - /** - * Returns the value of the 'Mother' containment reference. - * It is bidirectional and its opposite is '{@link edu.kit.ipd.sdq.metamodels.families.Member#getFamilyMother Family Mother}'. - * - *

- * If the meaning of the 'Mother' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Mother' containment reference. - * @see #setMother(Member) - * @see edu.kit.ipd.sdq.metamodels.families.FamiliesPackage#getFamily_Mother() - * @see edu.kit.ipd.sdq.metamodels.families.Member#getFamilyMother - * @model opposite="familyMother" containment="true" ordered="false" - * @generated - */ - Member getMother(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.families.Family#getMother Mother}' containment reference. - * - * - * @param value the new value of the 'Mother' containment reference. - * @see #getMother() - * @generated - */ - void setMother(Member value); - -} // Family diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/FamilyRegister.java b/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/FamilyRegister.java deleted file mode 100644 index 40bae36..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/FamilyRegister.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.families; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Family Register'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.families.FamilyRegister#getFamilies Families}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.families.FamilyRegister#getId Id}
  • - *
- * - * @see edu.kit.ipd.sdq.metamodels.families.FamiliesPackage#getFamilyRegister() - * @model - * @generated - */ -public interface FamilyRegister extends EObject { - /** - * Returns the value of the 'Families' containment reference list. - * The list contents are of type {@link edu.kit.ipd.sdq.metamodels.families.Family}. - * - *

- * If the meaning of the 'Families' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Families' containment reference list. - * @see edu.kit.ipd.sdq.metamodels.families.FamiliesPackage#getFamilyRegister_Families() - * @model containment="true" ordered="false" - * @generated - */ - EList getFamilies(); - - /** - * Returns the value of the 'Id' attribute. - * - *

- * If the meaning of the 'Id' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Id' attribute. - * @see #setId(String) - * @see edu.kit.ipd.sdq.metamodels.families.FamiliesPackage#getFamilyRegister_Id() - * @model id="true" - * @generated - */ - String getId(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.families.FamilyRegister#getId Id}' attribute. - * - * - * @param value the new value of the 'Id' attribute. - * @see #getId() - * @generated - */ - void setId(String value); - -} // FamilyRegister diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/Member.java b/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/Member.java deleted file mode 100644 index ba2991c..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/Member.java +++ /dev/null @@ -1,166 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.families; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Member'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.families.Member#getFirstName First Name}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.families.Member#getFamilySon Family Son}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.families.Member#getFamilyDaughter Family Daughter}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.families.Member#getFamilyFather Family Father}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.families.Member#getFamilyMother Family Mother}
  • - *
- * - * @see edu.kit.ipd.sdq.metamodels.families.FamiliesPackage#getMember() - * @model - * @generated - */ -public interface Member extends EObject { - /** - * Returns the value of the 'First Name' attribute. - * - *

- * If the meaning of the 'First Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'First Name' attribute. - * @see #setFirstName(String) - * @see edu.kit.ipd.sdq.metamodels.families.FamiliesPackage#getMember_FirstName() - * @model unique="false" ordered="false" - * @generated - */ - String getFirstName(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.families.Member#getFirstName First Name}' attribute. - * - * - * @param value the new value of the 'First Name' attribute. - * @see #getFirstName() - * @generated - */ - void setFirstName(String value); - - /** - * Returns the value of the 'Family Son' container reference. - * It is bidirectional and its opposite is '{@link edu.kit.ipd.sdq.metamodels.families.Family#getSons Sons}'. - * - *

- * If the meaning of the 'Family Son' container reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Family Son' container reference. - * @see #setFamilySon(Family) - * @see edu.kit.ipd.sdq.metamodels.families.FamiliesPackage#getMember_FamilySon() - * @see edu.kit.ipd.sdq.metamodels.families.Family#getSons - * @model opposite="sons" transient="false" ordered="false" - * @generated - */ - Family getFamilySon(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.families.Member#getFamilySon Family Son}' container reference. - * - * - * @param value the new value of the 'Family Son' container reference. - * @see #getFamilySon() - * @generated - */ - void setFamilySon(Family value); - - /** - * Returns the value of the 'Family Daughter' container reference. - * It is bidirectional and its opposite is '{@link edu.kit.ipd.sdq.metamodels.families.Family#getDaughters Daughters}'. - * - *

- * If the meaning of the 'Family Daughter' container reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Family Daughter' container reference. - * @see #setFamilyDaughter(Family) - * @see edu.kit.ipd.sdq.metamodels.families.FamiliesPackage#getMember_FamilyDaughter() - * @see edu.kit.ipd.sdq.metamodels.families.Family#getDaughters - * @model opposite="daughters" transient="false" ordered="false" - * @generated - */ - Family getFamilyDaughter(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.families.Member#getFamilyDaughter Family Daughter}' container reference. - * - * - * @param value the new value of the 'Family Daughter' container reference. - * @see #getFamilyDaughter() - * @generated - */ - void setFamilyDaughter(Family value); - - /** - * Returns the value of the 'Family Father' container reference. - * It is bidirectional and its opposite is '{@link edu.kit.ipd.sdq.metamodels.families.Family#getFather Father}'. - * - *

- * If the meaning of the 'Family Father' container reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Family Father' container reference. - * @see #setFamilyFather(Family) - * @see edu.kit.ipd.sdq.metamodels.families.FamiliesPackage#getMember_FamilyFather() - * @see edu.kit.ipd.sdq.metamodels.families.Family#getFather - * @model opposite="father" transient="false" ordered="false" - * @generated - */ - Family getFamilyFather(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.families.Member#getFamilyFather Family Father}' container reference. - * - * - * @param value the new value of the 'Family Father' container reference. - * @see #getFamilyFather() - * @generated - */ - void setFamilyFather(Family value); - - /** - * Returns the value of the 'Family Mother' container reference. - * It is bidirectional and its opposite is '{@link edu.kit.ipd.sdq.metamodels.families.Family#getMother Mother}'. - * - *

- * If the meaning of the 'Family Mother' container reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Family Mother' container reference. - * @see #setFamilyMother(Family) - * @see edu.kit.ipd.sdq.metamodels.families.FamiliesPackage#getMember_FamilyMother() - * @see edu.kit.ipd.sdq.metamodels.families.Family#getMother - * @model opposite="mother" transient="false" ordered="false" - * @generated - */ - Family getFamilyMother(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.families.Member#getFamilyMother Family Mother}' container reference. - * - * - * @param value the new value of the 'Family Mother' container reference. - * @see #getFamilyMother() - * @generated - */ - void setFamilyMother(Family value); - -} // Member 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 deleted file mode 100644 index e7a489c..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/FamiliesFactoryImpl.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.families.impl; - -import edu.kit.ipd.sdq.metamodels.families.*; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.impl.EFactoryImpl; - -import org.eclipse.emf.ecore.plugin.EcorePlugin; - -/** - * - * An implementation of the model Factory. - * - * @generated - */ -public class FamiliesFactoryImpl extends EFactoryImpl implements FamiliesFactory { - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static FamiliesFactory init() { - try { - FamiliesFactory theFamiliesFactory = (FamiliesFactory)EPackage.Registry.INSTANCE.getEFactory(FamiliesPackage.eNS_URI); - if (theFamiliesFactory != null) { - return theFamiliesFactory; - } - } - catch (Exception exception) { - EcorePlugin.INSTANCE.log(exception); - } - return new FamiliesFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public FamiliesFactoryImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - public EObject create(EClass eClass) { - switch (eClass.getClassifierID()) { - case FamiliesPackage.FAMILY_REGISTER: return createFamilyRegister(); - case FamiliesPackage.FAMILY: return createFamily(); - case FamiliesPackage.MEMBER: return createMember(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - @Override - public FamilyRegister createFamilyRegister() { - FamilyRegisterImpl familyRegister = new FamilyRegisterImpl(); - return familyRegister; - } - - /** - * - * - * @generated - */ - @Override - public Family createFamily() { - FamilyImpl family = new FamilyImpl(); - return family; - } - - /** - * - * - * @generated - */ - @Override - public Member createMember() { - MemberImpl member = new MemberImpl(); - return member; - } - - /** - * - * - * @generated - */ - @Override - public FamiliesPackage getFamiliesPackage() { - return (FamiliesPackage)getEPackage(); - } - - /** - * - * - * @deprecated - * @generated - */ - @Deprecated - public static FamiliesPackage getPackage() { - return FamiliesPackage.eINSTANCE; - } - -} //FamiliesFactoryImpl 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 deleted file mode 100644 index f809f15..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/FamiliesPackageImpl.java +++ /dev/null @@ -1,357 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.families.impl; - -import edu.kit.ipd.sdq.metamodels.families.FamiliesFactory; -import edu.kit.ipd.sdq.metamodels.families.FamiliesPackage; -import edu.kit.ipd.sdq.metamodels.families.Family; -import edu.kit.ipd.sdq.metamodels.families.FamilyRegister; -import edu.kit.ipd.sdq.metamodels.families.Member; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - -import org.eclipse.emf.ecore.impl.EPackageImpl; - -/** - * - * An implementation of the model Package. - * - * @generated - */ -public class FamiliesPackageImpl extends EPackageImpl implements FamiliesPackage { - /** - * - * - * @generated - */ - private EClass familyRegisterEClass = null; - - /** - * - * - * @generated - */ - private EClass familyEClass = null; - - /** - * - * - * @generated - */ - private EClass memberEClass = 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.families.FamiliesPackage#eNS_URI - * @see #init() - * @generated - */ - private FamiliesPackageImpl() { - super(eNS_URI, FamiliesFactory.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 FamiliesPackage#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 FamiliesPackage init() { - if (isInited) return (FamiliesPackage)EPackage.Registry.INSTANCE.getEPackage(FamiliesPackage.eNS_URI); - - // Obtain or create and register package - Object registeredFamiliesPackage = EPackage.Registry.INSTANCE.get(eNS_URI); - FamiliesPackageImpl theFamiliesPackage = registeredFamiliesPackage instanceof FamiliesPackageImpl ? (FamiliesPackageImpl)registeredFamiliesPackage : new FamiliesPackageImpl(); - - isInited = true; - - // Create package meta-data objects - theFamiliesPackage.createPackageContents(); - - // Initialize created meta-data - theFamiliesPackage.initializePackageContents(); - - // 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; - } - - /** - * - * - * @generated - */ - @Override - public EClass getFamilyRegister() { - return familyRegisterEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getFamilyRegister_Families() { - return (EReference)familyRegisterEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getFamilyRegister_Id() { - return (EAttribute)familyRegisterEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getFamily() { - return familyEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getFamily_LastName() { - return (EAttribute)familyEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getFamily_Sons() { - return (EReference)familyEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EReference getFamily_Daughters() { - return (EReference)familyEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EReference getFamily_Father() { - return (EReference)familyEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - @Override - public EReference getFamily_Mother() { - return (EReference)familyEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * @generated - */ - @Override - public EClass getMember() { - return memberEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getMember_FirstName() { - return (EAttribute)memberEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EReference getMember_FamilySon() { - return (EReference)memberEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EReference getMember_FamilyDaughter() { - return (EReference)memberEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EReference getMember_FamilyFather() { - return (EReference)memberEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - @Override - public EReference getMember_FamilyMother() { - return (EReference)memberEClass.getEStructuralFeatures().get(4); - } - - /** - * - * - * @generated - */ - @Override - public FamiliesFactory getFamiliesFactory() { - return (FamiliesFactory)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 - familyRegisterEClass = createEClass(FAMILY_REGISTER); - createEReference(familyRegisterEClass, FAMILY_REGISTER__FAMILIES); - createEAttribute(familyRegisterEClass, FAMILY_REGISTER__ID); - - familyEClass = createEClass(FAMILY); - createEAttribute(familyEClass, FAMILY__LAST_NAME); - createEReference(familyEClass, FAMILY__SONS); - createEReference(familyEClass, FAMILY__DAUGHTERS); - createEReference(familyEClass, FAMILY__FATHER); - createEReference(familyEClass, FAMILY__MOTHER); - - memberEClass = createEClass(MEMBER); - createEAttribute(memberEClass, MEMBER__FIRST_NAME); - createEReference(memberEClass, MEMBER__FAMILY_SON); - createEReference(memberEClass, MEMBER__FAMILY_DAUGHTER); - createEReference(memberEClass, MEMBER__FAMILY_FATHER); - createEReference(memberEClass, MEMBER__FAMILY_MOTHER); - } - - /** - * - * - * @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(familyRegisterEClass, FamilyRegister.class, "FamilyRegister", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getFamilyRegister_Families(), this.getFamily(), null, "families", null, 0, -1, FamilyRegister.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getFamilyRegister_Id(), ecorePackage.getEString(), "id", null, 0, 1, FamilyRegister.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(familyEClass, Family.class, "Family", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getFamily_LastName(), ecorePackage.getEString(), "lastName", null, 1, 1, Family.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getFamily_Sons(), this.getMember(), this.getMember_FamilySon(), "sons", null, 0, -1, Family.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getFamily_Daughters(), this.getMember(), this.getMember_FamilyDaughter(), "daughters", null, 0, -1, Family.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getFamily_Father(), this.getMember(), this.getMember_FamilyFather(), "father", null, 0, 1, Family.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getFamily_Mother(), this.getMember(), this.getMember_FamilyMother(), "mother", null, 0, 1, Family.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(memberEClass, Member.class, "Member", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getMember_FirstName(), ecorePackage.getEString(), "firstName", null, 0, 1, Member.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getMember_FamilySon(), this.getFamily(), this.getFamily_Sons(), "familySon", null, 0, 1, Member.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getMember_FamilyDaughter(), this.getFamily(), this.getFamily_Daughters(), "familyDaughter", null, 0, 1, Member.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getMember_FamilyFather(), this.getFamily(), this.getFamily_Father(), "familyFather", null, 0, 1, Member.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEReference(getMember_FamilyMother(), this.getFamily(), this.getFamily_Mother(), "familyMother", null, 0, 1, Member.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - // Create resource - createResource(eNS_URI); - } - -} //FamiliesPackageImpl 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 deleted file mode 100644 index 22bfb9d..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/FamilyImpl.java +++ /dev/null @@ -1,423 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.families.impl; - -import edu.kit.ipd.sdq.metamodels.families.FamiliesPackage; -import edu.kit.ipd.sdq.metamodels.families.Family; -import edu.kit.ipd.sdq.metamodels.families.Member; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * - * An implementation of the model object 'Family'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.families.impl.FamilyImpl#getLastName Last Name}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.families.impl.FamilyImpl#getSons Sons}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.families.impl.FamilyImpl#getDaughters Daughters}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.families.impl.FamilyImpl#getFather Father}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.families.impl.FamilyImpl#getMother Mother}
  • - *
- * - * @generated - */ -public class FamilyImpl extends MinimalEObjectImpl.Container implements Family { - /** - * The default value of the '{@link #getLastName() Last Name}' attribute. - * - * - * @see #getLastName() - * @generated - * @ordered - */ - protected static final String LAST_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getLastName() Last Name}' attribute. - * - * - * @see #getLastName() - * @generated - * @ordered - */ - protected String lastName = LAST_NAME_EDEFAULT; - - /** - * The cached value of the '{@link #getSons() Sons}' containment reference list. - * - * - * @see #getSons() - * @generated - * @ordered - */ - protected EList sons; - - /** - * The cached value of the '{@link #getDaughters() Daughters}' containment reference list. - * - * - * @see #getDaughters() - * @generated - * @ordered - */ - protected EList daughters; - - /** - * The cached value of the '{@link #getFather() Father}' containment reference. - * - * - * @see #getFather() - * @generated - * @ordered - */ - protected Member father; - - /** - * The cached value of the '{@link #getMother() Mother}' containment reference. - * - * - * @see #getMother() - * @generated - * @ordered - */ - protected Member mother; - - /** - * - * - * @generated - */ - protected FamilyImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FamiliesPackage.Literals.FAMILY; - } - - /** - * - * - * @generated - */ - @Override - public String getLastName() { - return lastName; - } - - /** - * - * - * @generated - */ - @Override - public void setLastName(String newLastName) { - String oldLastName = lastName; - lastName = newLastName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FamiliesPackage.FAMILY__LAST_NAME, oldLastName, lastName)); - } - - /** - * - * - * @generated - */ - @Override - public EList getSons() { - if (sons == null) { - sons = new EObjectContainmentWithInverseEList(Member.class, this, FamiliesPackage.FAMILY__SONS, FamiliesPackage.MEMBER__FAMILY_SON); - } - return sons; - } - - /** - * - * - * @generated - */ - @Override - public EList getDaughters() { - if (daughters == null) { - daughters = new EObjectContainmentWithInverseEList(Member.class, this, FamiliesPackage.FAMILY__DAUGHTERS, FamiliesPackage.MEMBER__FAMILY_DAUGHTER); - } - return daughters; - } - - /** - * - * - * @generated - */ - @Override - public Member getFather() { - return father; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetFather(Member newFather, NotificationChain msgs) { - Member oldFather = father; - father = newFather; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FamiliesPackage.FAMILY__FATHER, oldFather, newFather); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - @Override - public void setFather(Member newFather) { - if (newFather != father) { - NotificationChain msgs = null; - if (father != null) - msgs = ((InternalEObject)father).eInverseRemove(this, FamiliesPackage.MEMBER__FAMILY_FATHER, Member.class, msgs); - if (newFather != null) - msgs = ((InternalEObject)newFather).eInverseAdd(this, FamiliesPackage.MEMBER__FAMILY_FATHER, Member.class, msgs); - msgs = basicSetFather(newFather, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FamiliesPackage.FAMILY__FATHER, newFather, newFather)); - } - - /** - * - * - * @generated - */ - @Override - public Member getMother() { - return mother; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetMother(Member newMother, NotificationChain msgs) { - Member oldMother = mother; - mother = newMother; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FamiliesPackage.FAMILY__MOTHER, oldMother, newMother); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - @Override - public void setMother(Member newMother) { - if (newMother != mother) { - NotificationChain msgs = null; - if (mother != null) - msgs = ((InternalEObject)mother).eInverseRemove(this, FamiliesPackage.MEMBER__FAMILY_MOTHER, Member.class, msgs); - if (newMother != null) - msgs = ((InternalEObject)newMother).eInverseAdd(this, FamiliesPackage.MEMBER__FAMILY_MOTHER, Member.class, msgs); - msgs = basicSetMother(newMother, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FamiliesPackage.FAMILY__MOTHER, newMother, newMother)); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case FamiliesPackage.FAMILY__SONS: - return ((InternalEList)(InternalEList)getSons()).basicAdd(otherEnd, msgs); - case FamiliesPackage.FAMILY__DAUGHTERS: - return ((InternalEList)(InternalEList)getDaughters()).basicAdd(otherEnd, msgs); - case FamiliesPackage.FAMILY__FATHER: - if (father != null) - msgs = ((InternalEObject)father).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FamiliesPackage.FAMILY__FATHER, null, msgs); - return basicSetFather((Member)otherEnd, msgs); - case FamiliesPackage.FAMILY__MOTHER: - if (mother != null) - msgs = ((InternalEObject)mother).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FamiliesPackage.FAMILY__MOTHER, null, msgs); - return basicSetMother((Member)otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case FamiliesPackage.FAMILY__SONS: - return ((InternalEList)getSons()).basicRemove(otherEnd, msgs); - case FamiliesPackage.FAMILY__DAUGHTERS: - return ((InternalEList)getDaughters()).basicRemove(otherEnd, msgs); - case FamiliesPackage.FAMILY__FATHER: - return basicSetFather(null, msgs); - case FamiliesPackage.FAMILY__MOTHER: - return basicSetMother(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FamiliesPackage.FAMILY__LAST_NAME: - return getLastName(); - case FamiliesPackage.FAMILY__SONS: - return getSons(); - case FamiliesPackage.FAMILY__DAUGHTERS: - return getDaughters(); - case FamiliesPackage.FAMILY__FATHER: - return getFather(); - case FamiliesPackage.FAMILY__MOTHER: - return getMother(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FamiliesPackage.FAMILY__LAST_NAME: - setLastName((String)newValue); - return; - case FamiliesPackage.FAMILY__SONS: - getSons().clear(); - getSons().addAll((Collection)newValue); - return; - case FamiliesPackage.FAMILY__DAUGHTERS: - getDaughters().clear(); - getDaughters().addAll((Collection)newValue); - return; - case FamiliesPackage.FAMILY__FATHER: - setFather((Member)newValue); - return; - case FamiliesPackage.FAMILY__MOTHER: - setMother((Member)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FamiliesPackage.FAMILY__LAST_NAME: - setLastName(LAST_NAME_EDEFAULT); - return; - case FamiliesPackage.FAMILY__SONS: - getSons().clear(); - return; - case FamiliesPackage.FAMILY__DAUGHTERS: - getDaughters().clear(); - return; - case FamiliesPackage.FAMILY__FATHER: - setFather((Member)null); - return; - case FamiliesPackage.FAMILY__MOTHER: - setMother((Member)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FamiliesPackage.FAMILY__LAST_NAME: - return LAST_NAME_EDEFAULT == null ? lastName != null : !LAST_NAME_EDEFAULT.equals(lastName); - case FamiliesPackage.FAMILY__SONS: - return sons != null && !sons.isEmpty(); - case FamiliesPackage.FAMILY__DAUGHTERS: - return daughters != null && !daughters.isEmpty(); - case FamiliesPackage.FAMILY__FATHER: - return father != null; - case FamiliesPackage.FAMILY__MOTHER: - return mother != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuilder result = new StringBuilder(super.toString()); - result.append(" (lastName: "); - result.append(lastName); - result.append(')'); - return result.toString(); - } - -} //FamilyImpl 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 deleted file mode 100644 index 7eb5f2e..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/FamilyRegisterImpl.java +++ /dev/null @@ -1,224 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.families.impl; - -import edu.kit.ipd.sdq.metamodels.families.FamiliesPackage; -import edu.kit.ipd.sdq.metamodels.families.Family; -import edu.kit.ipd.sdq.metamodels.families.FamilyRegister; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * - * An implementation of the model object 'Family Register'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.families.impl.FamilyRegisterImpl#getFamilies Families}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.families.impl.FamilyRegisterImpl#getId Id}
  • - *
- * - * @generated - */ -public class FamilyRegisterImpl extends MinimalEObjectImpl.Container implements FamilyRegister { - /** - * The cached value of the '{@link #getFamilies() Families}' containment reference list. - * - * - * @see #getFamilies() - * @generated - * @ordered - */ - protected EList families; - - /** - * The default value of the '{@link #getId() Id}' attribute. - * - * - * @see #getId() - * @generated - * @ordered - */ - protected static final String ID_EDEFAULT = null; - /** - * The cached value of the '{@link #getId() Id}' attribute. - * - * - * @see #getId() - * @generated - * @ordered - */ - protected String id = ID_EDEFAULT; - - /** - * - * - * @generated - */ - protected FamilyRegisterImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FamiliesPackage.Literals.FAMILY_REGISTER; - } - - /** - * - * - * @generated - */ - @Override - public EList getFamilies() { - if (families == null) { - families = new EObjectContainmentEList(Family.class, this, FamiliesPackage.FAMILY_REGISTER__FAMILIES); - } - return families; - } - - /** - * - * - * @generated - */ - @Override - public String getId() { - return id; - } - - /** - * - * - * @generated - */ - @Override - public void setId(String newId) { - String oldId = id; - id = newId; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FamiliesPackage.FAMILY_REGISTER__ID, oldId, id)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case FamiliesPackage.FAMILY_REGISTER__FAMILIES: - return ((InternalEList)getFamilies()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FamiliesPackage.FAMILY_REGISTER__FAMILIES: - return getFamilies(); - case FamiliesPackage.FAMILY_REGISTER__ID: - return getId(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FamiliesPackage.FAMILY_REGISTER__FAMILIES: - getFamilies().clear(); - getFamilies().addAll((Collection)newValue); - return; - case FamiliesPackage.FAMILY_REGISTER__ID: - setId((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FamiliesPackage.FAMILY_REGISTER__FAMILIES: - getFamilies().clear(); - return; - case FamiliesPackage.FAMILY_REGISTER__ID: - setId(ID_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FamiliesPackage.FAMILY_REGISTER__FAMILIES: - return families != null && !families.isEmpty(); - case FamiliesPackage.FAMILY_REGISTER__ID: - return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuilder result = new StringBuilder(super.toString()); - result.append(" (id: "); - result.append(id); - result.append(')'); - return result.toString(); - } - -} //FamilyRegisterImpl 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 deleted file mode 100644 index 70b25f3..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/impl/MemberImpl.java +++ /dev/null @@ -1,454 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.families.impl; - -import edu.kit.ipd.sdq.metamodels.families.FamiliesPackage; -import edu.kit.ipd.sdq.metamodels.families.Family; -import edu.kit.ipd.sdq.metamodels.families.Member; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.eclipse.emf.ecore.util.EcoreUtil; - -/** - * - * An implementation of the model object 'Member'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.families.impl.MemberImpl#getFirstName First Name}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.families.impl.MemberImpl#getFamilySon Family Son}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.families.impl.MemberImpl#getFamilyDaughter Family Daughter}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.families.impl.MemberImpl#getFamilyFather Family Father}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.families.impl.MemberImpl#getFamilyMother Family Mother}
  • - *
- * - * @generated - */ -public class MemberImpl extends MinimalEObjectImpl.Container implements Member { - /** - * The default value of the '{@link #getFirstName() First Name}' attribute. - * - * - * @see #getFirstName() - * @generated - * @ordered - */ - protected static final String FIRST_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getFirstName() First Name}' attribute. - * - * - * @see #getFirstName() - * @generated - * @ordered - */ - protected String firstName = FIRST_NAME_EDEFAULT; - - /** - * - * - * @generated - */ - protected MemberImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return FamiliesPackage.Literals.MEMBER; - } - - /** - * - * - * @generated - */ - @Override - public String getFirstName() { - return firstName; - } - - /** - * - * - * @generated - */ - @Override - public void setFirstName(String newFirstName) { - String oldFirstName = firstName; - firstName = newFirstName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FamiliesPackage.MEMBER__FIRST_NAME, oldFirstName, firstName)); - } - - /** - * - * - * @generated - */ - @Override - public Family getFamilySon() { - if (eContainerFeatureID() != FamiliesPackage.MEMBER__FAMILY_SON) return null; - return (Family)eInternalContainer(); - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetFamilySon(Family newFamilySon, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject)newFamilySon, FamiliesPackage.MEMBER__FAMILY_SON, msgs); - return msgs; - } - - /** - * - * - * @generated - */ - @Override - public void setFamilySon(Family newFamilySon) { - if (newFamilySon != eInternalContainer() || (eContainerFeatureID() != FamiliesPackage.MEMBER__FAMILY_SON && newFamilySon != null)) { - if (EcoreUtil.isAncestor(this, newFamilySon)) - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - NotificationChain msgs = null; - if (eInternalContainer() != null) - msgs = eBasicRemoveFromContainer(msgs); - if (newFamilySon != null) - msgs = ((InternalEObject)newFamilySon).eInverseAdd(this, FamiliesPackage.FAMILY__SONS, Family.class, msgs); - msgs = basicSetFamilySon(newFamilySon, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FamiliesPackage.MEMBER__FAMILY_SON, newFamilySon, newFamilySon)); - } - - /** - * - * - * @generated - */ - @Override - public Family getFamilyDaughter() { - if (eContainerFeatureID() != FamiliesPackage.MEMBER__FAMILY_DAUGHTER) return null; - return (Family)eInternalContainer(); - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetFamilyDaughter(Family newFamilyDaughter, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject)newFamilyDaughter, FamiliesPackage.MEMBER__FAMILY_DAUGHTER, msgs); - return msgs; - } - - /** - * - * - * @generated - */ - @Override - public void setFamilyDaughter(Family newFamilyDaughter) { - if (newFamilyDaughter != eInternalContainer() || (eContainerFeatureID() != FamiliesPackage.MEMBER__FAMILY_DAUGHTER && newFamilyDaughter != null)) { - if (EcoreUtil.isAncestor(this, newFamilyDaughter)) - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - NotificationChain msgs = null; - if (eInternalContainer() != null) - msgs = eBasicRemoveFromContainer(msgs); - if (newFamilyDaughter != null) - msgs = ((InternalEObject)newFamilyDaughter).eInverseAdd(this, FamiliesPackage.FAMILY__DAUGHTERS, Family.class, msgs); - msgs = basicSetFamilyDaughter(newFamilyDaughter, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FamiliesPackage.MEMBER__FAMILY_DAUGHTER, newFamilyDaughter, newFamilyDaughter)); - } - - /** - * - * - * @generated - */ - @Override - public Family getFamilyFather() { - if (eContainerFeatureID() != FamiliesPackage.MEMBER__FAMILY_FATHER) return null; - return (Family)eInternalContainer(); - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetFamilyFather(Family newFamilyFather, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject)newFamilyFather, FamiliesPackage.MEMBER__FAMILY_FATHER, msgs); - return msgs; - } - - /** - * - * - * @generated - */ - @Override - public void setFamilyFather(Family newFamilyFather) { - if (newFamilyFather != eInternalContainer() || (eContainerFeatureID() != FamiliesPackage.MEMBER__FAMILY_FATHER && newFamilyFather != null)) { - if (EcoreUtil.isAncestor(this, newFamilyFather)) - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - NotificationChain msgs = null; - if (eInternalContainer() != null) - msgs = eBasicRemoveFromContainer(msgs); - if (newFamilyFather != null) - msgs = ((InternalEObject)newFamilyFather).eInverseAdd(this, FamiliesPackage.FAMILY__FATHER, Family.class, msgs); - msgs = basicSetFamilyFather(newFamilyFather, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FamiliesPackage.MEMBER__FAMILY_FATHER, newFamilyFather, newFamilyFather)); - } - - /** - * - * - * @generated - */ - @Override - public Family getFamilyMother() { - if (eContainerFeatureID() != FamiliesPackage.MEMBER__FAMILY_MOTHER) return null; - return (Family)eInternalContainer(); - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetFamilyMother(Family newFamilyMother, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject)newFamilyMother, FamiliesPackage.MEMBER__FAMILY_MOTHER, msgs); - return msgs; - } - - /** - * - * - * @generated - */ - @Override - public void setFamilyMother(Family newFamilyMother) { - if (newFamilyMother != eInternalContainer() || (eContainerFeatureID() != FamiliesPackage.MEMBER__FAMILY_MOTHER && newFamilyMother != null)) { - if (EcoreUtil.isAncestor(this, newFamilyMother)) - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - NotificationChain msgs = null; - if (eInternalContainer() != null) - msgs = eBasicRemoveFromContainer(msgs); - if (newFamilyMother != null) - msgs = ((InternalEObject)newFamilyMother).eInverseAdd(this, FamiliesPackage.FAMILY__MOTHER, Family.class, msgs); - msgs = basicSetFamilyMother(newFamilyMother, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, FamiliesPackage.MEMBER__FAMILY_MOTHER, newFamilyMother, newFamilyMother)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case FamiliesPackage.MEMBER__FAMILY_SON: - if (eInternalContainer() != null) - msgs = eBasicRemoveFromContainer(msgs); - return basicSetFamilySon((Family)otherEnd, msgs); - case FamiliesPackage.MEMBER__FAMILY_DAUGHTER: - if (eInternalContainer() != null) - msgs = eBasicRemoveFromContainer(msgs); - return basicSetFamilyDaughter((Family)otherEnd, msgs); - case FamiliesPackage.MEMBER__FAMILY_FATHER: - if (eInternalContainer() != null) - msgs = eBasicRemoveFromContainer(msgs); - return basicSetFamilyFather((Family)otherEnd, msgs); - case FamiliesPackage.MEMBER__FAMILY_MOTHER: - if (eInternalContainer() != null) - msgs = eBasicRemoveFromContainer(msgs); - return basicSetFamilyMother((Family)otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case FamiliesPackage.MEMBER__FAMILY_SON: - return basicSetFamilySon(null, msgs); - case FamiliesPackage.MEMBER__FAMILY_DAUGHTER: - return basicSetFamilyDaughter(null, msgs); - case FamiliesPackage.MEMBER__FAMILY_FATHER: - return basicSetFamilyFather(null, msgs); - case FamiliesPackage.MEMBER__FAMILY_MOTHER: - return basicSetFamilyMother(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID()) { - case FamiliesPackage.MEMBER__FAMILY_SON: - return eInternalContainer().eInverseRemove(this, FamiliesPackage.FAMILY__SONS, Family.class, msgs); - case FamiliesPackage.MEMBER__FAMILY_DAUGHTER: - return eInternalContainer().eInverseRemove(this, FamiliesPackage.FAMILY__DAUGHTERS, Family.class, msgs); - case FamiliesPackage.MEMBER__FAMILY_FATHER: - return eInternalContainer().eInverseRemove(this, FamiliesPackage.FAMILY__FATHER, Family.class, msgs); - case FamiliesPackage.MEMBER__FAMILY_MOTHER: - return eInternalContainer().eInverseRemove(this, FamiliesPackage.FAMILY__MOTHER, Family.class, msgs); - } - return super.eBasicRemoveFromContainerFeature(msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case FamiliesPackage.MEMBER__FIRST_NAME: - return getFirstName(); - case FamiliesPackage.MEMBER__FAMILY_SON: - return getFamilySon(); - case FamiliesPackage.MEMBER__FAMILY_DAUGHTER: - return getFamilyDaughter(); - case FamiliesPackage.MEMBER__FAMILY_FATHER: - return getFamilyFather(); - case FamiliesPackage.MEMBER__FAMILY_MOTHER: - return getFamilyMother(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case FamiliesPackage.MEMBER__FIRST_NAME: - setFirstName((String)newValue); - return; - case FamiliesPackage.MEMBER__FAMILY_SON: - setFamilySon((Family)newValue); - return; - case FamiliesPackage.MEMBER__FAMILY_DAUGHTER: - setFamilyDaughter((Family)newValue); - return; - case FamiliesPackage.MEMBER__FAMILY_FATHER: - setFamilyFather((Family)newValue); - return; - case FamiliesPackage.MEMBER__FAMILY_MOTHER: - setFamilyMother((Family)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case FamiliesPackage.MEMBER__FIRST_NAME: - setFirstName(FIRST_NAME_EDEFAULT); - return; - case FamiliesPackage.MEMBER__FAMILY_SON: - setFamilySon((Family)null); - return; - case FamiliesPackage.MEMBER__FAMILY_DAUGHTER: - setFamilyDaughter((Family)null); - return; - case FamiliesPackage.MEMBER__FAMILY_FATHER: - setFamilyFather((Family)null); - return; - case FamiliesPackage.MEMBER__FAMILY_MOTHER: - setFamilyMother((Family)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case FamiliesPackage.MEMBER__FIRST_NAME: - return FIRST_NAME_EDEFAULT == null ? firstName != null : !FIRST_NAME_EDEFAULT.equals(firstName); - case FamiliesPackage.MEMBER__FAMILY_SON: - return getFamilySon() != null; - case FamiliesPackage.MEMBER__FAMILY_DAUGHTER: - return getFamilyDaughter() != null; - case FamiliesPackage.MEMBER__FAMILY_FATHER: - return getFamilyFather() != null; - case FamiliesPackage.MEMBER__FAMILY_MOTHER: - return getFamilyMother() != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuilder result = new StringBuilder(super.toString()); - result.append(" (firstName: "); - result.append(firstName); - result.append(')'); - return result.toString(); - } - -} //MemberImpl diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/util/FamiliesAdapterFactory.java b/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/util/FamiliesAdapterFactory.java deleted file mode 100644 index 1c88cf3..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/util/FamiliesAdapterFactory.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.families.util; - -import edu.kit.ipd.sdq.metamodels.families.*; - -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.families.FamiliesPackage - * @generated - */ -public class FamiliesAdapterFactory extends AdapterFactoryImpl { - /** - * The cached model package. - * - * - * @generated - */ - protected static FamiliesPackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * - * - * @generated - */ - public FamiliesAdapterFactory() { - if (modelPackage == null) { - modelPackage = FamiliesPackage.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 FamiliesSwitch modelSwitch = - new FamiliesSwitch() { - @Override - public Adapter caseFamilyRegister(FamilyRegister object) { - return createFamilyRegisterAdapter(); - } - @Override - public Adapter caseFamily(Family object) { - return createFamilyAdapter(); - } - @Override - public Adapter caseMember(Member object) { - return createMemberAdapter(); - } - @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.families.FamilyRegister Family Register}'. - * - * 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.families.FamilyRegister - * @generated - */ - public Adapter createFamilyRegisterAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link edu.kit.ipd.sdq.metamodels.families.Family Family}'. - * - * 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.families.Family - * @generated - */ - public Adapter createFamilyAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link edu.kit.ipd.sdq.metamodels.families.Member Member}'. - * - * 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.families.Member - * @generated - */ - public Adapter createMemberAdapter() { - 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; - } - -} //FamiliesAdapterFactory diff --git a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/util/FamiliesSwitch.java b/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/util/FamiliesSwitch.java deleted file mode 100644 index 35a884f..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.families/src/edu/kit/ipd/sdq/metamodels/families/util/FamiliesSwitch.java +++ /dev/null @@ -1,152 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.families.util; - -import edu.kit.ipd.sdq.metamodels.families.*; - -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.families.FamiliesPackage - * @generated - */ -public class FamiliesSwitch extends Switch { - /** - * The cached model package - * - * - * @generated - */ - protected static FamiliesPackage modelPackage; - - /** - * Creates an instance of the switch. - * - * - * @generated - */ - public FamiliesSwitch() { - if (modelPackage == null) { - modelPackage = FamiliesPackage.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 FamiliesPackage.FAMILY_REGISTER: { - FamilyRegister familyRegister = (FamilyRegister)theEObject; - T result = caseFamilyRegister(familyRegister); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FamiliesPackage.FAMILY: { - Family family = (Family)theEObject; - T result = caseFamily(family); - if (result == null) result = defaultCase(theEObject); - return result; - } - case FamiliesPackage.MEMBER: { - Member member = (Member)theEObject; - T result = caseMember(member); - if (result == null) result = defaultCase(theEObject); - return result; - } - default: return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpreting the object as an instance of 'Family Register'. - * - * 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 'Family Register'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseFamilyRegister(FamilyRegister object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Family'. - * - * 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 'Family'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseFamily(Family object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Member'. - * - * 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 'Member'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseMember(Member 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; - } - -} //FamiliesSwitch diff --git a/bundles/edu.kit.ipd.sdq.metamodels.insurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/insurance/provider/InsuranceClientItemProvider.java b/bundles/edu.kit.ipd.sdq.metamodels.insurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/insurance/provider/InsuranceClientItemProvider.java deleted file mode 100644 index 435c416..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.insurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/insurance/provider/InsuranceClientItemProvider.java +++ /dev/null @@ -1,189 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.insurance.provider; - -import edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient; -import edu.kit.ipd.sdq.metamodels.insurance.InsurancePackage; - -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.insurance.InsuranceClient} object. - * - * - * @generated - */ -public class InsuranceClientItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, - IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * @generated - */ - public InsuranceClientItemProvider(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); - addGenderPropertyDescriptor(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_InsuranceClient_name_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_InsuranceClient_name_feature", - "_UI_InsuranceClient_type"), - InsurancePackage.Literals.INSURANCE_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_InsuranceClient_socialSecurityNumber_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_InsuranceClient_socialSecurityNumber_feature", - "_UI_InsuranceClient_type"), - InsurancePackage.Literals.INSURANCE_CLIENT__SOCIAL_SECURITY_NUMBER, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - - /** - * This adds a property descriptor for the Gender feature. - * - * - * @generated - */ - protected void addGenderPropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), - getResourceLocator(), getString("_UI_InsuranceClient_gender_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_InsuranceClient_gender_feature", - "_UI_InsuranceClient_type"), - InsurancePackage.Literals.INSURANCE_CLIENT__GENDER, true, false, false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, null, null)); - } - - /** - * This returns InsuranceClient.gif. - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/InsuranceClient")); - } - - /** - * - * - * @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 = ((InsuranceClient) object).getName(); - return label == null || label.length() == 0 ? getString("_UI_InsuranceClient_type") - : getString("_UI_InsuranceClient_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(InsuranceClient.class)) { - case InsurancePackage.INSURANCE_CLIENT__NAME: - case InsurancePackage.INSURANCE_CLIENT__SOCIAL_SECURITY_NUMBER: - case InsurancePackage.INSURANCE_CLIENT__GENDER: - 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 InsuranceEditPlugin.INSTANCE; - } - -} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.insurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/insurance/provider/InsuranceDatabaseItemProvider.java b/bundles/edu.kit.ipd.sdq.metamodels.insurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/insurance/provider/InsuranceDatabaseItemProvider.java deleted file mode 100644 index be389d4..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.insurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/insurance/provider/InsuranceDatabaseItemProvider.java +++ /dev/null @@ -1,168 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.insurance.provider; - -import edu.kit.ipd.sdq.metamodels.insurance.InsuranceDatabase; -import edu.kit.ipd.sdq.metamodels.insurance.InsuranceFactory; -import edu.kit.ipd.sdq.metamodels.insurance.InsurancePackage; - -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.insurance.InsuranceDatabase} object. - * - * - * @generated - */ -public class InsuranceDatabaseItemProvider extends ItemProviderAdapter implements IEditingDomainItemProvider, - IStructuredItemContentProvider, ITreeItemContentProvider, IItemLabelProvider, IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * @generated - */ - public InsuranceDatabaseItemProvider(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(InsurancePackage.Literals.INSURANCE_DATABASE__INSURANCECLIENT); - } - 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 InsuranceDatabase.gif. - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/InsuranceDatabase")); - } - - /** - * - * - * @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_InsuranceDatabase_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(InsuranceDatabase.class)) { - case InsurancePackage.INSURANCE_DATABASE__INSURANCECLIENT: - 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(InsurancePackage.Literals.INSURANCE_DATABASE__INSURANCECLIENT, - InsuranceFactory.eINSTANCE.createInsuranceClient())); - } - - /** - * Return the resource locator for this item provider's resources. - * - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return InsuranceEditPlugin.INSTANCE; - } - -} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.insurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/insurance/provider/InsuranceEditPlugin.java b/bundles/edu.kit.ipd.sdq.metamodels.insurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/insurance/provider/InsuranceEditPlugin.java deleted file mode 100644 index b8b9a92..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.insurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/insurance/provider/InsuranceEditPlugin.java +++ /dev/null @@ -1,87 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.insurance.provider; - -import org.eclipse.emf.common.EMFPlugin; - -import org.eclipse.emf.common.util.ResourceLocator; - -/** - * This is the central singleton for the Insurance edit plugin. - * - * - * @generated - */ -public final class InsuranceEditPlugin extends EMFPlugin { - /** - * Keep track of the singleton. - * - * - * @generated - */ - public static final InsuranceEditPlugin INSTANCE = new InsuranceEditPlugin(); - - /** - * Keep track of the singleton. - * - * - * @generated - */ - private static Implementation plugin; - - /** - * Create the instance. - * - * - * @generated - */ - public InsuranceEditPlugin() { - 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.insurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/insurance/provider/InsuranceItemProviderAdapterFactory.java b/bundles/edu.kit.ipd.sdq.metamodels.insurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/insurance/provider/InsuranceItemProviderAdapterFactory.java deleted file mode 100644 index 05d5624..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.insurance.edit/src-gen/edu/kit/ipd/sdq/metamodels/insurance/provider/InsuranceItemProviderAdapterFactory.java +++ /dev/null @@ -1,226 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.insurance.provider; - -import edu.kit.ipd.sdq.metamodels.insurance.util.InsuranceAdapterFactory; - -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 InsuranceItemProviderAdapterFactory extends InsuranceAdapterFactory - 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 InsuranceItemProviderAdapterFactory() { - 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.insurance.InsuranceDatabase} instances. - * - * - * @generated - */ - protected InsuranceDatabaseItemProvider insuranceDatabaseItemProvider; - - /** - * This creates an adapter for a {@link edu.kit.ipd.sdq.metamodels.insurance.InsuranceDatabase}. - * - * - * @generated - */ - @Override - public Adapter createInsuranceDatabaseAdapter() { - if (insuranceDatabaseItemProvider == null) { - insuranceDatabaseItemProvider = new InsuranceDatabaseItemProvider(this); - } - - return insuranceDatabaseItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient} instances. - * - * - * @generated - */ - protected InsuranceClientItemProvider insuranceClientItemProvider; - - /** - * This creates an adapter for a {@link edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient}. - * - * - * @generated - */ - @Override - public Adapter createInsuranceClientAdapter() { - if (insuranceClientItemProvider == null) { - insuranceClientItemProvider = new InsuranceClientItemProvider(this); - } - - return insuranceClientItemProvider; - } - - /** - * 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 (insuranceDatabaseItemProvider != null) - insuranceDatabaseItemProvider.dispose(); - if (insuranceClientItemProvider != null) - insuranceClientItemProvider.dispose(); - } - -} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.insurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/insurance/presentation/InsuranceActionBarContributor.java b/bundles/edu.kit.ipd.sdq.metamodels.insurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/insurance/presentation/InsuranceActionBarContributor.java deleted file mode 100644 index e856d49..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.insurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/insurance/presentation/InsuranceActionBarContributor.java +++ /dev/null @@ -1,423 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.insurance.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 Insurance model editor. - * - * - * @generated - */ -public class InsuranceActionBarContributor 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( - InsuranceEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { - @Override - public void run() { - try { - getPage().showView("org.eclipse.ui.views.PropertySheet"); - } catch (PartInitException exception) { - InsuranceEditorPlugin.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( - InsuranceEditorPlugin.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 InsuranceActionBarContributor() { - 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("insurance-settings")); - toolBarManager.add(new Separator("insurance-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( - InsuranceEditorPlugin.INSTANCE.getString("_UI_InsuranceEditor_menu"), - "edu.kit.ipd.sdq.metamodels.insuranceMenuID"); - 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(InsuranceEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - submenuManager.insertBefore("additions", createChildMenuManager); - - // Prepare for CreateSibling item addition or removal. - // - createSiblingMenuManager = new MenuManager( - InsuranceEditorPlugin.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(InsuranceEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - populateManager(submenuManager, createChildActions, null); - menuManager.insertBefore("edit", submenuManager); - - submenuManager = new MenuManager(InsuranceEditorPlugin.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.insurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/insurance/presentation/InsuranceEditor.java b/bundles/edu.kit.ipd.sdq.metamodels.insurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/insurance/presentation/InsuranceEditor.java deleted file mode 100644 index 0b3c98f..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.insurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/insurance/presentation/InsuranceEditor.java +++ /dev/null @@ -1,1777 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.insurance.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.insurance.provider.InsuranceItemProviderAdapterFactory; - -import org.eclipse.ui.actions.WorkspaceModifyOperation; - -/** - * This is an example of a Insurance model editor. - * - * - * @generated - */ -public class InsuranceEditor 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(InsuranceEditor.this); - - setCurrentViewer(contentOutlineViewer); - } - } else if (p instanceof PropertySheet) { - if (propertySheetPages.contains(((PropertySheet) p).getCurrentPage())) { - getActionBarContributor().setActiveEditor(InsuranceEditor.this); - handleActivate(); - } - } else if (p == InsuranceEditor.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(InsuranceEditor.this, false); - } - } - }); - } - - if (!visitor.getChangedResources().isEmpty()) { - getSite().getShell().getDisplay().asyncExec(new Runnable() { - public void run() { - changedResources.addAll(visitor.getChangedResources()); - if (getSite().getPage().getActiveEditor() == InsuranceEditor.this) { - handleActivate(); - } - } - }); - } - } catch (CoreException exception) { - InsuranceEditorPlugin.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(InsuranceEditor.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.insurance.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) { - InsuranceEditorPlugin.INSTANCE.log(exception); - } - } - - if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { - try { - markerHelper.updateMarkers(diagnostic); - } catch (CoreException exception) { - InsuranceEditorPlugin.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 InsuranceEditor() { - 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 InsuranceItemProviderAdapterFactory()); - 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.insurance.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.insurance.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(), InsuranceEditor.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(), InsuranceEditor.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(), InsuranceEditor.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(), InsuranceEditor.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(), InsuranceEditor.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(), InsuranceEditor.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) { - InsuranceEditor.this.setSelectionToViewer(selection); - InsuranceEditor.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. - // - InsuranceEditorPlugin.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 InsuranceEditorPlugin.INSTANCE.getString(key); - } - - /** - * This looks up a string in plugin.properties, making a substitution. - * - * - * @generated - */ - private static String getString(String key, Object s1) { - return InsuranceEditorPlugin.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.insurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/insurance/presentation/InsuranceEditorPlugin.java b/bundles/edu.kit.ipd.sdq.metamodels.insurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/insurance/presentation/InsuranceEditorPlugin.java deleted file mode 100644 index edd559d..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.insurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/insurance/presentation/InsuranceEditorPlugin.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.insurance.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 Insurance editor plugin. - * - * - * @generated - */ -public final class InsuranceEditorPlugin extends EMFPlugin { - /** - * Keep track of the singleton. - * - * - * @generated - */ - public static final InsuranceEditorPlugin INSTANCE = new InsuranceEditorPlugin(); - - /** - * Keep track of the singleton. - * - * - * @generated - */ - private static Implementation plugin; - - /** - * Create the instance. - * - * - * @generated - */ - public InsuranceEditorPlugin() { - 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.insurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/insurance/presentation/InsuranceModelWizard.java b/bundles/edu.kit.ipd.sdq.metamodels.insurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/insurance/presentation/InsuranceModelWizard.java deleted file mode 100644 index 363d84b..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.insurance.editor/src-gen/edu/kit/ipd/sdq/metamodels/insurance/presentation/InsuranceModelWizard.java +++ /dev/null @@ -1,625 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.insurance.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.insurance.InsuranceFactory; -import edu.kit.ipd.sdq.metamodels.insurance.InsurancePackage; -import edu.kit.ipd.sdq.metamodels.insurance.provider.InsuranceEditPlugin; - -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 InsuranceModelWizard extends Wizard implements INewWizard { - /** - * The supported extensions for created files. - * - * - * @generated - */ - public static final List FILE_EXTENSIONS = Collections.unmodifiableList(Arrays.asList( - InsuranceEditorPlugin.INSTANCE.getString("_UI_InsuranceEditorFilenameExtensions").split("\\s*,\\s*"))); - - /** - * A formatted list of supported file extensions, suitable for display. - * - * - * @generated - */ - public static final String FORMATTED_FILE_EXTENSIONS = InsuranceEditorPlugin.INSTANCE - .getString("_UI_InsuranceEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); - - /** - * This caches an instance of the model package. - * - * - * @generated - */ - protected InsurancePackage insurancePackage = InsurancePackage.eINSTANCE; - - /** - * This caches an instance of the model factory. - * - * - * @generated - */ - protected InsuranceFactory insuranceFactory = insurancePackage.getInsuranceFactory(); - - /** - * This is the file creation page. - * - * - * @generated - */ - protected InsuranceModelWizardNewFileCreationPage newFileCreationPage; - - /** - * This is the initial object creation page. - * - * - * @generated - */ - protected InsuranceModelWizardInitialObjectCreationPage 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(InsuranceEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); - setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE - .getImageDescriptor(InsuranceEditorPlugin.INSTANCE.getImage("full/wizban/NewInsurance"))); - } - - /** - * 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 : insurancePackage.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) insurancePackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); - EObject rootObject = insuranceFactory.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) { - InsuranceEditorPlugin.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(), - InsuranceEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); - return false; - } - - return true; - } catch (Exception exception) { - InsuranceEditorPlugin.INSTANCE.log(exception); - return false; - } - } - - /** - * This is the one page of the wizard. - * - * - * @generated - */ - public class InsuranceModelWizardNewFileCreationPage extends WizardNewFileCreationPage { - /** - * Pass in the selection. - * - * - * @generated - */ - public InsuranceModelWizardNewFileCreationPage(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( - InsuranceEditorPlugin.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 InsuranceModelWizardInitialObjectCreationPage extends WizardPage { - /** - * - * - * @generated - */ - protected Combo initialObjectField; - - /** - * @generated - * - * - */ - protected List encodings; - - /** - * - * - * @generated - */ - protected Combo encodingField; - - /** - * Pass in the selection. - * - * - * @generated - */ - public InsuranceModelWizardInitialObjectCreationPage(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(InsuranceEditorPlugin.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(InsuranceEditorPlugin.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 InsuranceEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); - } catch (MissingResourceException mre) { - InsuranceEditorPlugin.INSTANCE.log(mre); - } - return typeName; - } - - /** - * - * - * @generated - */ - protected Collection getEncodings() { - if (encodings == null) { - encodings = new ArrayList(); - for (StringTokenizer stringTokenizer = new StringTokenizer( - InsuranceEditorPlugin.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 InsuranceModelWizardNewFileCreationPage("Whatever", selection); - newFileCreationPage.setTitle(InsuranceEditorPlugin.INSTANCE.getString("_UI_InsuranceModelWizard_label")); - newFileCreationPage - .setDescription(InsuranceEditorPlugin.INSTANCE.getString("_UI_InsuranceModelWizard_description")); - newFileCreationPage - .setFileName(InsuranceEditorPlugin.INSTANCE.getString("_UI_InsuranceEditorFilenameDefaultBase") + "." - + 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 = InsuranceEditorPlugin.INSTANCE - .getString("_UI_InsuranceEditorFilenameDefaultBase"); - 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 InsuranceModelWizardInitialObjectCreationPage("Whatever2"); - initialObjectCreationPage.setTitle(InsuranceEditorPlugin.INSTANCE.getString("_UI_InsuranceModelWizard_label")); - initialObjectCreationPage - .setDescription(InsuranceEditorPlugin.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.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/Gender.java b/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/Gender.java deleted file mode 100644 index 9f6b785..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/Gender.java +++ /dev/null @@ -1,221 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.insurance; - -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 'Gender', - * and utility methods for working with them. - * - * @see edu.kit.ipd.sdq.metamodels.insurance.InsurancePackage#getGender() - * @model - * @generated - */ -public enum Gender 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 'Gender' enumerators. - * - * - * @generated - */ - private static final Gender[] VALUES_ARRAY = - new Gender[] - { - MALE, - FEMALE, - }; - - /** - * A public read-only list of all the 'Gender' enumerators. - * - * - * @generated - */ - public static final List VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); - - /** - * Returns the 'Gender' literal with the specified literal value. - * - * - * @param literal the literal. - * @return the matching enumerator or null. - * @generated - */ - public static Gender get(String literal) - { - for (int i = 0; i < VALUES_ARRAY.length; ++i) - { - Gender result = VALUES_ARRAY[i]; - if (result.toString().equals(literal)) - { - return result; - } - } - return null; - } - - /** - * Returns the 'Gender' literal with the specified name. - * - * - * @param name the name. - * @return the matching enumerator or null. - * @generated - */ - public static Gender getByName(String name) - { - for (int i = 0; i < VALUES_ARRAY.length; ++i) - { - Gender result = VALUES_ARRAY[i]; - if (result.getName().equals(name)) - { - return result; - } - } - return null; - } - - /** - * Returns the 'Gender' literal with the specified integer value. - * - * - * @param value the integer value. - * @return the matching enumerator or null. - * @generated - */ - public static Gender 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 Gender(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; - } - -} //Gender diff --git a/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/InsuranceClient.java b/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/InsuranceClient.java deleted file mode 100644 index d6100ec..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/InsuranceClient.java +++ /dev/null @@ -1,95 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.insurance; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Client'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient#getName Name}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient#getSocialSecurityNumber Social Security Number}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient#getGender Gender}
  • - *
- * - * @see edu.kit.ipd.sdq.metamodels.insurance.InsurancePackage#getInsuranceClient() - * @model - * @generated - */ -public interface InsuranceClient 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.insurance.InsurancePackage#getInsuranceClient_Name() - * @model - * @generated - */ - String getName(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient#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.insurance.InsurancePackage#getInsuranceClient_SocialSecurityNumber() - * @model - * @generated - */ - String getSocialSecurityNumber(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient#getSocialSecurityNumber Social Security Number}' attribute. - * - * - * @param value the new value of the 'Social Security Number' attribute. - * @see #getSocialSecurityNumber() - * @generated - */ - void setSocialSecurityNumber(String value); - - /** - * Returns the value of the 'Gender' attribute. - * The literals are from the enumeration {@link edu.kit.ipd.sdq.metamodels.insurance.Gender}. - * - * - * @return the value of the 'Gender' attribute. - * @see edu.kit.ipd.sdq.metamodels.insurance.Gender - * @see #setGender(Gender) - * @see edu.kit.ipd.sdq.metamodels.insurance.InsurancePackage#getInsuranceClient_Gender() - * @model - * @generated - */ - Gender getGender(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient#getGender Gender}' attribute. - * - * - * @param value the new value of the 'Gender' attribute. - * @see edu.kit.ipd.sdq.metamodels.insurance.Gender - * @see #getGender() - * @generated - */ - void setGender(Gender value); - -} // InsuranceClient diff --git a/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/InsuranceDatabase.java b/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/InsuranceDatabase.java deleted file mode 100644 index bdacde9..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/InsuranceDatabase.java +++ /dev/null @@ -1,38 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.insurance; - -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.insurance.InsuranceDatabase#getInsuranceclient Insuranceclient}
  • - *
- * - * @see edu.kit.ipd.sdq.metamodels.insurance.InsurancePackage#getInsuranceDatabase() - * @model - * @generated - */ -public interface InsuranceDatabase extends EObject { - /** - * Returns the value of the 'Insuranceclient' containment reference list. - * The list contents are of type {@link edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient}. - * - * - * @return the value of the 'Insuranceclient' containment reference list. - * @see edu.kit.ipd.sdq.metamodels.insurance.InsurancePackage#getInsuranceDatabase_Insuranceclient() - * @model containment="true" - * @generated - */ - EList getInsuranceclient(); - -} // InsuranceDatabase diff --git a/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/InsuranceFactory.java b/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/InsuranceFactory.java deleted file mode 100644 index 63869a0..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/InsuranceFactory.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.insurance; - -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.insurance.InsurancePackage - * @generated - */ -public interface InsuranceFactory extends EFactory { - /** - * The singleton instance of the factory. - * - * - * @generated - */ - InsuranceFactory eINSTANCE = edu.kit.ipd.sdq.metamodels.insurance.impl.InsuranceFactoryImpl.init(); - - /** - * Returns a new object of class 'Database'. - * - * - * @return a new object of class 'Database'. - * @generated - */ - InsuranceDatabase createInsuranceDatabase(); - - /** - * Returns a new object of class 'Client'. - * - * - * @return a new object of class 'Client'. - * @generated - */ - InsuranceClient createInsuranceClient(); - - /** - * Returns the package supported by this factory. - * - * - * @return the package supported by this factory. - * @generated - */ - InsurancePackage getInsurancePackage(); - -} //InsuranceFactory diff --git a/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/InsurancePackage.java b/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/InsurancePackage.java deleted file mode 100644 index 2cea801..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/InsurancePackage.java +++ /dev/null @@ -1,323 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.insurance; - -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.insurance.InsuranceFactory - * @model kind="package" - * @generated - */ -public interface InsurancePackage extends EPackage { - /** - * The package name. - * - * - * @generated - */ - String eNAME = "insurance"; - - /** - * The package namespace URI. - * - * - * @generated - */ - String eNS_URI = "edu.kit.ipd.sdq.metamodels.insurance"; - - /** - * The package namespace name. - * - * - * @generated - */ - String eNS_PREFIX = "insurance"; - - /** - * The singleton instance of the package. - * - * - * @generated - */ - InsurancePackage eINSTANCE = edu.kit.ipd.sdq.metamodels.insurance.impl.InsurancePackageImpl.init(); - - /** - * The meta object id for the '{@link edu.kit.ipd.sdq.metamodels.insurance.impl.InsuranceDatabaseImpl Database}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.insurance.impl.InsuranceDatabaseImpl - * @see edu.kit.ipd.sdq.metamodels.insurance.impl.InsurancePackageImpl#getInsuranceDatabase() - * @generated - */ - int INSURANCE_DATABASE = 0; - - /** - * The feature id for the 'Insuranceclient' containment reference list. - * - * - * @generated - * @ordered - */ - int INSURANCE_DATABASE__INSURANCECLIENT = 0; - - /** - * The number of structural features of the 'Database' class. - * - * - * @generated - * @ordered - */ - int INSURANCE_DATABASE_FEATURE_COUNT = 1; - - /** - * The number of operations of the 'Database' class. - * - * - * @generated - * @ordered - */ - int INSURANCE_DATABASE_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link edu.kit.ipd.sdq.metamodels.insurance.impl.InsuranceClientImpl Client}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.insurance.impl.InsuranceClientImpl - * @see edu.kit.ipd.sdq.metamodels.insurance.impl.InsurancePackageImpl#getInsuranceClient() - * @generated - */ - int INSURANCE_CLIENT = 1; - - /** - * The feature id for the 'Name' attribute. - * - * - * @generated - * @ordered - */ - int INSURANCE_CLIENT__NAME = 0; - - /** - * The feature id for the 'Social Security Number' attribute. - * - * - * @generated - * @ordered - */ - int INSURANCE_CLIENT__SOCIAL_SECURITY_NUMBER = 1; - - /** - * The feature id for the 'Gender' attribute. - * - * - * @generated - * @ordered - */ - int INSURANCE_CLIENT__GENDER = 2; - - /** - * The number of structural features of the 'Client' class. - * - * - * @generated - * @ordered - */ - int INSURANCE_CLIENT_FEATURE_COUNT = 3; - - /** - * The number of operations of the 'Client' class. - * - * - * @generated - * @ordered - */ - int INSURANCE_CLIENT_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link edu.kit.ipd.sdq.metamodels.insurance.Gender Gender}' enum. - * - * - * @see edu.kit.ipd.sdq.metamodels.insurance.Gender - * @see edu.kit.ipd.sdq.metamodels.insurance.impl.InsurancePackageImpl#getGender() - * @generated - */ - int GENDER = 2; - - /** - * Returns the meta object for class '{@link edu.kit.ipd.sdq.metamodels.insurance.InsuranceDatabase Database}'. - * - * - * @return the meta object for class 'Database'. - * @see edu.kit.ipd.sdq.metamodels.insurance.InsuranceDatabase - * @generated - */ - EClass getInsuranceDatabase(); - - /** - * Returns the meta object for the containment reference list '{@link edu.kit.ipd.sdq.metamodels.insurance.InsuranceDatabase#getInsuranceclient Insuranceclient}'. - * - * - * @return the meta object for the containment reference list 'Insuranceclient'. - * @see edu.kit.ipd.sdq.metamodels.insurance.InsuranceDatabase#getInsuranceclient() - * @see #getInsuranceDatabase() - * @generated - */ - EReference getInsuranceDatabase_Insuranceclient(); - - /** - * Returns the meta object for class '{@link edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient Client}'. - * - * - * @return the meta object for class 'Client'. - * @see edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient - * @generated - */ - EClass getInsuranceClient(); - - /** - * Returns the meta object for the attribute '{@link edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient#getName Name}'. - * - * - * @return the meta object for the attribute 'Name'. - * @see edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient#getName() - * @see #getInsuranceClient() - * @generated - */ - EAttribute getInsuranceClient_Name(); - - /** - * Returns the meta object for the attribute '{@link edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient#getSocialSecurityNumber Social Security Number}'. - * - * - * @return the meta object for the attribute 'Social Security Number'. - * @see edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient#getSocialSecurityNumber() - * @see #getInsuranceClient() - * @generated - */ - EAttribute getInsuranceClient_SocialSecurityNumber(); - - /** - * Returns the meta object for the attribute '{@link edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient#getGender Gender}'. - * - * - * @return the meta object for the attribute 'Gender'. - * @see edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient#getGender() - * @see #getInsuranceClient() - * @generated - */ - EAttribute getInsuranceClient_Gender(); - - /** - * Returns the meta object for enum '{@link edu.kit.ipd.sdq.metamodels.insurance.Gender Gender}'. - * - * - * @return the meta object for enum 'Gender'. - * @see edu.kit.ipd.sdq.metamodels.insurance.Gender - * @generated - */ - EEnum getGender(); - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - InsuranceFactory getInsuranceFactory(); - - /** - * - * 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.insurance.impl.InsuranceDatabaseImpl Database}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.insurance.impl.InsuranceDatabaseImpl - * @see edu.kit.ipd.sdq.metamodels.insurance.impl.InsurancePackageImpl#getInsuranceDatabase() - * @generated - */ - EClass INSURANCE_DATABASE = eINSTANCE.getInsuranceDatabase(); - - /** - * The meta object literal for the 'Insuranceclient' containment reference list feature. - * - * - * @generated - */ - EReference INSURANCE_DATABASE__INSURANCECLIENT = eINSTANCE.getInsuranceDatabase_Insuranceclient(); - - /** - * The meta object literal for the '{@link edu.kit.ipd.sdq.metamodels.insurance.impl.InsuranceClientImpl Client}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.insurance.impl.InsuranceClientImpl - * @see edu.kit.ipd.sdq.metamodels.insurance.impl.InsurancePackageImpl#getInsuranceClient() - * @generated - */ - EClass INSURANCE_CLIENT = eINSTANCE.getInsuranceClient(); - - /** - * The meta object literal for the 'Name' attribute feature. - * - * - * @generated - */ - EAttribute INSURANCE_CLIENT__NAME = eINSTANCE.getInsuranceClient_Name(); - - /** - * The meta object literal for the 'Social Security Number' attribute feature. - * - * - * @generated - */ - EAttribute INSURANCE_CLIENT__SOCIAL_SECURITY_NUMBER = eINSTANCE.getInsuranceClient_SocialSecurityNumber(); - - /** - * The meta object literal for the 'Gender' attribute feature. - * - * - * @generated - */ - EAttribute INSURANCE_CLIENT__GENDER = eINSTANCE.getInsuranceClient_Gender(); - - /** - * The meta object literal for the '{@link edu.kit.ipd.sdq.metamodels.insurance.Gender Gender}' enum. - * - * - * @see edu.kit.ipd.sdq.metamodels.insurance.Gender - * @see edu.kit.ipd.sdq.metamodels.insurance.impl.InsurancePackageImpl#getGender() - * @generated - */ - EEnum GENDER = eINSTANCE.getGender(); - - } - -} //InsurancePackage diff --git a/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/impl/InsuranceClientImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/impl/InsuranceClientImpl.java deleted file mode 100644 index 321e196..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/impl/InsuranceClientImpl.java +++ /dev/null @@ -1,278 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.insurance.impl; - -import edu.kit.ipd.sdq.metamodels.insurance.Gender; -import edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient; -import edu.kit.ipd.sdq.metamodels.insurance.InsurancePackage; - -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.insurance.impl.InsuranceClientImpl#getName Name}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.insurance.impl.InsuranceClientImpl#getSocialSecurityNumber Social Security Number}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.insurance.impl.InsuranceClientImpl#getGender Gender}
  • - *
- * - * @generated - */ -public class InsuranceClientImpl extends MinimalEObjectImpl.Container implements InsuranceClient { - /** - * 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; - - /** - * The default value of the '{@link #getGender() Gender}' attribute. - * - * - * @see #getGender() - * @generated - * @ordered - */ - protected static final Gender GENDER_EDEFAULT = Gender.MALE; - - /** - * The cached value of the '{@link #getGender() Gender}' attribute. - * - * - * @see #getGender() - * @generated - * @ordered - */ - protected Gender gender = GENDER_EDEFAULT; - - /** - * - * - * @generated - */ - protected InsuranceClientImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return InsurancePackage.Literals.INSURANCE_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, InsurancePackage.INSURANCE_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, - InsurancePackage.INSURANCE_CLIENT__SOCIAL_SECURITY_NUMBER, oldSocialSecurityNumber, - socialSecurityNumber)); - } - - /** - * - * - * @generated - */ - public Gender getGender() { - return gender; - } - - /** - * - * - * @generated - */ - public void setGender(Gender newGender) { - Gender oldGender = gender; - gender = newGender == null ? GENDER_EDEFAULT : newGender; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, InsurancePackage.INSURANCE_CLIENT__GENDER, oldGender, - gender)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case InsurancePackage.INSURANCE_CLIENT__NAME: - return getName(); - case InsurancePackage.INSURANCE_CLIENT__SOCIAL_SECURITY_NUMBER: - return getSocialSecurityNumber(); - case InsurancePackage.INSURANCE_CLIENT__GENDER: - return getGender(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case InsurancePackage.INSURANCE_CLIENT__NAME: - setName((String) newValue); - return; - case InsurancePackage.INSURANCE_CLIENT__SOCIAL_SECURITY_NUMBER: - setSocialSecurityNumber((String) newValue); - return; - case InsurancePackage.INSURANCE_CLIENT__GENDER: - setGender((Gender) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case InsurancePackage.INSURANCE_CLIENT__NAME: - setName(NAME_EDEFAULT); - return; - case InsurancePackage.INSURANCE_CLIENT__SOCIAL_SECURITY_NUMBER: - setSocialSecurityNumber(SOCIAL_SECURITY_NUMBER_EDEFAULT); - return; - case InsurancePackage.INSURANCE_CLIENT__GENDER: - setGender(GENDER_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case InsurancePackage.INSURANCE_CLIENT__NAME: - return NAME_EDEFAULT == null ? name != null : !NAME_EDEFAULT.equals(name); - case InsurancePackage.INSURANCE_CLIENT__SOCIAL_SECURITY_NUMBER: - return SOCIAL_SECURITY_NUMBER_EDEFAULT == null ? socialSecurityNumber != null - : !SOCIAL_SECURITY_NUMBER_EDEFAULT.equals(socialSecurityNumber); - case InsurancePackage.INSURANCE_CLIENT__GENDER: - return gender != GENDER_EDEFAULT; - } - 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(", gender: "); - result.append(gender); - result.append(')'); - return result.toString(); - } - -} //InsuranceClientImpl diff --git a/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/impl/InsuranceDatabaseImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/impl/InsuranceDatabaseImpl.java deleted file mode 100644 index 8e967f0..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/impl/InsuranceDatabaseImpl.java +++ /dev/null @@ -1,153 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.insurance.impl; - -import edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient; -import edu.kit.ipd.sdq.metamodels.insurance.InsuranceDatabase; -import edu.kit.ipd.sdq.metamodels.insurance.InsurancePackage; - -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.insurance.impl.InsuranceDatabaseImpl#getInsuranceclient Insuranceclient}
  • - *
- * - * @generated - */ -public class InsuranceDatabaseImpl extends MinimalEObjectImpl.Container implements InsuranceDatabase { - /** - * The cached value of the '{@link #getInsuranceclient() Insuranceclient}' containment reference list. - * - * - * @see #getInsuranceclient() - * @generated - * @ordered - */ - protected EList insuranceclient; - - /** - * - * - * @generated - */ - protected InsuranceDatabaseImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return InsurancePackage.Literals.INSURANCE_DATABASE; - } - - /** - * - * - * @generated - */ - public EList getInsuranceclient() { - if (insuranceclient == null) { - insuranceclient = new EObjectContainmentEList(InsuranceClient.class, this, - InsurancePackage.INSURANCE_DATABASE__INSURANCECLIENT); - } - return insuranceclient; - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case InsurancePackage.INSURANCE_DATABASE__INSURANCECLIENT: - return ((InternalEList) getInsuranceclient()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case InsurancePackage.INSURANCE_DATABASE__INSURANCECLIENT: - return getInsuranceclient(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case InsurancePackage.INSURANCE_DATABASE__INSURANCECLIENT: - getInsuranceclient().clear(); - getInsuranceclient().addAll((Collection) newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case InsurancePackage.INSURANCE_DATABASE__INSURANCECLIENT: - getInsuranceclient().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case InsurancePackage.INSURANCE_DATABASE__INSURANCECLIENT: - return insuranceclient != null && !insuranceclient.isEmpty(); - } - return super.eIsSet(featureID); - } - -} //InsuranceDatabaseImpl diff --git a/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/impl/InsuranceFactoryImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/impl/InsuranceFactoryImpl.java deleted file mode 100644 index 67d6773..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/impl/InsuranceFactoryImpl.java +++ /dev/null @@ -1,161 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.insurance.impl; - -import edu.kit.ipd.sdq.metamodels.insurance.*; - -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 InsuranceFactoryImpl extends EFactoryImpl implements InsuranceFactory { - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static InsuranceFactory init() { - try { - InsuranceFactory theInsuranceFactory = (InsuranceFactory) EPackage.Registry.INSTANCE - .getEFactory(InsurancePackage.eNS_URI); - if (theInsuranceFactory != null) { - return theInsuranceFactory; - } - } catch (Exception exception) { - EcorePlugin.INSTANCE.log(exception); - } - return new InsuranceFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public InsuranceFactoryImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - public EObject create(EClass eClass) { - switch (eClass.getClassifierID()) { - case InsurancePackage.INSURANCE_DATABASE: - return createInsuranceDatabase(); - case InsurancePackage.INSURANCE_CLIENT: - return createInsuranceClient(); - 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 InsurancePackage.GENDER: - return createGenderFromString(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 InsurancePackage.GENDER: - return convertGenderToString(eDataType, instanceValue); - default: - throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - public InsuranceDatabase createInsuranceDatabase() { - InsuranceDatabaseImpl insuranceDatabase = new InsuranceDatabaseImpl(); - return insuranceDatabase; - } - - /** - * - * - * @generated - */ - public InsuranceClient createInsuranceClient() { - InsuranceClientImpl insuranceClient = new InsuranceClientImpl(); - return insuranceClient; - } - - /** - * - * - * @generated - */ - public Gender createGenderFromString(EDataType eDataType, String initialValue) { - Gender result = Gender.get(initialValue); - if (result == null) - throw new IllegalArgumentException( - "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); - return result; - } - - /** - * - * - * @generated - */ - public String convertGenderToString(EDataType eDataType, Object instanceValue) { - return instanceValue == null ? null : instanceValue.toString(); - } - - /** - * - * - * @generated - */ - public InsurancePackage getInsurancePackage() { - return (InsurancePackage) getEPackage(); - } - - /** - * - * - * @deprecated - * @generated - */ - @Deprecated - public static InsurancePackage getPackage() { - return InsurancePackage.eINSTANCE; - } - -} //InsuranceFactoryImpl diff --git a/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/impl/InsurancePackageImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/impl/InsurancePackageImpl.java deleted file mode 100644 index 5726eee..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/impl/InsurancePackageImpl.java +++ /dev/null @@ -1,271 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.insurance.impl; - -import edu.kit.ipd.sdq.metamodels.insurance.Gender; -import edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient; -import edu.kit.ipd.sdq.metamodels.insurance.InsuranceDatabase; -import edu.kit.ipd.sdq.metamodels.insurance.InsuranceFactory; -import edu.kit.ipd.sdq.metamodels.insurance.InsurancePackage; - -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 InsurancePackageImpl extends EPackageImpl implements InsurancePackage { - /** - * - * - * @generated - */ - private EClass insuranceDatabaseEClass = null; - - /** - * - * - * @generated - */ - private EClass insuranceClientEClass = null; - - /** - * - * - * @generated - */ - private EEnum genderEEnum = 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.insurance.InsurancePackage#eNS_URI - * @see #init() - * @generated - */ - private InsurancePackageImpl() { - super(eNS_URI, InsuranceFactory.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 InsurancePackage#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 InsurancePackage init() { - if (isInited) - return (InsurancePackage) EPackage.Registry.INSTANCE.getEPackage(InsurancePackage.eNS_URI); - - // Obtain or create and register package - Object registeredInsurancePackage = EPackage.Registry.INSTANCE.get(eNS_URI); - InsurancePackageImpl theInsurancePackage = registeredInsurancePackage instanceof InsurancePackageImpl - ? (InsurancePackageImpl) registeredInsurancePackage - : new InsurancePackageImpl(); - - isInited = true; - - // Create package meta-data objects - theInsurancePackage.createPackageContents(); - - // Initialize created meta-data - theInsurancePackage.initializePackageContents(); - - // Mark meta-data to indicate it can't be changed - theInsurancePackage.freeze(); - - // Update the registry and return the package - EPackage.Registry.INSTANCE.put(InsurancePackage.eNS_URI, theInsurancePackage); - return theInsurancePackage; - } - - /** - * - * - * @generated - */ - public EClass getInsuranceDatabase() { - return insuranceDatabaseEClass; - } - - /** - * - * - * @generated - */ - public EReference getInsuranceDatabase_Insuranceclient() { - return (EReference) insuranceDatabaseEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EClass getInsuranceClient() { - return insuranceClientEClass; - } - - /** - * - * - * @generated - */ - public EAttribute getInsuranceClient_Name() { - return (EAttribute) insuranceClientEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - public EAttribute getInsuranceClient_SocialSecurityNumber() { - return (EAttribute) insuranceClientEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - public EAttribute getInsuranceClient_Gender() { - return (EAttribute) insuranceClientEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - public EEnum getGender() { - return genderEEnum; - } - - /** - * - * - * @generated - */ - public InsuranceFactory getInsuranceFactory() { - return (InsuranceFactory) 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 - insuranceDatabaseEClass = createEClass(INSURANCE_DATABASE); - createEReference(insuranceDatabaseEClass, INSURANCE_DATABASE__INSURANCECLIENT); - - insuranceClientEClass = createEClass(INSURANCE_CLIENT); - createEAttribute(insuranceClientEClass, INSURANCE_CLIENT__NAME); - createEAttribute(insuranceClientEClass, INSURANCE_CLIENT__SOCIAL_SECURITY_NUMBER); - createEAttribute(insuranceClientEClass, INSURANCE_CLIENT__GENDER); - - // Create enums - genderEEnum = createEEnum(GENDER); - } - - /** - * - * - * @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(insuranceDatabaseEClass, InsuranceDatabase.class, "InsuranceDatabase", !IS_ABSTRACT, !IS_INTERFACE, - IS_GENERATED_INSTANCE_CLASS); - initEReference(getInsuranceDatabase_Insuranceclient(), this.getInsuranceClient(), null, "insuranceclient", null, - 0, -1, InsuranceDatabase.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, - !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(insuranceClientEClass, InsuranceClient.class, "InsuranceClient", !IS_ABSTRACT, !IS_INTERFACE, - IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getInsuranceClient_Name(), ecorePackage.getEString(), "name", null, 0, 1, InsuranceClient.class, - !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getInsuranceClient_SocialSecurityNumber(), ecorePackage.getEString(), "socialSecurityNumber", - null, 0, 1, InsuranceClient.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, - IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getInsuranceClient_Gender(), this.getGender(), "gender", null, 0, 1, InsuranceClient.class, - !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - // Initialize enums and add enum literals - initEEnum(genderEEnum, Gender.class, "Gender"); - addEEnumLiteral(genderEEnum, Gender.MALE); - addEEnumLiteral(genderEEnum, Gender.FEMALE); - - // Create resource - createResource(eNS_URI); - } - -} //InsurancePackageImpl diff --git a/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/util/InsuranceAdapterFactory.java b/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/util/InsuranceAdapterFactory.java deleted file mode 100644 index 9b86bf6..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/util/InsuranceAdapterFactory.java +++ /dev/null @@ -1,138 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.insurance.util; - -import edu.kit.ipd.sdq.metamodels.insurance.*; - -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.insurance.InsurancePackage - * @generated - */ -public class InsuranceAdapterFactory extends AdapterFactoryImpl { - /** - * The cached model package. - * - * - * @generated - */ - protected static InsurancePackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * - * - * @generated - */ - public InsuranceAdapterFactory() { - if (modelPackage == null) { - modelPackage = InsurancePackage.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 InsuranceSwitch modelSwitch = new InsuranceSwitch() { - @Override - public Adapter caseInsuranceDatabase(InsuranceDatabase object) { - return createInsuranceDatabaseAdapter(); - } - - @Override - public Adapter caseInsuranceClient(InsuranceClient object) { - return createInsuranceClientAdapter(); - } - - @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.insurance.InsuranceDatabase 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.insurance.InsuranceDatabase - * @generated - */ - public Adapter createInsuranceDatabaseAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link edu.kit.ipd.sdq.metamodels.insurance.InsuranceClient 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.insurance.InsuranceClient - * @generated - */ - public Adapter createInsuranceClientAdapter() { - 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; - } - -} //InsuranceAdapterFactory diff --git a/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/util/InsuranceSwitch.java b/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/util/InsuranceSwitch.java deleted file mode 100644 index 1beb708..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.insurance/src-gen/edu/kit/ipd/sdq/metamodels/insurance/util/InsuranceSwitch.java +++ /dev/null @@ -1,134 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.insurance.util; - -import edu.kit.ipd.sdq.metamodels.insurance.*; - -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.insurance.InsurancePackage - * @generated - */ -public class InsuranceSwitch extends Switch { - /** - * The cached model package - * - * - * @generated - */ - protected static InsurancePackage modelPackage; - - /** - * Creates an instance of the switch. - * - * - * @generated - */ - public InsuranceSwitch() { - if (modelPackage == null) { - modelPackage = InsurancePackage.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 InsurancePackage.INSURANCE_DATABASE: { - InsuranceDatabase insuranceDatabase = (InsuranceDatabase) theEObject; - T result = caseInsuranceDatabase(insuranceDatabase); - if (result == null) - result = defaultCase(theEObject); - return result; - } - case InsurancePackage.INSURANCE_CLIENT: { - InsuranceClient insuranceClient = (InsuranceClient) theEObject; - T result = caseInsuranceClient(insuranceClient); - 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 caseInsuranceDatabase(InsuranceDatabase 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 caseInsuranceClient(InsuranceClient 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; - } - -} //InsuranceSwitch diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/.classpath b/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/.classpath index 555c5b6..19e7b34 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/.classpath +++ b/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/.classpath @@ -1,6 +1,6 @@ - + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/build.properties b/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/build.properties index 3a5d565..7d1cb86 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/build.properties +++ b/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/build.properties @@ -6,5 +6,5 @@ bin.includes = .,\ plugin.xml,\ plugin.properties jars.compile.order = . -source.. = src/ +source.. = src-gen/ output.. = target/classes/ diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/src/edu/kit/ipd/sdq/metamodels/persons/provider/FemaleItemProvider.java b/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/src/edu/kit/ipd/sdq/metamodels/persons/provider/FemaleItemProvider.java deleted file mode 100644 index 435bd4c..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/src/edu/kit/ipd/sdq/metamodels/persons/provider/FemaleItemProvider.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons.provider; - - -import edu.kit.ipd.sdq.metamodels.persons.Female; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; - -/** - * This is the item provider adapter for a {@link edu.kit.ipd.sdq.metamodels.persons.Female} object. - * - * - * @generated - */ -public class FemaleItemProvider extends PersonItemProvider { - /** - * This constructs an instance from a factory and a notifier. - * - * - * @generated - */ - public FemaleItemProvider(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 returns Female.gif. - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/Female")); - } - - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((Female)object).getFullName(); - return label == null || label.length() == 0 ? - getString("_UI_Female_type") : - getString("_UI_Female_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); - 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); - } - -} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/src/edu/kit/ipd/sdq/metamodels/persons/provider/MaleItemProvider.java b/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/src/edu/kit/ipd/sdq/metamodels/persons/provider/MaleItemProvider.java deleted file mode 100644 index f97e509..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/src/edu/kit/ipd/sdq/metamodels/persons/provider/MaleItemProvider.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons.provider; - - -import edu.kit.ipd.sdq.metamodels.persons.Male; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; - -/** - * This is the item provider adapter for a {@link edu.kit.ipd.sdq.metamodels.persons.Male} object. - * - * - * @generated - */ -public class MaleItemProvider extends PersonItemProvider { - /** - * This constructs an instance from a factory and a notifier. - * - * - * @generated - */ - public MaleItemProvider(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 returns Male.gif. - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/Male")); - } - - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((Male)object).getFullName(); - return label == null || label.length() == 0 ? - getString("_UI_Male_type") : - getString("_UI_Male_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); - 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); - } - -} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/src/edu/kit/ipd/sdq/metamodels/persons/provider/PersonItemProvider.java b/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/src/edu/kit/ipd/sdq/metamodels/persons/provider/PersonItemProvider.java deleted file mode 100644 index a8f35c7..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/src/edu/kit/ipd/sdq/metamodels/persons/provider/PersonItemProvider.java +++ /dev/null @@ -1,182 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons.provider; - - -import edu.kit.ipd.sdq.metamodels.persons.Person; -import edu.kit.ipd.sdq.metamodels.persons.PersonsPackage; - -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.persons.Person} object. - * - * - * @generated - */ -public class PersonItemProvider - extends ItemProviderAdapter - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * @generated - */ - public PersonItemProvider(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); - - addFullNamePropertyDescriptor(object); - addBirthdayPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Full Name feature. - * - * - * @generated - */ - protected void addFullNamePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_Person_fullName_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_Person_fullName_feature", "_UI_Person_type"), - PersonsPackage.Literals.PERSON__FULL_NAME, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Birthday feature. - * - * - * @generated - */ - protected void addBirthdayPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_Person_birthday_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_Person_birthday_feature", "_UI_Person_type"), - PersonsPackage.Literals.PERSON__BIRTHDAY, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This returns Person.gif. - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/Person")); - } - - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((Person)object).getFullName(); - return label == null || label.length() == 0 ? - getString("_UI_Person_type") : - getString("_UI_Person_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(Person.class)) { - case PersonsPackage.PERSON__FULL_NAME: - case PersonsPackage.PERSON__BIRTHDAY: - 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 PersonsEditPlugin.INSTANCE; - } - -} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/src/edu/kit/ipd/sdq/metamodels/persons/provider/PersonRegisterItemProvider.java b/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/src/edu/kit/ipd/sdq/metamodels/persons/provider/PersonRegisterItemProvider.java deleted file mode 100644 index 26aac70..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/src/edu/kit/ipd/sdq/metamodels/persons/provider/PersonRegisterItemProvider.java +++ /dev/null @@ -1,204 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons.provider; - - -import edu.kit.ipd.sdq.metamodels.persons.PersonRegister; -import edu.kit.ipd.sdq.metamodels.persons.PersonsFactory; -import edu.kit.ipd.sdq.metamodels.persons.PersonsPackage; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.common.util.ResourceLocator; - -import org.eclipse.emf.ecore.EStructuralFeature; - -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IEditingDomainItemProvider; -import org.eclipse.emf.edit.provider.IItemLabelProvider; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.IItemPropertySource; -import org.eclipse.emf.edit.provider.IStructuredItemContentProvider; -import org.eclipse.emf.edit.provider.ITreeItemContentProvider; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemProviderAdapter; -import org.eclipse.emf.edit.provider.ViewerNotification; - -/** - * This is the item provider adapter for a {@link edu.kit.ipd.sdq.metamodels.persons.PersonRegister} object. - * - * - * @generated - */ -public class PersonRegisterItemProvider - extends ItemProviderAdapter - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * @generated - */ - public PersonRegisterItemProvider(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); - - addIdPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Id feature. - * - * - * @generated - */ - protected void addIdPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_PersonRegister_id_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_PersonRegister_id_feature", "_UI_PersonRegister_type"), - PersonsPackage.Literals.PERSON_REGISTER__ID, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an - * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. - * - * - * @generated - */ - @Override - public Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(PersonsPackage.Literals.PERSON_REGISTER__PERSONS); - } - 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 PersonRegister.gif. - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/PersonRegister")); - } - - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((PersonRegister)object).getId(); - return label == null || label.length() == 0 ? - getString("_UI_PersonRegister_type") : - getString("_UI_PersonRegister_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(PersonRegister.class)) { - case PersonsPackage.PERSON_REGISTER__ID: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - case PersonsPackage.PERSON_REGISTER__PERSONS: - 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 - (PersonsPackage.Literals.PERSON_REGISTER__PERSONS, - PersonsFactory.eINSTANCE.createMale())); - - newChildDescriptors.add - (createChildParameter - (PersonsPackage.Literals.PERSON_REGISTER__PERSONS, - PersonsFactory.eINSTANCE.createFemale())); - } - - /** - * Return the resource locator for this item provider's resources. - * - * - * @generated - */ - @Override - public ResourceLocator getResourceLocator() { - return PersonsEditPlugin.INSTANCE; - } - -} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/src/edu/kit/ipd/sdq/metamodels/persons/provider/PersonsEditPlugin.java b/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/src/edu/kit/ipd/sdq/metamodels/persons/provider/PersonsEditPlugin.java deleted file mode 100644 index db9de01..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/src/edu/kit/ipd/sdq/metamodels/persons/provider/PersonsEditPlugin.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons.provider; - -import org.eclipse.emf.common.EMFPlugin; - -import org.eclipse.emf.common.util.ResourceLocator; - -/** - * This is the central singleton for the Persons edit plugin. - * - * - * @generated - */ -public final class PersonsEditPlugin extends EMFPlugin { - /** - * Keep track of the singleton. - * - * - * @generated - */ - public static final PersonsEditPlugin INSTANCE = new PersonsEditPlugin(); - - /** - * Keep track of the singleton. - * - * - * @generated - */ - private static Implementation plugin; - - /** - * Create the instance. - * - * - * @generated - */ - public PersonsEditPlugin() { - 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.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 deleted file mode 100644 index 698e6d3..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons.edit/src/edu/kit/ipd/sdq/metamodels/persons/provider/PersonsItemProviderAdapterFactory.java +++ /dev/null @@ -1,253 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons.provider; - -import edu.kit.ipd.sdq.metamodels.persons.util.PersonsAdapterFactory; - -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 PersonsItemProviderAdapterFactory extends PersonsAdapterFactory 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 PersonsItemProviderAdapterFactory() { - 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.persons.PersonRegister} instances. - * - * - * @generated - */ - protected PersonRegisterItemProvider personRegisterItemProvider; - - /** - * This creates an adapter for a {@link edu.kit.ipd.sdq.metamodels.persons.PersonRegister}. - * - * - * @generated - */ - @Override - public Adapter createPersonRegisterAdapter() { - if (personRegisterItemProvider == null) { - personRegisterItemProvider = new PersonRegisterItemProvider(this); - } - - return personRegisterItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link edu.kit.ipd.sdq.metamodels.persons.Male} instances. - * - * - * @generated - */ - protected MaleItemProvider maleItemProvider; - - /** - * This creates an adapter for a {@link edu.kit.ipd.sdq.metamodels.persons.Male}. - * - * - * @generated - */ - @Override - public Adapter createMaleAdapter() { - if (maleItemProvider == null) { - maleItemProvider = new MaleItemProvider(this); - } - - return maleItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link edu.kit.ipd.sdq.metamodels.persons.Female} instances. - * - * - * @generated - */ - protected FemaleItemProvider femaleItemProvider; - - /** - * This creates an adapter for a {@link edu.kit.ipd.sdq.metamodels.persons.Female}. - * - * - * @generated - */ - @Override - public Adapter createFemaleAdapter() { - if (femaleItemProvider == null) { - femaleItemProvider = new FemaleItemProvider(this); - } - - return femaleItemProvider; - } - - /** - * This returns the root adapter factory that contains this factory. - * - * - * @generated - */ - @Override - public ComposeableAdapterFactory getRootAdapterFactory() { - return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); - } - - /** - * This sets the composed adapter factory that contains this factory. - * - * - * @generated - */ - @Override - 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 - */ - @Override - public void addListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.addListener(notifyChangedListener); - } - - /** - * This removes a listener. - * - * - * @generated - */ - @Override - public void removeListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.removeListener(notifyChangedListener); - } - - /** - * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. - * - * - * @generated - */ - @Override - 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 - */ - @Override - public void dispose() { - if (personRegisterItemProvider != null) personRegisterItemProvider.dispose(); - if (maleItemProvider != null) maleItemProvider.dispose(); - if (femaleItemProvider != null) femaleItemProvider.dispose(); - } - -} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/.classpath b/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/.classpath index 555c5b6..19e7b34 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/.classpath +++ b/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/.classpath @@ -1,6 +1,6 @@ - + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/build.properties b/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/build.properties index 3a5d565..7d1cb86 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/build.properties +++ b/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/build.properties @@ -6,5 +6,5 @@ bin.includes = .,\ plugin.xml,\ plugin.properties jars.compile.order = . -source.. = src/ +source.. = src-gen/ output.. = target/classes/ 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 deleted file mode 100644 index f7aa068..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/src/edu/kit/ipd/sdq/metamodels/persons/presentation/PersonsActionBarContributor.java +++ /dev/null @@ -1,426 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons.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 Persons model editor. - * - * - * @generated - */ -public class PersonsActionBarContributor - 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(PersonsEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { - @Override - public void run() { - try { - getPage().showView("org.eclipse.ui.views.PropertySheet"); - } - catch (PartInitException exception) { - PersonsEditorPlugin.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(PersonsEditorPlugin.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 PersonsActionBarContributor() { - 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("persons-settings")); - toolBarManager.add(new Separator("persons-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(PersonsEditorPlugin.INSTANCE.getString("_UI_PersonsEditor_menu"), "edu.kit.ipd.sdq.metamodels.personsMenuID"); - 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(PersonsEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - submenuManager.insertBefore("additions", createChildMenuManager); - - // Prepare for CreateSibling item addition or removal. - // - createSiblingMenuManager = new MenuManager(PersonsEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); - submenuManager.insertBefore("additions", createSiblingMenuManager); - - // Force an update because Eclipse hides empty menus now. - // - submenuManager.addMenuListener - (new IMenuListener() { - @Override - 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 - */ - @Override - 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(PersonsEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - populateManager(submenuManager, createChildActions, null); - menuManager.insertBefore("edit", submenuManager); - - submenuManager = new MenuManager(PersonsEditorPlugin.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.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 deleted file mode 100644 index bf558b0..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/src/edu/kit/ipd/sdq/metamodels/persons/presentation/PersonsEditor.java +++ /dev/null @@ -1,1848 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons.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.persons.provider.PersonsItemProviderAdapterFactory; - -import org.eclipse.ui.actions.WorkspaceModifyOperation; - - -/** - * This is an example of a Persons model editor. - * - * - * @generated - */ -public class PersonsEditor - 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() { - @Override - public void partActivated(IWorkbenchPart p) { - if (p instanceof ContentOutline) { - if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { - getActionBarContributor().setActiveEditor(PersonsEditor.this); - - setCurrentViewer(contentOutlineViewer); - } - } - else if (p instanceof PropertySheet) { - if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { - getActionBarContributor().setActiveEditor(PersonsEditor.this); - handleActivate(); - } - } - 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. - } - }; - - /** - * 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() { - @Override - 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() { - @Override - 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(); - - @Override - 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() { - @Override - public void run() { - removedResources.addAll(visitor.getRemovedResources()); - if (!isDirty()) { - getSite().getPage().closeEditor(PersonsEditor.this, false); - } - } - }); - } - - if (!visitor.getChangedResources().isEmpty()) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - changedResources.addAll(visitor.getChangedResources()); - if (getSite().getPage().getActiveEditor() == PersonsEditor.this) { - handleActivate(); - } - } - }); - } - } - catch (CoreException exception) { - PersonsEditorPlugin.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(PersonsEditor.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.persons.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) { - PersonsEditorPlugin.INSTANCE.log(exception); - } - } - - if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { - try { - markerHelper.updateMarkers(diagnostic); - } - catch (CoreException exception) { - PersonsEditorPlugin.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 PersonsEditor() { - 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 PersonsItemProviderAdapterFactory()); - 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() { - @Override - public void commandStackChanged(final EventObject event) { - getContainer().getDisplay().asyncExec - (new Runnable() { - @Override - 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() { - @Override - 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 - */ - @Override - 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. - // - @Override - 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 - */ - @Override - 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.persons.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.persons.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(), PersonsEditor.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(), PersonsEditor.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(), PersonsEditor.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(), PersonsEditor.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(), PersonsEditor.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(), PersonsEditor.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() { - @Override - 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() { - @Override - 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. - // - @Override - 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) { - PersonsEditor.this.setSelectionToViewer(selection); - PersonsEditor.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. - // - PersonsEditorPlugin.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 - */ - @Override - 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 - */ - @Override - public void addSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.add(listener); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. - * - * - * @generated - */ - @Override - public void removeSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.remove(listener); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection. - * - * - * @generated - */ - @Override - 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 - */ - @Override - 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 PersonsEditorPlugin.INSTANCE.getString(key); - } - - /** - * This looks up a string in plugin.properties, making a substitution. - * - * - * @generated - */ - private static String getString(String key, Object s1) { - return PersonsEditorPlugin.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 - */ - @Override - 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.persons.editor/src/edu/kit/ipd/sdq/metamodels/persons/presentation/PersonsEditorPlugin.java b/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/src/edu/kit/ipd/sdq/metamodels/persons/presentation/PersonsEditorPlugin.java deleted file mode 100644 index c5c0713..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/src/edu/kit/ipd/sdq/metamodels/persons/presentation/PersonsEditorPlugin.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons.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 Persons editor plugin. - * - * - * @generated - */ -public final class PersonsEditorPlugin extends EMFPlugin { - /** - * Keep track of the singleton. - * - * - * @generated - */ - public static final PersonsEditorPlugin INSTANCE = new PersonsEditorPlugin(); - - /** - * Keep track of the singleton. - * - * - * @generated - */ - private static Implementation plugin; - - /** - * Create the instance. - * - * - * @generated - */ - public PersonsEditorPlugin() { - 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.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 deleted file mode 100644 index 32b2576..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons.editor/src/edu/kit/ipd/sdq/metamodels/persons/presentation/PersonsModelWizard.java +++ /dev/null @@ -1,631 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons.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.persons.PersonsFactory; -import edu.kit.ipd.sdq.metamodels.persons.PersonsPackage; -import edu.kit.ipd.sdq.metamodels.persons.provider.PersonsEditPlugin; - - -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 PersonsModelWizard extends Wizard implements INewWizard { - /** - * The supported extensions for created files. - * - * - * @generated - */ - public static final List FILE_EXTENSIONS = - Collections.unmodifiableList(Arrays.asList(PersonsEditorPlugin.INSTANCE.getString("_UI_PersonsEditorFilenameExtensions").split("\\s*,\\s*"))); - - /** - * A formatted list of supported file extensions, suitable for display. - * - * - * @generated - */ - public static final String FORMATTED_FILE_EXTENSIONS = - PersonsEditorPlugin.INSTANCE.getString("_UI_PersonsEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); - - /** - * This caches an instance of the model package. - * - * - * @generated - */ - protected PersonsPackage personsPackage = PersonsPackage.eINSTANCE; - - /** - * This caches an instance of the model factory. - * - * - * @generated - */ - protected PersonsFactory personsFactory = personsPackage.getPersonsFactory(); - - /** - * This is the file creation page. - * - * - * @generated - */ - protected PersonsModelWizardNewFileCreationPage newFileCreationPage; - - /** - * This is the initial object creation page. - * - * - * @generated - */ - protected PersonsModelWizardInitialObjectCreationPage 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 - */ - @Override - public void init(IWorkbench workbench, IStructuredSelection selection) { - this.workbench = workbench; - this.selection = selection; - setWindowTitle(PersonsEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); - setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(PersonsEditorPlugin.INSTANCE.getImage("full/wizban/NewPersons"))); - } - - /** - * 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 : personsPackage.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)personsPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); - EObject rootObject = personsFactory.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) { - PersonsEditorPlugin.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() { - @Override - 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(), PersonsEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); - return false; - } - - return true; - } - catch (Exception exception) { - PersonsEditorPlugin.INSTANCE.log(exception); - return false; - } - } - - /** - * This is the one page of the wizard. - * - * - * @generated - */ - public class PersonsModelWizardNewFileCreationPage extends WizardNewFileCreationPage { - /** - * Pass in the selection. - * - * - * @generated - */ - public PersonsModelWizardNewFileCreationPage(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(PersonsEditorPlugin.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 PersonsModelWizardInitialObjectCreationPage extends WizardPage { - /** - * - * - * @generated - */ - protected Combo initialObjectField; - - /** - * @generated - * - * - */ - protected List encodings; - - /** - * - * - * @generated - */ - protected Combo encodingField; - - /** - * Pass in the selection. - * - * - * @generated - */ - public PersonsModelWizardInitialObjectCreationPage(String pageId) { - super(pageId); - } - - /** - * - * - * @generated - */ - @Override - 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(PersonsEditorPlugin.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(PersonsEditorPlugin.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() { - @Override - 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 PersonsEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); - } - catch(MissingResourceException mre) { - PersonsEditorPlugin.INSTANCE.log(mre); - } - return typeName; - } - - /** - * - * - * @generated - */ - protected Collection getEncodings() { - if (encodings == null) { - encodings = new ArrayList(); - for (StringTokenizer stringTokenizer = new StringTokenizer(PersonsEditorPlugin.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 PersonsModelWizardNewFileCreationPage("Whatever", selection); - newFileCreationPage.setTitle(PersonsEditorPlugin.INSTANCE.getString("_UI_PersonsModelWizard_label")); - newFileCreationPage.setDescription(PersonsEditorPlugin.INSTANCE.getString("_UI_PersonsModelWizard_description")); - newFileCreationPage.setFileName(PersonsEditorPlugin.INSTANCE.getString("_UI_PersonsEditorFilenameDefaultBase") + "." + 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 = PersonsEditorPlugin.INSTANCE.getString("_UI_PersonsEditorFilenameDefaultBase"); - 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 PersonsModelWizardInitialObjectCreationPage("Whatever2"); - initialObjectCreationPage.setTitle(PersonsEditorPlugin.INSTANCE.getString("_UI_PersonsModelWizard_label")); - initialObjectCreationPage.setDescription(PersonsEditorPlugin.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.persons/.classpath b/bundles/edu.kit.ipd.sdq.metamodels.persons/.classpath index 555c5b6..19e7b34 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/.classpath +++ b/bundles/edu.kit.ipd.sdq.metamodels.persons/.classpath @@ -1,6 +1,6 @@ - + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons/build.properties b/bundles/edu.kit.ipd.sdq.metamodels.persons/build.properties index 7e8f70d..e981b6a 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/build.properties +++ b/bundles/edu.kit.ipd.sdq.metamodels.persons/build.properties @@ -6,5 +6,5 @@ bin.includes = .,\ plugin.xml,\ plugin.properties jars.compile.order = . -source.. = src/ +source.. = src-gen/ output.. = target/classes/ 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 65752ee..3afa652 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/model/persons.genmodel +++ b/bundles/edu.kit.ipd.sdq.metamodels.persons/model/persons.genmodel @@ -1,9 +1,10 @@ + testsDirectory="/edu.kit.ipd.sdq.metamodels.persons.tests/src-gen" importerID="org.eclipse.emf.importer.ecore" + complianceLevel="8.0" copyrightFields="false" operationReflection="true" importOrganizing="true"> persons.ecore diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/Female.java b/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/Female.java deleted file mode 100644 index b006ae3..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/Female.java +++ /dev/null @@ -1,17 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons; - - -/** - * - * A representation of the model object 'Female'. - * - * - * - * @see edu.kit.ipd.sdq.metamodels.persons.PersonsPackage#getFemale() - * @model - * @generated - */ -public interface Female extends Person { -} // Female diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/Male.java b/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/Male.java deleted file mode 100644 index de59cb4..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/Male.java +++ /dev/null @@ -1,17 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons; - - -/** - * - * A representation of the model object 'Male'. - * - * - * - * @see edu.kit.ipd.sdq.metamodels.persons.PersonsPackage#getMale() - * @model - * @generated - */ -public interface Male extends Person { -} // Male diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/Person.java b/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/Person.java deleted file mode 100644 index 22aa437..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/Person.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons; - -import java.util.Date; -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Person'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.persons.Person#getFullName Full Name}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.persons.Person#getBirthday Birthday}
  • - *
- * - * @see edu.kit.ipd.sdq.metamodels.persons.PersonsPackage#getPerson() - * @model abstract="true" - * @generated - */ -public interface Person extends EObject { - /** - * Returns the value of the 'Full Name' attribute. - * - *

- * If the meaning of the 'Full Name' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Full Name' attribute. - * @see #setFullName(String) - * @see edu.kit.ipd.sdq.metamodels.persons.PersonsPackage#getPerson_FullName() - * @model unique="false" required="true" ordered="false" - * @generated - */ - String getFullName(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.persons.Person#getFullName Full Name}' attribute. - * - * - * @param value the new value of the 'Full Name' attribute. - * @see #getFullName() - * @generated - */ - void setFullName(String value); - - /** - * Returns the value of the 'Birthday' attribute. - * - *

- * If the meaning of the 'Birthday' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Birthday' attribute. - * @see #setBirthday(Date) - * @see edu.kit.ipd.sdq.metamodels.persons.PersonsPackage#getPerson_Birthday() - * @model unique="false" required="true" ordered="false" - * @generated - */ - Date getBirthday(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.persons.Person#getBirthday Birthday}' attribute. - * - * - * @param value the new value of the 'Birthday' attribute. - * @see #getBirthday() - * @generated - */ - void setBirthday(Date value); - -} // Person diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/PersonRegister.java b/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/PersonRegister.java deleted file mode 100644 index 7f021c9..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/PersonRegister.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Person Register'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.persons.PersonRegister#getPersons Persons}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.persons.PersonRegister#getId Id}
  • - *
- * - * @see edu.kit.ipd.sdq.metamodels.persons.PersonsPackage#getPersonRegister() - * @model - * @generated - */ -public interface PersonRegister extends EObject { - /** - * Returns the value of the 'Persons' containment reference list. - * The list contents are of type {@link edu.kit.ipd.sdq.metamodels.persons.Person}. - * - *

- * If the meaning of the 'Persons' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Persons' containment reference list. - * @see edu.kit.ipd.sdq.metamodels.persons.PersonsPackage#getPersonRegister_Persons() - * @model containment="true" ordered="false" - * @generated - */ - EList getPersons(); - - /** - * Returns the value of the 'Id' attribute. - * - *

- * If the meaning of the 'Id' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Id' attribute. - * @see #setId(String) - * @see edu.kit.ipd.sdq.metamodels.persons.PersonsPackage#getPersonRegister_Id() - * @model id="true" - * @generated - */ - String getId(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.persons.PersonRegister#getId Id}' attribute. - * - * - * @param value the new value of the 'Id' attribute. - * @see #getId() - * @generated - */ - void setId(String value); - -} // PersonRegister diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/PersonsFactory.java b/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/PersonsFactory.java deleted file mode 100644 index f72521c..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/PersonsFactory.java +++ /dev/null @@ -1,60 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons; - -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.persons.PersonsPackage - * @generated - */ -public interface PersonsFactory extends EFactory { - /** - * The singleton instance of the factory. - * - * - * @generated - */ - PersonsFactory eINSTANCE = edu.kit.ipd.sdq.metamodels.persons.impl.PersonsFactoryImpl.init(); - - /** - * Returns a new object of class 'Person Register'. - * - * - * @return a new object of class 'Person Register'. - * @generated - */ - PersonRegister createPersonRegister(); - - /** - * Returns a new object of class 'Male'. - * - * - * @return a new object of class 'Male'. - * @generated - */ - Male createMale(); - - /** - * Returns a new object of class 'Female'. - * - * - * @return a new object of class 'Female'. - * @generated - */ - Female createFemale(); - - /** - * Returns the package supported by this factory. - * - * - * @return the package supported by this factory. - * @generated - */ - PersonsPackage getPersonsPackage(); - -} //PersonsFactory diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/PersonsPackage.java b/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/PersonsPackage.java deleted file mode 100644 index 11b29d8..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/PersonsPackage.java +++ /dev/null @@ -1,425 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -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.persons.PersonsFactory - * @model kind="package" - * @generated - */ -public interface PersonsPackage extends EPackage { - /** - * The package name. - * - * - * @generated - */ - String eNAME = "persons"; - - /** - * The package namespace URI. - * - * - * @generated - */ - String eNS_URI = "edu.kit.ipd.sdq.metamodels.persons"; - - /** - * The package namespace name. - * - * - * @generated - */ - String eNS_PREFIX = "persons"; - - /** - * The singleton instance of the package. - * - * - * @generated - */ - PersonsPackage eINSTANCE = edu.kit.ipd.sdq.metamodels.persons.impl.PersonsPackageImpl.init(); - - /** - * The meta object id for the '{@link edu.kit.ipd.sdq.metamodels.persons.impl.PersonRegisterImpl Person Register}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.persons.impl.PersonRegisterImpl - * @see edu.kit.ipd.sdq.metamodels.persons.impl.PersonsPackageImpl#getPersonRegister() - * @generated - */ - int PERSON_REGISTER = 0; - - /** - * The feature id for the 'Persons' containment reference list. - * - * - * @generated - * @ordered - */ - int PERSON_REGISTER__PERSONS = 0; - - /** - * The feature id for the 'Id' attribute. - * - * - * @generated - * @ordered - */ - int PERSON_REGISTER__ID = 1; - - /** - * The number of structural features of the 'Person Register' class. - * - * - * @generated - * @ordered - */ - int PERSON_REGISTER_FEATURE_COUNT = 2; - - /** - * The number of operations of the 'Person Register' class. - * - * - * @generated - * @ordered - */ - int PERSON_REGISTER_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link edu.kit.ipd.sdq.metamodels.persons.impl.PersonImpl Person}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.persons.impl.PersonImpl - * @see edu.kit.ipd.sdq.metamodels.persons.impl.PersonsPackageImpl#getPerson() - * @generated - */ - int PERSON = 1; - - /** - * The feature id for the 'Full Name' attribute. - * - * - * @generated - * @ordered - */ - int PERSON__FULL_NAME = 0; - - /** - * The feature id for the 'Birthday' attribute. - * - * - * @generated - * @ordered - */ - int PERSON__BIRTHDAY = 1; - - /** - * The number of structural features of the 'Person' class. - * - * - * @generated - * @ordered - */ - int PERSON_FEATURE_COUNT = 2; - - /** - * The number of operations of the 'Person' class. - * - * - * @generated - * @ordered - */ - int PERSON_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link edu.kit.ipd.sdq.metamodels.persons.impl.MaleImpl Male}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.persons.impl.MaleImpl - * @see edu.kit.ipd.sdq.metamodels.persons.impl.PersonsPackageImpl#getMale() - * @generated - */ - int MALE = 2; - - /** - * The feature id for the 'Full Name' attribute. - * - * - * @generated - * @ordered - */ - int MALE__FULL_NAME = PERSON__FULL_NAME; - - /** - * The feature id for the 'Birthday' attribute. - * - * - * @generated - * @ordered - */ - int MALE__BIRTHDAY = PERSON__BIRTHDAY; - - /** - * The number of structural features of the 'Male' class. - * - * - * @generated - * @ordered - */ - int MALE_FEATURE_COUNT = PERSON_FEATURE_COUNT + 0; - - /** - * The number of operations of the 'Male' class. - * - * - * @generated - * @ordered - */ - int MALE_OPERATION_COUNT = PERSON_OPERATION_COUNT + 0; - - /** - * The meta object id for the '{@link edu.kit.ipd.sdq.metamodels.persons.impl.FemaleImpl Female}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.persons.impl.FemaleImpl - * @see edu.kit.ipd.sdq.metamodels.persons.impl.PersonsPackageImpl#getFemale() - * @generated - */ - int FEMALE = 3; - - /** - * The feature id for the 'Full Name' attribute. - * - * - * @generated - * @ordered - */ - int FEMALE__FULL_NAME = PERSON__FULL_NAME; - - /** - * The feature id for the 'Birthday' attribute. - * - * - * @generated - * @ordered - */ - int FEMALE__BIRTHDAY = PERSON__BIRTHDAY; - - /** - * The number of structural features of the 'Female' class. - * - * - * @generated - * @ordered - */ - int FEMALE_FEATURE_COUNT = PERSON_FEATURE_COUNT + 0; - - /** - * The number of operations of the 'Female' class. - * - * - * @generated - * @ordered - */ - int FEMALE_OPERATION_COUNT = PERSON_OPERATION_COUNT + 0; - - - /** - * Returns the meta object for class '{@link edu.kit.ipd.sdq.metamodels.persons.PersonRegister Person Register}'. - * - * - * @return the meta object for class 'Person Register'. - * @see edu.kit.ipd.sdq.metamodels.persons.PersonRegister - * @generated - */ - EClass getPersonRegister(); - - /** - * Returns the meta object for the containment reference list '{@link edu.kit.ipd.sdq.metamodels.persons.PersonRegister#getPersons Persons}'. - * - * - * @return the meta object for the containment reference list 'Persons'. - * @see edu.kit.ipd.sdq.metamodels.persons.PersonRegister#getPersons() - * @see #getPersonRegister() - * @generated - */ - EReference getPersonRegister_Persons(); - - /** - * Returns the meta object for the attribute '{@link edu.kit.ipd.sdq.metamodels.persons.PersonRegister#getId Id}'. - * - * - * @return the meta object for the attribute 'Id'. - * @see edu.kit.ipd.sdq.metamodels.persons.PersonRegister#getId() - * @see #getPersonRegister() - * @generated - */ - EAttribute getPersonRegister_Id(); - - /** - * Returns the meta object for class '{@link edu.kit.ipd.sdq.metamodels.persons.Person Person}'. - * - * - * @return the meta object for class 'Person'. - * @see edu.kit.ipd.sdq.metamodels.persons.Person - * @generated - */ - EClass getPerson(); - - /** - * Returns the meta object for the attribute '{@link edu.kit.ipd.sdq.metamodels.persons.Person#getFullName Full Name}'. - * - * - * @return the meta object for the attribute 'Full Name'. - * @see edu.kit.ipd.sdq.metamodels.persons.Person#getFullName() - * @see #getPerson() - * @generated - */ - EAttribute getPerson_FullName(); - - /** - * Returns the meta object for the attribute '{@link edu.kit.ipd.sdq.metamodels.persons.Person#getBirthday Birthday}'. - * - * - * @return the meta object for the attribute 'Birthday'. - * @see edu.kit.ipd.sdq.metamodels.persons.Person#getBirthday() - * @see #getPerson() - * @generated - */ - EAttribute getPerson_Birthday(); - - /** - * Returns the meta object for class '{@link edu.kit.ipd.sdq.metamodels.persons.Male Male}'. - * - * - * @return the meta object for class 'Male'. - * @see edu.kit.ipd.sdq.metamodels.persons.Male - * @generated - */ - EClass getMale(); - - /** - * Returns the meta object for class '{@link edu.kit.ipd.sdq.metamodels.persons.Female Female}'. - * - * - * @return the meta object for class 'Female'. - * @see edu.kit.ipd.sdq.metamodels.persons.Female - * @generated - */ - EClass getFemale(); - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - PersonsFactory getPersonsFactory(); - - /** - * - * 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.persons.impl.PersonRegisterImpl Person Register}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.persons.impl.PersonRegisterImpl - * @see edu.kit.ipd.sdq.metamodels.persons.impl.PersonsPackageImpl#getPersonRegister() - * @generated - */ - EClass PERSON_REGISTER = eINSTANCE.getPersonRegister(); - - /** - * The meta object literal for the 'Persons' containment reference list feature. - * - * - * @generated - */ - EReference PERSON_REGISTER__PERSONS = eINSTANCE.getPersonRegister_Persons(); - - /** - * The meta object literal for the 'Id' attribute feature. - * - * - * @generated - */ - EAttribute PERSON_REGISTER__ID = eINSTANCE.getPersonRegister_Id(); - - /** - * The meta object literal for the '{@link edu.kit.ipd.sdq.metamodels.persons.impl.PersonImpl Person}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.persons.impl.PersonImpl - * @see edu.kit.ipd.sdq.metamodels.persons.impl.PersonsPackageImpl#getPerson() - * @generated - */ - EClass PERSON = eINSTANCE.getPerson(); - - /** - * The meta object literal for the 'Full Name' attribute feature. - * - * - * @generated - */ - EAttribute PERSON__FULL_NAME = eINSTANCE.getPerson_FullName(); - - /** - * The meta object literal for the 'Birthday' attribute feature. - * - * - * @generated - */ - EAttribute PERSON__BIRTHDAY = eINSTANCE.getPerson_Birthday(); - - /** - * The meta object literal for the '{@link edu.kit.ipd.sdq.metamodels.persons.impl.MaleImpl Male}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.persons.impl.MaleImpl - * @see edu.kit.ipd.sdq.metamodels.persons.impl.PersonsPackageImpl#getMale() - * @generated - */ - EClass MALE = eINSTANCE.getMale(); - - /** - * The meta object literal for the '{@link edu.kit.ipd.sdq.metamodels.persons.impl.FemaleImpl Female}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.persons.impl.FemaleImpl - * @see edu.kit.ipd.sdq.metamodels.persons.impl.PersonsPackageImpl#getFemale() - * @generated - */ - EClass FEMALE = eINSTANCE.getFemale(); - - } - -} //PersonsPackage diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/FemaleImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/FemaleImpl.java deleted file mode 100644 index 94bc817..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/FemaleImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons.impl; - -import edu.kit.ipd.sdq.metamodels.persons.Female; -import edu.kit.ipd.sdq.metamodels.persons.PersonsPackage; - -import org.eclipse.emf.ecore.EClass; - -/** - * - * An implementation of the model object 'Female'. - * - * - * @generated - */ -public class FemaleImpl extends PersonImpl implements Female { - /** - * - * - * @generated - */ - protected FemaleImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return PersonsPackage.Literals.FEMALE; - } - -} //FemaleImpl diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/MaleImpl.java b/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/MaleImpl.java deleted file mode 100644 index c5e9f10..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/MaleImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons.impl; - -import edu.kit.ipd.sdq.metamodels.persons.Male; -import edu.kit.ipd.sdq.metamodels.persons.PersonsPackage; - -import org.eclipse.emf.ecore.EClass; - -/** - * - * An implementation of the model object 'Male'. - * - * - * @generated - */ -public class MaleImpl extends PersonImpl implements Male { - /** - * - * - * @generated - */ - protected MaleImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return PersonsPackage.Literals.MALE; - } - -} //MaleImpl 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 deleted file mode 100644 index 31533c1..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/PersonImpl.java +++ /dev/null @@ -1,222 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons.impl; - -import edu.kit.ipd.sdq.metamodels.persons.Person; -import edu.kit.ipd.sdq.metamodels.persons.PersonsPackage; - -import java.util.Date; -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 'Person'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.persons.impl.PersonImpl#getFullName Full Name}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.persons.impl.PersonImpl#getBirthday Birthday}
  • - *
- * - * @generated - */ -public abstract class PersonImpl extends MinimalEObjectImpl.Container implements Person { - /** - * The default value of the '{@link #getFullName() Full Name}' attribute. - * - * - * @see #getFullName() - * @generated - * @ordered - */ - protected static final String FULL_NAME_EDEFAULT = null; - - /** - * The cached value of the '{@link #getFullName() Full Name}' attribute. - * - * - * @see #getFullName() - * @generated - * @ordered - */ - protected String fullName = FULL_NAME_EDEFAULT; - - /** - * The default value of the '{@link #getBirthday() Birthday}' attribute. - * - * - * @see #getBirthday() - * @generated - * @ordered - */ - protected static final Date BIRTHDAY_EDEFAULT = null; - - /** - * The cached value of the '{@link #getBirthday() Birthday}' attribute. - * - * - * @see #getBirthday() - * @generated - * @ordered - */ - protected Date birthday = BIRTHDAY_EDEFAULT; - - /** - * - * - * @generated - */ - protected PersonImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return PersonsPackage.Literals.PERSON; - } - - /** - * - * - * @generated - */ - @Override - public String getFullName() { - return fullName; - } - - /** - * - * - * @generated - */ - @Override - public void setFullName(String newFullName) { - String oldFullName = fullName; - fullName = newFullName; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, PersonsPackage.PERSON__FULL_NAME, oldFullName, fullName)); - } - - /** - * - * - * @generated - */ - @Override - public Date getBirthday() { - return birthday; - } - - /** - * - * - * @generated - */ - @Override - public void setBirthday(Date newBirthday) { - Date oldBirthday = birthday; - birthday = newBirthday; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, PersonsPackage.PERSON__BIRTHDAY, oldBirthday, birthday)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case PersonsPackage.PERSON__FULL_NAME: - return getFullName(); - case PersonsPackage.PERSON__BIRTHDAY: - return getBirthday(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case PersonsPackage.PERSON__FULL_NAME: - setFullName((String)newValue); - return; - case PersonsPackage.PERSON__BIRTHDAY: - setBirthday((Date)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case PersonsPackage.PERSON__FULL_NAME: - setFullName(FULL_NAME_EDEFAULT); - return; - case PersonsPackage.PERSON__BIRTHDAY: - setBirthday(BIRTHDAY_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case PersonsPackage.PERSON__FULL_NAME: - return FULL_NAME_EDEFAULT == null ? fullName != null : !FULL_NAME_EDEFAULT.equals(fullName); - case PersonsPackage.PERSON__BIRTHDAY: - return BIRTHDAY_EDEFAULT == null ? birthday != null : !BIRTHDAY_EDEFAULT.equals(birthday); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuilder result = new StringBuilder(super.toString()); - result.append(" (fullName: "); - result.append(fullName); - result.append(", birthday: "); - result.append(birthday); - result.append(')'); - return result.toString(); - } - -} //PersonImpl 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 deleted file mode 100644 index a1b2fbc..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/PersonRegisterImpl.java +++ /dev/null @@ -1,224 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons.impl; - -import edu.kit.ipd.sdq.metamodels.persons.Person; -import edu.kit.ipd.sdq.metamodels.persons.PersonRegister; -import edu.kit.ipd.sdq.metamodels.persons.PersonsPackage; - -import java.util.Collection; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.common.util.EList; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; - -import org.eclipse.emf.ecore.util.EObjectContainmentEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * - * An implementation of the model object 'Person Register'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.persons.impl.PersonRegisterImpl#getPersons Persons}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.persons.impl.PersonRegisterImpl#getId Id}
  • - *
- * - * @generated - */ -public class PersonRegisterImpl extends MinimalEObjectImpl.Container implements PersonRegister { - /** - * The cached value of the '{@link #getPersons() Persons}' containment reference list. - * - * - * @see #getPersons() - * @generated - * @ordered - */ - protected EList persons; - - /** - * The default value of the '{@link #getId() Id}' attribute. - * - * - * @see #getId() - * @generated - * @ordered - */ - protected static final String ID_EDEFAULT = null; - /** - * The cached value of the '{@link #getId() Id}' attribute. - * - * - * @see #getId() - * @generated - * @ordered - */ - protected String id = ID_EDEFAULT; - - /** - * - * - * @generated - */ - protected PersonRegisterImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return PersonsPackage.Literals.PERSON_REGISTER; - } - - /** - * - * - * @generated - */ - @Override - public EList getPersons() { - if (persons == null) { - persons = new EObjectContainmentEList(Person.class, this, PersonsPackage.PERSON_REGISTER__PERSONS); - } - return persons; - } - - /** - * - * - * @generated - */ - @Override - public String getId() { - return id; - } - - /** - * - * - * @generated - */ - @Override - public void setId(String newId) { - String oldId = id; - id = newId; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, PersonsPackage.PERSON_REGISTER__ID, oldId, id)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case PersonsPackage.PERSON_REGISTER__PERSONS: - return ((InternalEList)getPersons()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case PersonsPackage.PERSON_REGISTER__PERSONS: - return getPersons(); - case PersonsPackage.PERSON_REGISTER__ID: - return getId(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case PersonsPackage.PERSON_REGISTER__PERSONS: - getPersons().clear(); - getPersons().addAll((Collection)newValue); - return; - case PersonsPackage.PERSON_REGISTER__ID: - setId((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case PersonsPackage.PERSON_REGISTER__PERSONS: - getPersons().clear(); - return; - case PersonsPackage.PERSON_REGISTER__ID: - setId(ID_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case PersonsPackage.PERSON_REGISTER__PERSONS: - return persons != null && !persons.isEmpty(); - case PersonsPackage.PERSON_REGISTER__ID: - return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuilder result = new StringBuilder(super.toString()); - result.append(" (id: "); - result.append(id); - result.append(')'); - return result.toString(); - } - -} //PersonRegisterImpl 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 deleted file mode 100644 index beba7d5..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/PersonsFactoryImpl.java +++ /dev/null @@ -1,121 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons.impl; - -import edu.kit.ipd.sdq.metamodels.persons.*; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.impl.EFactoryImpl; - -import org.eclipse.emf.ecore.plugin.EcorePlugin; - -/** - * - * An implementation of the model Factory. - * - * @generated - */ -public class PersonsFactoryImpl extends EFactoryImpl implements PersonsFactory { - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static PersonsFactory init() { - try { - PersonsFactory thePersonsFactory = (PersonsFactory)EPackage.Registry.INSTANCE.getEFactory(PersonsPackage.eNS_URI); - if (thePersonsFactory != null) { - return thePersonsFactory; - } - } - catch (Exception exception) { - EcorePlugin.INSTANCE.log(exception); - } - return new PersonsFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public PersonsFactoryImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - public EObject create(EClass eClass) { - switch (eClass.getClassifierID()) { - case PersonsPackage.PERSON_REGISTER: return createPersonRegister(); - case PersonsPackage.MALE: return createMale(); - case PersonsPackage.FEMALE: return createFemale(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - @Override - public PersonRegister createPersonRegister() { - PersonRegisterImpl personRegister = new PersonRegisterImpl(); - return personRegister; - } - - /** - * - * - * @generated - */ - @Override - public Male createMale() { - MaleImpl male = new MaleImpl(); - return male; - } - - /** - * - * - * @generated - */ - @Override - public Female createFemale() { - FemaleImpl female = new FemaleImpl(); - return female; - } - - /** - * - * - * @generated - */ - @Override - public PersonsPackage getPersonsPackage() { - return (PersonsPackage)getEPackage(); - } - - /** - * - * - * @deprecated - * @generated - */ - @Deprecated - public static PersonsPackage getPackage() { - return PersonsPackage.eINSTANCE; - } - -} //PersonsFactoryImpl 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 deleted file mode 100644 index d174cc7..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/impl/PersonsPackageImpl.java +++ /dev/null @@ -1,284 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons.impl; - -import edu.kit.ipd.sdq.metamodels.persons.Female; -import edu.kit.ipd.sdq.metamodels.persons.Male; -import edu.kit.ipd.sdq.metamodels.persons.Person; -import edu.kit.ipd.sdq.metamodels.persons.PersonRegister; -import edu.kit.ipd.sdq.metamodels.persons.PersonsFactory; -import edu.kit.ipd.sdq.metamodels.persons.PersonsPackage; -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.EReference; -import org.eclipse.emf.ecore.impl.EPackageImpl; - -/** - * - * An implementation of the model Package. - * - * @generated - */ -public class PersonsPackageImpl extends EPackageImpl implements PersonsPackage { - /** - * - * - * @generated - */ - private EClass personRegisterEClass = null; - - /** - * - * - * @generated - */ - private EClass personEClass = null; - - /** - * - * - * @generated - */ - private EClass maleEClass = null; - - /** - * - * - * @generated - */ - private EClass femaleEClass = 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.persons.PersonsPackage#eNS_URI - * @see #init() - * @generated - */ - private PersonsPackageImpl() { - super(eNS_URI, PersonsFactory.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 PersonsPackage#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 PersonsPackage init() { - if (isInited) return (PersonsPackage)EPackage.Registry.INSTANCE.getEPackage(PersonsPackage.eNS_URI); - - // Obtain or create and register package - Object registeredPersonsPackage = EPackage.Registry.INSTANCE.get(eNS_URI); - PersonsPackageImpl thePersonsPackage = registeredPersonsPackage instanceof PersonsPackageImpl ? (PersonsPackageImpl)registeredPersonsPackage : new PersonsPackageImpl(); - - isInited = true; - - // Create package meta-data objects - thePersonsPackage.createPackageContents(); - - // Initialize created meta-data - thePersonsPackage.initializePackageContents(); - - // 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; - } - - /** - * - * - * @generated - */ - @Override - public EClass getPersonRegister() { - return personRegisterEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getPersonRegister_Persons() { - return (EReference)personRegisterEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getPersonRegister_Id() { - return (EAttribute)personRegisterEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getPerson() { - return personEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getPerson_FullName() { - return (EAttribute)personEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getPerson_Birthday() { - return (EAttribute)personEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getMale() { - return maleEClass; - } - - /** - * - * - * @generated - */ - @Override - public EClass getFemale() { - return femaleEClass; - } - - /** - * - * - * @generated - */ - @Override - public PersonsFactory getPersonsFactory() { - return (PersonsFactory)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 - personRegisterEClass = createEClass(PERSON_REGISTER); - createEReference(personRegisterEClass, PERSON_REGISTER__PERSONS); - createEAttribute(personRegisterEClass, PERSON_REGISTER__ID); - - personEClass = createEClass(PERSON); - createEAttribute(personEClass, PERSON__FULL_NAME); - createEAttribute(personEClass, PERSON__BIRTHDAY); - - maleEClass = createEClass(MALE); - - femaleEClass = createEClass(FEMALE); - } - - /** - * - * - * @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 - maleEClass.getESuperTypes().add(this.getPerson()); - femaleEClass.getESuperTypes().add(this.getPerson()); - - // Initialize classes, features, and operations; add parameters - initEClass(personRegisterEClass, PersonRegister.class, "PersonRegister", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getPersonRegister_Persons(), this.getPerson(), null, "persons", null, 0, -1, PersonRegister.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getPersonRegister_Id(), ecorePackage.getEString(), "id", null, 0, 1, PersonRegister.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(personEClass, Person.class, "Person", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getPerson_FullName(), ecorePackage.getEString(), "fullName", null, 1, 1, Person.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - initEAttribute(getPerson_Birthday(), ecorePackage.getEDate(), "birthday", null, 1, 1, Person.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, !IS_UNIQUE, !IS_DERIVED, !IS_ORDERED); - - initEClass(maleEClass, Male.class, "Male", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - initEClass(femaleEClass, Female.class, "Female", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - - // Create resource - createResource(eNS_URI); - } - -} //PersonsPackageImpl diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/util/PersonsAdapterFactory.java b/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/util/PersonsAdapterFactory.java deleted file mode 100644 index 73579b0..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/util/PersonsAdapterFactory.java +++ /dev/null @@ -1,174 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons.util; - -import edu.kit.ipd.sdq.metamodels.persons.*; - -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.persons.PersonsPackage - * @generated - */ -public class PersonsAdapterFactory extends AdapterFactoryImpl { - /** - * The cached model package. - * - * - * @generated - */ - protected static PersonsPackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * - * - * @generated - */ - public PersonsAdapterFactory() { - if (modelPackage == null) { - modelPackage = PersonsPackage.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 PersonsSwitch modelSwitch = - new PersonsSwitch() { - @Override - public Adapter casePersonRegister(PersonRegister object) { - return createPersonRegisterAdapter(); - } - @Override - public Adapter casePerson(Person object) { - return createPersonAdapter(); - } - @Override - public Adapter caseMale(Male object) { - return createMaleAdapter(); - } - @Override - public Adapter caseFemale(Female object) { - return createFemaleAdapter(); - } - @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.persons.PersonRegister Person Register}'. - * - * 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.persons.PersonRegister - * @generated - */ - public Adapter createPersonRegisterAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link edu.kit.ipd.sdq.metamodels.persons.Person Person}'. - * - * 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.persons.Person - * @generated - */ - public Adapter createPersonAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link edu.kit.ipd.sdq.metamodels.persons.Male Male}'. - * - * 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.persons.Male - * @generated - */ - public Adapter createMaleAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link edu.kit.ipd.sdq.metamodels.persons.Female Female}'. - * - * 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.persons.Female - * @generated - */ - public Adapter createFemaleAdapter() { - 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; - } - -} //PersonsAdapterFactory diff --git a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/util/PersonsSwitch.java b/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/util/PersonsSwitch.java deleted file mode 100644 index 382f0af..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.persons/src/edu/kit/ipd/sdq/metamodels/persons/util/PersonsSwitch.java +++ /dev/null @@ -1,175 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.persons.util; - -import edu.kit.ipd.sdq.metamodels.persons.*; - -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.persons.PersonsPackage - * @generated - */ -public class PersonsSwitch extends Switch { - /** - * The cached model package - * - * - * @generated - */ - protected static PersonsPackage modelPackage; - - /** - * Creates an instance of the switch. - * - * - * @generated - */ - public PersonsSwitch() { - if (modelPackage == null) { - modelPackage = PersonsPackage.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 PersonsPackage.PERSON_REGISTER: { - PersonRegister personRegister = (PersonRegister)theEObject; - T result = casePersonRegister(personRegister); - if (result == null) result = defaultCase(theEObject); - return result; - } - case PersonsPackage.PERSON: { - Person person = (Person)theEObject; - T result = casePerson(person); - if (result == null) result = defaultCase(theEObject); - return result; - } - case PersonsPackage.MALE: { - Male male = (Male)theEObject; - T result = caseMale(male); - if (result == null) result = casePerson(male); - if (result == null) result = defaultCase(theEObject); - return result; - } - case PersonsPackage.FEMALE: { - Female female = (Female)theEObject; - T result = caseFemale(female); - if (result == null) result = casePerson(female); - if (result == null) result = defaultCase(theEObject); - return result; - } - default: return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpreting the object as an instance of 'Person Register'. - * - * 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 'Person Register'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T casePersonRegister(PersonRegister object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Person'. - * - * 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 'Person'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T casePerson(Person object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Male'. - * - * 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 'Male'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseMale(Male object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Female'. - * - * 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 'Female'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseFemale(Female 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; - } - -} //PersonsSwitch diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/.classpath b/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/.classpath index 555c5b6..19e7b34 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/.classpath +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/.classpath @@ -1,6 +1,6 @@ - + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/build.properties b/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/build.properties index 3a5d565..7d1cb86 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/build.properties +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/build.properties @@ -6,5 +6,5 @@ bin.includes = .,\ plugin.xml,\ plugin.properties jars.compile.order = . -source.. = src/ +source.. = src-gen/ output.. = target/classes/ diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/CityItemProvider.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/CityItemProvider.java deleted file mode 100644 index 48a0472..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/CityItemProvider.java +++ /dev/null @@ -1,132 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients.provider; - - -import edu.kit.ipd.sdq.metamodels.recipients.City; -import edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; - -/** - * This is the item provider adapter for a {@link edu.kit.ipd.sdq.metamodels.recipients.City} object. - * - * - * @generated - */ -public class CityItemProvider extends IdentifiedElementItemProvider { - /** - * This constructs an instance from a factory and a notifier. - * - * - * @generated - */ - public CityItemProvider(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); - - addZipCodePropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Zip Code feature. - * - * - * @generated - */ - protected void addZipCodePropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_City_zipCode_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_City_zipCode_feature", "_UI_City_type"), - RecipientsPackage.Literals.CITY__ZIP_CODE, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This returns City.gif. - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/City")); - } - - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((City)object).getId(); - return label == null || label.length() == 0 ? - getString("_UI_City_type") : - getString("_UI_City_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(City.class)) { - case RecipientsPackage.CITY__ZIP_CODE: - 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); - } - -} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/IdentifiedElementItemProvider.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/IdentifiedElementItemProvider.java deleted file mode 100644 index 7911e40..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/IdentifiedElementItemProvider.java +++ /dev/null @@ -1,147 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients.provider; - - -import edu.kit.ipd.sdq.metamodels.recipients.IdentifiedElement; -import edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage; - -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.recipients.IdentifiedElement} object. - * - * - * @generated - */ -public class IdentifiedElementItemProvider - extends ItemProviderAdapter - implements - IEditingDomainItemProvider, - IStructuredItemContentProvider, - ITreeItemContentProvider, - IItemLabelProvider, - IItemPropertySource { - /** - * This constructs an instance from a factory and a notifier. - * - * - * @generated - */ - public IdentifiedElementItemProvider(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); - - addIdPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Id feature. - * - * - * @generated - */ - protected void addIdPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_IdentifiedElement_id_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_IdentifiedElement_id_feature", "_UI_IdentifiedElement_type"), - RecipientsPackage.Literals.IDENTIFIED_ELEMENT__ID, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((IdentifiedElement)object).getId(); - return label == null || label.length() == 0 ? - getString("_UI_IdentifiedElement_type") : - getString("_UI_IdentifiedElement_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(IdentifiedElement.class)) { - case RecipientsPackage.IDENTIFIED_ELEMENT__ID: - 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 RecipientsEditPlugin.INSTANCE; - } - -} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/LocationItemProvider.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/LocationItemProvider.java deleted file mode 100644 index 27b5812..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/LocationItemProvider.java +++ /dev/null @@ -1,156 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients.provider; - - -import edu.kit.ipd.sdq.metamodels.recipients.Location; -import edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; - -/** - * This is the item provider adapter for a {@link edu.kit.ipd.sdq.metamodels.recipients.Location} object. - * - * - * @generated - */ -public class LocationItemProvider extends IdentifiedElementItemProvider { - /** - * This constructs an instance from a factory and a notifier. - * - * - * @generated - */ - public LocationItemProvider(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); - - addNumberPropertyDescriptor(object); - addStreetPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Number feature. - * - * - * @generated - */ - protected void addNumberPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_Location_number_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_Location_number_feature", "_UI_Location_type"), - RecipientsPackage.Literals.LOCATION__NUMBER, - true, - false, - false, - ItemPropertyDescriptor.INTEGRAL_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Street feature. - * - * - * @generated - */ - protected void addStreetPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_Location_street_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_Location_street_feature", "_UI_Location_type"), - RecipientsPackage.Literals.LOCATION__STREET, - true, - false, - false, - ItemPropertyDescriptor.GENERIC_VALUE_IMAGE, - null, - null)); - } - - /** - * This returns Location.gif. - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/Location")); - } - - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((Location)object).getId(); - return label == null || label.length() == 0 ? - getString("_UI_Location_type") : - getString("_UI_Location_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(Location.class)) { - case RecipientsPackage.LOCATION__NUMBER: - case RecipientsPackage.LOCATION__STREET: - 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); - } - -} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/RecipientItemProvider.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/RecipientItemProvider.java deleted file mode 100644 index d3e22f8..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/RecipientItemProvider.java +++ /dev/null @@ -1,196 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients.provider; - - -import edu.kit.ipd.sdq.metamodels.recipients.Recipient; -import edu.kit.ipd.sdq.metamodels.recipients.RecipientsFactory; -import edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EStructuralFeature; - -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; - -/** - * This is the item provider adapter for a {@link edu.kit.ipd.sdq.metamodels.recipients.Recipient} object. - * - * - * @generated - */ -public class RecipientItemProvider extends IdentifiedElementItemProvider { - /** - * This constructs an instance from a factory and a notifier. - * - * - * @generated - */ - public RecipientItemProvider(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); - - addBusinessPropertyDescriptor(object); - addLocatedInPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Business feature. - * - * - * @generated - */ - protected void addBusinessPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_Recipient_business_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_Recipient_business_feature", "_UI_Recipient_type"), - RecipientsPackage.Literals.RECIPIENT__BUSINESS, - true, - false, - false, - ItemPropertyDescriptor.BOOLEAN_VALUE_IMAGE, - null, - null)); - } - - /** - * This adds a property descriptor for the Located In feature. - * - * - * @generated - */ - protected void addLocatedInPropertyDescriptor(Object object) { - itemPropertyDescriptors.add - (createItemPropertyDescriptor - (((ComposeableAdapterFactory)adapterFactory).getRootAdapterFactory(), - getResourceLocator(), - getString("_UI_Recipient_locatedIn_feature"), - getString("_UI_PropertyDescriptor_description", "_UI_Recipient_locatedIn_feature", "_UI_Recipient_type"), - RecipientsPackage.Literals.RECIPIENT__LOCATED_IN, - true, - false, - true, - null, - null, - null)); - } - - /** - * This specifies how to implement {@link #getChildren} and is used to deduce an appropriate feature for an - * {@link org.eclipse.emf.edit.command.AddCommand}, {@link org.eclipse.emf.edit.command.RemoveCommand} or - * {@link org.eclipse.emf.edit.command.MoveCommand} in {@link #createCommand}. - * - * - * @generated - */ - @Override - public Collection getChildrenFeatures(Object object) { - if (childrenFeatures == null) { - super.getChildrenFeatures(object); - childrenFeatures.add(RecipientsPackage.Literals.RECIPIENT__LOCATED_AT); - } - 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 Recipient.gif. - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/Recipient")); - } - - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((Recipient)object).getId(); - return label == null || label.length() == 0 ? - getString("_UI_Recipient_type") : - getString("_UI_Recipient_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(Recipient.class)) { - case RecipientsPackage.RECIPIENT__BUSINESS: - fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), false, true)); - return; - case RecipientsPackage.RECIPIENT__LOCATED_AT: - 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 - (RecipientsPackage.Literals.RECIPIENT__LOCATED_AT, - RecipientsFactory.eINSTANCE.createLocation())); - } - -} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/RecipientsEditPlugin.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/RecipientsEditPlugin.java deleted file mode 100644 index 1769dd5..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/RecipientsEditPlugin.java +++ /dev/null @@ -1,89 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients.provider; - -import org.eclipse.emf.common.EMFPlugin; - -import org.eclipse.emf.common.util.ResourceLocator; - -/** - * This is the central singleton for the Recipients edit plugin. - * - * - * @generated - */ -public final class RecipientsEditPlugin extends EMFPlugin { - /** - * Keep track of the singleton. - * - * - * @generated - */ - public static final RecipientsEditPlugin INSTANCE = new RecipientsEditPlugin(); - - /** - * Keep track of the singleton. - * - * - * @generated - */ - private static Implementation plugin; - - /** - * Create the instance. - * - * - * @generated - */ - public RecipientsEditPlugin() { - 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.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/RecipientsItemProvider.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/RecipientsItemProvider.java deleted file mode 100644 index cf274e4..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/RecipientsItemProvider.java +++ /dev/null @@ -1,145 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients.provider; - - -import edu.kit.ipd.sdq.metamodels.recipients.Recipients; -import edu.kit.ipd.sdq.metamodels.recipients.RecipientsFactory; -import edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EStructuralFeature; - -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.emf.edit.provider.ViewerNotification; - -/** - * This is the item provider adapter for a {@link edu.kit.ipd.sdq.metamodels.recipients.Recipients} object. - * - * - * @generated - */ -public class RecipientsItemProvider extends IdentifiedElementItemProvider { - /** - * This constructs an instance from a factory and a notifier. - * - * - * @generated - */ - public RecipientsItemProvider(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(RecipientsPackage.Literals.RECIPIENTS__RECIPIENTS); - } - 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 Recipients.gif. - * - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/Recipients")); - } - - /** - * This returns the label text for the adapted class. - * - * - * @generated - */ - @Override - public String getText(Object object) { - String label = ((Recipients)object).getId(); - return label == null || label.length() == 0 ? - getString("_UI_Recipients_type") : - getString("_UI_Recipients_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(Recipients.class)) { - case RecipientsPackage.RECIPIENTS__RECIPIENTS: - 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 - (RecipientsPackage.Literals.RECIPIENTS__RECIPIENTS, - RecipientsFactory.eINSTANCE.createRecipient())); - } - -} 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 deleted file mode 100644 index 74f569b..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients.edit/src/edu/kit/ipd/sdq/metamodels/recipients/provider/RecipientsItemProviderAdapterFactory.java +++ /dev/null @@ -1,277 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients.provider; - -import edu.kit.ipd.sdq.metamodels.recipients.util.RecipientsAdapterFactory; - -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 RecipientsItemProviderAdapterFactory extends RecipientsAdapterFactory 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 RecipientsItemProviderAdapterFactory() { - 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.recipients.Recipient} instances. - * - * - * @generated - */ - protected RecipientItemProvider recipientItemProvider; - - /** - * This creates an adapter for a {@link edu.kit.ipd.sdq.metamodels.recipients.Recipient}. - * - * - * @generated - */ - @Override - public Adapter createRecipientAdapter() { - if (recipientItemProvider == null) { - recipientItemProvider = new RecipientItemProvider(this); - } - - return recipientItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link edu.kit.ipd.sdq.metamodels.recipients.Location} instances. - * - * - * @generated - */ - protected LocationItemProvider locationItemProvider; - - /** - * This creates an adapter for a {@link edu.kit.ipd.sdq.metamodels.recipients.Location}. - * - * - * @generated - */ - @Override - public Adapter createLocationAdapter() { - if (locationItemProvider == null) { - locationItemProvider = new LocationItemProvider(this); - } - - return locationItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link edu.kit.ipd.sdq.metamodels.recipients.City} instances. - * - * - * @generated - */ - protected CityItemProvider cityItemProvider; - - /** - * This creates an adapter for a {@link edu.kit.ipd.sdq.metamodels.recipients.City}. - * - * - * @generated - */ - @Override - public Adapter createCityAdapter() { - if (cityItemProvider == null) { - cityItemProvider = new CityItemProvider(this); - } - - return cityItemProvider; - } - - /** - * This keeps track of the one adapter used for all {@link edu.kit.ipd.sdq.metamodels.recipients.Recipients} instances. - * - * - * @generated - */ - protected RecipientsItemProvider recipientsItemProvider; - - /** - * This creates an adapter for a {@link edu.kit.ipd.sdq.metamodels.recipients.Recipients}. - * - * - * @generated - */ - @Override - public Adapter createRecipientsAdapter() { - if (recipientsItemProvider == null) { - recipientsItemProvider = new RecipientsItemProvider(this); - } - - return recipientsItemProvider; - } - - /** - * This returns the root adapter factory that contains this factory. - * - * - * @generated - */ - @Override - public ComposeableAdapterFactory getRootAdapterFactory() { - return parentAdapterFactory == null ? this : parentAdapterFactory.getRootAdapterFactory(); - } - - /** - * This sets the composed adapter factory that contains this factory. - * - * - * @generated - */ - @Override - 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 - */ - @Override - public void addListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.addListener(notifyChangedListener); - } - - /** - * This removes a listener. - * - * - * @generated - */ - @Override - public void removeListener(INotifyChangedListener notifyChangedListener) { - changeNotifier.removeListener(notifyChangedListener); - } - - /** - * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. - * - * - * @generated - */ - @Override - 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 - */ - @Override - public void dispose() { - if (recipientsItemProvider != null) recipientsItemProvider.dispose(); - if (recipientItemProvider != null) recipientItemProvider.dispose(); - if (locationItemProvider != null) locationItemProvider.dispose(); - if (cityItemProvider != null) cityItemProvider.dispose(); - } - -} diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/.classpath b/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/.classpath index 555c5b6..19e7b34 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/.classpath +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/.classpath @@ -1,6 +1,6 @@ - + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/build.properties b/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/build.properties index 3a5d565..7d1cb86 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/build.properties +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/build.properties @@ -6,5 +6,5 @@ bin.includes = .,\ plugin.xml,\ plugin.properties jars.compile.order = . -source.. = src/ +source.. = src-gen/ output.. = target/classes/ 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 deleted file mode 100644 index c0093b4..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/src/edu/kit/ipd/sdq/metamodels/recipients/presentation/RecipientsActionBarContributor.java +++ /dev/null @@ -1,426 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients.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 Recipients model editor. - * - * - * @generated - */ -public class RecipientsActionBarContributor - 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(RecipientsEditorPlugin.INSTANCE.getString("_UI_ShowPropertiesView_menu_item")) { - @Override - public void run() { - try { - getPage().showView("org.eclipse.ui.views.PropertySheet"); - } - catch (PartInitException exception) { - RecipientsEditorPlugin.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(RecipientsEditorPlugin.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 RecipientsActionBarContributor() { - 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("recipients-settings")); - toolBarManager.add(new Separator("recipients-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(RecipientsEditorPlugin.INSTANCE.getString("_UI_RecipientsEditor_menu"), "edu.kit.ipd.sdq.metamodels.recipientsMenuID"); - 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(RecipientsEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - submenuManager.insertBefore("additions", createChildMenuManager); - - // Prepare for CreateSibling item addition or removal. - // - createSiblingMenuManager = new MenuManager(RecipientsEditorPlugin.INSTANCE.getString("_UI_CreateSibling_menu_item")); - submenuManager.insertBefore("additions", createSiblingMenuManager); - - // Force an update because Eclipse hides empty menus now. - // - submenuManager.addMenuListener - (new IMenuListener() { - @Override - 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 - */ - @Override - 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(RecipientsEditorPlugin.INSTANCE.getString("_UI_CreateChild_menu_item")); - populateManager(submenuManager, createChildActions, null); - menuManager.insertBefore("edit", submenuManager); - - submenuManager = new MenuManager(RecipientsEditorPlugin.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.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 deleted file mode 100644 index 91fba5b..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/src/edu/kit/ipd/sdq/metamodels/recipients/presentation/RecipientsEditor.java +++ /dev/null @@ -1,1848 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients.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.recipients.provider.RecipientsItemProviderAdapterFactory; - -import org.eclipse.ui.actions.WorkspaceModifyOperation; - - -/** - * This is an example of a Recipients model editor. - * - * - * @generated - */ -public class RecipientsEditor - 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() { - @Override - public void partActivated(IWorkbenchPart p) { - if (p instanceof ContentOutline) { - if (((ContentOutline)p).getCurrentPage() == contentOutlinePage) { - getActionBarContributor().setActiveEditor(RecipientsEditor.this); - - setCurrentViewer(contentOutlineViewer); - } - } - else if (p instanceof PropertySheet) { - if (propertySheetPages.contains(((PropertySheet)p).getCurrentPage())) { - getActionBarContributor().setActiveEditor(RecipientsEditor.this); - handleActivate(); - } - } - 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. - } - }; - - /** - * 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() { - @Override - 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() { - @Override - 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(); - - @Override - 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() { - @Override - public void run() { - removedResources.addAll(visitor.getRemovedResources()); - if (!isDirty()) { - getSite().getPage().closeEditor(RecipientsEditor.this, false); - } - } - }); - } - - if (!visitor.getChangedResources().isEmpty()) { - getSite().getShell().getDisplay().asyncExec - (new Runnable() { - @Override - public void run() { - changedResources.addAll(visitor.getChangedResources()); - if (getSite().getPage().getActiveEditor() == RecipientsEditor.this) { - handleActivate(); - } - } - }); - } - } - catch (CoreException exception) { - RecipientsEditorPlugin.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(RecipientsEditor.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.recipients.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) { - RecipientsEditorPlugin.INSTANCE.log(exception); - } - } - - if (markerHelper.hasMarkers(editingDomain.getResourceSet())) { - try { - markerHelper.updateMarkers(diagnostic); - } - catch (CoreException exception) { - RecipientsEditorPlugin.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 RecipientsEditor() { - 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 RecipientsItemProviderAdapterFactory()); - 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() { - @Override - public void commandStackChanged(final EventObject event) { - getContainer().getDisplay().asyncExec - (new Runnable() { - @Override - 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() { - @Override - 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 - */ - @Override - 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. - // - @Override - 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 - */ - @Override - 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.recipients.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.recipients.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(), RecipientsEditor.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(), RecipientsEditor.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(), RecipientsEditor.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(), RecipientsEditor.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(), RecipientsEditor.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(), RecipientsEditor.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() { - @Override - 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() { - @Override - 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. - // - @Override - 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) { - RecipientsEditor.this.setSelectionToViewer(selection); - RecipientsEditor.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. - // - RecipientsEditorPlugin.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 - */ - @Override - 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 - */ - @Override - public void addSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.add(listener); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider}. - * - * - * @generated - */ - @Override - public void removeSelectionChangedListener(ISelectionChangedListener listener) { - selectionChangedListeners.remove(listener); - } - - /** - * This implements {@link org.eclipse.jface.viewers.ISelectionProvider} to return this editor's overall selection. - * - * - * @generated - */ - @Override - 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 - */ - @Override - 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 RecipientsEditorPlugin.INSTANCE.getString(key); - } - - /** - * This looks up a string in plugin.properties, making a substitution. - * - * - * @generated - */ - private static String getString(String key, Object s1) { - return RecipientsEditorPlugin.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 - */ - @Override - 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.recipients.editor/src/edu/kit/ipd/sdq/metamodels/recipients/presentation/RecipientsEditorPlugin.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/src/edu/kit/ipd/sdq/metamodels/recipients/presentation/RecipientsEditorPlugin.java deleted file mode 100644 index 58e6b55..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/src/edu/kit/ipd/sdq/metamodels/recipients/presentation/RecipientsEditorPlugin.java +++ /dev/null @@ -1,91 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients.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 Recipients editor plugin. - * - * - * @generated - */ -public final class RecipientsEditorPlugin extends EMFPlugin { - /** - * Keep track of the singleton. - * - * - * @generated - */ - public static final RecipientsEditorPlugin INSTANCE = new RecipientsEditorPlugin(); - - /** - * Keep track of the singleton. - * - * - * @generated - */ - private static Implementation plugin; - - /** - * Create the instance. - * - * - * @generated - */ - public RecipientsEditorPlugin() { - 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.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 deleted file mode 100644 index 629fb67..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients.editor/src/edu/kit/ipd/sdq/metamodels/recipients/presentation/RecipientsModelWizard.java +++ /dev/null @@ -1,631 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients.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.recipients.RecipientsFactory; -import edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage; -import edu.kit.ipd.sdq.metamodels.recipients.provider.RecipientsEditPlugin; - - -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 RecipientsModelWizard extends Wizard implements INewWizard { - /** - * The supported extensions for created files. - * - * - * @generated - */ - public static final List FILE_EXTENSIONS = - Collections.unmodifiableList(Arrays.asList(RecipientsEditorPlugin.INSTANCE.getString("_UI_RecipientsEditorFilenameExtensions").split("\\s*,\\s*"))); - - /** - * A formatted list of supported file extensions, suitable for display. - * - * - * @generated - */ - public static final String FORMATTED_FILE_EXTENSIONS = - RecipientsEditorPlugin.INSTANCE.getString("_UI_RecipientsEditorFilenameExtensions").replaceAll("\\s*,\\s*", ", "); - - /** - * This caches an instance of the model package. - * - * - * @generated - */ - protected RecipientsPackage recipientsPackage = RecipientsPackage.eINSTANCE; - - /** - * This caches an instance of the model factory. - * - * - * @generated - */ - protected RecipientsFactory recipientsFactory = recipientsPackage.getRecipientsFactory(); - - /** - * This is the file creation page. - * - * - * @generated - */ - protected RecipientsModelWizardNewFileCreationPage newFileCreationPage; - - /** - * This is the initial object creation page. - * - * - * @generated - */ - protected RecipientsModelWizardInitialObjectCreationPage 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 - */ - @Override - public void init(IWorkbench workbench, IStructuredSelection selection) { - this.workbench = workbench; - this.selection = selection; - setWindowTitle(RecipientsEditorPlugin.INSTANCE.getString("_UI_Wizard_label")); - setDefaultPageImageDescriptor(ExtendedImageRegistry.INSTANCE.getImageDescriptor(RecipientsEditorPlugin.INSTANCE.getImage("full/wizban/NewRecipients"))); - } - - /** - * 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 : recipientsPackage.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)recipientsPackage.getEClassifier(initialObjectCreationPage.getInitialObjectName()); - EObject rootObject = recipientsFactory.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) { - RecipientsEditorPlugin.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() { - @Override - 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(), RecipientsEditorPlugin.INSTANCE.getString("_UI_OpenEditorError_label"), exception.getMessage()); - return false; - } - - return true; - } - catch (Exception exception) { - RecipientsEditorPlugin.INSTANCE.log(exception); - return false; - } - } - - /** - * This is the one page of the wizard. - * - * - * @generated - */ - public class RecipientsModelWizardNewFileCreationPage extends WizardNewFileCreationPage { - /** - * Pass in the selection. - * - * - * @generated - */ - public RecipientsModelWizardNewFileCreationPage(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(RecipientsEditorPlugin.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 RecipientsModelWizardInitialObjectCreationPage extends WizardPage { - /** - * - * - * @generated - */ - protected Combo initialObjectField; - - /** - * @generated - * - * - */ - protected List encodings; - - /** - * - * - * @generated - */ - protected Combo encodingField; - - /** - * Pass in the selection. - * - * - * @generated - */ - public RecipientsModelWizardInitialObjectCreationPage(String pageId) { - super(pageId); - } - - /** - * - * - * @generated - */ - @Override - 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(RecipientsEditorPlugin.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(RecipientsEditorPlugin.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() { - @Override - 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 RecipientsEditPlugin.INSTANCE.getString("_UI_" + typeName + "_type"); - } - catch(MissingResourceException mre) { - RecipientsEditorPlugin.INSTANCE.log(mre); - } - return typeName; - } - - /** - * - * - * @generated - */ - protected Collection getEncodings() { - if (encodings == null) { - encodings = new ArrayList(); - for (StringTokenizer stringTokenizer = new StringTokenizer(RecipientsEditorPlugin.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 RecipientsModelWizardNewFileCreationPage("Whatever", selection); - newFileCreationPage.setTitle(RecipientsEditorPlugin.INSTANCE.getString("_UI_RecipientsModelWizard_label")); - newFileCreationPage.setDescription(RecipientsEditorPlugin.INSTANCE.getString("_UI_RecipientsModelWizard_description")); - newFileCreationPage.setFileName(RecipientsEditorPlugin.INSTANCE.getString("_UI_RecipientsEditorFilenameDefaultBase") + "." + 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 = RecipientsEditorPlugin.INSTANCE.getString("_UI_RecipientsEditorFilenameDefaultBase"); - 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 RecipientsModelWizardInitialObjectCreationPage("Whatever2"); - initialObjectCreationPage.setTitle(RecipientsEditorPlugin.INSTANCE.getString("_UI_RecipientsModelWizard_label")); - initialObjectCreationPage.setDescription(RecipientsEditorPlugin.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.recipients/.classpath b/bundles/edu.kit.ipd.sdq.metamodels.recipients/.classpath index 685a699..5c68515 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/.classpath +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients/.classpath @@ -6,6 +6,6 @@ - + diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients/build.properties b/bundles/edu.kit.ipd.sdq.metamodels.recipients/build.properties index 7e8f70d..e981b6a 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/build.properties +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients/build.properties @@ -6,5 +6,5 @@ bin.includes = .,\ plugin.xml,\ plugin.properties jars.compile.order = . -source.. = src/ +source.. = src-gen/ output.. = target/classes/ 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 e895f5e..0233f9c 100644 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/model/recipients.genmodel +++ b/bundles/edu.kit.ipd.sdq.metamodels.recipients/model/recipients.genmodel @@ -1,9 +1,10 @@ + xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/edu.kit.ipd.sdq.metamodels.recipients/src-gen" + editDirectory="/edu.kit.ipd.sdq.metamodels.recipients.edit/src-gen" editorDirectory="/edu.kit.ipd.sdq.metamodels.recipients.editor/src-gen" + modelPluginID="edu.kit.ipd.sdq.metamodels.recipients" modelName="Recipients" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" + testsDirectory="/edu.kit.ipd.sdq.metamodels.recipients.tests/src-gen" importerID="org.eclipse.emf.importer.ecore" + complianceLevel="8.0" copyrightFields="false" operationReflection="true" importOrganizing="true"> recipients.ecore diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/City.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/City.java deleted file mode 100644 index 48186d5..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/City.java +++ /dev/null @@ -1,78 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients; - - -/** - * - * A representation of the model object 'City'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.City#getParent Parent}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.City#getZipCode Zip Code}
  • - *
- * - * @see edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage#getCity() - * @model - * @generated - */ -public interface City extends IdentifiedElement { - /** - * Returns the value of the 'Parent' container reference. - * It is bidirectional and its opposite is '{@link edu.kit.ipd.sdq.metamodels.recipients.Recipient#getLocatedIn Located In}'. - * - *

- * If the meaning of the 'Parent' container reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Parent' container reference. - * @see #setParent(Recipient) - * @see edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage#getCity_Parent() - * @see edu.kit.ipd.sdq.metamodels.recipients.Recipient#getLocatedIn - * @model opposite="locatedIn" required="true" transient="false" - * @generated - */ - Recipient getParent(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.recipients.City#getParent Parent}' container reference. - * - * - * @param value the new value of the 'Parent' container reference. - * @see #getParent() - * @generated - */ - void setParent(Recipient value); - - /** - * Returns the value of the 'Zip Code' attribute. - * - *

- * If the meaning of the 'Zip Code' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Zip Code' attribute. - * @see #setZipCode(String) - * @see edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage#getCity_ZipCode() - * @model required="true" - * @generated - */ - String getZipCode(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.recipients.City#getZipCode Zip Code}' attribute. - * - * - * @param value the new value of the 'Zip Code' attribute. - * @see #getZipCode() - * @generated - */ - void setZipCode(String value); - -} // City diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/IdentifiedElement.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/IdentifiedElement.java deleted file mode 100644 index 1a7baa8..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/IdentifiedElement.java +++ /dev/null @@ -1,50 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients; - -import org.eclipse.emf.ecore.EObject; - -/** - * - * A representation of the model object 'Identified Element'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.IdentifiedElement#getId Id}
  • - *
- * - * @see edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage#getIdentifiedElement() - * @model abstract="true" - * @generated - */ -public interface IdentifiedElement extends EObject { - /** - * Returns the value of the 'Id' attribute. - * - *

- * If the meaning of the 'Id' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Id' attribute. - * @see #setId(String) - * @see edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage#getIdentifiedElement_Id() - * @model id="true" required="true" - * @generated - */ - String getId(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.recipients.IdentifiedElement#getId Id}' attribute. - * - * - * @param value the new value of the 'Id' attribute. - * @see #getId() - * @generated - */ - void setId(String value); - -} // IdentifiedElement diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/Location.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/Location.java deleted file mode 100644 index 94a701b..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/Location.java +++ /dev/null @@ -1,105 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients; - - -/** - * - * A representation of the model object 'Location'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.Location#getParent Parent}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.Location#getNumber Number}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.Location#getStreet Street}
  • - *
- * - * @see edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage#getLocation() - * @model - * @generated - */ -public interface Location extends IdentifiedElement { - /** - * Returns the value of the 'Parent' container reference. - * It is bidirectional and its opposite is '{@link edu.kit.ipd.sdq.metamodels.recipients.Recipient#getLocatedAt Located At}'. - * - *

- * If the meaning of the 'Parent' container reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Parent' container reference. - * @see #setParent(Recipient) - * @see edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage#getLocation_Parent() - * @see edu.kit.ipd.sdq.metamodels.recipients.Recipient#getLocatedAt - * @model opposite="locatedAt" required="true" transient="false" - * @generated - */ - Recipient getParent(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.recipients.Location#getParent Parent}' container reference. - * - * - * @param value the new value of the 'Parent' container reference. - * @see #getParent() - * @generated - */ - void setParent(Recipient value); - - /** - * Returns the value of the 'Number' attribute. - * - *

- * If the meaning of the 'Number' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Number' attribute. - * @see #setNumber(int) - * @see edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage#getLocation_Number() - * @model required="true" - * @generated - */ - int getNumber(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.recipients.Location#getNumber Number}' attribute. - * - * - * @param value the new value of the 'Number' attribute. - * @see #getNumber() - * @generated - */ - void setNumber(int value); - - /** - * Returns the value of the 'Street' attribute. - * - *

- * If the meaning of the 'Street' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Street' attribute. - * @see #setStreet(String) - * @see edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage#getLocation_Street() - * @model required="true" - * @generated - */ - String getStreet(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.recipients.Location#getStreet Street}' attribute. - * - * - * @param value the new value of the 'Street' attribute. - * @see #getStreet() - * @generated - */ - void setStreet(String value); - -} // Location diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/Recipient.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/Recipient.java deleted file mode 100644 index c653819..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/Recipient.java +++ /dev/null @@ -1,137 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients; - - -/** - * - * A representation of the model object 'Recipient'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.Recipient#getParent Parent}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.Recipient#isBusiness Business}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.Recipient#getLocatedAt Located At}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.Recipient#getLocatedIn Located In}
  • - *
- * - * @see edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage#getRecipient() - * @model - * @generated - */ -public interface Recipient extends IdentifiedElement { - /** - * Returns the value of the 'Parent' container reference. - * It is bidirectional and its opposite is '{@link edu.kit.ipd.sdq.metamodels.recipients.Recipients#getRecipients Recipients}'. - * - *

- * If the meaning of the 'Parent' container reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Parent' container reference. - * @see #setParent(Recipients) - * @see edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage#getRecipient_Parent() - * @see edu.kit.ipd.sdq.metamodels.recipients.Recipients#getRecipients - * @model opposite="recipients" required="true" transient="false" - * @generated - */ - Recipients getParent(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.recipients.Recipient#getParent Parent}' container reference. - * - * - * @param value the new value of the 'Parent' container reference. - * @see #getParent() - * @generated - */ - void setParent(Recipients value); - - /** - * Returns the value of the 'Business' attribute. - * The default value is "false". - * - *

- * If the meaning of the 'Business' attribute isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Business' attribute. - * @see #setBusiness(boolean) - * @see edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage#getRecipient_Business() - * @model default="false" required="true" - * @generated - */ - boolean isBusiness(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.recipients.Recipient#isBusiness Business}' attribute. - * - * - * @param value the new value of the 'Business' attribute. - * @see #isBusiness() - * @generated - */ - void setBusiness(boolean value); - - /** - * Returns the value of the 'Located At' containment reference. - * It is bidirectional and its opposite is '{@link edu.kit.ipd.sdq.metamodels.recipients.Location#getParent Parent}'. - * - *

- * If the meaning of the 'Located At' containment reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Located At' containment reference. - * @see #setLocatedAt(Location) - * @see edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage#getRecipient_LocatedAt() - * @see edu.kit.ipd.sdq.metamodels.recipients.Location#getParent - * @model opposite="parent" containment="true" required="true" - * @generated - */ - Location getLocatedAt(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.recipients.Recipient#getLocatedAt Located At}' containment reference. - * - * - * @param value the new value of the 'Located At' containment reference. - * @see #getLocatedAt() - * @generated - */ - void setLocatedAt(Location value); - - /** - * Returns the value of the 'Located In' containment reference. - * It is bidirectional and its opposite is '{@link edu.kit.ipd.sdq.metamodels.recipients.City#getParent Parent}'. - * - *

- * If the meaning of the 'Located In' reference isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Located In' containment reference. - * @see #setLocatedIn(City) - * @see edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage#getRecipient_LocatedIn() - * @see edu.kit.ipd.sdq.metamodels.recipients.City#getParent - * @model opposite="parent" containment="true" required="true" - * @generated - */ - City getLocatedIn(); - - /** - * Sets the value of the '{@link edu.kit.ipd.sdq.metamodels.recipients.Recipient#getLocatedIn Located In}' containment reference. - * - * - * @param value the new value of the 'Located In' containment reference. - * @see #getLocatedIn() - * @generated - */ - void setLocatedIn(City value); - -} // Recipient diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/Recipients.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/Recipients.java deleted file mode 100644 index 05c2f88..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/Recipients.java +++ /dev/null @@ -1,42 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients; - -import org.eclipse.emf.common.util.EList; - -/** - * - * A representation of the model object 'Recipients'. - * - * - *

- * The following features are supported: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.Recipients#getRecipients Recipients}
  • - *
- * - * @see edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage#getRecipients() - * @model - * @generated - */ -public interface Recipients extends IdentifiedElement { - /** - * Returns the value of the 'Recipients' containment reference list. - * The list contents are of type {@link edu.kit.ipd.sdq.metamodels.recipients.Recipient}. - * It is bidirectional and its opposite is '{@link edu.kit.ipd.sdq.metamodels.recipients.Recipient#getParent Parent}'. - * - *

- * If the meaning of the 'Recipients' containment reference list isn't clear, - * there really should be more of a description here... - *

- * - * @return the value of the 'Recipients' containment reference list. - * @see edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage#getRecipients_Recipients() - * @see edu.kit.ipd.sdq.metamodels.recipients.Recipient#getParent - * @model opposite="parent" containment="true" required="true" - * @generated - */ - EList getRecipients(); - -} // Recipients diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/RecipientsFactory.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/RecipientsFactory.java deleted file mode 100644 index 5d40ebf..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/RecipientsFactory.java +++ /dev/null @@ -1,69 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients; - -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.recipients.RecipientsPackage - * @generated - */ -public interface RecipientsFactory extends EFactory { - /** - * The singleton instance of the factory. - * - * - * @generated - */ - RecipientsFactory eINSTANCE = edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientsFactoryImpl.init(); - - /** - * Returns a new object of class 'Recipient'. - * - * - * @return a new object of class 'Recipient'. - * @generated - */ - Recipient createRecipient(); - - /** - * Returns a new object of class 'Location'. - * - * - * @return a new object of class 'Location'. - * @generated - */ - Location createLocation(); - - /** - * Returns a new object of class 'City'. - * - * - * @return a new object of class 'City'. - * @generated - */ - City createCity(); - - /** - * Returns a new object of class 'Recipients'. - * - * - * @return a new object of class 'Recipients'. - * @generated - */ - Recipients createRecipients(); - - /** - * Returns the package supported by this factory. - * - * - * @return the package supported by this factory. - * @generated - */ - RecipientsPackage getRecipientsPackage(); - -} //RecipientsFactory diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/RecipientsPackage.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/RecipientsPackage.java deleted file mode 100644 index aaeed45..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/RecipientsPackage.java +++ /dev/null @@ -1,669 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -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.recipients.RecipientsFactory - * @model kind="package" - * @generated - */ -public interface RecipientsPackage extends EPackage { - /** - * The package name. - * - * - * @generated - */ - String eNAME = "recipients"; - - /** - * The package namespace URI. - * - * - * @generated - */ - String eNS_URI = "edu.kit.ipd.sdq.metamodels.recipients"; - - /** - * The package namespace name. - * - * - * @generated - */ - String eNS_PREFIX = "recipients"; - - /** - * The singleton instance of the package. - * - * - * @generated - */ - RecipientsPackage eINSTANCE = edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientsPackageImpl.init(); - - /** - * The meta object id for the '{@link edu.kit.ipd.sdq.metamodels.recipients.impl.IdentifiedElementImpl Identified Element}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.recipients.impl.IdentifiedElementImpl - * @see edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientsPackageImpl#getIdentifiedElement() - * @generated - */ - int IDENTIFIED_ELEMENT = 0; - - /** - * The feature id for the 'Id' attribute. - * - * - * @generated - * @ordered - */ - int IDENTIFIED_ELEMENT__ID = 0; - - /** - * The number of structural features of the 'Identified Element' class. - * - * - * @generated - * @ordered - */ - int IDENTIFIED_ELEMENT_FEATURE_COUNT = 1; - - /** - * The number of operations of the 'Identified Element' class. - * - * - * @generated - * @ordered - */ - int IDENTIFIED_ELEMENT_OPERATION_COUNT = 0; - - /** - * The meta object id for the '{@link edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientImpl Recipient}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientImpl - * @see edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientsPackageImpl#getRecipient() - * @generated - */ - int RECIPIENT = 2; - - /** - * The meta object id for the '{@link edu.kit.ipd.sdq.metamodels.recipients.impl.LocationImpl Location}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.recipients.impl.LocationImpl - * @see edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientsPackageImpl#getLocation() - * @generated - */ - int LOCATION = 3; - - /** - * The meta object id for the '{@link edu.kit.ipd.sdq.metamodels.recipients.impl.CityImpl City}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.recipients.impl.CityImpl - * @see edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientsPackageImpl#getCity() - * @generated - */ - int CITY = 4; - - /** - * The meta object id for the '{@link edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientsImpl Recipients}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientsImpl - * @see edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientsPackageImpl#getRecipients() - * @generated - */ - int RECIPIENTS = 1; - - /** - * The feature id for the 'Id' attribute. - * - * - * @generated - * @ordered - */ - int RECIPIENTS__ID = IDENTIFIED_ELEMENT__ID; - - /** - * The feature id for the 'Recipients' containment reference list. - * - * - * @generated - * @ordered - */ - int RECIPIENTS__RECIPIENTS = IDENTIFIED_ELEMENT_FEATURE_COUNT + 0; - - /** - * The number of structural features of the 'Recipients' class. - * - * - * @generated - * @ordered - */ - int RECIPIENTS_FEATURE_COUNT = IDENTIFIED_ELEMENT_FEATURE_COUNT + 1; - - /** - * The number of operations of the 'Recipients' class. - * - * - * @generated - * @ordered - */ - int RECIPIENTS_OPERATION_COUNT = IDENTIFIED_ELEMENT_OPERATION_COUNT + 0; - - /** - * The feature id for the 'Id' attribute. - * - * - * @generated - * @ordered - */ - int RECIPIENT__ID = IDENTIFIED_ELEMENT__ID; - - /** - * The feature id for the 'Parent' container reference. - * - * - * @generated - * @ordered - */ - int RECIPIENT__PARENT = IDENTIFIED_ELEMENT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Business' attribute. - * - * - * @generated - * @ordered - */ - int RECIPIENT__BUSINESS = IDENTIFIED_ELEMENT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Located At' containment reference. - * - * - * @generated - * @ordered - */ - int RECIPIENT__LOCATED_AT = IDENTIFIED_ELEMENT_FEATURE_COUNT + 2; - - /** - * The feature id for the 'Located In' containment reference. - * - * - * @generated - * @ordered - */ - int RECIPIENT__LOCATED_IN = IDENTIFIED_ELEMENT_FEATURE_COUNT + 3; - - /** - * The number of structural features of the 'Recipient' class. - * - * - * @generated - * @ordered - */ - int RECIPIENT_FEATURE_COUNT = IDENTIFIED_ELEMENT_FEATURE_COUNT + 4; - - /** - * The number of operations of the 'Recipient' class. - * - * - * @generated - * @ordered - */ - int RECIPIENT_OPERATION_COUNT = IDENTIFIED_ELEMENT_OPERATION_COUNT + 0; - - /** - * The feature id for the 'Id' attribute. - * - * - * @generated - * @ordered - */ - int LOCATION__ID = IDENTIFIED_ELEMENT__ID; - - /** - * The feature id for the 'Parent' container reference. - * - * - * @generated - * @ordered - */ - int LOCATION__PARENT = IDENTIFIED_ELEMENT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Number' attribute. - * - * - * @generated - * @ordered - */ - int LOCATION__NUMBER = IDENTIFIED_ELEMENT_FEATURE_COUNT + 1; - - /** - * The feature id for the 'Street' attribute. - * - * - * @generated - * @ordered - */ - int LOCATION__STREET = IDENTIFIED_ELEMENT_FEATURE_COUNT + 2; - - /** - * The number of structural features of the 'Location' class. - * - * - * @generated - * @ordered - */ - int LOCATION_FEATURE_COUNT = IDENTIFIED_ELEMENT_FEATURE_COUNT + 3; - - /** - * The number of operations of the 'Location' class. - * - * - * @generated - * @ordered - */ - int LOCATION_OPERATION_COUNT = IDENTIFIED_ELEMENT_OPERATION_COUNT + 0; - - /** - * The feature id for the 'Id' attribute. - * - * - * @generated - * @ordered - */ - int CITY__ID = IDENTIFIED_ELEMENT__ID; - - /** - * The feature id for the 'Parent' container reference. - * - * - * @generated - * @ordered - */ - int CITY__PARENT = IDENTIFIED_ELEMENT_FEATURE_COUNT + 0; - - /** - * The feature id for the 'Zip Code' attribute. - * - * - * @generated - * @ordered - */ - int CITY__ZIP_CODE = IDENTIFIED_ELEMENT_FEATURE_COUNT + 1; - - /** - * The number of structural features of the 'City' class. - * - * - * @generated - * @ordered - */ - int CITY_FEATURE_COUNT = IDENTIFIED_ELEMENT_FEATURE_COUNT + 2; - - /** - * The number of operations of the 'City' class. - * - * - * @generated - * @ordered - */ - int CITY_OPERATION_COUNT = IDENTIFIED_ELEMENT_OPERATION_COUNT + 0; - - - /** - * Returns the meta object for class '{@link edu.kit.ipd.sdq.metamodels.recipients.IdentifiedElement Identified Element}'. - * - * - * @return the meta object for class 'Identified Element'. - * @see edu.kit.ipd.sdq.metamodels.recipients.IdentifiedElement - * @generated - */ - EClass getIdentifiedElement(); - - /** - * Returns the meta object for the attribute '{@link edu.kit.ipd.sdq.metamodels.recipients.IdentifiedElement#getId Id}'. - * - * - * @return the meta object for the attribute 'Id'. - * @see edu.kit.ipd.sdq.metamodels.recipients.IdentifiedElement#getId() - * @see #getIdentifiedElement() - * @generated - */ - EAttribute getIdentifiedElement_Id(); - - /** - * Returns the meta object for class '{@link edu.kit.ipd.sdq.metamodels.recipients.Recipient Recipient}'. - * - * - * @return the meta object for class 'Recipient'. - * @see edu.kit.ipd.sdq.metamodels.recipients.Recipient - * @generated - */ - EClass getRecipient(); - - /** - * Returns the meta object for the container reference '{@link edu.kit.ipd.sdq.metamodels.recipients.Recipient#getParent Parent}'. - * - * - * @return the meta object for the container reference 'Parent'. - * @see edu.kit.ipd.sdq.metamodels.recipients.Recipient#getParent() - * @see #getRecipient() - * @generated - */ - EReference getRecipient_Parent(); - - /** - * Returns the meta object for the attribute '{@link edu.kit.ipd.sdq.metamodels.recipients.Recipient#isBusiness Business}'. - * - * - * @return the meta object for the attribute 'Business'. - * @see edu.kit.ipd.sdq.metamodels.recipients.Recipient#isBusiness() - * @see #getRecipient() - * @generated - */ - EAttribute getRecipient_Business(); - - /** - * Returns the meta object for the containment reference '{@link edu.kit.ipd.sdq.metamodels.recipients.Recipient#getLocatedAt Located At}'. - * - * - * @return the meta object for the containment reference 'Located At'. - * @see edu.kit.ipd.sdq.metamodels.recipients.Recipient#getLocatedAt() - * @see #getRecipient() - * @generated - */ - EReference getRecipient_LocatedAt(); - - /** - * Returns the meta object for the containment reference '{@link edu.kit.ipd.sdq.metamodels.recipients.Recipient#getLocatedIn Located In}'. - * - * - * @return the meta object for the containment reference 'Located In'. - * @see edu.kit.ipd.sdq.metamodels.recipients.Recipient#getLocatedIn() - * @see #getRecipient() - * @generated - */ - EReference getRecipient_LocatedIn(); - - /** - * Returns the meta object for class '{@link edu.kit.ipd.sdq.metamodels.recipients.Location Location}'. - * - * - * @return the meta object for class 'Location'. - * @see edu.kit.ipd.sdq.metamodels.recipients.Location - * @generated - */ - EClass getLocation(); - - /** - * Returns the meta object for the container reference '{@link edu.kit.ipd.sdq.metamodels.recipients.Location#getParent Parent}'. - * - * - * @return the meta object for the container reference 'Parent'. - * @see edu.kit.ipd.sdq.metamodels.recipients.Location#getParent() - * @see #getLocation() - * @generated - */ - EReference getLocation_Parent(); - - /** - * Returns the meta object for the attribute '{@link edu.kit.ipd.sdq.metamodels.recipients.Location#getNumber Number}'. - * - * - * @return the meta object for the attribute 'Number'. - * @see edu.kit.ipd.sdq.metamodels.recipients.Location#getNumber() - * @see #getLocation() - * @generated - */ - EAttribute getLocation_Number(); - - /** - * Returns the meta object for the attribute '{@link edu.kit.ipd.sdq.metamodels.recipients.Location#getStreet Street}'. - * - * - * @return the meta object for the attribute 'Street'. - * @see edu.kit.ipd.sdq.metamodels.recipients.Location#getStreet() - * @see #getLocation() - * @generated - */ - EAttribute getLocation_Street(); - - /** - * Returns the meta object for class '{@link edu.kit.ipd.sdq.metamodels.recipients.City City}'. - * - * - * @return the meta object for class 'City'. - * @see edu.kit.ipd.sdq.metamodels.recipients.City - * @generated - */ - EClass getCity(); - - /** - * Returns the meta object for the container reference '{@link edu.kit.ipd.sdq.metamodels.recipients.City#getParent Parent}'. - * - * - * @return the meta object for the container reference 'Parent'. - * @see edu.kit.ipd.sdq.metamodels.recipients.City#getParent() - * @see #getCity() - * @generated - */ - EReference getCity_Parent(); - - /** - * Returns the meta object for the attribute '{@link edu.kit.ipd.sdq.metamodels.recipients.City#getZipCode Zip Code}'. - * - * - * @return the meta object for the attribute 'Zip Code'. - * @see edu.kit.ipd.sdq.metamodels.recipients.City#getZipCode() - * @see #getCity() - * @generated - */ - EAttribute getCity_ZipCode(); - - /** - * Returns the meta object for class '{@link edu.kit.ipd.sdq.metamodels.recipients.Recipients Recipients}'. - * - * - * @return the meta object for class 'Recipients'. - * @see edu.kit.ipd.sdq.metamodels.recipients.Recipients - * @generated - */ - EClass getRecipients(); - - /** - * Returns the meta object for the containment reference list '{@link edu.kit.ipd.sdq.metamodels.recipients.Recipients#getRecipients Recipients}'. - * - * - * @return the meta object for the containment reference list 'Recipients'. - * @see edu.kit.ipd.sdq.metamodels.recipients.Recipients#getRecipients() - * @see #getRecipients() - * @generated - */ - EReference getRecipients_Recipients(); - - /** - * Returns the factory that creates the instances of the model. - * - * - * @return the factory that creates the instances of the model. - * @generated - */ - RecipientsFactory getRecipientsFactory(); - - /** - * - * 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.recipients.impl.IdentifiedElementImpl Identified Element}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.recipients.impl.IdentifiedElementImpl - * @see edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientsPackageImpl#getIdentifiedElement() - * @generated - */ - EClass IDENTIFIED_ELEMENT = eINSTANCE.getIdentifiedElement(); - - /** - * The meta object literal for the 'Id' attribute feature. - * - * - * @generated - */ - EAttribute IDENTIFIED_ELEMENT__ID = eINSTANCE.getIdentifiedElement_Id(); - - /** - * The meta object literal for the '{@link edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientImpl Recipient}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientImpl - * @see edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientsPackageImpl#getRecipient() - * @generated - */ - EClass RECIPIENT = eINSTANCE.getRecipient(); - - /** - * The meta object literal for the 'Parent' container reference feature. - * - * - * @generated - */ - EReference RECIPIENT__PARENT = eINSTANCE.getRecipient_Parent(); - - /** - * The meta object literal for the 'Business' attribute feature. - * - * - * @generated - */ - EAttribute RECIPIENT__BUSINESS = eINSTANCE.getRecipient_Business(); - - /** - * The meta object literal for the 'Located At' containment reference feature. - * - * - * @generated - */ - EReference RECIPIENT__LOCATED_AT = eINSTANCE.getRecipient_LocatedAt(); - - /** - * The meta object literal for the 'Located In' containment reference feature. - * - * - * @generated - */ - EReference RECIPIENT__LOCATED_IN = eINSTANCE.getRecipient_LocatedIn(); - - /** - * The meta object literal for the '{@link edu.kit.ipd.sdq.metamodels.recipients.impl.LocationImpl Location}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.recipients.impl.LocationImpl - * @see edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientsPackageImpl#getLocation() - * @generated - */ - EClass LOCATION = eINSTANCE.getLocation(); - - /** - * The meta object literal for the 'Parent' container reference feature. - * - * - * @generated - */ - EReference LOCATION__PARENT = eINSTANCE.getLocation_Parent(); - - /** - * The meta object literal for the 'Number' attribute feature. - * - * - * @generated - */ - EAttribute LOCATION__NUMBER = eINSTANCE.getLocation_Number(); - - /** - * The meta object literal for the 'Street' attribute feature. - * - * - * @generated - */ - EAttribute LOCATION__STREET = eINSTANCE.getLocation_Street(); - - /** - * The meta object literal for the '{@link edu.kit.ipd.sdq.metamodels.recipients.impl.CityImpl City}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.recipients.impl.CityImpl - * @see edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientsPackageImpl#getCity() - * @generated - */ - EClass CITY = eINSTANCE.getCity(); - - /** - * The meta object literal for the 'Parent' container reference feature. - * - * - * @generated - */ - EReference CITY__PARENT = eINSTANCE.getCity_Parent(); - - /** - * The meta object literal for the 'Zip Code' attribute feature. - * - * - * @generated - */ - EAttribute CITY__ZIP_CODE = eINSTANCE.getCity_ZipCode(); - - /** - * The meta object literal for the '{@link edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientsImpl Recipients}' class. - * - * - * @see edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientsImpl - * @see edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientsPackageImpl#getRecipients() - * @generated - */ - EClass RECIPIENTS = eINSTANCE.getRecipients(); - - /** - * The meta object literal for the 'Recipients' containment reference list feature. - * - * - * @generated - */ - EReference RECIPIENTS__RECIPIENTS = eINSTANCE.getRecipients_Recipients(); - - } - -} //RecipientsPackage 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 deleted file mode 100644 index 7b6474b..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/CityImpl.java +++ /dev/null @@ -1,266 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients.impl; - -import edu.kit.ipd.sdq.metamodels.recipients.City; -import edu.kit.ipd.sdq.metamodels.recipients.Recipient; -import edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; - -/** - * - * An implementation of the model object 'City'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.impl.CityImpl#getParent Parent}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.impl.CityImpl#getZipCode Zip Code}
  • - *
- * - * @generated - */ -public class CityImpl extends IdentifiedElementImpl implements City { - /** - * The default value of the '{@link #getZipCode() Zip Code}' attribute. - * - * - * @see #getZipCode() - * @generated - * @ordered - */ - protected static final String ZIP_CODE_EDEFAULT = null; - - /** - * The cached value of the '{@link #getZipCode() Zip Code}' attribute. - * - * - * @see #getZipCode() - * @generated - * @ordered - */ - protected String zipCode = ZIP_CODE_EDEFAULT; - - /** - * - * - * @generated - */ - protected CityImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return RecipientsPackage.Literals.CITY; - } - - /** - * - * - * @generated - */ - @Override - public Recipient getParent() { - if (eContainerFeatureID() != RecipientsPackage.CITY__PARENT) return null; - return (Recipient)eInternalContainer(); - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetParent(Recipient newParent, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject)newParent, RecipientsPackage.CITY__PARENT, msgs); - return msgs; - } - - /** - * - * - * @generated - */ - @Override - public void setParent(Recipient newParent) { - if (newParent != eInternalContainer() || (eContainerFeatureID() != RecipientsPackage.CITY__PARENT && newParent != null)) { - if (EcoreUtil.isAncestor(this, newParent)) - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - NotificationChain msgs = null; - if (eInternalContainer() != null) - msgs = eBasicRemoveFromContainer(msgs); - if (newParent != null) - msgs = ((InternalEObject)newParent).eInverseAdd(this, RecipientsPackage.RECIPIENT__LOCATED_IN, Recipient.class, msgs); - msgs = basicSetParent(newParent, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, RecipientsPackage.CITY__PARENT, newParent, newParent)); - } - - /** - * - * - * @generated - */ - @Override - public String getZipCode() { - return zipCode; - } - - /** - * - * - * @generated - */ - @Override - public void setZipCode(String newZipCode) { - String oldZipCode = zipCode; - zipCode = newZipCode; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, RecipientsPackage.CITY__ZIP_CODE, oldZipCode, zipCode)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case RecipientsPackage.CITY__PARENT: - if (eInternalContainer() != null) - msgs = eBasicRemoveFromContainer(msgs); - return basicSetParent((Recipient)otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case RecipientsPackage.CITY__PARENT: - return basicSetParent(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID()) { - case RecipientsPackage.CITY__PARENT: - return eInternalContainer().eInverseRemove(this, RecipientsPackage.RECIPIENT__LOCATED_IN, Recipient.class, msgs); - } - return super.eBasicRemoveFromContainerFeature(msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case RecipientsPackage.CITY__PARENT: - return getParent(); - case RecipientsPackage.CITY__ZIP_CODE: - return getZipCode(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case RecipientsPackage.CITY__PARENT: - setParent((Recipient)newValue); - return; - case RecipientsPackage.CITY__ZIP_CODE: - setZipCode((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case RecipientsPackage.CITY__PARENT: - setParent((Recipient)null); - return; - case RecipientsPackage.CITY__ZIP_CODE: - setZipCode(ZIP_CODE_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case RecipientsPackage.CITY__PARENT: - return getParent() != null; - case RecipientsPackage.CITY__ZIP_CODE: - return ZIP_CODE_EDEFAULT == null ? zipCode != null : !ZIP_CODE_EDEFAULT.equals(zipCode); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuilder result = new StringBuilder(super.toString()); - result.append(" (zipCode: "); - result.append(zipCode); - result.append(')'); - return result.toString(); - } - -} //CityImpl 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 deleted file mode 100644 index 102d7d6..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/IdentifiedElementImpl.java +++ /dev/null @@ -1,167 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients.impl; - -import edu.kit.ipd.sdq.metamodels.recipients.IdentifiedElement; -import edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; - -/** - * - * An implementation of the model object 'Identified Element'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.impl.IdentifiedElementImpl#getId Id}
  • - *
- * - * @generated - */ -public abstract class IdentifiedElementImpl extends MinimalEObjectImpl.Container implements IdentifiedElement { - /** - * The default value of the '{@link #getId() Id}' attribute. - * - * - * @see #getId() - * @generated - * @ordered - */ - protected static final String ID_EDEFAULT = null; - - /** - * The cached value of the '{@link #getId() Id}' attribute. - * - * - * @see #getId() - * @generated - * @ordered - */ - protected String id = ID_EDEFAULT; - - /** - * - * - * @generated NOT - */ - protected IdentifiedElementImpl() { - super(); - this.id = EcoreUtil.generateUUID(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return RecipientsPackage.Literals.IDENTIFIED_ELEMENT; - } - - /** - * - * - * @generated - */ - @Override - public String getId() { - return id; - } - - /** - * - * - * @generated - */ - @Override - public void setId(String newId) { - String oldId = id; - id = newId; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, RecipientsPackage.IDENTIFIED_ELEMENT__ID, oldId, id)); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case RecipientsPackage.IDENTIFIED_ELEMENT__ID: - return getId(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case RecipientsPackage.IDENTIFIED_ELEMENT__ID: - setId((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case RecipientsPackage.IDENTIFIED_ELEMENT__ID: - setId(ID_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case RecipientsPackage.IDENTIFIED_ELEMENT__ID: - return ID_EDEFAULT == null ? id != null : !ID_EDEFAULT.equals(id); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuilder result = new StringBuilder(super.toString()); - result.append(" (id: "); - result.append(id); - result.append(')'); - return result.toString(); - } - -} //IdentifiedElementImpl 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 deleted file mode 100644 index 4f86b29..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/LocationImpl.java +++ /dev/null @@ -1,322 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients.impl; - -import edu.kit.ipd.sdq.metamodels.recipients.Location; -import edu.kit.ipd.sdq.metamodels.recipients.Recipient; -import edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage; - -import org.eclipse.emf.common.notify.Notification; - -import org.eclipse.emf.common.notify.NotificationChain; -import org.eclipse.emf.ecore.EClass; - -import org.eclipse.emf.ecore.InternalEObject; -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; - -/** - * - * An implementation of the model object 'Location'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.impl.LocationImpl#getParent Parent}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.impl.LocationImpl#getNumber Number}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.impl.LocationImpl#getStreet Street}
  • - *
- * - * @generated - */ -public class LocationImpl extends IdentifiedElementImpl implements Location { - /** - * The default value of the '{@link #getNumber() Number}' attribute. - * - * - * @see #getNumber() - * @generated - * @ordered - */ - protected static final int NUMBER_EDEFAULT = 0; - - /** - * The cached value of the '{@link #getNumber() Number}' attribute. - * - * - * @see #getNumber() - * @generated - * @ordered - */ - protected int number = NUMBER_EDEFAULT; - - /** - * The default value of the '{@link #getStreet() Street}' attribute. - * - * - * @see #getStreet() - * @generated - * @ordered - */ - protected static final String STREET_EDEFAULT = null; - - /** - * The cached value of the '{@link #getStreet() Street}' attribute. - * - * - * @see #getStreet() - * @generated - * @ordered - */ - protected String street = STREET_EDEFAULT; - - /** - * - * - * @generated - */ - protected LocationImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return RecipientsPackage.Literals.LOCATION; - } - - /** - * - * - * @generated - */ - @Override - public Recipient getParent() { - if (eContainerFeatureID() != RecipientsPackage.LOCATION__PARENT) return null; - return (Recipient)eInternalContainer(); - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetParent(Recipient newParent, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject)newParent, RecipientsPackage.LOCATION__PARENT, msgs); - return msgs; - } - - /** - * - * - * @generated - */ - @Override - public void setParent(Recipient newParent) { - if (newParent != eInternalContainer() || (eContainerFeatureID() != RecipientsPackage.LOCATION__PARENT && newParent != null)) { - if (EcoreUtil.isAncestor(this, newParent)) - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - NotificationChain msgs = null; - if (eInternalContainer() != null) - msgs = eBasicRemoveFromContainer(msgs); - if (newParent != null) - msgs = ((InternalEObject)newParent).eInverseAdd(this, RecipientsPackage.RECIPIENT__LOCATED_AT, Recipient.class, msgs); - msgs = basicSetParent(newParent, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, RecipientsPackage.LOCATION__PARENT, newParent, newParent)); - } - - /** - * - * - * @generated - */ - @Override - public int getNumber() { - return number; - } - - /** - * - * - * @generated - */ - @Override - public void setNumber(int newNumber) { - int oldNumber = number; - number = newNumber; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, RecipientsPackage.LOCATION__NUMBER, oldNumber, number)); - } - - /** - * - * - * @generated - */ - @Override - public String getStreet() { - return street; - } - - /** - * - * - * @generated - */ - @Override - public void setStreet(String newStreet) { - String oldStreet = street; - street = newStreet; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, RecipientsPackage.LOCATION__STREET, oldStreet, street)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case RecipientsPackage.LOCATION__PARENT: - if (eInternalContainer() != null) - msgs = eBasicRemoveFromContainer(msgs); - return basicSetParent((Recipient)otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case RecipientsPackage.LOCATION__PARENT: - return basicSetParent(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID()) { - case RecipientsPackage.LOCATION__PARENT: - return eInternalContainer().eInverseRemove(this, RecipientsPackage.RECIPIENT__LOCATED_AT, Recipient.class, msgs); - } - return super.eBasicRemoveFromContainerFeature(msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case RecipientsPackage.LOCATION__PARENT: - return getParent(); - case RecipientsPackage.LOCATION__NUMBER: - return getNumber(); - case RecipientsPackage.LOCATION__STREET: - return getStreet(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case RecipientsPackage.LOCATION__PARENT: - setParent((Recipient)newValue); - return; - case RecipientsPackage.LOCATION__NUMBER: - setNumber((Integer)newValue); - return; - case RecipientsPackage.LOCATION__STREET: - setStreet((String)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case RecipientsPackage.LOCATION__PARENT: - setParent((Recipient)null); - return; - case RecipientsPackage.LOCATION__NUMBER: - setNumber(NUMBER_EDEFAULT); - return; - case RecipientsPackage.LOCATION__STREET: - setStreet(STREET_EDEFAULT); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case RecipientsPackage.LOCATION__PARENT: - return getParent() != null; - case RecipientsPackage.LOCATION__NUMBER: - return number != NUMBER_EDEFAULT; - case RecipientsPackage.LOCATION__STREET: - return STREET_EDEFAULT == null ? street != null : !STREET_EDEFAULT.equals(street); - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuilder result = new StringBuilder(super.toString()); - result.append(" (number: "); - result.append(number); - result.append(", street: "); - result.append(street); - result.append(')'); - return result.toString(); - } - -} //LocationImpl 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 deleted file mode 100644 index a3bbe06..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/RecipientImpl.java +++ /dev/null @@ -1,412 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients.impl; - -import edu.kit.ipd.sdq.metamodels.recipients.City; -import edu.kit.ipd.sdq.metamodels.recipients.Location; -import edu.kit.ipd.sdq.metamodels.recipients.Recipient; -import edu.kit.ipd.sdq.metamodels.recipients.Recipients; -import edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage; - -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.common.notify.NotificationChain; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.InternalEObject; - -import org.eclipse.emf.ecore.impl.ENotificationImpl; -import org.eclipse.emf.ecore.util.EcoreUtil; - -/** - * - * An implementation of the model object 'Recipient'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientImpl#getParent Parent}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientImpl#isBusiness Business}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientImpl#getLocatedAt Located At}
  • - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientImpl#getLocatedIn Located In}
  • - *
- * - * @generated - */ -public class RecipientImpl extends IdentifiedElementImpl implements Recipient { - /** - * The default value of the '{@link #isBusiness() Business}' attribute. - * - * - * @see #isBusiness() - * @generated - * @ordered - */ - protected static final boolean BUSINESS_EDEFAULT = false; - - /** - * The cached value of the '{@link #isBusiness() Business}' attribute. - * - * - * @see #isBusiness() - * @generated - * @ordered - */ - protected boolean business = BUSINESS_EDEFAULT; - - /** - * The cached value of the '{@link #getLocatedAt() Located At}' containment reference. - * - * - * @see #getLocatedAt() - * @generated - * @ordered - */ - protected Location locatedAt; - - /** - * The cached value of the '{@link #getLocatedIn() Located In}' containment reference. - * - * - * @see #getLocatedIn() - * @generated - * @ordered - */ - protected City locatedIn; - - /** - * - * - * @generated - */ - protected RecipientImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return RecipientsPackage.Literals.RECIPIENT; - } - - /** - * - * - * @generated - */ - @Override - public Recipients getParent() { - if (eContainerFeatureID() != RecipientsPackage.RECIPIENT__PARENT) return null; - return (Recipients)eInternalContainer(); - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetParent(Recipients newParent, NotificationChain msgs) { - msgs = eBasicSetContainer((InternalEObject)newParent, RecipientsPackage.RECIPIENT__PARENT, msgs); - return msgs; - } - - /** - * - * - * @generated - */ - @Override - public void setParent(Recipients newParent) { - if (newParent != eInternalContainer() || (eContainerFeatureID() != RecipientsPackage.RECIPIENT__PARENT && newParent != null)) { - if (EcoreUtil.isAncestor(this, newParent)) - throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); - NotificationChain msgs = null; - if (eInternalContainer() != null) - msgs = eBasicRemoveFromContainer(msgs); - if (newParent != null) - msgs = ((InternalEObject)newParent).eInverseAdd(this, RecipientsPackage.RECIPIENTS__RECIPIENTS, Recipients.class, msgs); - msgs = basicSetParent(newParent, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, RecipientsPackage.RECIPIENT__PARENT, newParent, newParent)); - } - - /** - * - * - * @generated - */ - @Override - public boolean isBusiness() { - return business; - } - - /** - * - * - * @generated - */ - @Override - public void setBusiness(boolean newBusiness) { - boolean oldBusiness = business; - business = newBusiness; - if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, RecipientsPackage.RECIPIENT__BUSINESS, oldBusiness, business)); - } - - /** - * - * - * @generated - */ - @Override - public Location getLocatedAt() { - return locatedAt; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetLocatedAt(Location newLocatedAt, NotificationChain msgs) { - Location oldLocatedAt = locatedAt; - locatedAt = newLocatedAt; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RecipientsPackage.RECIPIENT__LOCATED_AT, oldLocatedAt, newLocatedAt); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - @Override - public void setLocatedAt(Location newLocatedAt) { - if (newLocatedAt != locatedAt) { - NotificationChain msgs = null; - if (locatedAt != null) - msgs = ((InternalEObject)locatedAt).eInverseRemove(this, RecipientsPackage.LOCATION__PARENT, Location.class, msgs); - if (newLocatedAt != null) - msgs = ((InternalEObject)newLocatedAt).eInverseAdd(this, RecipientsPackage.LOCATION__PARENT, Location.class, msgs); - msgs = basicSetLocatedAt(newLocatedAt, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, RecipientsPackage.RECIPIENT__LOCATED_AT, newLocatedAt, newLocatedAt)); - } - - /** - * - * - * @generated - */ - @Override - public City getLocatedIn() { - return locatedIn; - } - - /** - * - * - * @generated - */ - public NotificationChain basicSetLocatedIn(City newLocatedIn, NotificationChain msgs) { - City oldLocatedIn = locatedIn; - locatedIn = newLocatedIn; - if (eNotificationRequired()) { - ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, RecipientsPackage.RECIPIENT__LOCATED_IN, oldLocatedIn, newLocatedIn); - if (msgs == null) msgs = notification; else msgs.add(notification); - } - return msgs; - } - - /** - * - * - * @generated - */ - @Override - public void setLocatedIn(City newLocatedIn) { - if (newLocatedIn != locatedIn) { - NotificationChain msgs = null; - if (locatedIn != null) - msgs = ((InternalEObject)locatedIn).eInverseRemove(this, RecipientsPackage.CITY__PARENT, City.class, msgs); - if (newLocatedIn != null) - msgs = ((InternalEObject)newLocatedIn).eInverseAdd(this, RecipientsPackage.CITY__PARENT, City.class, msgs); - msgs = basicSetLocatedIn(newLocatedIn, msgs); - if (msgs != null) msgs.dispatch(); - } - else if (eNotificationRequired()) - eNotify(new ENotificationImpl(this, Notification.SET, RecipientsPackage.RECIPIENT__LOCATED_IN, newLocatedIn, newLocatedIn)); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case RecipientsPackage.RECIPIENT__PARENT: - if (eInternalContainer() != null) - msgs = eBasicRemoveFromContainer(msgs); - return basicSetParent((Recipients)otherEnd, msgs); - case RecipientsPackage.RECIPIENT__LOCATED_AT: - if (locatedAt != null) - msgs = ((InternalEObject)locatedAt).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - RecipientsPackage.RECIPIENT__LOCATED_AT, null, msgs); - return basicSetLocatedAt((Location)otherEnd, msgs); - case RecipientsPackage.RECIPIENT__LOCATED_IN: - if (locatedIn != null) - msgs = ((InternalEObject)locatedIn).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - RecipientsPackage.RECIPIENT__LOCATED_IN, null, msgs); - return basicSetLocatedIn((City)otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case RecipientsPackage.RECIPIENT__PARENT: - return basicSetParent(null, msgs); - case RecipientsPackage.RECIPIENT__LOCATED_AT: - return basicSetLocatedAt(null, msgs); - case RecipientsPackage.RECIPIENT__LOCATED_IN: - return basicSetLocatedIn(null, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { - switch (eContainerFeatureID()) { - case RecipientsPackage.RECIPIENT__PARENT: - return eInternalContainer().eInverseRemove(this, RecipientsPackage.RECIPIENTS__RECIPIENTS, Recipients.class, msgs); - } - return super.eBasicRemoveFromContainerFeature(msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case RecipientsPackage.RECIPIENT__PARENT: - return getParent(); - case RecipientsPackage.RECIPIENT__BUSINESS: - return isBusiness(); - case RecipientsPackage.RECIPIENT__LOCATED_AT: - return getLocatedAt(); - case RecipientsPackage.RECIPIENT__LOCATED_IN: - return getLocatedIn(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case RecipientsPackage.RECIPIENT__PARENT: - setParent((Recipients)newValue); - return; - case RecipientsPackage.RECIPIENT__BUSINESS: - setBusiness((Boolean)newValue); - return; - case RecipientsPackage.RECIPIENT__LOCATED_AT: - setLocatedAt((Location)newValue); - return; - case RecipientsPackage.RECIPIENT__LOCATED_IN: - setLocatedIn((City)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case RecipientsPackage.RECIPIENT__PARENT: - setParent((Recipients)null); - return; - case RecipientsPackage.RECIPIENT__BUSINESS: - setBusiness(BUSINESS_EDEFAULT); - return; - case RecipientsPackage.RECIPIENT__LOCATED_AT: - setLocatedAt((Location)null); - return; - case RecipientsPackage.RECIPIENT__LOCATED_IN: - setLocatedIn((City)null); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case RecipientsPackage.RECIPIENT__PARENT: - return getParent() != null; - case RecipientsPackage.RECIPIENT__BUSINESS: - return business != BUSINESS_EDEFAULT; - case RecipientsPackage.RECIPIENT__LOCATED_AT: - return locatedAt != null; - case RecipientsPackage.RECIPIENT__LOCATED_IN: - return locatedIn != null; - } - return super.eIsSet(featureID); - } - - /** - * - * - * @generated - */ - @Override - public String toString() { - if (eIsProxy()) return super.toString(); - - StringBuilder result = new StringBuilder(super.toString()); - result.append(" (business: "); - result.append(business); - result.append(')'); - return result.toString(); - } - -} //RecipientImpl 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 deleted file mode 100644 index 97e8b3c..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/RecipientsFactoryImpl.java +++ /dev/null @@ -1,133 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients.impl; - -import edu.kit.ipd.sdq.metamodels.recipients.*; - -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.emf.ecore.EPackage; - -import org.eclipse.emf.ecore.impl.EFactoryImpl; - -import org.eclipse.emf.ecore.plugin.EcorePlugin; - -/** - * - * An implementation of the model Factory. - * - * @generated - */ -public class RecipientsFactoryImpl extends EFactoryImpl implements RecipientsFactory { - /** - * Creates the default factory implementation. - * - * - * @generated - */ - public static RecipientsFactory init() { - try { - RecipientsFactory theRecipientsFactory = (RecipientsFactory)EPackage.Registry.INSTANCE.getEFactory(RecipientsPackage.eNS_URI); - if (theRecipientsFactory != null) { - return theRecipientsFactory; - } - } - catch (Exception exception) { - EcorePlugin.INSTANCE.log(exception); - } - return new RecipientsFactoryImpl(); - } - - /** - * Creates an instance of the factory. - * - * - * @generated - */ - public RecipientsFactoryImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - public EObject create(EClass eClass) { - switch (eClass.getClassifierID()) { - case RecipientsPackage.RECIPIENTS: return createRecipients(); - case RecipientsPackage.RECIPIENT: return createRecipient(); - case RecipientsPackage.LOCATION: return createLocation(); - case RecipientsPackage.CITY: return createCity(); - default: - throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); - } - } - - /** - * - * - * @generated - */ - @Override - public Recipient createRecipient() { - RecipientImpl recipient = new RecipientImpl(); - return recipient; - } - - /** - * - * - * @generated - */ - @Override - public Location createLocation() { - LocationImpl location = new LocationImpl(); - return location; - } - - /** - * - * - * @generated - */ - @Override - public City createCity() { - CityImpl city = new CityImpl(); - return city; - } - - /** - * - * - * @generated - */ - @Override - public Recipients createRecipients() { - RecipientsImpl recipients = new RecipientsImpl(); - return recipients; - } - - /** - * - * - * @generated - */ - @Override - public RecipientsPackage getRecipientsPackage() { - return (RecipientsPackage)getEPackage(); - } - - /** - * - * - * @deprecated - * @generated - */ - @Deprecated - public static RecipientsPackage getPackage() { - return RecipientsPackage.eINSTANCE; - } - -} //RecipientsFactoryImpl 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 deleted file mode 100644 index d5b11c8..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/RecipientsImpl.java +++ /dev/null @@ -1,165 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients.impl; - -import edu.kit.ipd.sdq.metamodels.recipients.Recipient; -import edu.kit.ipd.sdq.metamodels.recipients.Recipients; -import edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage; - -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.util.EObjectContainmentWithInverseEList; -import org.eclipse.emf.ecore.util.InternalEList; - -/** - * - * An implementation of the model object 'Recipients'. - * - *

- * The following features are implemented: - *

- *
    - *
  • {@link edu.kit.ipd.sdq.metamodels.recipients.impl.RecipientsImpl#getRecipients Recipients}
  • - *
- * - * @generated - */ -public class RecipientsImpl extends IdentifiedElementImpl implements Recipients { - /** - * The cached value of the '{@link #getRecipients() Recipients}' containment reference list. - * - * - * @see #getRecipients() - * @generated - * @ordered - */ - protected EList recipients; - - /** - * - * - * @generated - */ - protected RecipientsImpl() { - super(); - } - - /** - * - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return RecipientsPackage.Literals.RECIPIENTS; - } - - /** - * - * - * @generated - */ - @Override - public EList getRecipients() { - if (recipients == null) { - recipients = new EObjectContainmentWithInverseEList(Recipient.class, this, RecipientsPackage.RECIPIENTS__RECIPIENTS, RecipientsPackage.RECIPIENT__PARENT); - } - return recipients; - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case RecipientsPackage.RECIPIENTS__RECIPIENTS: - return ((InternalEList)(InternalEList)getRecipients()).basicAdd(otherEnd, msgs); - } - return super.eInverseAdd(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { - switch (featureID) { - case RecipientsPackage.RECIPIENTS__RECIPIENTS: - return ((InternalEList)getRecipients()).basicRemove(otherEnd, msgs); - } - return super.eInverseRemove(otherEnd, featureID, msgs); - } - - /** - * - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case RecipientsPackage.RECIPIENTS__RECIPIENTS: - return getRecipients(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * - * - * @generated - */ - @SuppressWarnings("unchecked") - @Override - public void eSet(int featureID, Object newValue) { - switch (featureID) { - case RecipientsPackage.RECIPIENTS__RECIPIENTS: - getRecipients().clear(); - getRecipients().addAll((Collection)newValue); - return; - } - super.eSet(featureID, newValue); - } - - /** - * - * - * @generated - */ - @Override - public void eUnset(int featureID) { - switch (featureID) { - case RecipientsPackage.RECIPIENTS__RECIPIENTS: - getRecipients().clear(); - return; - } - super.eUnset(featureID); - } - - /** - * - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case RecipientsPackage.RECIPIENTS__RECIPIENTS: - return recipients != null && !recipients.isEmpty(); - } - return super.eIsSet(featureID); - } - -} //RecipientsImpl 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 deleted file mode 100644 index 46891f6..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/impl/RecipientsPackageImpl.java +++ /dev/null @@ -1,393 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients.impl; - -import edu.kit.ipd.sdq.metamodels.recipients.City; -import edu.kit.ipd.sdq.metamodels.recipients.IdentifiedElement; -import edu.kit.ipd.sdq.metamodels.recipients.Location; -import edu.kit.ipd.sdq.metamodels.recipients.Recipient; -import edu.kit.ipd.sdq.metamodels.recipients.Recipients; -import edu.kit.ipd.sdq.metamodels.recipients.RecipientsFactory; -import edu.kit.ipd.sdq.metamodels.recipients.RecipientsPackage; - -import org.eclipse.emf.ecore.EAttribute; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EPackage; -import org.eclipse.emf.ecore.EReference; - -import org.eclipse.emf.ecore.impl.EPackageImpl; - -/** - * - * An implementation of the model Package. - * - * @generated - */ -public class RecipientsPackageImpl extends EPackageImpl implements RecipientsPackage { - /** - * - * - * @generated - */ - private EClass identifiedElementEClass = null; - - /** - * - * - * @generated - */ - private EClass recipientEClass = null; - - /** - * - * - * @generated - */ - private EClass locationEClass = null; - - /** - * - * - * @generated - */ - private EClass cityEClass = null; - - /** - * - * - * @generated - */ - private EClass recipientsEClass = 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.recipients.RecipientsPackage#eNS_URI - * @see #init() - * @generated - */ - private RecipientsPackageImpl() { - super(eNS_URI, RecipientsFactory.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 RecipientsPackage#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 RecipientsPackage init() { - if (isInited) return (RecipientsPackage)EPackage.Registry.INSTANCE.getEPackage(RecipientsPackage.eNS_URI); - - // Obtain or create and register package - Object registeredRecipientsPackage = EPackage.Registry.INSTANCE.get(eNS_URI); - RecipientsPackageImpl theRecipientsPackage = registeredRecipientsPackage instanceof RecipientsPackageImpl ? (RecipientsPackageImpl)registeredRecipientsPackage : new RecipientsPackageImpl(); - - isInited = true; - - // Create package meta-data objects - theRecipientsPackage.createPackageContents(); - - // Initialize created meta-data - theRecipientsPackage.initializePackageContents(); - - // 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; - } - - /** - * - * - * @generated - */ - @Override - public EClass getIdentifiedElement() { - return identifiedElementEClass; - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getIdentifiedElement_Id() { - return (EAttribute)identifiedElementEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EClass getRecipient() { - return recipientEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getRecipient_Parent() { - return (EReference)recipientEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getRecipient_Business() { - return (EAttribute)recipientEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EReference getRecipient_LocatedAt() { - return (EReference)recipientEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EReference getRecipient_LocatedIn() { - return (EReference)recipientEClass.getEStructuralFeatures().get(3); - } - - /** - * - * - * @generated - */ - @Override - public EClass getLocation() { - return locationEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getLocation_Parent() { - return (EReference)locationEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getLocation_Number() { - return (EAttribute)locationEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getLocation_Street() { - return (EAttribute)locationEClass.getEStructuralFeatures().get(2); - } - - /** - * - * - * @generated - */ - @Override - public EClass getCity() { - return cityEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getCity_Parent() { - return (EReference)cityEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public EAttribute getCity_ZipCode() { - return (EAttribute)cityEClass.getEStructuralFeatures().get(1); - } - - /** - * - * - * @generated - */ - @Override - public EClass getRecipients() { - return recipientsEClass; - } - - /** - * - * - * @generated - */ - @Override - public EReference getRecipients_Recipients() { - return (EReference)recipientsEClass.getEStructuralFeatures().get(0); - } - - /** - * - * - * @generated - */ - @Override - public RecipientsFactory getRecipientsFactory() { - return (RecipientsFactory)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 - identifiedElementEClass = createEClass(IDENTIFIED_ELEMENT); - createEAttribute(identifiedElementEClass, IDENTIFIED_ELEMENT__ID); - - recipientsEClass = createEClass(RECIPIENTS); - createEReference(recipientsEClass, RECIPIENTS__RECIPIENTS); - - recipientEClass = createEClass(RECIPIENT); - createEReference(recipientEClass, RECIPIENT__PARENT); - createEAttribute(recipientEClass, RECIPIENT__BUSINESS); - createEReference(recipientEClass, RECIPIENT__LOCATED_AT); - createEReference(recipientEClass, RECIPIENT__LOCATED_IN); - - locationEClass = createEClass(LOCATION); - createEReference(locationEClass, LOCATION__PARENT); - createEAttribute(locationEClass, LOCATION__NUMBER); - createEAttribute(locationEClass, LOCATION__STREET); - - cityEClass = createEClass(CITY); - createEReference(cityEClass, CITY__PARENT); - createEAttribute(cityEClass, CITY__ZIP_CODE); - } - - /** - * - * - * @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 - recipientsEClass.getESuperTypes().add(this.getIdentifiedElement()); - recipientEClass.getESuperTypes().add(this.getIdentifiedElement()); - locationEClass.getESuperTypes().add(this.getIdentifiedElement()); - cityEClass.getESuperTypes().add(this.getIdentifiedElement()); - - // Initialize classes, features, and operations; add parameters - initEClass(identifiedElementEClass, IdentifiedElement.class, "IdentifiedElement", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEAttribute(getIdentifiedElement_Id(), ecorePackage.getEString(), "id", null, 1, 1, IdentifiedElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(recipientsEClass, Recipients.class, "Recipients", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getRecipients_Recipients(), this.getRecipient(), this.getRecipient_Parent(), "recipients", null, 1, -1, Recipients.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(recipientEClass, Recipient.class, "Recipient", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getRecipient_Parent(), this.getRecipients(), this.getRecipients_Recipients(), "parent", null, 1, 1, Recipient.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getRecipient_Business(), ecorePackage.getEBoolean(), "business", "false", 1, 1, Recipient.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getRecipient_LocatedAt(), this.getLocation(), this.getLocation_Parent(), "locatedAt", null, 1, 1, Recipient.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEReference(getRecipient_LocatedIn(), this.getCity(), this.getCity_Parent(), "locatedIn", null, 1, 1, Recipient.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(locationEClass, Location.class, "Location", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getLocation_Parent(), this.getRecipient(), this.getRecipient_LocatedAt(), "parent", null, 1, 1, Location.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getLocation_Number(), ecorePackage.getEInt(), "number", null, 1, 1, Location.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getLocation_Street(), ecorePackage.getEString(), "street", null, 1, 1, Location.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - initEClass(cityEClass, City.class, "City", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); - initEReference(getCity_Parent(), this.getRecipient(), this.getRecipient_LocatedIn(), "parent", null, 1, 1, City.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - initEAttribute(getCity_ZipCode(), ecorePackage.getEString(), "zipCode", null, 1, 1, City.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); - - // Create resource - createResource(eNS_URI); - } - -} //RecipientsPackageImpl diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/util/RecipientsAdapterFactory.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/util/RecipientsAdapterFactory.java deleted file mode 100644 index f11127b..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/util/RecipientsAdapterFactory.java +++ /dev/null @@ -1,192 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients.util; - -import edu.kit.ipd.sdq.metamodels.recipients.*; - -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.recipients.RecipientsPackage - * @generated - */ -public class RecipientsAdapterFactory extends AdapterFactoryImpl { - /** - * The cached model package. - * - * - * @generated - */ - protected static RecipientsPackage modelPackage; - - /** - * Creates an instance of the adapter factory. - * - * - * @generated - */ - public RecipientsAdapterFactory() { - if (modelPackage == null) { - modelPackage = RecipientsPackage.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 RecipientsSwitch modelSwitch = - new RecipientsSwitch() { - @Override - public Adapter caseIdentifiedElement(IdentifiedElement object) { - return createIdentifiedElementAdapter(); - } - @Override - public Adapter caseRecipients(Recipients object) { - return createRecipientsAdapter(); - } - @Override - public Adapter caseRecipient(Recipient object) { - return createRecipientAdapter(); - } - @Override - public Adapter caseLocation(Location object) { - return createLocationAdapter(); - } - @Override - public Adapter caseCity(City object) { - return createCityAdapter(); - } - @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.recipients.IdentifiedElement Identified Element}'. - * - * 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.recipients.IdentifiedElement - * @generated - */ - public Adapter createIdentifiedElementAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link edu.kit.ipd.sdq.metamodels.recipients.Recipient Recipient}'. - * - * 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.recipients.Recipient - * @generated - */ - public Adapter createRecipientAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link edu.kit.ipd.sdq.metamodels.recipients.Location Location}'. - * - * 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.recipients.Location - * @generated - */ - public Adapter createLocationAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link edu.kit.ipd.sdq.metamodels.recipients.City City}'. - * - * 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.recipients.City - * @generated - */ - public Adapter createCityAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class '{@link edu.kit.ipd.sdq.metamodels.recipients.Recipients Recipients}'. - * - * 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.recipients.Recipients - * @generated - */ - public Adapter createRecipientsAdapter() { - 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; - } - -} //RecipientsAdapterFactory diff --git a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/util/RecipientsSwitch.java b/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/util/RecipientsSwitch.java deleted file mode 100644 index 4aeeeff..0000000 --- a/bundles/edu.kit.ipd.sdq.metamodels.recipients/src/edu/kit/ipd/sdq/metamodels/recipients/util/RecipientsSwitch.java +++ /dev/null @@ -1,198 +0,0 @@ -/** - */ -package edu.kit.ipd.sdq.metamodels.recipients.util; - -import edu.kit.ipd.sdq.metamodels.recipients.*; - -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.recipients.RecipientsPackage - * @generated - */ -public class RecipientsSwitch extends Switch { - /** - * The cached model package - * - * - * @generated - */ - protected static RecipientsPackage modelPackage; - - /** - * Creates an instance of the switch. - * - * - * @generated - */ - public RecipientsSwitch() { - if (modelPackage == null) { - modelPackage = RecipientsPackage.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 RecipientsPackage.IDENTIFIED_ELEMENT: { - IdentifiedElement identifiedElement = (IdentifiedElement)theEObject; - T result = caseIdentifiedElement(identifiedElement); - if (result == null) result = defaultCase(theEObject); - return result; - } - case RecipientsPackage.RECIPIENTS: { - Recipients recipients = (Recipients)theEObject; - T result = caseRecipients(recipients); - if (result == null) result = caseIdentifiedElement(recipients); - if (result == null) result = defaultCase(theEObject); - return result; - } - case RecipientsPackage.RECIPIENT: { - Recipient recipient = (Recipient)theEObject; - T result = caseRecipient(recipient); - if (result == null) result = caseIdentifiedElement(recipient); - if (result == null) result = defaultCase(theEObject); - return result; - } - case RecipientsPackage.LOCATION: { - Location location = (Location)theEObject; - T result = caseLocation(location); - if (result == null) result = caseIdentifiedElement(location); - if (result == null) result = defaultCase(theEObject); - return result; - } - case RecipientsPackage.CITY: { - City city = (City)theEObject; - T result = caseCity(city); - if (result == null) result = caseIdentifiedElement(city); - if (result == null) result = defaultCase(theEObject); - return result; - } - default: return defaultCase(theEObject); - } - } - - /** - * Returns the result of interpreting the object as an instance of 'Identified Element'. - * - * 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 'Identified Element'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseIdentifiedElement(IdentifiedElement object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Recipient'. - * - * 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 'Recipient'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseRecipient(Recipient object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Location'. - * - * 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 'Location'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseLocation(Location object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'City'. - * - * 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 'City'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseCity(City object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of 'Recipients'. - * - * 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 'Recipients'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseRecipients(Recipients 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; - } - -} //RecipientsSwitch 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 4a4344e..073b872 100644 --- a/releng/edu.kit.ipd.sdq.metamodels.demo.aggregator/pom.xml +++ b/releng/edu.kit.ipd.sdq.metamodels.demo.aggregator/pom.xml @@ -11,6 +11,7 @@ edu.kit.ipd.sdq.metamodels.demo.aggregator pom + ../../releng/edu.kit.ipd.sdq.metamodels.workflow ../../bundles/edu.kit.ipd.sdq.metamodels.addresses ../../bundles/edu.kit.ipd.sdq.metamodels.addresses.edit ../../bundles/edu.kit.ipd.sdq.metamodels.addresses.editor 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 309ee09..6cdcb8f 100644 --- a/releng/edu.kit.ipd.sdq.metamodels.demo.parent/pom.xml +++ b/releng/edu.kit.ipd.sdq.metamodels.demo.parent/pom.xml @@ -10,6 +10,11 @@ UTF-8 UTF-8 2.1.0 + 1.6.1 + 2.12.1 + 2.22.0 + 2.26.0 + 2.25.0 @@ -111,5 +116,138 @@ + + + + + + org.codehaus.mojo + exec-maven-plugin + 3.0.0 + + + org.eclipse.emf + org.eclipse.emf.mwe2.launch + ${mwe2.version} + + + org.eclipse.xtext + org.eclipse.xtext.common.types + ${xtext.version} + + + + + + + + + + mwe2-cleanup + + + workflow/clean.mwe2 + + + + + + org.codehaus.mojo + exec-maven-plugin + + + clean-mwe2 + clean + + java + + + org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher + + /${project.basedir}/workflow/clean.mwe2 + -p + workspaceRoot=${maven.multiModuleProjectDirectory} + + compile + true + false + + + + + + + org.eclipse.emf + org.eclipse.emf.mwe.utils + ${mwe.version} + + + + + + + + + + mwe2-execution + + + workflow/generate.mwe2 + + + + + + org.codehaus.mojo + exec-maven-plugin + + + execute-mwe2 + generate-sources + + java + + + org.eclipse.emf.mwe2.launch.runtime.Mwe2Launcher + + /${project.basedir}/workflow/generate.mwe2 + -p + workspaceRoot=/${maven.multiModuleProjectDirectory} + + compile + true + false + + + + + + + org.eclipse.emf + org.eclipse.emf.mwe2.lib + ${mwe2.version} + + + org.eclipse.emf + org.eclipse.emf.codegen + ${emf-codegen.version} + + + org.eclipse.emf + org.eclipse.emf.codegen.ecore + ${ecore-codegen.version} + + + org.eclipse.emf + org.eclipse.emf.mwe.utils + ${mwe.version} + + + + + + + \ No newline at end of file diff --git a/releng/edu.kit.ipd.sdq.metamodels.workflow/.classpath b/releng/edu.kit.ipd.sdq.metamodels.workflow/.classpath new file mode 100644 index 0000000..cbd391f --- /dev/null +++ b/releng/edu.kit.ipd.sdq.metamodels.workflow/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/releng/edu.kit.ipd.sdq.metamodels.workflow/.project b/releng/edu.kit.ipd.sdq.metamodels.workflow/.project new file mode 100644 index 0000000..f790c56 --- /dev/null +++ b/releng/edu.kit.ipd.sdq.metamodels.workflow/.project @@ -0,0 +1,34 @@ + + + edu.kit.ipd.sdq.metamodels.workflow + + + + + + org.eclipse.xtext.ui.shared.xtextBuilder + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + org.eclipse.xtext.ui.shared.xtextNature + + diff --git a/releng/edu.kit.ipd.sdq.metamodels.workflow/.settings/org.eclipse.jdt.core.prefs b/releng/edu.kit.ipd.sdq.metamodels.workflow/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 0000000..c9545f0 --- /dev/null +++ b/releng/edu.kit.ipd.sdq.metamodels.workflow/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,9 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=11 +org.eclipse.jdt.core.compiler.compliance=11 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning +org.eclipse.jdt.core.compiler.release=enabled +org.eclipse.jdt.core.compiler.source=11 diff --git a/releng/edu.kit.ipd.sdq.metamodels.workflow/META-INF/MANIFEST.MF b/releng/edu.kit.ipd.sdq.metamodels.workflow/META-INF/MANIFEST.MF new file mode 100644 index 0000000..488fbc2 --- /dev/null +++ b/releng/edu.kit.ipd.sdq.metamodels.workflow/META-INF/MANIFEST.MF @@ -0,0 +1,8 @@ +Manifest-Version: 1.0 +Bundle-ManifestVersion: 2 +Bundle-Name: Demo Metamodels Workflow +Bundle-SymbolicName: edu.kit.ipd.sdq.metamodels.workflow +Bundle-Version: 1.5.0.qualifier +Bundle-Vendor: KIT SDQ +Automatic-Module-Name: edu.kit.ipd.sdq.metamodels.workflow +Bundle-RequiredExecutionEnvironment: JavaSE-11 diff --git a/releng/edu.kit.ipd.sdq.metamodels.workflow/build.properties b/releng/edu.kit.ipd.sdq.metamodels.workflow/build.properties new file mode 100644 index 0000000..d308e0e --- /dev/null +++ b/releng/edu.kit.ipd.sdq.metamodels.workflow/build.properties @@ -0,0 +1,11 @@ +bin.includes = META-INF/,\ + . +additional.bundles = org.eclipse.equinox.common,\ + org.eclipse.emf.mwe.utils,\ + org.eclipse.emf.mwe2.launch,\ + org.eclipse.emf.mwe2.lib,\ + org.eclipse.emf.mwe2.runtime,\ + org.apache.log4j,\ + org.apache.commons.logging,\ + org.eclipse.emf.codegen.ecore,\ + org.objectweb.asm \ No newline at end of file diff --git a/releng/edu.kit.ipd.sdq.metamodels.workflow/pom.xml b/releng/edu.kit.ipd.sdq.metamodels.workflow/pom.xml new file mode 100644 index 0000000..1f55e87 --- /dev/null +++ b/releng/edu.kit.ipd.sdq.metamodels.workflow/pom.xml @@ -0,0 +1,14 @@ + + + 4.0.0 + + edu.kit.ipd.sdq + parent + 1.5.0-SNAPSHOT + ../edu.kit.ipd.sdq.metamodels.demo.parent + + edu.kit.ipd.sdq.metamodels.workflow + Demo Metamodels Workflow + eclipse-plugin + \ No newline at end of file diff --git a/releng/edu.kit.ipd.sdq.metamodels.workflow/workflow/clean.mwe2 b/releng/edu.kit.ipd.sdq.metamodels.workflow/workflow/clean.mwe2 new file mode 100644 index 0000000..27e940c --- /dev/null +++ b/releng/edu.kit.ipd.sdq.metamodels.workflow/workflow/clean.mwe2 @@ -0,0 +1,75 @@ +module clean + +import org.eclipse.emf.mwe.utils.DirectoryCleaner + +var addressesPluginName = "edu.kit.ipd.sdq.metamodels.addresses" +var familiesPluginName = "edu.kit.ipd.sdq.metamodels.families" +var insurancePluginName = "edu.kit.ipd.sdq.metamodels.insurance" +var personsPluginName = "edu.kit.ipd.sdq.metamodels.persons" +var recipientsPluginName = "edu.kit.ipd.sdq.metamodels.recipients" + +var workspaceRoot = "../../" + +Workflow { + + component = DirectoryCleaner { + directory = "${workspaceRoot}/bundles/${addressesPluginName}/src-gen" + } + + component = DirectoryCleaner { + directory = "${workspaceRoot}/bundles/${addressesPluginName}.edit/src-gen" + } + + component = DirectoryCleaner { + directory = "${workspaceRoot}/bundles/${addressesPluginName}.editor/src-gen" + } + + component = DirectoryCleaner { + directory = "${workspaceRoot}/bundles/${familiesPluginName}/src-gen" + } + + component = DirectoryCleaner { + directory = "${workspaceRoot}/bundles/${familiesPluginName}.edit/src-gen" + } + + component = DirectoryCleaner { + directory = "${workspaceRoot}/bundles/${familiesPluginName}.editor/src-gen" + } + + component = DirectoryCleaner { + directory = "${workspaceRoot}/bundles/${insurancePluginName}/src-gen" + } + + component = DirectoryCleaner { + directory = "${workspaceRoot}/bundles/${insurancePluginName}.edit/src-gen" + } + + component = DirectoryCleaner { + directory = "${workspaceRoot}/bundles/${insurancePluginName}.editor/src-gen" + } + + component = DirectoryCleaner { + directory = "${workspaceRoot}/bundles/${personsPluginName}/src-gen" + } + + component = DirectoryCleaner { + directory = "${workspaceRoot}/bundles/${personsPluginName}.edit/src-gen" + } + + component = DirectoryCleaner { + directory = "${workspaceRoot}/bundles/${personsPluginName}.editor/src-gen" + } + + component = DirectoryCleaner { + directory = "${workspaceRoot}/bundles/${recipientsPluginName}/src-gen" + } + + component = DirectoryCleaner { + directory = "${workspaceRoot}/bundles/${recipientsPluginName}.edit/src-gen" + } + + component = DirectoryCleaner { + directory = "${workspaceRoot}/bundles/${recipientsPluginName}.editor/src-gen" + } + +} diff --git a/releng/edu.kit.ipd.sdq.metamodels.workflow/workflow/generate.mwe2 b/releng/edu.kit.ipd.sdq.metamodels.workflow/workflow/generate.mwe2 new file mode 100644 index 0000000..3c3cabc --- /dev/null +++ b/releng/edu.kit.ipd.sdq.metamodels.workflow/workflow/generate.mwe2 @@ -0,0 +1,60 @@ +module generate + +import org.eclipse.emf.mwe2.ecore.EcoreGenerator +import org.eclipse.emf.mwe.utils.StandaloneSetup + +var addressesPluginName = "edu.kit.ipd.sdq.metamodels.addresses" +var familiesPluginName = "edu.kit.ipd.sdq.metamodels.families" +var insurancePluginName = "edu.kit.ipd.sdq.metamodels.insurance" +var personsPluginName = "edu.kit.ipd.sdq.metamodels.persons" +var recipientsPluginName = "edu.kit.ipd.sdq.metamodels.recipients" + +var workspaceRoot = "../../" + +Workflow { + + bean = StandaloneSetup { + scanClassPath = true + platformUri = workspaceRoot + } + + component = EcoreGenerator { + srcPath = "platform:/resource/${addressesPluginName}/src-gen" + genModel = "platform:/resource/${addressesPluginName}/model/addresses.genmodel" + generateCustomClasses = false + generateEdit = true + generateEditor = true + } + + component = EcoreGenerator { + srcPath = "platform:/resource/${familiesPluginName}/src-gen" + genModel = "platform:/resource/${familiesPluginName}/model/families.genmodel" + generateCustomClasses = false + generateEdit = true + generateEditor = true + } + + component = EcoreGenerator { + srcPath = "platform:/resource/${insurancePluginName}/src-gen" + genModel = "platform:/resource/${insurancePluginName}/model/insurance.genmodel" + generateCustomClasses = false + generateEdit = true + generateEditor = true + } + + component = EcoreGenerator { + srcPath = "platform:/resource/${personsPluginName}/src-gen" + genModel = "platform:/resource/${personsPluginName}/model/persons.genmodel" + generateCustomClasses = false + generateEdit = true + generateEditor = true + } + + component = EcoreGenerator { + srcPath = "platform:/resource/${recipientsPluginName}/src-gen" + genModel = "platform:/resource/${recipientsPluginName}/model/recipients.genmodel" + generateCustomClasses = false + generateEdit = true + generateEditor = true + } +}