diff options
author | Johannes Faltermeier | 2014-11-13 13:04:43 +0000 |
---|---|---|
committer | Johannes Faltermeier | 2014-11-13 13:36:16 +0000 |
commit | 3a7e706d3085cf73449482e32d52548c1253220b (patch) | |
tree | 33a15da072dab871fa3b0b789fe6ac6ee14846f6 | |
parent | f6360d3b5c087f042e5e772d3a0d1b250b645d1a (diff) | |
download | org.eclipse.emf.ecp.core-3a7e706d3085cf73449482e32d52548c1253220b.tar.gz org.eclipse.emf.ecp.core-3a7e706d3085cf73449482e32d52548c1253220b.tar.xz org.eclipse.emf.ecp.core-3a7e706d3085cf73449482e32d52548c1253220b.zip |
Bug 447478 - TreeMasterDetailSWTRenderer#fillContextMenu throws
ClassCastException
https://bugs.eclipse.org/bugs/show_bug.cgi?id=447478
Change-Id: Ie5bf05aef93404b894ff2a13b0178b063e77ac3c
38 files changed, 2245 insertions, 80 deletions
diff --git a/bundles/org.eclipse.emf.ecp.view.treemasterdetail.ui.swt/src/org/eclipse/emf/ecp/view/spi/treemasterdetail/ui/swt/MasterDetailAction.java b/bundles/org.eclipse.emf.ecp.view.treemasterdetail.ui.swt/src/org/eclipse/emf/ecp/view/spi/treemasterdetail/ui/swt/MasterDetailAction.java index 55a7066806..1b2b2bd2c6 100644 --- a/bundles/org.eclipse.emf.ecp.view.treemasterdetail.ui.swt/src/org/eclipse/emf/ecp/view/spi/treemasterdetail/ui/swt/MasterDetailAction.java +++ b/bundles/org.eclipse.emf.ecp.view.treemasterdetail.ui.swt/src/org/eclipse/emf/ecp/view/spi/treemasterdetail/ui/swt/MasterDetailAction.java @@ -16,6 +16,7 @@ import org.eclipse.emf.ecore.EObject; /** * @author Alexandra Buzila + * @since 1.5 * */ public abstract class MasterDetailAction extends AbstractHandler { diff --git a/bundles/org.eclipse.emf.ecp.view.treemasterdetail.ui.swt/src/org/eclipse/emf/ecp/view/spi/treemasterdetail/ui/swt/TreeMasterDetailSWTRenderer.java b/bundles/org.eclipse.emf.ecp.view.treemasterdetail.ui.swt/src/org/eclipse/emf/ecp/view/spi/treemasterdetail/ui/swt/TreeMasterDetailSWTRenderer.java index 7aef1eeb06..776ca82a8d 100644 --- a/bundles/org.eclipse.emf.ecp.view.treemasterdetail.ui.swt/src/org/eclipse/emf/ecp/view/spi/treemasterdetail/ui/swt/TreeMasterDetailSWTRenderer.java +++ b/bundles/org.eclipse.emf.ecp.view.treemasterdetail.ui.swt/src/org/eclipse/emf/ecp/view/spi/treemasterdetail/ui/swt/TreeMasterDetailSWTRenderer.java @@ -103,6 +103,7 @@ import org.osgi.framework.FrameworkUtil; * * @author Anas Chakfeh * @author Eugen Neufeld + * @since 1.5 * */ public class TreeMasterDetailSWTRenderer extends AbstractSWTRenderer<VTreeMasterDetail> { @@ -185,7 +186,7 @@ public class TreeMasterDetailSWTRenderer extends AbstractSWTRenderer<VTreeMaster */ @Override protected Control renderControl(SWTGridCell cell, Composite parent) throws NoRendererFoundException, - NoPropertyDescriptorFoundExeption { + NoPropertyDescriptorFoundExeption { /* The tree's composites */ final Composite form = createMasterDetailForm(parent); @@ -255,7 +256,7 @@ public class TreeMasterDetailSWTRenderer extends AbstractSWTRenderer<VTreeMaster treeViewer = new TreeViewer(masterPanel); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).hint(100, SWT.DEFAULT) - .applyTo(treeViewer.getTree()); + .applyTo(treeViewer.getTree()); treeViewer.setContentProvider(adapterFactoryContentProvider); treeViewer.setLabelProvider(getLabelProvider(adapterFactoryLabelProvider)); @@ -432,7 +433,7 @@ public class TreeMasterDetailSWTRenderer extends AbstractSWTRenderer<VTreeMaster rightPanelContainerComposite = new Composite(container, SWT.FILL); rightPanelContainerComposite.setLayout(GridLayoutFactory.fillDefaults().create()); GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true) - .applyTo(rightPanelContainerComposite); + .applyTo(rightPanelContainerComposite); rightPanelContainerComposite.setBackground(rightPanel.getBackground()); rightPanel.setContent(container); @@ -523,14 +524,13 @@ public class TreeMasterDetailSWTRenderer extends AbstractSWTRenderer<VTreeMaster if (treeViewer.getSelection() instanceof IStructuredSelection) { final IStructuredSelection selection = (IStructuredSelection) treeViewer.getSelection(); - if (selection.size() == 1) { - final EObject eObject = (EObject) selection.getFirstElement(); - final EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(eObject); - if (domain == null) { + if (selection.size() == 1 && selection.getFirstElement() != null) { + final boolean successfull = fillContextMenuForSingleSelection(editingDomain, + childrenDescriptorCollector, manager, + selection); + if (!successfull) { return; } - final Collection<?> descriptors = childrenDescriptorCollector.getDescriptors(eObject); - fillContextMenu(manager, descriptors, editingDomain, eObject); } if (!selection.toList().contains(root)) { manager.add(new Separator(GLOBAL_ADDITIONS)); @@ -538,8 +538,10 @@ public class TreeMasterDetailSWTRenderer extends AbstractSWTRenderer<VTreeMaster } manager.add(new Separator()); - if (selection.getFirstElement() != null && EObject.class.isInstance(selection.getFirstElement())) { - final EObject selectedObject = (EObject) selection.getFirstElement(); + if (selection.getFirstElement() != null + && EObject.class.isInstance(AdapterFactoryEditingDomain.unwrap(selection.getFirstElement()))) { + final EObject selectedObject = (EObject) AdapterFactoryEditingDomain.unwrap(selection + .getFirstElement()); for (final MasterDetailAction menuAction : menuActions) { if (menuAction.shouldShow(selectedObject)) { @@ -562,6 +564,24 @@ public class TreeMasterDetailSWTRenderer extends AbstractSWTRenderer<VTreeMaster } } } + + private boolean fillContextMenuForSingleSelection(final EditingDomain editingDomain, + final ChildrenDescriptorCollector childrenDescriptorCollector, IMenuManager manager, + final IStructuredSelection selection) { + final Object firstElement = selection.getFirstElement(); + final Object unwrappedElement = AdapterFactoryEditingDomain.unwrap(firstElement); + if (!EObject.class.isInstance(unwrappedElement)) { + return false; + } + final EObject eObject = EObject.class.cast(unwrappedElement); + final EditingDomain domain = AdapterFactoryEditingDomain.getEditingDomainFor(eObject); + if (domain == null) { + return false; + } + final Collection<?> descriptors = childrenDescriptorCollector.getDescriptors(eObject); + fillContextMenu(manager, descriptors, editingDomain, eObject); + return true; + } }); final Menu menu = menuMgr.createContextMenu(treeViewer.getControl()); treeViewer.getControl().setMenu(menu); @@ -701,6 +721,7 @@ public class TreeMasterDetailSWTRenderer extends AbstractSWTRenderer<VTreeMaster public void selectionChanged(SelectionChangedEvent event) { final Object treeSelected = ((IStructuredSelection) event.getSelection()).getFirstElement(); + // TODO selection final Object selected = manipulateSelection(treeSelected); if (selected instanceof EObject) { try { @@ -746,11 +767,11 @@ public class TreeMasterDetailSWTRenderer extends AbstractSWTRenderer<VTreeMaster relayoutDetail(); } catch (final ECPRendererException e) { Activator - .getDefault() - .getReportService() - .report(new StatusReport( - new Status(IStatus.ERROR, Activator.getDefault().getBundle().getSymbolicName(), e - .getMessage(), e))); + .getDefault() + .getReportService() + .report(new StatusReport( + new Status(IStatus.ERROR, Activator.getDefault().getBundle().getSymbolicName(), e + .getMessage(), e))); } } } diff --git a/tests/ECPQ7Tests/NonEPPTests/Editor/TreeMasterDetailContextMenuFeatureMap.test b/tests/ECPQ7Tests/NonEPPTests/Editor/TreeMasterDetailContextMenuFeatureMap.test new file mode 100644 index 0000000000..a784c5f680 --- /dev/null +++ b/tests/ECPQ7Tests/NonEPPTests/Editor/TreeMasterDetailContextMenuFeatureMap.test @@ -0,0 +1,39 @@ +--- RCPTT testcase --- +Format-Version: 1.0 +Contexts: _mY5uUKEgEeKX8e34E6tWIg,_rr2EEFpSEeKcnaHGSt8OwA,_IuFcgFpZEeKcnaHGSt8OwA,_f3qEUVpSEeKcnaHGSt8OwA +Element-Name: TreeMasterDetailContextMenuFeatureMap +Element-Type: testcase +Element-Version: 3.0 +External-Reference: +Id: _HzFpMGs4EeSUs_kOwABuHQ +Runtime-Version: 1.5.2.201408180747 +Save-Time: 11/13/14 2:33 PM +Testcase-Type: ecl + +------=_.content-0a7243a0-75d3-3d5f-9791-539de0e5b7ac +Content-Type: text/ecl +Entry-Name: .content + +get-view "Model Explorer" | get-tree | get-menu "Create new project" | click +with [get-window "Create Project"] { + get-editbox -after [get-label "Project Name:"] | set-text test + get-button Finish | click +} +get-view "Model Explorer" | get-tree | select test | get-menu "New Model Element" | click +with [get-window "Add new model element"] { + get-editbox -after [get-label Search] | set-text staff + get-tree | select "university/Staff" + get-button Finish | click +} +with [get-editor Staff] { + get-button "Create and link" | click + get-button "Create and link" -after [get-label Details] -index 1 | click +} +get-editor Professor | close +get-editor Staff | get-tree | select "Staff/<assistants> Assistant" | get-menu Delete | click +get-editor Staff | get-table | get-property "getItems().length" | equals 0 | verify-true +get-editor Staff | get-tree | select "Staff/<professors> Professor" | get-menu Delete | click +get-editor Staff | get-table -after [get-label Details] -index 1 | get-property "getItems().length" | equals 0 + | verify-true +get-editor Staff | get-tree | get-item Staff | get-property childCount | equals 0 | verify-true +------=_.content-0a7243a0-75d3-3d5f-9791-539de0e5b7ac-- diff --git a/tests/org.eclipse.emf.ecp.test.model.edit/META-INF/MANIFEST.MF b/tests/org.eclipse.emf.ecp.test.model.edit/META-INF/MANIFEST.MF index e22ee3ed10..a8e2df49e8 100644 --- a/tests/org.eclipse.emf.ecp.test.model.edit/META-INF/MANIFEST.MF +++ b/tests/org.eclipse.emf.ecp.test.model.edit/META-INF/MANIFEST.MF @@ -8,9 +8,8 @@ Bundle-Activator: org.eclipse.emf.ecp.test.university.provider.UniversityEditPlu Bundle-Vendor: Eclipse Modeling Project Bundle-Localization: plugin Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Export-Package: org.eclipse.emf.ecp.test.university.provider;version=" - 1.5.0";x-internal:=true +Export-Package: org.eclipse.emf.ecp.test.university.provider;version="1.5.0";x-internal:=true Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)", - org.eclipse.emf.ecp.test.model;visibility:=reexport;bundle-version="[1.4.0,2.0.0)", - org.eclipse.emf.edit;visibility:=reexport;bundle-version="[2.9.0,3.0.0)" + org.eclipse.emf.ecp.test.model;bundle-version="[1.4.0,2.0.0)";visibility:=reexport, + org.eclipse.emf.edit;bundle-version="[2.9.0,3.0.0)";visibility:=reexport Bundle-ActivationPolicy: lazy diff --git a/tests/org.eclipse.emf.ecp.test.model.edit/icons/full/obj16/Assistant.gif b/tests/org.eclipse.emf.ecp.test.model.edit/icons/full/obj16/Assistant.gif Binary files differnew file mode 100644 index 0000000000..c414fe9f72 --- /dev/null +++ b/tests/org.eclipse.emf.ecp.test.model.edit/icons/full/obj16/Assistant.gif diff --git a/tests/org.eclipse.emf.ecp.test.model.edit/icons/full/obj16/Professor.gif b/tests/org.eclipse.emf.ecp.test.model.edit/icons/full/obj16/Professor.gif Binary files differnew file mode 100644 index 0000000000..b3643da048 --- /dev/null +++ b/tests/org.eclipse.emf.ecp.test.model.edit/icons/full/obj16/Professor.gif diff --git a/tests/org.eclipse.emf.ecp.test.model.edit/icons/full/obj16/Staff.gif b/tests/org.eclipse.emf.ecp.test.model.edit/icons/full/obj16/Staff.gif Binary files differnew file mode 100644 index 0000000000..338fb8d9a7 --- /dev/null +++ b/tests/org.eclipse.emf.ecp.test.model.edit/icons/full/obj16/Staff.gif diff --git a/tests/org.eclipse.emf.ecp.test.model.edit/plugin.properties b/tests/org.eclipse.emf.ecp.test.model.edit/plugin.properties index 88b2cdabd9..75b42e41d8 100644 --- a/tests/org.eclipse.emf.ecp.test.model.edit/plugin.properties +++ b/tests/org.eclipse.emf.ecp.test.model.edit/plugin.properties @@ -32,3 +32,10 @@ _UI_Course_name_feature = Name _UI_Unknown_feature = Unspecified _UI_Course_etcs_feature = Etcs +_UI_Staff_type = Staff +_UI_Professor_type = Professor +_UI_Assistant_type = Assistant +_UI_Person_type = Person +_UI_Staff_professors_feature = Professors +_UI_Staff_assistants_feature = Assistants +_UI_Staff_staff_feature = Staff diff --git a/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/AssistantItemProvider.java b/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/AssistantItemProvider.java new file mode 100644 index 0000000000..0ba04f0ea7 --- /dev/null +++ b/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/AssistantItemProvider.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * EclipseSource - Generated code + */ +package org.eclipse.emf.ecp.test.university.provider; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.edit.provider.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.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; + +/** + * This is the item provider adapter for a {@link org.eclipse.emf.ecp.test.university.Assistant} object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ +public class AssistantItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource +{ + /** + * This constructs an instance from a factory and a notifier. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public AssistantItemProvider(AdapterFactory adapterFactory) + { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) + { + if (itemPropertyDescriptors == null) + { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This returns Assistant.gif. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public Object getImage(Object object) + { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Assistant")); //$NON-NLS-1$ + } + + /** + * This returns the label text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public String getText(Object object) + { + return getString("_UI_Assistant_type"); //$NON-NLS-1$ + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) + { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) + { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() + { + return UniversityEditPlugin.INSTANCE; + } + +} diff --git a/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/CourseCatalogItemProvider.java b/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/CourseCatalogItemProvider.java index 5345393961..3e2cdb7d5e 100644 --- a/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/CourseCatalogItemProvider.java +++ b/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/CourseCatalogItemProvider.java @@ -1,11 +1,11 @@ /** * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * EclipseSource - Generated code */ diff --git a/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/CourseItemProvider.java b/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/CourseItemProvider.java index b3947e101f..5d44147c38 100644 --- a/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/CourseItemProvider.java +++ b/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/CourseItemProvider.java @@ -1,11 +1,11 @@ /** * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others. - * + * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html - * + * * Contributors: * EclipseSource - Generated code */ diff --git a/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/ProfessorItemProvider.java b/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/ProfessorItemProvider.java new file mode 100644 index 0000000000..f9cb27ad1f --- /dev/null +++ b/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/ProfessorItemProvider.java @@ -0,0 +1,140 @@ +/** + * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * EclipseSource - Generated code + */ +package org.eclipse.emf.ecp.test.university.provider; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.edit.provider.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.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; + +/** + * This is the item provider adapter for a {@link org.eclipse.emf.ecp.test.university.Professor} object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ +public class ProfessorItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource +{ + /** + * This constructs an instance from a factory and a notifier. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public ProfessorItemProvider(AdapterFactory adapterFactory) + { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) + { + if (itemPropertyDescriptors == null) + { + super.getPropertyDescriptors(object); + + } + return itemPropertyDescriptors; + } + + /** + * This returns Professor.gif. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public Object getImage(Object object) + { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Professor")); //$NON-NLS-1$ + } + + /** + * This returns the label text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public String getText(Object object) + { + return getString("_UI_Professor_type"); //$NON-NLS-1$ + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) + { + updateChildren(notification); + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) + { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() + { + return UniversityEditPlugin.INSTANCE; + } + +} diff --git a/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/StaffItemProvider.java b/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/StaffItemProvider.java new file mode 100644 index 0000000000..0d0e0c9d55 --- /dev/null +++ b/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/StaffItemProvider.java @@ -0,0 +1,186 @@ +/** + * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * EclipseSource - Generated code + */ +package org.eclipse.emf.ecp.test.university.provider; + +import java.util.Collection; +import java.util.List; + +import org.eclipse.emf.common.notify.AdapterFactory; +import org.eclipse.emf.common.notify.Notification; +import org.eclipse.emf.common.util.ResourceLocator; +import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecp.test.university.Staff; +import org.eclipse.emf.ecp.test.university.UniversityPackage; +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.ITreeItemContentProvider; +import org.eclipse.emf.edit.provider.ItemProviderAdapter; +import org.eclipse.emf.edit.provider.ViewerNotification; + +/** + * This is the item provider adapter for a {@link org.eclipse.emf.ecp.test.university.Staff} object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ +public class StaffItemProvider + extends ItemProviderAdapter + implements + IEditingDomainItemProvider, + ITreeItemContentProvider, + IItemLabelProvider, + IItemPropertySource +{ + /** + * This constructs an instance from a factory and a notifier. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public StaffItemProvider(AdapterFactory adapterFactory) + { + super(adapterFactory); + } + + /** + * This returns the property descriptors for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public List<IItemPropertyDescriptor> getPropertyDescriptors(Object object) + { + if (itemPropertyDescriptors == null) + { + super.getPropertyDescriptors(object); + + } + 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}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public Collection<? extends EStructuralFeature> getChildrenFeatures(Object object) + { + if (childrenFeatures == null) + { + super.getChildrenFeatures(object); + childrenFeatures.add(UniversityPackage.Literals.STAFF__STAFF); + } + return childrenFeatures; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + protected EStructuralFeature getChildFeature(Object object, Object child) + { + // Check the type of the specified child object and return the proper feature to use for + // adding (see {@link AddCommand}) it as a child. + + return super.getChildFeature(object, child); + } + + /** + * This returns Staff.gif. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public Object getImage(Object object) + { + return overlayImage(object, getResourceLocator().getImage("full/obj16/Staff")); //$NON-NLS-1$ + } + + /** + * This returns the label text for the adapted class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public String getText(Object object) + { + return getString("_UI_Staff_type"); //$NON-NLS-1$ + } + + /** + * This handles model notifications by calling {@link #updateChildren} to update any cached + * children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public void notifyChanged(Notification notification) + { + updateChildren(notification); + + switch (notification.getFeatureID(Staff.class)) + { + case UniversityPackage.STAFF__STAFF: + fireNotifyChanged(new ViewerNotification(notification, notification.getNotifier(), true, false)); + return; + } + super.notifyChanged(notification); + } + + /** + * This adds {@link org.eclipse.emf.edit.command.CommandParameter}s describing the children + * that can be created under this object. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + protected void collectNewChildDescriptors(Collection<Object> newChildDescriptors, Object object) + { + super.collectNewChildDescriptors(newChildDescriptors, object); + } + + /** + * Return the resource locator for this item provider's resources. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public ResourceLocator getResourceLocator() + { + return UniversityEditPlugin.INSTANCE; + } + +} diff --git a/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/UniversityEditPlugin.java b/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/UniversityEditPlugin.java index 27c562b07a..d1a49e412e 100644 --- a/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/UniversityEditPlugin.java +++ b/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/UniversityEditPlugin.java @@ -18,6 +18,7 @@ import org.eclipse.emf.common.util.ResourceLocator; * This is the central singleton for the University edit plugin. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public final class UniversityEditPlugin extends EMFPlugin { @@ -25,6 +26,7 @@ public final class UniversityEditPlugin extends EMFPlugin { * Keep track of the singleton. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public static final UniversityEditPlugin INSTANCE = new UniversityEditPlugin(); @@ -33,6 +35,7 @@ public final class UniversityEditPlugin extends EMFPlugin { * Keep track of the singleton. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ private static Implementation plugin; @@ -41,6 +44,7 @@ public final class UniversityEditPlugin extends EMFPlugin { * Create the instance. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public UniversityEditPlugin() { @@ -53,6 +57,7 @@ public final class UniversityEditPlugin extends EMFPlugin { * Returns the singleton instance of the Eclipse plugin. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @return the singleton instance. * @generated */ @@ -65,6 +70,7 @@ public final class UniversityEditPlugin extends EMFPlugin { * Returns the singleton instance of the Eclipse plugin. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @return the singleton instance. * @generated */ @@ -76,6 +82,7 @@ public final class UniversityEditPlugin extends EMFPlugin { * The actual implementation of the Eclipse <b>Plugin</b>. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public static class Implementation extends EclipsePlugin { @@ -83,6 +90,7 @@ public final class UniversityEditPlugin extends EMFPlugin { * Creates an instance. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public Implementation() { diff --git a/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/UniversityItemProviderAdapterFactory.java b/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/UniversityItemProviderAdapterFactory.java index 7b42e96ba1..56d2497fb0 100644 --- a/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/UniversityItemProviderAdapterFactory.java +++ b/tests/org.eclipse.emf.ecp.test.model.edit/src/org/eclipse/emf/ecp/test/university/provider/UniversityItemProviderAdapterFactory.java @@ -32,11 +32,13 @@ 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 generated by this factory convert EMF adapter notifications into calls to {@link #fireNotifyChanged + * fireNotifyChanged}. * The adapters also support Eclipse property sheets. * Note that most of the adapters are shared among multiple instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public class UniversityItemProviderAdapterFactory extends @@ -46,6 +48,7 @@ public class UniversityItemProviderAdapterFactory extends * This keeps track of the root adapter factory that delegates to this adapter factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ protected ComposedAdapterFactory parentAdapterFactory; @@ -54,6 +57,7 @@ public class UniversityItemProviderAdapterFactory extends * This is used to implement {@link org.eclipse.emf.edit.provider.IChangeNotifier}. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ protected IChangeNotifier changeNotifier = new ChangeNotifier(); @@ -62,6 +66,7 @@ public class UniversityItemProviderAdapterFactory extends * This keeps track of all the supported types checked by {@link #isFactoryForType isFactoryForType}. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ protected Collection<Object> supportedTypes = new ArrayList<Object>(); @@ -70,6 +75,7 @@ public class UniversityItemProviderAdapterFactory extends * This constructs an instance. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public UniversityItemProviderAdapterFactory() { @@ -81,9 +87,11 @@ public class UniversityItemProviderAdapterFactory extends } /** - * This keeps track of the one adapter used for all {@link org.eclipse.emf.ecp.test.university.CourseCatalog} instances. + * This keeps track of the one adapter used for all {@link org.eclipse.emf.ecp.test.university.CourseCatalog} + * instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ protected CourseCatalogItemProvider courseCatalogItemProvider; @@ -92,6 +100,7 @@ public class UniversityItemProviderAdapterFactory extends * This creates an adapter for a {@link org.eclipse.emf.ecp.test.university.CourseCatalog}. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override @@ -108,6 +117,7 @@ public class UniversityItemProviderAdapterFactory extends * This keeps track of the one adapter used for all {@link org.eclipse.emf.ecp.test.university.Course} instances. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ protected CourseItemProvider courseItemProvider; @@ -116,6 +126,7 @@ public class UniversityItemProviderAdapterFactory extends * This creates an adapter for a {@link org.eclipse.emf.ecp.test.university.Course}. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override @@ -129,9 +140,91 @@ public class UniversityItemProviderAdapterFactory extends } /** + * This keeps track of the one adapter used for all {@link org.eclipse.emf.ecp.test.university.Staff} instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + protected StaffItemProvider staffItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.emf.ecp.test.university.Staff}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public Adapter createStaffAdapter() + { + if (staffItemProvider == null) + { + staffItemProvider = new StaffItemProvider(this); + } + + return staffItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.emf.ecp.test.university.Professor} instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + protected ProfessorItemProvider professorItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.emf.ecp.test.university.Professor}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public Adapter createProfessorAdapter() + { + if (professorItemProvider == null) + { + professorItemProvider = new ProfessorItemProvider(this); + } + + return professorItemProvider; + } + + /** + * This keeps track of the one adapter used for all {@link org.eclipse.emf.ecp.test.university.Assistant} instances. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + protected AssistantItemProvider assistantItemProvider; + + /** + * This creates an adapter for a {@link org.eclipse.emf.ecp.test.university.Assistant}. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public Adapter createAssistantAdapter() + { + if (assistantItemProvider == null) + { + assistantItemProvider = new AssistantItemProvider(this); + } + + return assistantItemProvider; + } + + /** * This returns the root adapter factory that contains this factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public ComposeableAdapterFactory getRootAdapterFactory() { @@ -142,6 +235,7 @@ public class UniversityItemProviderAdapterFactory extends * This sets the composed adapter factory that contains this factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public void setParentAdapterFactory( @@ -152,6 +246,7 @@ public class UniversityItemProviderAdapterFactory extends /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override @@ -163,6 +258,7 @@ public class UniversityItemProviderAdapterFactory extends * This implementation substitutes the factory itself as the key for the adapter. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override @@ -173,6 +269,7 @@ public class UniversityItemProviderAdapterFactory extends /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override @@ -193,6 +290,7 @@ public class UniversityItemProviderAdapterFactory extends * This adds a listener. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public void addListener(INotifyChangedListener notifyChangedListener) { @@ -203,6 +301,7 @@ public class UniversityItemProviderAdapterFactory extends * This removes a listener. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public void removeListener(INotifyChangedListener notifyChangedListener) { @@ -213,6 +312,7 @@ public class UniversityItemProviderAdapterFactory extends * This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public void fireNotifyChanged(Notification notification) { @@ -225,9 +325,10 @@ public class UniversityItemProviderAdapterFactory extends } /** - * This disposes all of the item providers created by this factory. + * This disposes all of the item providers created by this factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public void dispose() { @@ -235,6 +336,12 @@ public class UniversityItemProviderAdapterFactory extends courseCatalogItemProvider.dispose(); if (courseItemProvider != null) courseItemProvider.dispose(); + if (staffItemProvider != null) + staffItemProvider.dispose(); + if (professorItemProvider != null) + professorItemProvider.dispose(); + if (assistantItemProvider != null) + assistantItemProvider.dispose(); } } diff --git a/tests/org.eclipse.emf.ecp.test.model/META-INF/MANIFEST.MF b/tests/org.eclipse.emf.ecp.test.model/META-INF/MANIFEST.MF index 032684d4e2..8338ea1070 100644 --- a/tests/org.eclipse.emf.ecp.test.model/META-INF/MANIFEST.MF +++ b/tests/org.eclipse.emf.ecp.test.model/META-INF/MANIFEST.MF @@ -5,11 +5,11 @@ Bundle-SymbolicName: org.eclipse.emf.ecp.test.model;singleton:=true Bundle-Version: 1.5.0.qualifier Bundle-ClassPath: . Bundle-RequiredExecutionEnvironment: J2SE-1.5 -Export-Package: org.eclipse.emf.ecp.test.university;version="1.5.0";x- - friends:="org.eclipse.emf.ecp.test.model.edit",org.eclipse.emf.ecp.te - st.university.impl;version="1.5.0";x-internal:=true,org.eclipse.emf.e - cp.test.university.util;version="1.5.0";x-friends:="org.eclipse.emf.e - cp.test.model.edit" +Export-Package: org.eclipse.emf.ecp.test.university;version="1.5.0"; + x-friends:="org.eclipse.emf.ecp.test.model.edit", + org.eclipse.emf.ecp.test.university.impl;version="1.5.0";x-internal:=true, + org.eclipse.emf.ecp.test.university.util;version="1.5.0"; + x-friends:="org.eclipse.emf.ecp.test.model.edit" Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.7.0,4.0.0)", org.eclipse.emf.ecore;bundle-version="[2.9.0,3.0.0)";visibility:=reexport, org.eclipse.emf.ecp.view.validation;bundle-version="[1.4.0,2.0.0)", diff --git a/tests/org.eclipse.emf.ecp.test.model/model/university.ecore b/tests/org.eclipse.emf.ecp.test.model/model/university.ecore index f942284c88..c349c4f5d3 100644 --- a/tests/org.eclipse.emf.ecp.test.model/model/university.ecore +++ b/tests/org.eclipse.emf.ecp.test.model/model/university.ecore @@ -14,4 +14,27 @@ <eStructuralFeatures xsi:type="ecore:EAttribute" name="name" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/> <eStructuralFeatures xsi:type="ecore:EAttribute" name="etcs" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Staff"> + <eStructuralFeatures xsi:type="ecore:EReference" name="professors" upperBound="-1" + eType="#//Professor" volatile="true" transient="true" derived="true" containment="true"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="group" value="#staff"/> + </eAnnotations> + </eStructuralFeatures> + <eStructuralFeatures xsi:type="ecore:EReference" name="assistants" upperBound="-1" + eType="#//Assistant" volatile="true" transient="true" derived="true" containment="true"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="group" value="#staff"/> + </eAnnotations> + </eStructuralFeatures> + <eStructuralFeatures xsi:type="ecore:EAttribute" name="staff" upperBound="-1" + eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry"> + <eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData"> + <details key="kind" value="group"/> + </eAnnotations> + </eStructuralFeatures> + </eClassifiers> + <eClassifiers xsi:type="ecore:EClass" name="Professor" eSuperTypes="#//Person"/> + <eClassifiers xsi:type="ecore:EClass" name="Assistant" eSuperTypes="#//Person"/> + <eClassifiers xsi:type="ecore:EClass" name="Person" abstract="true" interface="true"/> </ecore:EPackage> diff --git a/tests/org.eclipse.emf.ecp.test.model/model/university.genmodel b/tests/org.eclipse.emf.ecp.test.model/model/university.genmodel index 4aa6fcdc86..671e70695b 100644 --- a/tests/org.eclipse.emf.ecp.test.model/model/university.genmodel +++ b/tests/org.eclipse.emf.ecp.test.model/model/university.genmodel @@ -15,6 +15,15 @@ <genClasses ecoreClass="university.ecore#//Course"> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute university.ecore#//Course/id"/> <genFeatures createChild="false" ecoreFeature="ecore:EAttribute university.ecore#//Course/name"/> + <genFeatures createChild="false" ecoreFeature="ecore:EAttribute university.ecore#//Course/etcs"/> </genClasses> + <genClasses ecoreClass="university.ecore#//Staff"> + <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference university.ecore#//Staff/professors"/> + <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference university.ecore#//Staff/assistants"/> + <genFeatures property="None" children="true" createChild="false" ecoreFeature="ecore:EAttribute university.ecore#//Staff/staff"/> + </genClasses> + <genClasses ecoreClass="university.ecore#//Professor"/> + <genClasses ecoreClass="university.ecore#//Assistant"/> + <genClasses image="false" ecoreClass="university.ecore#//Person"/> </genPackages> </genmodel:GenModel> diff --git a/tests/org.eclipse.emf.ecp.test.model/plugin.xml b/tests/org.eclipse.emf.ecp.test.model/plugin.xml index 25e03be2e2..ec7385e069 100644 --- a/tests/org.eclipse.emf.ecp.test.model/plugin.xml +++ b/tests/org.eclipse.emf.ecp.test.model/plugin.xml @@ -24,6 +24,8 @@ </extension> <extension point="org.eclipse.emf.ecp.view.model.provider.xmi.file"> +<file filePath="viewmodel/Staff.view"/> + <file filePath="viewmodel/catalog.view"> </file> diff --git a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/Assistant.java b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/Assistant.java new file mode 100644 index 0000000000..a50dd5ac37 --- /dev/null +++ b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/Assistant.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * EclipseSource - Generated code + */ +package org.eclipse.emf.ecp.test.university; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Assistant</b></em>'. + * <!-- end-user-doc --> + * + * + * @see org.eclipse.emf.ecp.test.university.UniversityPackage#getAssistant() + * @model + * @generated + */ +public interface Assistant extends Person +{ +} // Assistant diff --git a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/Course.java b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/Course.java index ff71dd46fe..65f6566870 100644 --- a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/Course.java +++ b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/Course.java @@ -21,9 +21,9 @@ import org.eclipse.emf.ecore.EObject; * <p> * The following features are supported: * <ul> - * <li>{@link org.eclipse.emf.ecp.test.university.Course#getId <em>Id</em>}</li> - * <li>{@link org.eclipse.emf.ecp.test.university.Course#getName <em>Name</em>}</li> - * <li>{@link org.eclipse.emf.ecp.test.university.Course#getEtcs <em>Etcs</em>}</li> + * <li>{@link org.eclipse.emf.ecp.test.university.Course#getId <em>Id</em>}</li> + * <li>{@link org.eclipse.emf.ecp.test.university.Course#getName <em>Name</em>}</li> + * <li>{@link org.eclipse.emf.ecp.test.university.Course#getEtcs <em>Etcs</em>}</li> * </ul> * </p> * @@ -40,6 +40,7 @@ public interface Course extends EObject * If the meaning of the '<em>Id</em>' attribute isn't clear, there really should be more of a description here... * </p> * <!-- end-user-doc --> + * * @return the value of the '<em>Id</em>' attribute. * @see #setId(String) * @see org.eclipse.emf.ecp.test.university.UniversityPackage#getCourse_Id() @@ -52,6 +53,7 @@ public interface Course extends EObject * Sets the value of the '{@link org.eclipse.emf.ecp.test.university.Course#getId <em>Id</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @param value the new value of the '<em>Id</em>' attribute. * @see #getId() * @generated @@ -65,6 +67,7 @@ public interface Course extends EObject * If the meaning of the '<em>Name</em>' attribute isn't clear, there really should be more of a description here... * </p> * <!-- end-user-doc --> + * * @return the value of the '<em>Name</em>' attribute. * @see #setName(String) * @see org.eclipse.emf.ecp.test.university.UniversityPackage#getCourse_Name() @@ -77,6 +80,7 @@ public interface Course extends EObject * Sets the value of the '{@link org.eclipse.emf.ecp.test.university.Course#getName <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @param value the new value of the '<em>Name</em>' attribute. * @see #getName() * @generated @@ -87,10 +91,10 @@ public interface Course extends EObject * Returns the value of the '<em><b>Etcs</b></em>' attribute. * <!-- begin-user-doc --> * <p> - * If the meaning of the '<em>Etcs</em>' attribute isn't clear, - * there really should be more of a description here... + * If the meaning of the '<em>Etcs</em>' attribute isn't clear, there really should be more of a description here... * </p> * <!-- end-user-doc --> + * * @return the value of the '<em>Etcs</em>' attribute. * @see #setEtcs(int) * @see org.eclipse.emf.ecp.test.university.UniversityPackage#getCourse_Etcs() @@ -103,6 +107,7 @@ public interface Course extends EObject * Sets the value of the '{@link org.eclipse.emf.ecp.test.university.Course#getEtcs <em>Etcs</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @param value the new value of the '<em>Etcs</em>' attribute. * @see #getEtcs() * @generated diff --git a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/CourseCatalog.java b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/CourseCatalog.java index 9b65f1716c..7382c2c08e 100644 --- a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/CourseCatalog.java +++ b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/CourseCatalog.java @@ -22,7 +22,7 @@ import org.eclipse.emf.ecore.EObject; * <p> * The following features are supported: * <ul> - * <li>{@link org.eclipse.emf.ecp.test.university.CourseCatalog#getCourses <em>Courses</em>}</li> + * <li>{@link org.eclipse.emf.ecp.test.university.CourseCatalog#getCourses <em>Courses</em>}</li> * </ul> * </p> * @@ -41,6 +41,7 @@ public interface CourseCatalog extends EObject * here... * </p> * <!-- end-user-doc --> + * * @return the value of the '<em>Courses</em>' containment reference list. * @see org.eclipse.emf.ecp.test.university.UniversityPackage#getCourseCatalog_Courses() * @model containment="true" diff --git a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/Person.java b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/Person.java new file mode 100644 index 0000000000..cc95708b9f --- /dev/null +++ b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/Person.java @@ -0,0 +1,28 @@ +/** + * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * EclipseSource - Generated code + */ +package org.eclipse.emf.ecp.test.university; + +import org.eclipse.emf.ecore.EObject; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Person</b></em>'. + * <!-- end-user-doc --> + * + * + * @see org.eclipse.emf.ecp.test.university.UniversityPackage#getPerson() + * @model interface="true" abstract="true" + * @generated + */ +public interface Person extends EObject +{ +} // Person diff --git a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/Professor.java b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/Professor.java new file mode 100644 index 0000000000..2a90e96814 --- /dev/null +++ b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/Professor.java @@ -0,0 +1,26 @@ +/** + * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * EclipseSource - Generated code + */ +package org.eclipse.emf.ecp.test.university; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Professor</b></em>'. + * <!-- end-user-doc --> + * + * + * @see org.eclipse.emf.ecp.test.university.UniversityPackage#getProfessor() + * @model + * @generated + */ +public interface Professor extends Person +{ +} // Professor diff --git a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/Staff.java b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/Staff.java new file mode 100644 index 0000000000..fe367f9ad8 --- /dev/null +++ b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/Staff.java @@ -0,0 +1,92 @@ +/** + * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * EclipseSource - Generated code + */ +package org.eclipse.emf.ecp.test.university; + +import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecore.util.FeatureMap; + +/** + * <!-- begin-user-doc --> + * A representation of the model object '<em><b>Staff</b></em>'. + * <!-- end-user-doc --> + * + * <p> + * The following features are supported: + * <ul> + * <li>{@link org.eclipse.emf.ecp.test.university.Staff#getProfessors <em>Professors</em>}</li> + * <li>{@link org.eclipse.emf.ecp.test.university.Staff#getAssistants <em>Assistants</em>}</li> + * <li>{@link org.eclipse.emf.ecp.test.university.Staff#getStaff <em>Staff</em>}</li> + * </ul> + * </p> + * + * @see org.eclipse.emf.ecp.test.university.UniversityPackage#getStaff() + * @model + * @generated + */ +public interface Staff extends EObject +{ + /** + * Returns the value of the '<em><b>Professors</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.emf.ecp.test.university.Professor}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Professors</em>' containment reference list isn't clear, there really should be more + * of a description here... + * </p> + * <!-- end-user-doc --> + * + * @return the value of the '<em>Professors</em>' containment reference list. + * @see org.eclipse.emf.ecp.test.university.UniversityPackage#getStaff_Professors() + * @model containment="true" transient="true" volatile="true" derived="true" + * extendedMetaData="group='#staff'" + * @generated + */ + EList<Professor> getProfessors(); + + /** + * Returns the value of the '<em><b>Assistants</b></em>' containment reference list. + * The list contents are of type {@link org.eclipse.emf.ecp.test.university.Assistant}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Assistants</em>' containment reference list isn't clear, there really should be more + * of a description here... + * </p> + * <!-- end-user-doc --> + * + * @return the value of the '<em>Assistants</em>' containment reference list. + * @see org.eclipse.emf.ecp.test.university.UniversityPackage#getStaff_Assistants() + * @model containment="true" transient="true" volatile="true" derived="true" + * extendedMetaData="group='#staff'" + * @generated + */ + EList<Assistant> getAssistants(); + + /** + * Returns the value of the '<em><b>Staff</b></em>' attribute list. + * The list contents are of type {@link org.eclipse.emf.ecore.util.FeatureMap.Entry}. + * <!-- begin-user-doc --> + * <p> + * If the meaning of the '<em>Staff</em>' attribute list isn't clear, there really should be more of a description + * here... + * </p> + * <!-- end-user-doc --> + * + * @return the value of the '<em>Staff</em>' attribute list. + * @see org.eclipse.emf.ecp.test.university.UniversityPackage#getStaff_Staff() + * @model dataType="org.eclipse.emf.ecore.EFeatureMapEntry" many="true" + * extendedMetaData="kind='group'" + * @generated + */ + FeatureMap getStaff(); + +} // Staff diff --git a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/UniversityFactory.java b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/UniversityFactory.java index 2856ddf8a0..de3f1f8210 100644 --- a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/UniversityFactory.java +++ b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/UniversityFactory.java @@ -18,6 +18,7 @@ import org.eclipse.emf.ecore.EFactory; * The <b>Factory</b> for the model. * It provides a create method for each non-abstract class of the model. * <!-- end-user-doc --> + * * @see org.eclipse.emf.ecp.test.university.UniversityPackage * @generated */ @@ -27,6 +28,7 @@ public interface UniversityFactory extends EFactory * The singleton instance of the factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ UniversityFactory eINSTANCE = org.eclipse.emf.ecp.test.university.impl.UniversityFactoryImpl.init(); @@ -35,6 +37,7 @@ public interface UniversityFactory extends EFactory * Returns a new object of class '<em>Course Catalog</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @return a new object of class '<em>Course Catalog</em>'. * @generated */ @@ -44,15 +47,47 @@ public interface UniversityFactory extends EFactory * Returns a new object of class '<em>Course</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @return a new object of class '<em>Course</em>'. * @generated */ Course createCourse(); /** + * Returns a new object of class '<em>Staff</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @return a new object of class '<em>Staff</em>'. + * @generated + */ + Staff createStaff(); + + /** + * Returns a new object of class '<em>Professor</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @return a new object of class '<em>Professor</em>'. + * @generated + */ + Professor createProfessor(); + + /** + * Returns a new object of class '<em>Assistant</em>'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @return a new object of class '<em>Assistant</em>'. + * @generated + */ + Assistant createAssistant(); + + /** * Returns the package supported by this factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @return the package supported by this factory. * @generated */ diff --git a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/UniversityPackage.java b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/UniversityPackage.java index 79d157bfda..12a201e93a 100644 --- a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/UniversityPackage.java +++ b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/UniversityPackage.java @@ -28,6 +28,7 @@ import org.eclipse.emf.ecore.EReference; * <li>and each data type</li> * </ul> * <!-- end-user-doc --> + * * @see org.eclipse.emf.ecp.test.university.UniversityFactory * @model kind="package" * @generated @@ -38,6 +39,7 @@ public interface UniversityPackage extends EPackage * The package name. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ String eNAME = "university"; //$NON-NLS-1$ @@ -46,6 +48,7 @@ public interface UniversityPackage extends EPackage * The package namespace URI. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ String eNS_URI = "http://org/eclipse/emf/ecp/test/university"; //$NON-NLS-1$ @@ -54,6 +57,7 @@ public interface UniversityPackage extends EPackage * The package namespace name. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ String eNS_PREFIX = "org.eclipse.emf.ecp.test.university"; //$NON-NLS-1$ @@ -62,14 +66,17 @@ public interface UniversityPackage extends EPackage * The singleton instance of the package. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ UniversityPackage eINSTANCE = org.eclipse.emf.ecp.test.university.impl.UniversityPackageImpl.init(); /** - * The meta object id for the '{@link org.eclipse.emf.ecp.test.university.impl.CourseCatalogImpl <em>Course Catalog</em>}' class. + * The meta object id for the '{@link org.eclipse.emf.ecp.test.university.impl.CourseCatalogImpl + * <em>Course Catalog</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @see org.eclipse.emf.ecp.test.university.impl.CourseCatalogImpl * @see org.eclipse.emf.ecp.test.university.impl.UniversityPackageImpl#getCourseCatalog() * @generated @@ -80,6 +87,7 @@ public interface UniversityPackage extends EPackage * The feature id for the '<em><b>Courses</b></em>' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated * @ordered */ @@ -89,6 +97,7 @@ public interface UniversityPackage extends EPackage * The number of structural features of the '<em>Course Catalog</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated * @ordered */ @@ -98,6 +107,7 @@ public interface UniversityPackage extends EPackage * The number of operations of the '<em>Course Catalog</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated * @ordered */ @@ -107,6 +117,7 @@ public interface UniversityPackage extends EPackage * The meta object id for the '{@link org.eclipse.emf.ecp.test.university.impl.CourseImpl <em>Course</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @see org.eclipse.emf.ecp.test.university.impl.CourseImpl * @see org.eclipse.emf.ecp.test.university.impl.UniversityPackageImpl#getCourse() * @generated @@ -117,6 +128,7 @@ public interface UniversityPackage extends EPackage * The feature id for the '<em><b>Id</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated * @ordered */ @@ -126,6 +138,7 @@ public interface UniversityPackage extends EPackage * The feature id for the '<em><b>Name</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated * @ordered */ @@ -135,6 +148,7 @@ public interface UniversityPackage extends EPackage * The feature id for the '<em><b>Etcs</b></em>' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated * @ordered */ @@ -144,6 +158,7 @@ public interface UniversityPackage extends EPackage * The number of structural features of the '<em>Course</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated * @ordered */ @@ -153,15 +168,174 @@ public interface UniversityPackage extends EPackage * The number of operations of the '<em>Course</em>' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated * @ordered */ int COURSE_OPERATION_COUNT = 0; /** - * Returns the meta object for class '{@link org.eclipse.emf.ecp.test.university.CourseCatalog <em>Course Catalog</em>}'. + * The meta object id for the '{@link org.eclipse.emf.ecp.test.university.impl.StaffImpl <em>Staff</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see org.eclipse.emf.ecp.test.university.impl.StaffImpl + * @see org.eclipse.emf.ecp.test.university.impl.UniversityPackageImpl#getStaff() + * @generated + */ + int STAFF = 2; + + /** + * The feature id for the '<em><b>Professors</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int STAFF__PROFESSORS = 0; + + /** + * The feature id for the '<em><b>Assistants</b></em>' containment reference list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int STAFF__ASSISTANTS = 1; + + /** + * The feature id for the '<em><b>Staff</b></em>' attribute list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int STAFF__STAFF = 2; + + /** + * The number of structural features of the '<em>Staff</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int STAFF_FEATURE_COUNT = 3; + + /** + * The number of operations of the '<em>Staff</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int STAFF_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.emf.ecp.test.university.Person <em>Person</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see org.eclipse.emf.ecp.test.university.Person + * @see org.eclipse.emf.ecp.test.university.impl.UniversityPackageImpl#getPerson() + * @generated + */ + int PERSON = 5; + + /** + * The number of structural features of the '<em>Person</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int PERSON_FEATURE_COUNT = 0; + + /** + * The number of operations of the '<em>Person</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int PERSON_OPERATION_COUNT = 0; + + /** + * The meta object id for the '{@link org.eclipse.emf.ecp.test.university.impl.ProfessorImpl <em>Professor</em>}' + * class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see org.eclipse.emf.ecp.test.university.impl.ProfessorImpl + * @see org.eclipse.emf.ecp.test.university.impl.UniversityPackageImpl#getProfessor() + * @generated + */ + int PROFESSOR = 3; + + /** + * The number of structural features of the '<em>Professor</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int PROFESSOR_FEATURE_COUNT = PERSON_FEATURE_COUNT + 0; + + /** + * The number of operations of the '<em>Professor</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int PROFESSOR_OPERATION_COUNT = PERSON_OPERATION_COUNT + 0; + + /** + * The meta object id for the '{@link org.eclipse.emf.ecp.test.university.impl.AssistantImpl <em>Assistant</em>}' + * class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see org.eclipse.emf.ecp.test.university.impl.AssistantImpl + * @see org.eclipse.emf.ecp.test.university.impl.UniversityPackageImpl#getAssistant() + * @generated + */ + int ASSISTANT = 4; + + /** + * The number of structural features of the '<em>Assistant</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int ASSISTANT_FEATURE_COUNT = PERSON_FEATURE_COUNT + 0; + + /** + * The number of operations of the '<em>Assistant</em>' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int ASSISTANT_OPERATION_COUNT = PERSON_OPERATION_COUNT + 0; + + /** + * Returns the meta object for class '{@link org.eclipse.emf.ecp.test.university.CourseCatalog + * <em>Course Catalog</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @return the meta object for class '<em>Course Catalog</em>'. * @see org.eclipse.emf.ecp.test.university.CourseCatalog * @generated @@ -169,9 +343,11 @@ public interface UniversityPackage extends EPackage EClass getCourseCatalog(); /** - * Returns the meta object for the containment reference list '{@link org.eclipse.emf.ecp.test.university.CourseCatalog#getCourses <em>Courses</em>}'. + * Returns the meta object for the containment reference list ' + * {@link org.eclipse.emf.ecp.test.university.CourseCatalog#getCourses <em>Courses</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @return the meta object for the containment reference list '<em>Courses</em>'. * @see org.eclipse.emf.ecp.test.university.CourseCatalog#getCourses() * @see #getCourseCatalog() @@ -183,6 +359,7 @@ public interface UniversityPackage extends EPackage * Returns the meta object for class '{@link org.eclipse.emf.ecp.test.university.Course <em>Course</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @return the meta object for class '<em>Course</em>'. * @see org.eclipse.emf.ecp.test.university.Course * @generated @@ -193,6 +370,7 @@ public interface UniversityPackage extends EPackage * Returns the meta object for the attribute '{@link org.eclipse.emf.ecp.test.university.Course#getId <em>Id</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @return the meta object for the attribute '<em>Id</em>'. * @see org.eclipse.emf.ecp.test.university.Course#getId() * @see #getCourse() @@ -201,9 +379,11 @@ public interface UniversityPackage extends EPackage EAttribute getCourse_Id(); /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.ecp.test.university.Course#getName <em>Name</em>}'. + * Returns the meta object for the attribute '{@link org.eclipse.emf.ecp.test.university.Course#getName + * <em>Name</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @return the meta object for the attribute '<em>Name</em>'. * @see org.eclipse.emf.ecp.test.university.Course#getName() * @see #getCourse() @@ -212,9 +392,11 @@ public interface UniversityPackage extends EPackage EAttribute getCourse_Name(); /** - * Returns the meta object for the attribute '{@link org.eclipse.emf.ecp.test.university.Course#getEtcs <em>Etcs</em>}'. + * Returns the meta object for the attribute '{@link org.eclipse.emf.ecp.test.university.Course#getEtcs + * <em>Etcs</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @return the meta object for the attribute '<em>Etcs</em>'. * @see org.eclipse.emf.ecp.test.university.Course#getEtcs() * @see #getCourse() @@ -223,9 +405,93 @@ public interface UniversityPackage extends EPackage EAttribute getCourse_Etcs(); /** + * Returns the meta object for class '{@link org.eclipse.emf.ecp.test.university.Staff <em>Staff</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @return the meta object for class '<em>Staff</em>'. + * @see org.eclipse.emf.ecp.test.university.Staff + * @generated + */ + EClass getStaff(); + + /** + * Returns the meta object for the containment reference list ' + * {@link org.eclipse.emf.ecp.test.university.Staff#getProfessors <em>Professors</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @return the meta object for the containment reference list '<em>Professors</em>'. + * @see org.eclipse.emf.ecp.test.university.Staff#getProfessors() + * @see #getStaff() + * @generated + */ + EReference getStaff_Professors(); + + /** + * Returns the meta object for the containment reference list ' + * {@link org.eclipse.emf.ecp.test.university.Staff#getAssistants <em>Assistants</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @return the meta object for the containment reference list '<em>Assistants</em>'. + * @see org.eclipse.emf.ecp.test.university.Staff#getAssistants() + * @see #getStaff() + * @generated + */ + EReference getStaff_Assistants(); + + /** + * Returns the meta object for the attribute list '{@link org.eclipse.emf.ecp.test.university.Staff#getStaff + * <em>Staff</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @return the meta object for the attribute list '<em>Staff</em>'. + * @see org.eclipse.emf.ecp.test.university.Staff#getStaff() + * @see #getStaff() + * @generated + */ + EAttribute getStaff_Staff(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.ecp.test.university.Professor <em>Professor</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @return the meta object for class '<em>Professor</em>'. + * @see org.eclipse.emf.ecp.test.university.Professor + * @generated + */ + EClass getProfessor(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.ecp.test.university.Assistant <em>Assistant</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @return the meta object for class '<em>Assistant</em>'. + * @see org.eclipse.emf.ecp.test.university.Assistant + * @generated + */ + EClass getAssistant(); + + /** + * Returns the meta object for class '{@link org.eclipse.emf.ecp.test.university.Person <em>Person</em>}'. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @return the meta object for class '<em>Person</em>'. + * @see org.eclipse.emf.ecp.test.university.Person + * @generated + */ + EClass getPerson(); + + /** * Returns the factory that creates the instances of the model. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @return the factory that creates the instances of the model. * @generated */ @@ -242,14 +508,17 @@ public interface UniversityPackage extends EPackage * <li>and each data type</li> * </ul> * <!-- end-user-doc --> + * * @generated */ interface Literals { /** - * The meta object literal for the '{@link org.eclipse.emf.ecp.test.university.impl.CourseCatalogImpl <em>Course Catalog</em>}' class. + * The meta object literal for the '{@link org.eclipse.emf.ecp.test.university.impl.CourseCatalogImpl + * <em>Course Catalog</em>}' class. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @see org.eclipse.emf.ecp.test.university.impl.CourseCatalogImpl * @see org.eclipse.emf.ecp.test.university.impl.UniversityPackageImpl#getCourseCatalog() * @generated @@ -260,14 +529,17 @@ public interface UniversityPackage extends EPackage * The meta object literal for the '<em><b>Courses</b></em>' containment reference list feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ EReference COURSE_CATALOG__COURSES = eINSTANCE.getCourseCatalog_Courses(); /** - * The meta object literal for the '{@link org.eclipse.emf.ecp.test.university.impl.CourseImpl <em>Course</em>}' class. + * The meta object literal for the '{@link org.eclipse.emf.ecp.test.university.impl.CourseImpl <em>Course</em>}' + * class. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @see org.eclipse.emf.ecp.test.university.impl.CourseImpl * @see org.eclipse.emf.ecp.test.university.impl.UniversityPackageImpl#getCourse() * @generated @@ -278,6 +550,7 @@ public interface UniversityPackage extends EPackage * The meta object literal for the '<em><b>Id</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ EAttribute COURSE__ID = eINSTANCE.getCourse_Id(); @@ -286,6 +559,7 @@ public interface UniversityPackage extends EPackage * The meta object literal for the '<em><b>Name</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ EAttribute COURSE__NAME = eINSTANCE.getCourse_Name(); @@ -294,10 +568,85 @@ public interface UniversityPackage extends EPackage * The meta object literal for the '<em><b>Etcs</b></em>' attribute feature. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ EAttribute COURSE__ETCS = eINSTANCE.getCourse_Etcs(); + /** + * The meta object literal for the '{@link org.eclipse.emf.ecp.test.university.impl.StaffImpl <em>Staff</em>}' + * class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see org.eclipse.emf.ecp.test.university.impl.StaffImpl + * @see org.eclipse.emf.ecp.test.university.impl.UniversityPackageImpl#getStaff() + * @generated + */ + EClass STAFF = eINSTANCE.getStaff(); + + /** + * The meta object literal for the '<em><b>Professors</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + EReference STAFF__PROFESSORS = eINSTANCE.getStaff_Professors(); + + /** + * The meta object literal for the '<em><b>Assistants</b></em>' containment reference list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + EReference STAFF__ASSISTANTS = eINSTANCE.getStaff_Assistants(); + + /** + * The meta object literal for the '<em><b>Staff</b></em>' attribute list feature. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + EAttribute STAFF__STAFF = eINSTANCE.getStaff_Staff(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.ecp.test.university.impl.ProfessorImpl + * <em>Professor</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see org.eclipse.emf.ecp.test.university.impl.ProfessorImpl + * @see org.eclipse.emf.ecp.test.university.impl.UniversityPackageImpl#getProfessor() + * @generated + */ + EClass PROFESSOR = eINSTANCE.getProfessor(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.ecp.test.university.impl.AssistantImpl + * <em>Assistant</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see org.eclipse.emf.ecp.test.university.impl.AssistantImpl + * @see org.eclipse.emf.ecp.test.university.impl.UniversityPackageImpl#getAssistant() + * @generated + */ + EClass ASSISTANT = eINSTANCE.getAssistant(); + + /** + * The meta object literal for the '{@link org.eclipse.emf.ecp.test.university.Person <em>Person</em>}' class. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see org.eclipse.emf.ecp.test.university.Person + * @see org.eclipse.emf.ecp.test.university.impl.UniversityPackageImpl#getPerson() + * @generated + */ + EClass PERSON = eINSTANCE.getPerson(); + } } // UniversityPackage diff --git a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/AssistantImpl.java b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/AssistantImpl.java new file mode 100644 index 0000000000..08ed28043d --- /dev/null +++ b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/AssistantImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * EclipseSource - Generated code + */ +package org.eclipse.emf.ecp.test.university.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.emf.ecp.test.university.Assistant; +import org.eclipse.emf.ecp.test.university.UniversityPackage; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Assistant</b></em>'. + * <!-- end-user-doc --> + * <p> + * </p> + * + * @generated + */ +public class AssistantImpl extends MinimalEObjectImpl.Container implements Assistant +{ + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + protected AssistantImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + protected EClass eStaticClass() + { + return UniversityPackage.Literals.ASSISTANT; + } + +} // AssistantImpl diff --git a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/CourseCatalogImpl.java b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/CourseCatalogImpl.java index 60933a4c43..ea9a781ecb 100644 --- a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/CourseCatalogImpl.java +++ b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/CourseCatalogImpl.java @@ -12,6 +12,7 @@ package org.eclipse.emf.ecp.test.university.impl; import java.util.Collection; + import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; @@ -30,7 +31,7 @@ import org.eclipse.emf.ecp.test.university.UniversityPackage; * <p> * The following features are implemented: * <ul> - * <li>{@link org.eclipse.emf.ecp.test.university.impl.CourseCatalogImpl#getCourses <em>Courses</em>}</li> + * <li>{@link org.eclipse.emf.ecp.test.university.impl.CourseCatalogImpl#getCourses <em>Courses</em>}</li> * </ul> * </p> * @@ -42,6 +43,7 @@ public class CourseCatalogImpl extends MinimalEObjectImpl.Container implements C * The cached value of the '{@link #getCourses() <em>Courses</em>}' containment reference list. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @see #getCourses() * @generated * @ordered @@ -51,6 +53,7 @@ public class CourseCatalogImpl extends MinimalEObjectImpl.Container implements C /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ protected CourseCatalogImpl() @@ -61,6 +64,7 @@ public class CourseCatalogImpl extends MinimalEObjectImpl.Container implements C /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override @@ -72,6 +76,7 @@ public class CourseCatalogImpl extends MinimalEObjectImpl.Container implements C /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public EList<Course> getCourses() @@ -86,6 +91,7 @@ public class CourseCatalogImpl extends MinimalEObjectImpl.Container implements C /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override @@ -102,6 +108,7 @@ public class CourseCatalogImpl extends MinimalEObjectImpl.Container implements C /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override @@ -118,6 +125,7 @@ public class CourseCatalogImpl extends MinimalEObjectImpl.Container implements C /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @SuppressWarnings("unchecked") @@ -137,6 +145,7 @@ public class CourseCatalogImpl extends MinimalEObjectImpl.Container implements C /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override @@ -154,6 +163,7 @@ public class CourseCatalogImpl extends MinimalEObjectImpl.Container implements C /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override diff --git a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/CourseImpl.java b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/CourseImpl.java index 248d5f0f4f..310b1c17ad 100644 --- a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/CourseImpl.java +++ b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/CourseImpl.java @@ -25,9 +25,9 @@ import org.eclipse.emf.ecp.test.university.UniversityPackage; * <p> * The following features are implemented: * <ul> - * <li>{@link org.eclipse.emf.ecp.test.university.impl.CourseImpl#getId <em>Id</em>}</li> - * <li>{@link org.eclipse.emf.ecp.test.university.impl.CourseImpl#getName <em>Name</em>}</li> - * <li>{@link org.eclipse.emf.ecp.test.university.impl.CourseImpl#getEtcs <em>Etcs</em>}</li> + * <li>{@link org.eclipse.emf.ecp.test.university.impl.CourseImpl#getId <em>Id</em>}</li> + * <li>{@link org.eclipse.emf.ecp.test.university.impl.CourseImpl#getName <em>Name</em>}</li> + * <li>{@link org.eclipse.emf.ecp.test.university.impl.CourseImpl#getEtcs <em>Etcs</em>}</li> * </ul> * </p> * @@ -39,6 +39,7 @@ public class CourseImpl extends MinimalEObjectImpl.Container implements Course * The default value of the '{@link #getId() <em>Id</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @see #getId() * @generated * @ordered @@ -49,6 +50,7 @@ public class CourseImpl extends MinimalEObjectImpl.Container implements Course * The cached value of the '{@link #getId() <em>Id</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @see #getId() * @generated * @ordered @@ -59,6 +61,7 @@ public class CourseImpl extends MinimalEObjectImpl.Container implements Course * The default value of the '{@link #getName() <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @see #getName() * @generated * @ordered @@ -69,6 +72,7 @@ public class CourseImpl extends MinimalEObjectImpl.Container implements Course * The cached value of the '{@link #getName() <em>Name</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @see #getName() * @generated * @ordered @@ -79,6 +83,7 @@ public class CourseImpl extends MinimalEObjectImpl.Container implements Course * The default value of the '{@link #getEtcs() <em>Etcs</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @see #getEtcs() * @generated * @ordered @@ -89,6 +94,7 @@ public class CourseImpl extends MinimalEObjectImpl.Container implements Course * The cached value of the '{@link #getEtcs() <em>Etcs</em>}' attribute. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @see #getEtcs() * @generated * @ordered @@ -98,6 +104,7 @@ public class CourseImpl extends MinimalEObjectImpl.Container implements Course /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ protected CourseImpl() @@ -108,6 +115,7 @@ public class CourseImpl extends MinimalEObjectImpl.Container implements Course /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override @@ -119,6 +127,7 @@ public class CourseImpl extends MinimalEObjectImpl.Container implements Course /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public String getId() @@ -129,6 +138,7 @@ public class CourseImpl extends MinimalEObjectImpl.Container implements Course /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public void setId(String newId) @@ -142,6 +152,7 @@ public class CourseImpl extends MinimalEObjectImpl.Container implements Course /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public String getName() @@ -152,6 +163,7 @@ public class CourseImpl extends MinimalEObjectImpl.Container implements Course /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public void setName(String newName) @@ -165,6 +177,7 @@ public class CourseImpl extends MinimalEObjectImpl.Container implements Course /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public int getEtcs() @@ -175,6 +188,7 @@ public class CourseImpl extends MinimalEObjectImpl.Container implements Course /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public void setEtcs(int newEtcs) @@ -188,6 +202,7 @@ public class CourseImpl extends MinimalEObjectImpl.Container implements Course /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override @@ -208,6 +223,7 @@ public class CourseImpl extends MinimalEObjectImpl.Container implements Course /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override @@ -231,6 +247,7 @@ public class CourseImpl extends MinimalEObjectImpl.Container implements Course /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override @@ -254,6 +271,7 @@ public class CourseImpl extends MinimalEObjectImpl.Container implements Course /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override @@ -274,6 +292,7 @@ public class CourseImpl extends MinimalEObjectImpl.Container implements Course /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override diff --git a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/ProfessorImpl.java b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/ProfessorImpl.java new file mode 100644 index 0000000000..b949b8f9ec --- /dev/null +++ b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/ProfessorImpl.java @@ -0,0 +1,53 @@ +/** + * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * EclipseSource - Generated code + */ +package org.eclipse.emf.ecp.test.university.impl; + +import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; +import org.eclipse.emf.ecp.test.university.Professor; +import org.eclipse.emf.ecp.test.university.UniversityPackage; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Professor</b></em>'. + * <!-- end-user-doc --> + * <p> + * </p> + * + * @generated + */ +public class ProfessorImpl extends MinimalEObjectImpl.Container implements Professor +{ + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + protected ProfessorImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + protected EClass eStaticClass() + { + return UniversityPackage.Literals.PROFESSOR; + } + +} // ProfessorImpl diff --git a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/StaffImpl.java b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/StaffImpl.java new file mode 100644 index 0000000000..c390c2714c --- /dev/null +++ b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/StaffImpl.java @@ -0,0 +1,252 @@ +/** + * Copyright (c) 2011-2014 EclipseSource Muenchen GmbH and others. + * + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * EclipseSource - Generated code + */ +package org.eclipse.emf.ecp.test.university.impl; + +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.BasicFeatureMap; +import org.eclipse.emf.ecore.util.FeatureMap; +import org.eclipse.emf.ecore.util.InternalEList; +import org.eclipse.emf.ecp.test.university.Assistant; +import org.eclipse.emf.ecp.test.university.Professor; +import org.eclipse.emf.ecp.test.university.Staff; +import org.eclipse.emf.ecp.test.university.UniversityPackage; + +/** + * <!-- begin-user-doc --> + * An implementation of the model object '<em><b>Staff</b></em>'. + * <!-- end-user-doc --> + * <p> + * The following features are implemented: + * <ul> + * <li>{@link org.eclipse.emf.ecp.test.university.impl.StaffImpl#getProfessors <em>Professors</em>}</li> + * <li>{@link org.eclipse.emf.ecp.test.university.impl.StaffImpl#getAssistants <em>Assistants</em>}</li> + * <li>{@link org.eclipse.emf.ecp.test.university.impl.StaffImpl#getStaff <em>Staff</em>}</li> + * </ul> + * </p> + * + * @generated + */ +public class StaffImpl extends MinimalEObjectImpl.Container implements Staff +{ + /** + * The cached value of the '{@link #getStaff() <em>Staff</em>}' attribute list. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @see #getStaff() + * @generated + * @ordered + */ + protected FeatureMap staff; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + protected StaffImpl() + { + super(); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + protected EClass eStaticClass() + { + return UniversityPackage.Literals.STAFF; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public EList<Professor> getProfessors() + { + return getStaff().list(UniversityPackage.Literals.STAFF__PROFESSORS); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public EList<Assistant> getAssistants() + { + return getStaff().list(UniversityPackage.Literals.STAFF__ASSISTANTS); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public FeatureMap getStaff() + { + if (staff == null) + { + staff = new BasicFeatureMap(this, UniversityPackage.STAFF__STAFF); + } + return staff; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) + { + switch (featureID) + { + case UniversityPackage.STAFF__PROFESSORS: + return ((InternalEList<?>) getProfessors()).basicRemove(otherEnd, msgs); + case UniversityPackage.STAFF__ASSISTANTS: + return ((InternalEList<?>) getAssistants()).basicRemove(otherEnd, msgs); + case UniversityPackage.STAFF__STAFF: + return ((InternalEList<?>) getStaff()).basicRemove(otherEnd, msgs); + } + return super.eInverseRemove(otherEnd, featureID, msgs); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public Object eGet(int featureID, boolean resolve, boolean coreType) + { + switch (featureID) + { + case UniversityPackage.STAFF__PROFESSORS: + return getProfessors(); + case UniversityPackage.STAFF__ASSISTANTS: + return getAssistants(); + case UniversityPackage.STAFF__STAFF: + if (coreType) + return getStaff(); + return ((FeatureMap.Internal) getStaff()).getWrapper(); + } + return super.eGet(featureID, resolve, coreType); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @SuppressWarnings("unchecked") + @Override + public void eSet(int featureID, Object newValue) + { + switch (featureID) + { + case UniversityPackage.STAFF__PROFESSORS: + getProfessors().clear(); + getProfessors().addAll((Collection<? extends Professor>) newValue); + return; + case UniversityPackage.STAFF__ASSISTANTS: + getAssistants().clear(); + getAssistants().addAll((Collection<? extends Assistant>) newValue); + return; + case UniversityPackage.STAFF__STAFF: + ((FeatureMap.Internal) getStaff()).set(newValue); + return; + } + super.eSet(featureID, newValue); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public void eUnset(int featureID) + { + switch (featureID) + { + case UniversityPackage.STAFF__PROFESSORS: + getProfessors().clear(); + return; + case UniversityPackage.STAFF__ASSISTANTS: + getAssistants().clear(); + return; + case UniversityPackage.STAFF__STAFF: + getStaff().clear(); + return; + } + super.eUnset(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public boolean eIsSet(int featureID) + { + switch (featureID) + { + case UniversityPackage.STAFF__PROFESSORS: + return !getProfessors().isEmpty(); + case UniversityPackage.STAFF__ASSISTANTS: + return !getAssistants().isEmpty(); + case UniversityPackage.STAFF__STAFF: + return staff != null && !staff.isEmpty(); + } + return super.eIsSet(featureID); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + @Override + public String toString() + { + if (eIsProxy()) + return super.toString(); + + StringBuffer result = new StringBuffer(super.toString()); + result.append(" (staff: "); //$NON-NLS-1$ + result.append(staff); + result.append(')'); + return result.toString(); + } + +} // StaffImpl diff --git a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/UniversityFactoryImpl.java b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/UniversityFactoryImpl.java index a5f1662c95..df36adeaa3 100644 --- a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/UniversityFactoryImpl.java +++ b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/UniversityFactoryImpl.java @@ -16,8 +16,11 @@ import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.impl.EFactoryImpl; import org.eclipse.emf.ecore.plugin.EcorePlugin; +import org.eclipse.emf.ecp.test.university.Assistant; import org.eclipse.emf.ecp.test.university.Course; import org.eclipse.emf.ecp.test.university.CourseCatalog; +import org.eclipse.emf.ecp.test.university.Professor; +import org.eclipse.emf.ecp.test.university.Staff; import org.eclipse.emf.ecp.test.university.UniversityFactory; import org.eclipse.emf.ecp.test.university.UniversityPackage; @@ -25,6 +28,7 @@ import org.eclipse.emf.ecp.test.university.UniversityPackage; * <!-- begin-user-doc --> * An implementation of the model <b>Factory</b>. * <!-- end-user-doc --> + * * @generated */ public class UniversityFactoryImpl extends EFactoryImpl implements UniversityFactory @@ -33,6 +37,7 @@ public class UniversityFactoryImpl extends EFactoryImpl implements UniversityFac * Creates the default factory implementation. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public static UniversityFactory init() @@ -56,6 +61,7 @@ public class UniversityFactoryImpl extends EFactoryImpl implements UniversityFac * Creates an instance of the factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public UniversityFactoryImpl() @@ -66,6 +72,7 @@ public class UniversityFactoryImpl extends EFactoryImpl implements UniversityFac /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ @Override @@ -77,6 +84,12 @@ public class UniversityFactoryImpl extends EFactoryImpl implements UniversityFac return createCourseCatalog(); case UniversityPackage.COURSE: return createCourse(); + case UniversityPackage.STAFF: + return createStaff(); + case UniversityPackage.PROFESSOR: + return createProfessor(); + case UniversityPackage.ASSISTANT: + return createAssistant(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); //$NON-NLS-1$ //$NON-NLS-2$ } @@ -85,6 +98,7 @@ public class UniversityFactoryImpl extends EFactoryImpl implements UniversityFac /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public CourseCatalog createCourseCatalog() @@ -96,6 +110,7 @@ public class UniversityFactoryImpl extends EFactoryImpl implements UniversityFac /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public Course createCourse() @@ -107,6 +122,43 @@ public class UniversityFactoryImpl extends EFactoryImpl implements UniversityFac /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * + * @generated + */ + public Staff createStaff() + { + StaffImpl staff = new StaffImpl(); + return staff; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public Professor createProfessor() + { + ProfessorImpl professor = new ProfessorImpl(); + return professor; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public Assistant createAssistant() + { + AssistantImpl assistant = new AssistantImpl(); + return assistant; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * * @generated */ public UniversityPackage getUniversityPackage() @@ -117,6 +169,7 @@ public class UniversityFactoryImpl extends EFactoryImpl implements UniversityFac /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @deprecated * @generated */ diff --git a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/UniversityPackageImpl.java b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/UniversityPackageImpl.java index c0594b17c6..7494db4701 100644 --- a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/UniversityPackageImpl.java +++ b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/impl/UniversityPackageImpl.java @@ -17,8 +17,12 @@ import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.EValidator; import org.eclipse.emf.ecore.impl.EPackageImpl; +import org.eclipse.emf.ecp.test.university.Assistant; import org.eclipse.emf.ecp.test.university.Course; import org.eclipse.emf.ecp.test.university.CourseCatalog; +import org.eclipse.emf.ecp.test.university.Person; +import org.eclipse.emf.ecp.test.university.Professor; +import org.eclipse.emf.ecp.test.university.Staff; import org.eclipse.emf.ecp.test.university.UniversityFactory; import org.eclipse.emf.ecp.test.university.UniversityPackage; import org.eclipse.emf.ecp.test.university.util.UniversityValidator; @@ -27,6 +31,7 @@ import org.eclipse.emf.ecp.test.university.util.UniversityValidator; * <!-- begin-user-doc --> * An implementation of the model <b>Package</b>. * <!-- end-user-doc --> + * * @generated */ public class UniversityPackageImpl extends EPackageImpl implements UniversityPackage @@ -34,6 +39,7 @@ public class UniversityPackageImpl extends EPackageImpl implements UniversityPac /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ private EClass courseCatalogEClass = null; @@ -41,11 +47,44 @@ public class UniversityPackageImpl extends EPackageImpl implements UniversityPac /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ private EClass courseEClass = null; /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + private EClass staffEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + private EClass professorEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + private EClass assistantEClass = null; + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + private EClass personEClass = null; + + /** * Creates an instance of the model <b>Package</b>, registered with {@link org.eclipse.emf.ecore.EPackage.Registry * EPackage.Registry} by the package * package URI value. @@ -67,6 +106,7 @@ public class UniversityPackageImpl extends EPackageImpl implements UniversityPac /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ private static boolean isInited = false; @@ -74,10 +114,11 @@ public class UniversityPackageImpl extends EPackageImpl implements UniversityPac /** * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. * - * <p>This method is used to initialize {@link UniversityPackage#eINSTANCE} when that field is accessed. - * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. - * <!-- begin-user-doc + * <p> + * This method is used to initialize {@link UniversityPackage#eINSTANCE} when that field is accessed. Clients should + * not invoke it directly. Instead, they should simply access that field to obtain the package. <!-- begin-user-doc * --> <!-- end-user-doc --> + * * @see #eNS_URI * @see #createPackageContents() * @see #initializePackageContents() @@ -90,7 +131,8 @@ public class UniversityPackageImpl extends EPackageImpl implements UniversityPac // Obtain or create and register package UniversityPackageImpl theUniversityPackage = (UniversityPackageImpl) (EPackage.Registry.INSTANCE.get(eNS_URI) instanceof UniversityPackageImpl ? EPackage.Registry.INSTANCE - .get(eNS_URI) : new UniversityPackageImpl()); + .get(eNS_URI) + : new UniversityPackageImpl()); isInited = true; @@ -122,6 +164,7 @@ public class UniversityPackageImpl extends EPackageImpl implements UniversityPac /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public EClass getCourseCatalog() @@ -132,6 +175,7 @@ public class UniversityPackageImpl extends EPackageImpl implements UniversityPac /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public EReference getCourseCatalog_Courses() @@ -142,6 +186,7 @@ public class UniversityPackageImpl extends EPackageImpl implements UniversityPac /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public EClass getCourse() @@ -152,6 +197,7 @@ public class UniversityPackageImpl extends EPackageImpl implements UniversityPac /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public EAttribute getCourse_Id() @@ -162,6 +208,7 @@ public class UniversityPackageImpl extends EPackageImpl implements UniversityPac /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public EAttribute getCourse_Name() @@ -172,6 +219,7 @@ public class UniversityPackageImpl extends EPackageImpl implements UniversityPac /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public EAttribute getCourse_Etcs() @@ -182,6 +230,84 @@ public class UniversityPackageImpl extends EPackageImpl implements UniversityPac /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * + * @generated + */ + public EClass getStaff() + { + return staffEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public EReference getStaff_Professors() + { + return (EReference) staffEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public EReference getStaff_Assistants() + { + return (EReference) staffEClass.getEStructuralFeatures().get(1); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public EAttribute getStaff_Staff() + { + return (EAttribute) staffEClass.getEStructuralFeatures().get(2); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public EClass getProfessor() + { + return professorEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public EClass getAssistant() + { + return assistantEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public EClass getPerson() + { + return personEClass; + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * * @generated */ public UniversityFactory getUniversityFactory() @@ -192,15 +318,17 @@ public class UniversityPackageImpl extends EPackageImpl implements UniversityPac /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ private boolean isCreated = false; /** - * Creates the meta-model objects for the package. This method is + * Creates the meta-model objects for the package. This method is * guarded to have no affect on any invocation but its first. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public void createPackageContents() @@ -217,20 +345,33 @@ public class UniversityPackageImpl extends EPackageImpl implements UniversityPac createEAttribute(courseEClass, COURSE__ID); createEAttribute(courseEClass, COURSE__NAME); createEAttribute(courseEClass, COURSE__ETCS); + + staffEClass = createEClass(STAFF); + createEReference(staffEClass, STAFF__PROFESSORS); + createEReference(staffEClass, STAFF__ASSISTANTS); + createEAttribute(staffEClass, STAFF__STAFF); + + professorEClass = createEClass(PROFESSOR); + + assistantEClass = createEClass(ASSISTANT); + + personEClass = createEClass(PERSON); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ private boolean isInitialized = false; /** - * Complete the initialization of the package and its meta-model. This + * Complete the initialization of the package and its meta-model. This * method is guarded to have no affect on any invocation but its first. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public void initializePackageContents() @@ -249,6 +390,8 @@ public class UniversityPackageImpl extends EPackageImpl implements UniversityPac // Set bounds for type parameters // Add supertypes to classes + professorEClass.getESuperTypes().add(this.getPerson()); + assistantEClass.getESuperTypes().add(this.getPerson()); // Initialize classes, features, and operations; add parameters initEClass(courseCatalogEClass, CourseCatalog.class, @@ -273,27 +416,81 @@ public class UniversityPackageImpl extends EPackageImpl implements UniversityPac ecorePackage.getEInt(), "etcs", null, 1, 1, Course.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEClass(staffEClass, Staff.class, "Staff", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference( + getStaff_Professors(), + this.getProfessor(), + null, + "professors", null, 0, -1, Staff.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEReference( + getStaff_Assistants(), + this.getAssistant(), + null, + "assistants", null, 0, -1, Staff.class, IS_TRANSIENT, IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + initEAttribute( + getStaff_Staff(), + ecorePackage.getEFeatureMapEntry(), + "staff", null, 0, -1, Staff.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); //$NON-NLS-1$ + + initEClass(professorEClass, Professor.class, + "Professor", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + + initEClass(assistantEClass, Assistant.class, + "Assistant", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + + initEClass(personEClass, Person.class, "Person", IS_ABSTRACT, IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + // Create resource createResource(eNS_URI); // Create annotations // http://www.eclipse.org/emf/2002/Ecore createEcoreAnnotations(); + // http:///org/eclipse/emf/ecore/util/ExtendedMetaData + createExtendedMetaDataAnnotations(); } /** * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ protected void createEcoreAnnotations() { - String source = "http://www.eclipse.org/emf/2002/Ecore"; //$NON-NLS-1$ + String source = "http://www.eclipse.org/emf/2002/Ecore"; //$NON-NLS-1$ addAnnotation(courseEClass, source, new String[] - { "constraints", "UniqueItemById NameNotEmpty" //$NON-NLS-1$ //$NON-NLS-2$ + { "constraints", "UniqueItemById NameNotEmpty" //$NON-NLS-1$ //$NON-NLS-2$ + }); + } + + /** + * Initializes the annotations for <b>http:///org/eclipse/emf/ecore/util/ExtendedMetaData</b>. + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + protected void createExtendedMetaDataAnnotations() + { + String source = "http:///org/eclipse/emf/ecore/util/ExtendedMetaData"; //$NON-NLS-1$ + addAnnotation(getStaff_Professors(), + source, + new String[] + { "group", "#staff" //$NON-NLS-1$ //$NON-NLS-2$ + }); + addAnnotation(getStaff_Assistants(), + source, + new String[] + { "group", "#staff" //$NON-NLS-1$ //$NON-NLS-2$ + }); + addAnnotation(getStaff_Staff(), + source, + new String[] + { "kind", "group" //$NON-NLS-1$ //$NON-NLS-2$ }); } diff --git a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/util/UniversityAdapterFactory.java b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/util/UniversityAdapterFactory.java index 2a43fd6a2c..befc5e9d7f 100644 --- a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/util/UniversityAdapterFactory.java +++ b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/util/UniversityAdapterFactory.java @@ -15,8 +15,12 @@ import org.eclipse.emf.common.notify.Adapter; import org.eclipse.emf.common.notify.Notifier; import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; import org.eclipse.emf.ecore.EObject; +import org.eclipse.emf.ecp.test.university.Assistant; import org.eclipse.emf.ecp.test.university.Course; import org.eclipse.emf.ecp.test.university.CourseCatalog; +import org.eclipse.emf.ecp.test.university.Person; +import org.eclipse.emf.ecp.test.university.Professor; +import org.eclipse.emf.ecp.test.university.Staff; import org.eclipse.emf.ecp.test.university.UniversityPackage; /** @@ -24,6 +28,7 @@ import org.eclipse.emf.ecp.test.university.UniversityPackage; * The <b>Adapter Factory</b> for the model. * It provides an adapter <code>createXXX</code> method for each class of the model. * <!-- end-user-doc --> + * * @see org.eclipse.emf.ecp.test.university.UniversityPackage * @generated */ @@ -33,6 +38,7 @@ public class UniversityAdapterFactory extends AdapterFactoryImpl * The cached model package. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ protected static UniversityPackage modelPackage; @@ -41,6 +47,7 @@ public class UniversityAdapterFactory extends AdapterFactoryImpl * Creates an instance of the adapter factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public UniversityAdapterFactory() @@ -57,6 +64,7 @@ public class UniversityAdapterFactory extends AdapterFactoryImpl * This implementation returns <code>true</code> if the object is either the model's package or is an instance * object of the model. * <!-- end-user-doc --> + * * @return whether this factory is applicable for the type of the object. * @generated */ @@ -78,6 +86,7 @@ public class UniversityAdapterFactory extends AdapterFactoryImpl * The switch that delegates to the <code>createXXX</code> methods. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ protected UniversitySwitch<Adapter> modelSwitch = @@ -96,6 +105,30 @@ public class UniversityAdapterFactory extends AdapterFactoryImpl } @Override + public Adapter caseStaff(Staff object) + { + return createStaffAdapter(); + } + + @Override + public Adapter caseProfessor(Professor object) + { + return createProfessorAdapter(); + } + + @Override + public Adapter caseAssistant(Assistant object) + { + return createAssistantAdapter(); + } + + @Override + public Adapter casePerson(Person object) + { + return createPersonAdapter(); + } + + @Override public Adapter defaultCase(EObject object) { return createEObjectAdapter(); @@ -106,6 +139,7 @@ public class UniversityAdapterFactory extends AdapterFactoryImpl * Creates an adapter for the <code>target</code>. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @param target the object to adapt. * @return the adapter for the <code>target</code>. * @generated @@ -117,11 +151,13 @@ public class UniversityAdapterFactory extends AdapterFactoryImpl } /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.test.university.CourseCatalog <em>Course Catalog</em>}'. + * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.test.university.CourseCatalog + * <em>Course Catalog</em>}'. * <!-- begin-user-doc --> * This default implementation returns null so that we can easily ignore cases; * it's useful to ignore a case when inheritance will catch all the cases anyway. * <!-- end-user-doc --> + * * @return the new adapter. * @see org.eclipse.emf.ecp.test.university.CourseCatalog * @generated @@ -132,11 +168,13 @@ public class UniversityAdapterFactory extends AdapterFactoryImpl } /** - * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.test.university.Course <em>Course</em>}'. + * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.test.university.Course <em>Course</em>} + * '. * <!-- begin-user-doc --> * This default implementation returns null so that we can easily ignore cases; * it's useful to ignore a case when inheritance will catch all the cases anyway. * <!-- end-user-doc --> + * * @return the new adapter. * @see org.eclipse.emf.ecp.test.university.Course * @generated @@ -147,10 +185,78 @@ public class UniversityAdapterFactory extends AdapterFactoryImpl } /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.test.university.Staff <em>Staff</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * + * @return the new adapter. + * @see org.eclipse.emf.ecp.test.university.Staff + * @generated + */ + public Adapter createStaffAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.test.university.Professor + * <em>Professor</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * + * @return the new adapter. + * @see org.eclipse.emf.ecp.test.university.Professor + * @generated + */ + public Adapter createProfessorAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.test.university.Assistant + * <em>Assistant</em>}'. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * + * @return the new adapter. + * @see org.eclipse.emf.ecp.test.university.Assistant + * @generated + */ + public Adapter createAssistantAdapter() + { + return null; + } + + /** + * Creates a new adapter for an object of class '{@link org.eclipse.emf.ecp.test.university.Person <em>Person</em>} + * '. + * <!-- begin-user-doc --> + * This default implementation returns null so that we can easily ignore cases; + * it's useful to ignore a case when inheritance will catch all the cases anyway. + * <!-- end-user-doc --> + * + * @return the new adapter. + * @see org.eclipse.emf.ecp.test.university.Person + * @generated + */ + public Adapter createPersonAdapter() + { + return null; + } + + /** * Creates a new adapter for the default case. * <!-- begin-user-doc --> * This default implementation returns null. * <!-- end-user-doc --> + * * @return the new adapter. * @generated */ diff --git a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/util/UniversitySwitch.java b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/util/UniversitySwitch.java index 1ecc5b239a..7df6085727 100644 --- a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/util/UniversitySwitch.java +++ b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/util/UniversitySwitch.java @@ -14,8 +14,12 @@ package org.eclipse.emf.ecp.test.university.util; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.util.Switch; +import org.eclipse.emf.ecp.test.university.Assistant; import org.eclipse.emf.ecp.test.university.Course; import org.eclipse.emf.ecp.test.university.CourseCatalog; +import org.eclipse.emf.ecp.test.university.Person; +import org.eclipse.emf.ecp.test.university.Professor; +import org.eclipse.emf.ecp.test.university.Staff; import org.eclipse.emf.ecp.test.university.UniversityPackage; /** @@ -28,6 +32,7 @@ import org.eclipse.emf.ecp.test.university.UniversityPackage; * until a non-null result is returned, * which is the result of the switch. * <!-- end-user-doc --> + * * @see org.eclipse.emf.ecp.test.university.UniversityPackage * @generated */ @@ -37,6 +42,7 @@ public class UniversitySwitch<T> extends Switch<T> * The cached model package * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ protected static UniversityPackage modelPackage; @@ -45,6 +51,7 @@ public class UniversitySwitch<T> extends Switch<T> * Creates an instance of the switch. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @generated */ public UniversitySwitch() @@ -59,6 +66,7 @@ public class UniversitySwitch<T> extends Switch<T> * Checks whether this is a switch for the given package. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @parameter ePackage the package in question. * @return whether this is a switch for the given package. * @generated @@ -70,9 +78,11 @@ public class UniversitySwitch<T> extends Switch<T> } /** - * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result. + * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that + * result. * <!-- begin-user-doc --> * <!-- end-user-doc --> + * * @return the first non-null result returned by a <code>caseXXX</code> call. * @generated */ @@ -95,6 +105,38 @@ public class UniversitySwitch<T> extends Switch<T> result = defaultCase(theEObject); return result; } + case UniversityPackage.STAFF: { + Staff staff = (Staff) theEObject; + T result = caseStaff(staff); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case UniversityPackage.PROFESSOR: { + Professor professor = (Professor) theEObject; + T result = caseProfessor(professor); + if (result == null) + result = casePerson(professor); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case UniversityPackage.ASSISTANT: { + Assistant assistant = (Assistant) theEObject; + T result = caseAssistant(assistant); + if (result == null) + result = casePerson(assistant); + if (result == null) + result = defaultCase(theEObject); + return result; + } + case UniversityPackage.PERSON: { + Person person = (Person) theEObject; + T result = casePerson(person); + if (result == null) + result = defaultCase(theEObject); + return result; + } default: return defaultCase(theEObject); } @@ -106,6 +148,7 @@ public class UniversitySwitch<T> extends Switch<T> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> + * * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Course Catalog</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -122,6 +165,7 @@ public class UniversitySwitch<T> extends Switch<T> * This implementation returns null; * returning a non-null result will terminate the switch. * <!-- end-user-doc --> + * * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>Course</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) @@ -133,11 +177,80 @@ public class UniversitySwitch<T> extends Switch<T> } /** + * Returns the result of interpreting the object as an instance of '<em>Staff</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Staff</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseStaff(Staff object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Professor</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Professor</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseProfessor(Professor object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Assistant</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Assistant</em>'. + * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) + * @generated + */ + public T caseAssistant(Assistant object) + { + return null; + } + + /** + * Returns the result of interpreting the object as an instance of '<em>Person</em>'. + * <!-- begin-user-doc --> + * This implementation returns null; + * returning a non-null result will terminate the switch. + * <!-- end-user-doc --> + * + * @param object the target of the switch. + * @return the result of interpreting the object as an instance of '<em>Person</em>'. + * @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 '<em>EObject</em>'. * <!-- begin-user-doc --> * This implementation returns null; * returning a non-null result will terminate the switch, but this is the last case anyway. * <!-- end-user-doc --> + * * @param object the target of the switch. * @return the result of interpreting the object as an instance of '<em>EObject</em>'. * @see #doSwitch(org.eclipse.emf.ecore.EObject) diff --git a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/util/UniversityValidator.java b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/util/UniversityValidator.java index 44f6ef55c0..642d479b45 100644 --- a/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/util/UniversityValidator.java +++ b/tests/org.eclipse.emf.ecp.test.model/src/org/eclipse/emf/ecp/test/university/util/UniversityValidator.java @@ -24,8 +24,12 @@ import org.eclipse.emf.common.util.EList; import org.eclipse.emf.common.util.ResourceLocator; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.util.EObjectValidator; +import org.eclipse.emf.ecp.test.university.Assistant; import org.eclipse.emf.ecp.test.university.Course; import org.eclipse.emf.ecp.test.university.CourseCatalog; +import org.eclipse.emf.ecp.test.university.Person; +import org.eclipse.emf.ecp.test.university.Professor; +import org.eclipse.emf.ecp.test.university.Staff; import org.eclipse.emf.ecp.test.university.UniversityPackage; import org.eclipse.emf.ecp.view.internal.validation.ValidationNotification; @@ -120,6 +124,14 @@ public class UniversityValidator extends EObjectValidator return validateCourseCatalog((CourseCatalog) value, diagnostics, context); case UniversityPackage.COURSE: return validateCourse((Course) value, diagnostics, context); + case UniversityPackage.STAFF: + return validateStaff((Staff) value, diagnostics, context); + case UniversityPackage.PROFESSOR: + return validateProfessor((Professor) value, diagnostics, context); + case UniversityPackage.ASSISTANT: + return validateAssistant((Assistant) value, diagnostics, context); + case UniversityPackage.PERSON: + return validatePerson((Person) value, diagnostics, context); default: return true; } @@ -145,37 +157,27 @@ public class UniversityValidator extends EObjectValidator */ public boolean validateCourse(Course course, DiagnosticChain diagnostics, Map<Object, Object> context) { - if (!validate_NoCircularContainment(course, diagnostics, context)) { + if (!validate_NoCircularContainment(course, diagnostics, context)) return false; - } boolean result = validate_EveryMultiplicityConforms(course, diagnostics, context); - if (result || diagnostics != null) { + if (result || diagnostics != null) result &= validate_EveryDataValueConforms(course, diagnostics, context); - } - if (result || diagnostics != null) { + if (result || diagnostics != null) result &= validate_EveryReferenceIsContained(course, diagnostics, context); - } - if (result || diagnostics != null) { + if (result || diagnostics != null) result &= validate_EveryBidirectionalReferenceIsPaired(course, diagnostics, context); - } - if (result || diagnostics != null) { + if (result || diagnostics != null) result &= validate_EveryProxyResolves(course, diagnostics, context); - } - if (result || diagnostics != null) { + if (result || diagnostics != null) result &= validate_UniqueID(course, diagnostics, context); - } - if (result || diagnostics != null) { + if (result || diagnostics != null) result &= validate_EveryKeyUnique(course, diagnostics, context); - } - if (result || diagnostics != null) { + if (result || diagnostics != null) result &= validate_EveryMapEntryUnique(course, diagnostics, context); - } - if (result || diagnostics != null) { + if (result || diagnostics != null) result &= validateCourse_UniqueItemById(course, diagnostics, context); - } - if (result || diagnostics != null) { + if (result || diagnostics != null) result &= validateCourse_NameNotEmpty(course, diagnostics, context); - } return result; } @@ -284,6 +286,50 @@ public class UniversityValidator extends EObjectValidator } /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public boolean validateStaff(Staff staff, DiagnosticChain diagnostics, Map<Object, Object> context) + { + return validate_EveryDefaultConstraint(staff, diagnostics, context); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public boolean validateProfessor(Professor professor, DiagnosticChain diagnostics, Map<Object, Object> context) + { + return validate_EveryDefaultConstraint(professor, diagnostics, context); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public boolean validateAssistant(Assistant assistant, DiagnosticChain diagnostics, Map<Object, Object> context) + { + return validate_EveryDefaultConstraint(assistant, diagnostics, context); + } + + /** + * <!-- begin-user-doc --> + * <!-- end-user-doc --> + * + * @generated + */ + public boolean validatePerson(Person person, DiagnosticChain diagnostics, Map<Object, Object> context) + { + return validate_EveryDefaultConstraint(person, diagnostics, context); + } + + /** * Returns the resource locator that will be used to fetch messages for this validator's diagnostics. * <!-- begin-user-doc --> * <!-- end-user-doc --> diff --git a/tests/org.eclipse.emf.ecp.test.model/viewmodel/Staff.view b/tests/org.eclipse.emf.ecp.test.model/viewmodel/Staff.view new file mode 100644 index 0000000000..41f6792075 --- /dev/null +++ b/tests/org.eclipse.emf.ecp.test.model/viewmodel/Staff.view @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="ASCII"?> +<org.eclipse.emf.ecp.view.model:View xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:org.eclipse.emf.ecp.view.model="http://org/eclipse/emf/ecp/view/model" xmlns:org.eclipse.emf.ecp.view.treemasterview.model="http://org/eclipse/emf/ecp/view/treemasterview/model" ecorePath="/org.eclipse.emf.ecp.test.model/model/university.ecore"> + <rootEClass href="http://org/eclipse/emf/ecp/test/university#//Staff"/> + <children xsi:type="org.eclipse.emf.ecp.view.treemasterview.model:TreeMasterDetail"> + <detailView> + <rootEClass href="http://org/eclipse/emf/ecp/test/university#//Staff"/> + <children xsi:type="org.eclipse.emf.ecp.view.model:Control" name="Control assistants"> + <domainModelReference xsi:type="org.eclipse.emf.ecp.view.model:FeaturePathDomainModelReference"> + <domainModelEFeature xsi:type="ecore:EReference" href="http://org/eclipse/emf/ecp/test/university#//Staff/assistants"/> + </domainModelReference> + </children> + <children xsi:type="org.eclipse.emf.ecp.view.model:Control" name="Control professors"> + <domainModelReference xsi:type="org.eclipse.emf.ecp.view.model:FeaturePathDomainModelReference"> + <domainModelEFeature xsi:type="ecore:EReference" href="http://org/eclipse/emf/ecp/test/university#//Staff/professors"/> + </domainModelReference> + </children> + </detailView> + </children> +</org.eclipse.emf.ecp.view.model:View> |