diff options
| author | Maxime Porhel | 2016-04-11 14:54:20 +0000 |
|---|---|---|
| committer | Maxime Porhel | 2016-04-18 08:48:25 +0000 |
| commit | fcfde6e2cc714fb3d2f3d749f375b872367107be (patch) | |
| tree | 0371f6fd0c7e9f041f44040bec39c92a2b67458d | |
| parent | 7cdab3ead9b8aba901db80b1fcb79fa8ff1270fd (diff) | |
| download | org.eclipse.sirius-fcfde6e2cc714fb3d2f3d749f375b872367107be.tar.gz org.eclipse.sirius-fcfde6e2cc714fb3d2f3d749f375b872367107be.tar.xz org.eclipse.sirius-fcfde6e2cc714fb3d2f3d749f375b872367107be.zip | |
[491604] Merge DRepresentationContainer into DView
DRepresentationContainer has been removed from the viewpoint.ecore
metamodel.
DRepresentationContainer used to extend DView with a single derived,
transient and volatile reference ("models"). In practice, it was the
only implementation of DView.
DRepresentationContainer has been replaced by DView as serialized type.
So a migration participant is needed for that, it will be provided in a
separated commit.
The "models" transient and derived reference has been moved to DView.
Given the nature of that reference it has no impact on the
serialization.
The features of DView have also been reordered to place the viewpoint
reference before the other multi valued containment references. This
will allow to serialize the reference to the viewpoint before the
contained representations.
Bug: 491604
Change-Id: I6821d1b76bb7fc8752ef75888fb77ca28db59533
Signed-off-by: Laurent Fasani <laurent.fasani@obeo.fr>
Signed-off-by: Maxime Porhel <maxime.porhel@obeo.fr>
49 files changed, 367 insertions, 815 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram/sequence/tool/internal/action/repair/SequenceDiagramRepairParticipant.java b/plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram/sequence/tool/internal/action/repair/SequenceDiagramRepairParticipant.java index 7d81b7494c..b89d7b4d7a 100644 --- a/plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram/sequence/tool/internal/action/repair/SequenceDiagramRepairParticipant.java +++ b/plugins/org.eclipse.sirius.diagram.sequence/src/org/eclipse/sirius/diagram/sequence/tool/internal/action/repair/SequenceDiagramRepairParticipant.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2015 THALES GLOBAL SERVICES and others. + * Copyright (c) 2012, 2016 THALES GLOBAL SERVICES 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 @@ -41,7 +41,6 @@ import org.eclipse.sirius.diagram.ui.business.internal.query.DNodeQuery; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.viewpoint.DAnalysis; import org.eclipse.sirius.viewpoint.DRepresentation; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; import org.eclipse.sirius.viewpoint.DView; import com.google.common.collect.Iterables; @@ -84,22 +83,22 @@ public class SequenceDiagramRepairParticipant implements IRepairParticipant { } /** - * Scan {@link DRepresentationContainer}s for sequence diagrams to repair. + * Scan {@link DView}s for sequence diagrams to repair. * * @param model * the current session model * @param domain * the current {@link TransactionalEditingDomain} * @return a {@link CompoundCommand} of sequence diagrams reparing commands - * in each {@link DRepresentationContainer} + * in each {@link DView} */ private Command migrateModel(Resource model, TransactionalEditingDomain domain) { CompoundCommand cc = new CompoundCommand(Messages.SequenceDiagramRepairParticipant_repairCommandName); EObject eObject = model.getContents().get(0); if (eObject instanceof DAnalysis) { DAnalysis dAnalysis = (DAnalysis) eObject; - for (DRepresentationContainer container : Iterables.filter(dAnalysis.getOwnedViews(), DRepresentationContainer.class)) { - CompoundCommand migrateRepresentationContainer = migrateRepresentationContainer(container, domain); + for (DView container : Iterables.filter(dAnalysis.getOwnedViews(), DView.class)) { + CompoundCommand migrateRepresentationContainer = migrateDView(container, domain); if (!migrateRepresentationContainer.getCommandList().isEmpty()) { cc.append(migrateRepresentationContainer); } @@ -111,16 +110,15 @@ public class SequenceDiagramRepairParticipant implements IRepairParticipant { /** * Add a {@link SequenceInstanceRoleRepairCommand} and a * {@link FlagSequenceEventsCommand} for each {@link SequenceDDiagram} - * founds in the {@link DRepresentationContainer}. + * founds in the {@link DView}. * * @param container - * a {@link DRepresentationContainer} to scan for - * {@link SequenceDDiagram} + * a {@link DView} to scan for {@link SequenceDDiagram} * @param domain * the current {@link TransactionalEditingDomain} * @return a {@link CompoundCommand} of sequence diagrams reparing commands */ - private CompoundCommand migrateRepresentationContainer(DRepresentationContainer container, TransactionalEditingDomain domain) { + private CompoundCommand migrateDView(DView container, TransactionalEditingDomain domain) { CompoundCommand cc = new CompoundCommand(Messages.SequenceDiagramRepairParticipant_repairCommandName); for (SequenceDDiagram seqDDiag : Iterables.filter(container.getOwnedRepresentations(), SequenceDDiagram.class)) { final Diagram gmfDiagram = SiriusGMFHelper.getGmfDiagram(seqDDiag); diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/wizards/page/DiagramSelectionWizardPage.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/wizards/page/DiagramSelectionWizardPage.java index 40f6d22415..855db9bc6a 100644 --- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/wizards/page/DiagramSelectionWizardPage.java +++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/tools/api/wizards/page/DiagramSelectionWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2015 THALES GLOBAL SERVICES and others. + * Copyright (c) 2008, 2016 THALES GLOBAL SERVICES 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 @@ -36,7 +36,6 @@ import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.diagram.DSemanticDiagram; import org.eclipse.sirius.diagram.ui.provider.Messages; import org.eclipse.sirius.viewpoint.DRepresentation; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; import org.eclipse.sirius.viewpoint.DSemanticDecorator; import org.eclipse.sirius.viewpoint.DView; import org.eclipse.swt.SWT; @@ -134,7 +133,7 @@ public class DiagramSelectionWizardPage extends WizardPage { pageComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, false, false)); this.treeViewer = createTreeViewer(pageComposite); - treeViewer.setInput(((DRepresentationContainer) root).getModels().iterator().next()); + treeViewer.setInput(root.getModels().iterator().next()); treeViewer.addFilter(this.diagramSelectionFilter); treeViewer.expandAll(); treeViewer.collapseAll(); diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/helper/SiriusDiagramUtil.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/helper/SiriusDiagramUtil.java index bd28f53da0..9b0f930610 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/helper/SiriusDiagramUtil.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/api/helper/SiriusDiagramUtil.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2009 THALES GLOBAL SERVICES. + * Copyright (c) 2008, 2016 THALES GLOBAL SERVICES. * 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 @@ -18,7 +18,7 @@ import org.eclipse.sirius.diagram.business.internal.metamodel.helper.DiagramComp import org.eclipse.sirius.diagram.description.DiagramDescription; import org.eclipse.sirius.diagram.description.DiagramElementMapping; import org.eclipse.sirius.diagram.description.DiagramExtensionDescription; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; +import org.eclipse.sirius.viewpoint.DView; /** * Useful operations to manipulate a DDiagram model. @@ -44,11 +44,11 @@ public final class SiriusDiagramUtil { * the viewpoint. * @return the found analysis or <code>null</code> if no analysis is found. */ - public static DRepresentationContainer findRepresentationContainer(final DDiagram diagram) { + public static DView findRepresentationContainer(final DDiagram diagram) { EObject current = diagram; while (current != null) { - if (current instanceof DRepresentationContainer) { - return (DRepresentationContainer) current; + if (current instanceof DView) { + return (DView) current; } current = current.eContainer(); } diff --git a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/repair/resource/RepairRepresentationRefresher.java b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/repair/resource/RepairRepresentationRefresher.java index ab616221ca..ad8725057c 100644 --- a/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/repair/resource/RepairRepresentationRefresher.java +++ b/plugins/org.eclipse.sirius.diagram/src-core/org/eclipse/sirius/diagram/business/internal/repair/resource/RepairRepresentationRefresher.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012 THALES GLOBAL SERVICES. + * Copyright (c) 2012, 2016 THALES GLOBAL SERVICES. * 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 @@ -39,7 +39,6 @@ import org.eclipse.sirius.tools.api.interpreter.InterpreterRegistry; import org.eclipse.sirius.tools.api.profiler.SiriusTasksKey; import org.eclipse.sirius.viewpoint.DAnalysis; import org.eclipse.sirius.viewpoint.DRepresentation; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; import org.eclipse.sirius.viewpoint.DView; import org.eclipse.sirius.viewpoint.SiriusPlugin; @@ -83,24 +82,22 @@ public class RepairRepresentationRefresher { TransactionalEditingDomain transactionalEditingDomain = TransactionUtil.getEditingDomain(dAnalysis); boolean hasAlreadyModel = false; // The old representations have no a model. - if (view instanceof DRepresentationContainer) { - if (!((DAnalysis) view.eContainer()).getModels().isEmpty()) { - // Set hasAlreadyModel to true only if almost one of the models - // is not a proxy - for (EObject model : ((DAnalysis) view.eContainer()).getModels()) { - if (!model.eIsProxy()) { - hasAlreadyModel = true; - } + if (!((DAnalysis) view.eContainer()).getModels().isEmpty()) { + // Set hasAlreadyModel to true only if almost one of the models + // is not a proxy + for (EObject model : ((DAnalysis) view.eContainer()).getModels()) { + if (!model.eIsProxy()) { + hasAlreadyModel = true; } - } else if (!hasAlreadyModel) { - final Map<EObject, AnyType> extension = ((XMIResource) dAnalysis.eResource()).getEObjectToExtensionMap(); - final AnyType viewSettings = extension.get(view); - if (viewSettings != null) { - for (final FeatureMap.Entry feature : viewSettings.getMixed()) { - if ("model".equals(feature.getEStructuralFeature().getName())) { //$NON-NLS-1$ - ((DAnalysis) view.eContainer()).getModels().add(EcoreUtil.resolve((EObject) feature.getValue(), view.eResource().getResourceSet())); - hasAlreadyModel = true; - } + } + } else if (!hasAlreadyModel) { + final Map<EObject, AnyType> extension = ((XMIResource) dAnalysis.eResource()).getEObjectToExtensionMap(); + final AnyType viewSettings = extension.get(view); + if (viewSettings != null) { + for (final FeatureMap.Entry feature : viewSettings.getMixed()) { + if ("model".equals(feature.getEStructuralFeature().getName())) { //$NON-NLS-1$ + ((DAnalysis) view.eContainer()).getModels().add(EcoreUtil.resolve((EObject) feature.getValue(), view.eResource().getResourceSet())); + hasAlreadyModel = true; } } } diff --git a/plugins/org.eclipse.sirius.doc/doc/developer/Meta-models.html b/plugins/org.eclipse.sirius.doc/doc/developer/Meta-models.html index 84cd8b911b..afbcf1d17a 100644 --- a/plugins/org.eclipse.sirius.doc/doc/developer/Meta-models.html +++ b/plugins/org.eclipse.sirius.doc/doc/developer/Meta-models.html @@ -103,10 +103,10 @@ <code>semanticResources</code> reference, and may reference other “sub-aird” through its <code>referencedAnalysis</code> reference. It also contains through <code>ownedViews</code> a - <code>DRepresentationContainer</code> for every Viewpoint which was ever enabled in the session. The sub-set of + <code>DView</code> for every Viewpoint which was ever enabled in the session. The sub-set of <code>ownedViews</code> in <code>selectedViews</code> corresponds to the Viewpoints currently enabled in the session. Each - <code>DRepresentationContainer</code> references (through + <code>DView</code> references (through <code>viewpoint</code>) the viewpoint definition it is an “instance” of, and contains actual representations (from that viewpoint) in <code>ownedRepresentations</code>. </p> diff --git a/plugins/org.eclipse.sirius.doc/doc/developer/Meta-models.textile b/plugins/org.eclipse.sirius.doc/doc/developer/Meta-models.textile index 543f215035..04a84aa783 100644 --- a/plugins/org.eclipse.sirius.doc/doc/developer/Meta-models.textile +++ b/plugins/org.eclipse.sirius.doc/doc/developer/Meta-models.textile @@ -30,6 +30,6 @@ The meta-model for representation files is defined in the @http://www.eclipse.or * @http://www.eclipse.org/sirius/table/1.1.0@ defined in @org.eclipse.sirius.table@. * @http://www.eclipse.org/sirius/tree/1.0.0@ defined in @org.eclipse.sirius.tree@. -The concrete structure of an @aird@ file is the following: An @aird@ resource contains a single @DAnalysis@. The analysis references the semantic resources in the session, via its @semanticResources@ reference, and may reference other "sub-aird" through its @referencedAnalysis@ reference. It also contains through @ownedViews@ a @DRepresentationContainer@ for every Viewpoint which was ever enabled in the session. The sub-set of @ownedViews@ in @selectedViews@ corresponds to the Viewpoints currently enabled in the session. Each @DRepresentationContainer@ references (through @viewpoint@) the viewpoint definition it is an "instance" of, and contains actual representations (from that viewpoint) in @ownedRepresentations@. +The concrete structure of an @aird@ file is the following: An @aird@ resource contains a single @DAnalysis@. The analysis references the semantic resources in the session, via its @semanticResources@ reference, and may reference other "sub-aird" through its @referencedAnalysis@ reference. It also contains through @ownedViews@ a @DView@ for every Viewpoint which was ever enabled in the session. The sub-set of @ownedViews@ in @selectedViews@ corresponds to the Viewpoints currently enabled in the session. Each @DView@ references (through @viewpoint@) the viewpoint definition it is an "instance" of, and contains actual representations (from that viewpoint) in @ownedRepresentations@. The structure of the representations themselves depend on each dialect, which defines its own meta-model as mentioned above. However, they all use the @org.eclipse.sirius.viewpoint.DSemanticDecorator@ interface for representation elements which stand for semantic elements. The @getTarget()@ method of @DSemanticDecorator@ can be used to obtain the actual semantic target element being represented. This means that both a node on a diagram (which is a @DNode@) and a cell in a table (a @DCell@), and any other representation element in Sirius, share the same API to retrieve the element in the user's semantic model that it represents. diff --git a/plugins/org.eclipse.sirius.editor/help/contexts.xml b/plugins/org.eclipse.sirius.editor/help/contexts.xml index b65882d284..036cc18d71 100644 --- a/plugins/org.eclipse.sirius.editor/help/contexts.xml +++ b/plugins/org.eclipse.sirius.editor/help/contexts.xml @@ -58,17 +58,6 @@ </description> </context> - <context id="DRepresentationContainer"> - <description> - - - - <!-- Start of user code DRepresentationContainer description --> - - <!-- End of user code DRepresentationContainer description --> - - </description> - </context> <context id="DSemanticDecorator"> <description> An element that has a link to the semantic model. diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/componentization/DiagramExtensionDescriptionTest.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/componentization/DiagramExtensionDescriptionTest.java index 43f3c2a792..8bd3cb2efd 100644 --- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/componentization/DiagramExtensionDescriptionTest.java +++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/componentization/DiagramExtensionDescriptionTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES. + * Copyright (c) 2010, 2016 THALES GLOBAL SERVICES. * 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 @@ -21,7 +21,7 @@ import org.eclipse.sirius.diagram.DDiagram; import org.eclipse.sirius.tests.support.api.SiriusDiagramTestCase; import org.eclipse.sirius.tests.support.api.TestsUtil; import org.eclipse.sirius.ui.business.api.dialect.DialectUIManager; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; +import org.eclipse.sirius.viewpoint.DView; /** * Test opening a diagram corresponding to an extension of an extension of a @@ -56,7 +56,7 @@ public class DiagramExtensionDescriptionTest extends SiriusDiagramTestCase imple diagram = (DDiagram) getRepresentations(DIAGRAM_DESCRIPTION).toArray()[0]; assertNotNull(diagram); - session.addSelectedView((DRepresentationContainer) this.diagram.eContainer(), new NullProgressMonitor()); + session.addSelectedView((DView) this.diagram.eContainer(), new NullProgressMonitor()); TestsUtil.emptyEventsFromUIThread(); diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/dialect/DialectEditorCloserTest.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/dialect/DialectEditorCloserTest.java index a93a50e25b..ac34ced7af 100644 --- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/dialect/DialectEditorCloserTest.java +++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/dialect/DialectEditorCloserTest.java @@ -37,7 +37,7 @@ import org.eclipse.sirius.ui.business.api.dialect.DialectEditor; import org.eclipse.sirius.ui.business.api.dialect.DialectUIManager; import org.eclipse.sirius.ui.business.api.preferences.SiriusUIPreferencesKeys; import org.eclipse.sirius.viewpoint.DAnalysis; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; +import org.eclipse.sirius.viewpoint.DView; import org.eclipse.sirius.viewpoint.ViewpointFactory; import org.eclipse.sirius.viewpoint.ViewpointPackage; import org.eclipse.sirius.viewpoint.description.Viewpoint; @@ -82,18 +82,18 @@ public class DialectEditorCloserTest extends SiriusTestCase { target = session.getSemanticResources().iterator().next().getContents().get(0); } - public void testDialectEditorCloserOnDRepresentationContainerAdditionUndo() { + public void testDialectEditorCloserOnDViewAdditionUndo() { DAnalysis dAnalysis = new AirDResouceQuery((AirdResource) session.getSessionResource()).getDAnalysis().get(); URI designViewpointURI = URI.createURI("viewpoint:/org.eclipse.sirius.sample.ecore.design/Design"); Viewpoint viewpoint = ViewpointRegistry.getInstance().getViewpoint(designViewpointURI); viewpoint = (Viewpoint) domain.getResourceSet().getEObject(EcoreUtil.getURI(viewpoint), true); - DRepresentationContainer dRepresentationContainer = ViewpointFactory.eINSTANCE.createDRepresentationContainer(); + DView dView = ViewpointFactory.eINSTANCE.createDView(); DTree dTree = TreeFactory.eINSTANCE.createDTree(); dTree.setTarget(target); - dRepresentationContainer.getOwnedRepresentations().add(dTree); - dRepresentationContainer.setViewpoint(viewpoint); - Command cmd = AddCommand.create(domain, dAnalysis, ViewpointPackage.Literals.DANALYSIS__OWNED_VIEWS, dRepresentationContainer); + dView.getOwnedRepresentations().add(dTree); + dView.setViewpoint(viewpoint); + Command cmd = AddCommand.create(domain, dAnalysis, ViewpointPackage.Literals.DANALYSIS__OWNED_VIEWS, dView); commandStack.execute(cmd); IEditorPart openedEditor = DialectUIManager.INSTANCE.openEditor(session, dTree, new NullProgressMonitor()); diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/refresh/ChangeIdAndLabelTests.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/refresh/ChangeIdAndLabelTests.java index d5f5448f36..14c226462d 100644 --- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/refresh/ChangeIdAndLabelTests.java +++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/refresh/ChangeIdAndLabelTests.java @@ -24,7 +24,7 @@ import org.eclipse.sirius.tests.SiriusTestsPlugin; import org.eclipse.sirius.tests.support.api.SiriusDiagramTestCase; import org.eclipse.sirius.tests.unit.diagram.modeler.ecore.EcoreModeler; import org.eclipse.sirius.viewpoint.DRepresentation; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; +import org.eclipse.sirius.viewpoint.DView; import org.eclipse.sirius.viewpoint.RGBValues; import org.eclipse.sirius.viewpoint.description.Viewpoint; @@ -81,7 +81,7 @@ public class ChangeIdAndLabelTests extends SiriusDiagramTestCase implements Ecor Collection<DRepresentation> representations = getRepresentations(REPRESENTATION_DESC_NAME); if (representations.size() == 1) { assertFalse("The rename of the id of the viewpoint should break the existing diagram (bad number of representations).", - newId.equals(((DRepresentationContainer) representations.iterator().next().eContainer()).getViewpoint().getName())); + newId.equals(((DView) representations.iterator().next().eContainer()).getViewpoint().getName())); } else if (representations.size() != 0) { fail("The rename of the id of the viewpoint should break the existing diagram (bad number of representations)."); } diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/refresh/EdgeWithConditionalStyleTest.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/refresh/EdgeWithConditionalStyleTest.java index 678a5fd770..2eeeb4cb67 100644 --- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/refresh/EdgeWithConditionalStyleTest.java +++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/refresh/EdgeWithConditionalStyleTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2015 THALES GLOBAL SERVICES and others. + * Copyright (c) 2010, 2016 THALES GLOBAL SERVICES 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 @@ -37,7 +37,7 @@ import org.eclipse.sirius.tests.unit.common.DocbookTestCase; import org.eclipse.sirius.ui.business.api.dialect.DialectUIManager; import org.eclipse.sirius.ui.tools.api.color.VisualBindingManager; import org.eclipse.sirius.viewpoint.DAnalysis; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; +import org.eclipse.sirius.viewpoint.DView; import org.eclipse.sirius.viewpoint.FontFormat; import org.eclipse.sirius.viewpoint.ViewpointPackage; import org.eclipse.sirius.viewpoint.description.SystemColor; @@ -54,7 +54,7 @@ public class EdgeWithConditionalStyleTest extends DocbookTestCase { @Override protected void setUp() throws Exception { super.setUp(); - this.session.addSelectedView((DRepresentationContainer) this.evoluateDiagram.eContainer(), new NullProgressMonitor()); + this.session.addSelectedView((DView) this.evoluateDiagram.eContainer(), new NullProgressMonitor()); } /** diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/session/SessionWorkspaceSyncTests.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/session/SessionWorkspaceSyncTests.java index 8315e4c366..715adb66fa 100644 --- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/session/SessionWorkspaceSyncTests.java +++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/session/SessionWorkspaceSyncTests.java @@ -422,7 +422,7 @@ public class SessionWorkspaceSyncTests extends SiriusDiagramTestCase implements ResourceSet rset = new ResourceSetImpl(); final Resource otherAnalysisResourceInstance = rset.getResource(analysisResource.getURI(), true); DAnalysis otherAnalysisRef = (DAnalysis) otherAnalysisResourceInstance.getContents().get(0); - otherAnalysisRef.getOwnedViews().add(ViewpointFactory.eINSTANCE.createDRepresentationContainer()); + otherAnalysisRef.getOwnedViews().add(ViewpointFactory.eINSTANCE.createDView()); otherAnalysisResourceInstance.setModified(true); otherAnalysisResourceInstance.save(Collections.emptyMap()); TestsUtil.synchronizationWithUIThread(); diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/common/DocbookTestCase.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/common/DocbookTestCase.java index 6d7898d7ab..ee30d674e9 100644 --- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/common/DocbookTestCase.java +++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/common/DocbookTestCase.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2015 THALES GLOBAL SERVICES. + * Copyright (c) 2010, 2016 THALES GLOBAL SERVICES. * 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 @@ -61,9 +61,9 @@ import org.eclipse.sirius.tools.api.command.DCommand; import org.eclipse.sirius.tools.api.interpreter.InterpreterRegistry; import org.eclipse.sirius.viewpoint.DAnalysis; import org.eclipse.sirius.viewpoint.DRepresentation; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; import org.eclipse.sirius.viewpoint.DRepresentationElement; import org.eclipse.sirius.viewpoint.DSemanticDecorator; +import org.eclipse.sirius.viewpoint.DView; import org.eclipse.sirius.viewpoint.description.tool.AbstractToolDescription; import org.eclipse.sirius.viewpoint.description.tool.SelectionWizardDescription; @@ -107,7 +107,9 @@ public class DocbookTestCase extends SiriusDiagramTestCase implements DocBookMod private static final String E_ALL_CONTENTS_D_NODE_CONTAINER_TARGET_E_CLASS_NAME_CHAPTER_N_LAST = "aql:self.eAllContents(diagram::DNodeContainer)->select(e | e.target.eClass().name ='Chapter')->last()"; - /** Interpreter which can be used by subclasses to avoid instantiating more. */ + /** + * Interpreter which can be used by subclasses to avoid instantiating more. + */ protected static IInterpreter INTERPRETER; /** @@ -1287,13 +1289,10 @@ public class DocbookTestCase extends SiriusDiagramTestCase implements DocBookMod domain.getCommandStack().execute(new RecordingCommand(domain) { @Override protected void doExecute() { - for (Object view : ((DAnalysis) EcoreUtil.getRootContainer(anyAnalysisObject)).getOwnedViews()) { - if (view instanceof DRepresentationContainer) { - DRepresentationContainer container = (DRepresentationContainer) view; - for (Object diagram : container.getOwnedRepresentations()) { - if (diagram instanceof DRepresentation) { - DialectManager.INSTANCE.refresh((DRepresentation) diagram, new NullProgressMonitor()); - } + for (DView view : ((DAnalysis) EcoreUtil.getRootContainer(anyAnalysisObject)).getOwnedViews()) { + for (Object diagram : view.getOwnedRepresentations()) { + if (diagram instanceof DRepresentation) { + DialectManager.INSTANCE.refresh((DRepresentation) diagram, new NullProgressMonitor()); } } } diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/LockedRepresentationContainerTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/LockedRepresentationContainerTest.java index 9af05c4f52..53e5bd0318 100644 --- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/LockedRepresentationContainerTest.java +++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/LockedRepresentationContainerTest.java @@ -25,7 +25,7 @@ import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusDiagramEdi import org.eclipse.sirius.tests.swtbot.support.utils.SWTBotUtils; import org.eclipse.sirius.tools.internal.command.PrepareNewAnalysisCommand; import org.eclipse.sirius.viewpoint.DAnalysis; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; +import org.eclipse.sirius.viewpoint.DView; import org.eclipse.sirius.viewpoint.ViewpointFactory; import org.eclipse.swtbot.swt.finder.exceptions.WidgetNotFoundException; import org.eclipse.swtbot.swt.finder.widgets.SWTBotShell; @@ -33,7 +33,7 @@ import org.eclipse.swtbot.swt.finder.widgets.SWTBotTreeItem; /** * Ensure that some actions on representation are disabled when the - * {@link DRepresentationContainer} is locked by using the permission authority + * {@link DView} is locked by using the permission authority * {@link ReadOnlyPermissionAuthority} * * @author <a href="mailto:mickael.lanoe@obeo.fr">Mickael LANOE</a> @@ -125,8 +125,8 @@ public class LockedRepresentationContainerTest extends AbstractSiriusSwtBotGefTe lockRepresentationContainer(); // After locking the representation container - assertFalse("The creation of new representation should be disabled when the representation container is locked", semanticPackageNode.contextMenu(NEW_REPRESENTATION).menu(REPRESENTATION_NAME) - .isEnabled()); + assertFalse("The creation of new representation should be disabled when the representation container is locked", + semanticPackageNode.contextMenu(NEW_REPRESENTATION).menu(REPRESENTATION_NAME).isEnabled()); } /** diff --git a/plugins/org.eclipse.sirius.ui/icons/full/obj16/DRepresentationContainer.gif b/plugins/org.eclipse.sirius.ui/icons/full/obj16/DRepresentationContainer.gif Binary files differdeleted file mode 100644 index 7c2aaac84e..0000000000 --- a/plugins/org.eclipse.sirius.ui/icons/full/obj16/DRepresentationContainer.gif +++ /dev/null diff --git a/plugins/org.eclipse.sirius.ui/icons/license.txt b/plugins/org.eclipse.sirius.ui/icons/license.txt index fb070ce109..a3af9f7531 100644 --- a/plugins/org.eclipse.sirius.ui/icons/license.txt +++ b/plugins/org.eclipse.sirius.ui/icons/license.txt @@ -34,7 +34,6 @@ icons/full/obj16/DFile.gif - org.eclipse.ui - org.eclipse.ui/icons/full/obj16/fl icons/full/obj16/DFolder.gif - org.eclipse.ui - org.eclipse.ui/icons/full/obj16/fldr_obj.gif icons/full/obj16/DModel.gif - org.eclipse.ui - org.eclipse.ui/icons/full/obj16/fldr_obj.gif icons/full/obj16/DProject.gif - org.eclipse.ui - org.eclipse.ui/icons/full/obj16/fldr_obj.gif -icons/full/obj16/DRepresentationContainer.gif - org.eclipse.ui - org.eclipse.ui/icons/full/obj16/fldr_obj.gif icons/full/obj16/DSourceFileLink.gif - org.eclipse.ui - org.eclipse.ui/icons/full/obj16/fldr_obj.gif icons/full/obj16/DView.gif - org.eclipse.ui - org.eclipse.ui/icons/full/obj16/fldr_obj.gif icons/full/obj16/Decoration.gif - org.eclipse.jdt.debug.ui - org.eclipse.jdt.debug.ui/icons/full/ovr16/owned_ovr.gif diff --git a/plugins/org.eclipse.sirius.ui/plugin.properties b/plugins/org.eclipse.sirius.ui/plugin.properties index babf920ff1..e01abd7bef 100644 --- a/plugins/org.eclipse.sirius.ui/plugin.properties +++ b/plugins/org.eclipse.sirius.ui/plugin.properties @@ -410,7 +410,6 @@ _UI_DRefreshable_type = DRefreshable _UI_DLabelled_type = DLabelled _UI_DMappingBased_type = DMapping Based _UI_DContainer_type = DContainer -_UI_DRepresentationContainer_type = DRepresentation Container _UI_DSemanticDecorator_type = DSemantic Decorator _UI_DRepresentation_type = DRepresentation _UI_DRepresentationElement_type = DRepresentation Element @@ -468,8 +467,6 @@ _UI_TemplateInformationSection_type = Information Template _UI_Unknown_type = Object _UI_Unknown_datatype= Value _UI_DNavigable_ownedNavigationLinks_feature = Owned Navigation Links -_UI_DRepresentationContainer_diagramSet_feature = Diagram Set -_UI_DRepresentationContainer_model_feature = Model _UI_DSemanticDecorator_target_feature = Target _UI_DRepresentation_ownedRepresentationElements_feature = Owned Representation Elements _UI_DRepresentationElement_name_feature = Name @@ -794,7 +791,7 @@ _UI_RepresentationCreationDescription_titleExpression_feature = Title Expression _UI_DAnalysis_referencedAnalysis_feature = Referenced Analysis _UI_DAnalysis_models_feature = Models -_UI_DRepresentationContainer_models_feature = Models +_UI_DView_models_feature = Models _UI_SelectionWizardDescription_iconPath_feature = Icon Path _UI_SelectionWizardDescription_windowTitle_feature = Window Title _UI_SelectionWizardDescription_windowImagePath_feature = Window Image Path diff --git a/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/DAnalysisItemProvider.java b/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/DAnalysisItemProvider.java index 4ac40aadac..497c0abb5f 100644 --- a/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/DAnalysisItemProvider.java +++ b/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/DAnalysisItemProvider.java @@ -233,8 +233,6 @@ public class DAnalysisItemProvider extends ItemProviderAdapter newChildDescriptors.add(createChildParameter(ViewpointPackage.Literals.DANALYSIS__EANNOTATIONS, DescriptionFactory.eINSTANCE.createDAnnotationEntry())); newChildDescriptors.add(createChildParameter(ViewpointPackage.Literals.DANALYSIS__OWNED_VIEWS, ViewpointFactory.eINSTANCE.createDView())); - - newChildDescriptors.add(createChildParameter(ViewpointPackage.Literals.DANALYSIS__OWNED_VIEWS, ViewpointFactory.eINSTANCE.createDRepresentationContainer())); } /** diff --git a/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/DRepresentationContainerItemProvider.java b/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/DRepresentationContainerItemProvider.java deleted file mode 100644 index d32da2401c..0000000000 --- a/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/DRepresentationContainerItemProvider.java +++ /dev/null @@ -1,118 +0,0 @@ -/** - * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES. - * 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: - * Obeo - initial API and implementation - * - */ -package org.eclipse.sirius.viewpoint.provider; - -import java.util.Collection; -import java.util.List; - -import org.eclipse.emf.common.notify.AdapterFactory; -import org.eclipse.emf.common.notify.Notification; -import org.eclipse.emf.edit.provider.ComposeableAdapterFactory; -import org.eclipse.emf.edit.provider.IItemPropertyDescriptor; -import org.eclipse.sirius.viewpoint.ViewpointPackage; - -/** - * This is the item provider adapter for a - * {@link org.eclipse.sirius.viewpoint.DRepresentationContainer} object. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ -public class DRepresentationContainerItemProvider extends DViewItemProvider { - /** - * This constructs an instance from a factory and a notifier. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - public DRepresentationContainerItemProvider(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); - - addModelsPropertyDescriptor(object); - } - return itemPropertyDescriptors; - } - - /** - * This adds a property descriptor for the Models feature. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected void addModelsPropertyDescriptor(Object object) { - itemPropertyDescriptors - .add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_DRepresentationContainer_models_feature"), //$NON-NLS-1$ - getString("_UI_PropertyDescriptor_description", "_UI_DRepresentationContainer_models_feature", "_UI_DRepresentationContainer_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - ViewpointPackage.Literals.DREPRESENTATION_CONTAINER__MODELS, false, false, false, null, null, null)); - } - - /** - * This returns DRepresentationContainer.gif. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - */ - @Override - public Object getImage(Object object) { - return overlayImage(object, getResourceLocator().getImage("full/obj16/DRepresentationContainer")); //$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_DRepresentationContainer_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); - } - -} diff --git a/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/DViewItemProvider.java b/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/DViewItemProvider.java index 5401069c5e..886eb0d25a 100644 --- a/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/DViewItemProvider.java +++ b/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/DViewItemProvider.java @@ -61,6 +61,7 @@ public class DViewItemProvider extends ItemProviderAdapter implements IEditingDo super.getPropertyDescriptors(object); addViewpointPropertyDescriptor(object); + addModelsPropertyDescriptor(object); } return itemPropertyDescriptors; } @@ -78,6 +79,18 @@ public class DViewItemProvider extends ItemProviderAdapter implements IEditingDo } /** + * This adds a property descriptor for the Models feature. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + protected void addModelsPropertyDescriptor(Object object) { + itemPropertyDescriptors.add(createItemPropertyDescriptor(((ComposeableAdapterFactory) adapterFactory).getRootAdapterFactory(), getResourceLocator(), getString("_UI_DView_models_feature"), //$NON-NLS-1$ + getString("_UI_PropertyDescriptor_description", "_UI_DView_models_feature", "_UI_DView_type"), //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + ViewpointPackage.Literals.DVIEW__MODELS, false, false, false, null, null, null)); + } + + /** * This specifies how to implement {@link #getChildren} and is used to * deduce an appropriate feature for an * {@link org.eclipse.emf.edit.command.AddCommand}, diff --git a/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/ViewpointItemProviderAdapterFactory.java b/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/ViewpointItemProviderAdapterFactory.java index e56cd0e119..452fc2efd9 100644 --- a/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/ViewpointItemProviderAdapterFactory.java +++ b/plugins/org.eclipse.sirius.ui/src-gen/org/eclipse/sirius/viewpoint/provider/ViewpointItemProviderAdapterFactory.java @@ -108,31 +108,6 @@ public class ViewpointItemProviderAdapterFactory extends ViewpointAdapterFactory /** * This keeps track of the one adapter used for all - * {@link org.eclipse.sirius.viewpoint.DRepresentationContainer} instances. - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected DRepresentationContainerItemProvider dRepresentationContainerItemProvider; - - /** - * This creates an adapter for a - * {@link org.eclipse.sirius.viewpoint.DRepresentationContainer}. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - @Override - public Adapter createDRepresentationContainerAdapter() { - if (dRepresentationContainerItemProvider == null) { - dRepresentationContainerItemProvider = new DRepresentationContainerItemProvider(this); - } - - return dRepresentationContainerItemProvider; - } - - /** - * This keeps track of the one adapter used for all * {@link org.eclipse.sirius.viewpoint.DView} instances. <!-- begin-user-doc * --> <!-- end-user-doc --> * @@ -585,9 +560,6 @@ public class ViewpointItemProviderAdapterFactory extends ViewpointAdapterFactory if (dAnalysisItemProvider != null) { dAnalysisItemProvider.dispose(); } - if (dRepresentationContainerItemProvider != null) { - dRepresentationContainerItemProvider.dispose(); - } if (dViewItemProvider != null) { dViewItemProvider.dispose(); } diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/editor/DialectEditorCloserFilter.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/editor/DialectEditorCloserFilter.java index c645953c38..117a4308aa 100644 --- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/editor/DialectEditorCloserFilter.java +++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/business/internal/dialect/editor/DialectEditorCloserFilter.java @@ -61,7 +61,7 @@ public class DialectEditorCloserFilter extends NotificationFilter.Custom { representationDeleted = !(dRepresentation.eContainer() instanceof DView); } else if (notification.getFeature() == ViewpointPackage.Literals.DANALYSIS__OWNED_VIEWS && wasInOldValue(notification, dRepresentation.eContainer())) { // If it is a undo or a rollback but not a - // DRepresentationContainer moved from a DAnalysis to another + // DView moved from a DAnalysis to another representationDeleted = dRepresentation.eContainer() == null || !(dRepresentation.eContainer() != null && dRepresentation.eContainer().eContainer() instanceof DView); } return representationDeleted; diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/actions/copy/CopyRepresentationAction.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/actions/copy/CopyRepresentationAction.java index 98f15ede0f..c311a612de 100644 --- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/actions/copy/CopyRepresentationAction.java +++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/actions/copy/CopyRepresentationAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2009, 2015 THALES GLOBAL SERVICES and others. + * Copyright (c) 2009, 2016 THALES GLOBAL SERVICES 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 @@ -24,7 +24,7 @@ import org.eclipse.sirius.common.ui.tools.api.dialog.RenameDialog; import org.eclipse.sirius.ecore.extender.business.api.permission.IPermissionAuthority; import org.eclipse.sirius.ecore.extender.business.api.permission.PermissionAuthorityRegistry; import org.eclipse.sirius.viewpoint.DRepresentation; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; +import org.eclipse.sirius.viewpoint.DView; import org.eclipse.sirius.viewpoint.provider.Messages; import org.eclipse.swt.widgets.Display; import org.eclipse.ui.ISharedImages; @@ -116,7 +116,7 @@ public class CopyRepresentationAction extends Action { @Override public boolean apply(DRepresentation input) { EObject container = input.eContainer(); - if (container instanceof DRepresentationContainer) { + if (container instanceof DView) { IPermissionAuthority permissionAuthority = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(container); if (permissionAuthority != null && !permissionAuthority.canCreateIn(container)) { return true; diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/actions/creation/CreateRepresentationAction.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/actions/creation/CreateRepresentationAction.java index 8e4b415d22..7af7afabf3 100644 --- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/actions/creation/CreateRepresentationAction.java +++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/actions/creation/CreateRepresentationAction.java @@ -44,7 +44,7 @@ import org.eclipse.sirius.ui.business.api.session.IEditingSession; import org.eclipse.sirius.ui.business.api.session.SessionUIManager; import org.eclipse.sirius.ui.tools.api.Messages; import org.eclipse.sirius.viewpoint.DRepresentation; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; +import org.eclipse.sirius.viewpoint.DView; import org.eclipse.sirius.viewpoint.description.DescriptionPackage; import org.eclipse.sirius.viewpoint.description.RepresentationDescription; import org.eclipse.sirius.viewpoint.provider.SiriusEditPlugin; @@ -110,14 +110,14 @@ public class CreateRepresentationAction extends Action { if (session instanceof DAnalysisSessionImpl) { // Disable the action in case of the representation cannot be // created - Collection<DRepresentationContainer> containers = ((DAnalysisSessionImpl) session).getAvailableRepresentationContainers(description); + Collection<DView> containers = ((DAnalysisSessionImpl) session).getAvailableRepresentationContainers(description); // If containers is empty, a new one will be created, so the action // is enabled if (!containers.isEmpty()) { // Try to find one valid container candidate boolean enabled = false; - for (DRepresentationContainer container : containers) { + for (DView container : containers) { IPermissionAuthority permissionAuthority = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(container); if (permissionAuthority == null || permissionAuthority.canCreateIn(container)) { enabled = true; diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/action/DeleteRepresentationAction.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/action/DeleteRepresentationAction.java index 2db21123fc..fc73866780 100644 --- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/action/DeleteRepresentationAction.java +++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/action/DeleteRepresentationAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2015 THALES GLOBAL SERVICES and others. + * Copyright (c) 2011, 2016 THALES GLOBAL SERVICES 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 @@ -38,7 +38,7 @@ import org.eclipse.sirius.ui.business.api.dialect.DialectUIManager; import org.eclipse.sirius.ui.business.api.session.IEditingSession; import org.eclipse.sirius.ui.business.api.session.SessionUIManager; import org.eclipse.sirius.viewpoint.DRepresentation; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; +import org.eclipse.sirius.viewpoint.DView; import org.eclipse.sirius.viewpoint.provider.Messages; import org.eclipse.sirius.viewpoint.provider.SiriusEditPlugin; import org.eclipse.swt.widgets.Shell; @@ -124,7 +124,8 @@ public class DeleteRepresentationAction extends Action { @Override public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException { try { - String taskName = session2DRepresentations.size() > 1 ? Messages.DeleteRepresentationAction_deleteRepresentationTask_plural : Messages.DeleteRepresentationAction_deleteRepresentationTask; + String taskName = session2DRepresentations.size() > 1 ? Messages.DeleteRepresentationAction_deleteRepresentationTask_plural + : Messages.DeleteRepresentationAction_deleteRepresentationTask; monitor.beginTask(taskName, session2DRepresentations.size()); for (Entry<Session, Set<DRepresentation>> entry : session2DRepresentations.entrySet()) { Session session = entry.getKey(); @@ -209,7 +210,7 @@ public class DeleteRepresentationAction extends Action { @Override public boolean apply(DRepresentation input) { EObject container = input.eContainer(); - if (container instanceof DRepresentationContainer) { + if (container instanceof DView) { IPermissionAuthority permissionAuthority = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(container); if (permissionAuthority != null && !permissionAuthority.canDeleteInstance(input)) { return true; diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/action/ExtractRepresentationAction.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/action/ExtractRepresentationAction.java index d6e2da42fd..d2a42aba3b 100644 --- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/action/ExtractRepresentationAction.java +++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/action/ExtractRepresentationAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015 Obeo. + * Copyright (c) 2015, 2016 Obeo 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 @@ -24,7 +24,7 @@ import org.eclipse.sirius.ecore.extender.business.api.permission.IPermissionAuth import org.eclipse.sirius.ecore.extender.business.api.permission.PermissionAuthorityRegistry; import org.eclipse.sirius.ui.tools.internal.wizards.ExtractRepresentationsWizard; import org.eclipse.sirius.viewpoint.DRepresentation; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; +import org.eclipse.sirius.viewpoint.DView; import org.eclipse.sirius.viewpoint.provider.Messages; import org.eclipse.sirius.viewpoint.provider.SiriusEditPlugin; import org.eclipse.swt.widgets.Shell; @@ -89,7 +89,7 @@ public class ExtractRepresentationAction extends Action { @Override public boolean apply(DRepresentation input) { EObject container = input.eContainer(); - if (container instanceof DRepresentationContainer) { + if (container instanceof DView) { IPermissionAuthority permissionAuthority = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(container); if (permissionAuthority != null && !permissionAuthority.canDeleteInstance(input)) { return true; diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/action/MoveRepresentationAction.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/action/MoveRepresentationAction.java index 5fe930de2b..aa297b160c 100644 --- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/action/MoveRepresentationAction.java +++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/views/common/action/MoveRepresentationAction.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015 Obeo. + * Copyright (c) 2015, 2016 Obeo 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 @@ -25,7 +25,7 @@ import org.eclipse.sirius.ui.business.api.session.IEditingSession; import org.eclipse.sirius.ui.business.api.session.SessionUIManager; import org.eclipse.sirius.viewpoint.DAnalysis; import org.eclipse.sirius.viewpoint.DRepresentation; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; +import org.eclipse.sirius.viewpoint.DView; import org.eclipse.sirius.viewpoint.provider.Messages; import org.eclipse.sirius.viewpoint.provider.SiriusEditPlugin; import org.eclipse.ui.IEditorPart; @@ -102,7 +102,7 @@ public class MoveRepresentationAction extends Action { // Step 1: Check source representation container EObject container = input.eContainer(); - if (container instanceof DRepresentationContainer) { + if (container instanceof DView) { IPermissionAuthority permissionAuthority = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(container); if (permissionAuthority != null && !permissionAuthority.canDeleteInstance(input)) { invalid = true; @@ -111,7 +111,7 @@ public class MoveRepresentationAction extends Action { // Step 2: Check target representation container if (!invalid) { - DRepresentationContainer targetContainer = DAnalysisSessionHelper.findContainerForAddedRepresentation(targetAnalysis, input); + DView targetContainer = DAnalysisSessionHelper.findContainerForAddedRepresentation(targetAnalysis, input); if (targetContainer != null) { IPermissionAuthority permissionAuthority = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(targetContainer); if (permissionAuthority != null && !permissionAuthority.canCreateIn(targetContainer)) { diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/wizards/pages/RepresentationSelectionWizardPage.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/wizards/pages/RepresentationSelectionWizardPage.java index e8d79540e0..eced5531bc 100644 --- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/wizards/pages/RepresentationSelectionWizardPage.java +++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/wizards/pages/RepresentationSelectionWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2011, 2015 THALES GLOBAL SERVICES and others. + * Copyright (c) 2011, 2016 THALES GLOBAL SERVICES 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 @@ -32,7 +32,7 @@ import org.eclipse.sirius.ecore.extender.business.api.permission.IPermissionAuth import org.eclipse.sirius.ecore.extender.business.api.permission.PermissionAuthorityRegistry; import org.eclipse.sirius.ui.tools.api.views.ViewHelper; import org.eclipse.sirius.ui.tools.internal.views.common.navigator.sorter.CommonItemSorter; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; +import org.eclipse.sirius.viewpoint.DView; import org.eclipse.sirius.viewpoint.description.RepresentationDescription; import org.eclipse.sirius.viewpoint.description.Viewpoint; import org.eclipse.sirius.viewpoint.provider.Messages; @@ -88,14 +88,14 @@ public class RepresentationSelectionWizardPage extends WizardPage { result = true; // set to true before permission authority check if (root instanceof DAnalysisSessionImpl) { - Collection<DRepresentationContainer> containers = ((DAnalysisSessionImpl) root).getAvailableRepresentationContainers(representationDescription); + Collection<DView> containers = ((DAnalysisSessionImpl) root).getAvailableRepresentationContainers(representationDescription); // If containers is empty, a new one will be created, so the // wizard is available if (!containers.isEmpty()) { // Try to find one valid container candidate result = false; - for (DRepresentationContainer container : containers) { + for (DView container : containers) { IPermissionAuthority permissionAuthority = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(container); if (permissionAuthority == null || permissionAuthority.canCreateIn(container)) { result = true; diff --git a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/wizards/pages/RepresentationsSelectionWizardPage.java b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/wizards/pages/RepresentationsSelectionWizardPage.java index 6b9bdd0745..57ff6ff930 100644 --- a/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/wizards/pages/RepresentationsSelectionWizardPage.java +++ b/plugins/org.eclipse.sirius.ui/src/org/eclipse/sirius/ui/tools/internal/wizards/pages/RepresentationsSelectionWizardPage.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008, 2015 THALES GLOBAL SERVICES and others. + * Copyright (c) 2008, 2016 THALES GLOBAL SERVICES 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 @@ -36,8 +36,8 @@ import org.eclipse.sirius.ecore.extender.business.api.permission.IPermissionAuth import org.eclipse.sirius.ecore.extender.business.api.permission.PermissionAuthorityRegistry; import org.eclipse.sirius.ui.tools.api.views.ViewHelper; import org.eclipse.sirius.viewpoint.DRepresentation; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; import org.eclipse.sirius.viewpoint.DSemanticDecorator; +import org.eclipse.sirius.viewpoint.DView; import org.eclipse.sirius.viewpoint.provider.Messages; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.GridData; @@ -65,7 +65,9 @@ public class RepresentationsSelectionWizardPage extends WizardPage { /** The user has not selected one or more diagrams. */ private static final int CODE_NO_SEL = 1; - /** A representation cannot be extracted because the container is read only */ + /** + * A representation cannot be extracted because the container is read only + */ private static final int CODE_ERROR_READONLY = 2; /** The composite control of the page. */ @@ -176,7 +178,7 @@ public class RepresentationsSelectionWizardPage extends WizardPage { for (DRepresentation item : selectedRepresentations) { // check permission authority EObject container = item.eContainer(); - if (container instanceof DRepresentationContainer) { + if (container instanceof DView) { IPermissionAuthority permissionAuthority = PermissionAuthorityRegistry.getDefault().getPermissionAuthority(container); if (permissionAuthority != null && !permissionAuthority.canDeleteInstance(item)) { // Cannot remove representation from the container diff --git a/plugins/org.eclipse.sirius/model/viewpoint.ecore b/plugins/org.eclipse.sirius/model/viewpoint.ecore index c991e8db8d..09a4c0a7a7 100644 --- a/plugins/org.eclipse.sirius/model/viewpoint.ecore +++ b/plugins/org.eclipse.sirius/model/viewpoint.ecore @@ -57,11 +57,6 @@ </eAnnotations> </eOperations> </eClassifiers> - <eClassifiers xsi:type="ecore:EClass" name="DRepresentationContainer" eSuperTypes="#//DView"> - <eStructuralFeatures xsi:type="ecore:EReference" name="models" upperBound="-1" - eType="ecore:EClass platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EObject" - changeable="false" volatile="true" transient="true" derived="true"/> - </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="DSemanticDecorator" abstract="true"> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> <details key="documentation" value="An element that has a link to the semantic model."/> @@ -118,6 +113,12 @@ <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> <details key="documentation" value="An view is the root element"/> </eAnnotations> + <eStructuralFeatures xsi:type="ecore:EReference" name="viewpoint" lowerBound="1" + eType="#//description/Viewpoint"> + <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> + <details key="documentation" value="The viewpoint that is used for this view"/> + </eAnnotations> + </eStructuralFeatures> <eStructuralFeatures xsi:type="ecore:EReference" name="ownedRepresentations" upperBound="-1" eType="#//DRepresentation" containment="true"> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> @@ -130,12 +131,9 @@ <details key="documentation" value="The Meta Model extension for this analysis. It may be null."/> </eAnnotations> </eStructuralFeatures> - <eStructuralFeatures xsi:type="ecore:EReference" name="viewpoint" lowerBound="1" - eType="#//description/Viewpoint"> - <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> - <details key="documentation" value="The viewpoint that is used for this view"/> - </eAnnotations> - </eStructuralFeatures> + <eStructuralFeatures xsi:type="ecore:EReference" name="models" upperBound="-1" + eType="ecore:EClass platform:/plugin/org.eclipse.emf.ecore/model/Ecore.ecore#//EObject" + changeable="false" volatile="true" transient="true" derived="true"/> </eClassifiers> <eClassifiers xsi:type="ecore:EClass" name="MetaModelExtension"> <eAnnotations source="http://www.eclipse.org/emf/2002/GenModel"> diff --git a/plugins/org.eclipse.sirius/model/viewpoint.genmodel b/plugins/org.eclipse.sirius/model/viewpoint.genmodel index 66cd29c1aa..7ffcf9cb1b 100644 --- a/plugins/org.eclipse.sirius/model/viewpoint.genmodel +++ b/plugins/org.eclipse.sirius/model/viewpoint.genmodel @@ -51,9 +51,6 @@ <genClasses image="false" ecoreClass="viewpoint.ecore#//DMappingBased"> <genOperations ecoreOperation="viewpoint.ecore#//DMappingBased/getMapping"/> </genClasses> - <genClasses ecoreClass="viewpoint.ecore#//DRepresentationContainer"> - <genFeatures property="Readonly" notify="false" createChild="false" ecoreFeature="ecore:EReference viewpoint.ecore#//DRepresentationContainer/models"/> - </genClasses> <genClasses image="false" ecoreClass="viewpoint.ecore#//DSemanticDecorator"> <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference viewpoint.ecore#//DSemanticDecorator/target"/> </genClasses> @@ -69,9 +66,10 @@ <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference viewpoint.ecore#//DRepresentationElement/semanticElements"/> </genClasses> <genClasses ecoreClass="viewpoint.ecore#//DView"> + <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference viewpoint.ecore#//DView/viewpoint"/> + <genFeatures property="Readonly" notify="false" createChild="false" ecoreFeature="ecore:EReference viewpoint.ecore#//DView/models"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference viewpoint.ecore#//DView/ownedRepresentations"/> <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference viewpoint.ecore#//DView/ownedExtensions"/> - <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference viewpoint.ecore#//DView/viewpoint"/> </genClasses> <genClasses ecoreClass="viewpoint.ecore#//MetaModelExtension"> <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference viewpoint.ecore#//MetaModelExtension/extensionGroup"/> diff --git a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/DRepresentationContainer.java b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/DRepresentationContainer.java deleted file mode 100644 index 38425a33e2..0000000000 --- a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/DRepresentationContainer.java +++ /dev/null @@ -1,51 +0,0 @@ -/** - * Copyright (c) 2007, 2013 THALES GLOBAL SERVICES. - * 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: - * Obeo - initial API and implementation - * - */ -package org.eclipse.sirius.viewpoint; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EObject; - -/** - * <!-- begin-user-doc --> A representation of the model object ' - * <em><b>DRepresentation Container</b></em>'. <!-- end-user-doc --> - * - * <p> - * The following features are supported: - * </p> - * <ul> - * <li>{@link org.eclipse.sirius.viewpoint.DRepresentationContainer#getModels - * <em>Models</em>}</li> - * </ul> - * - * @see org.eclipse.sirius.viewpoint.ViewpointPackage#getDRepresentationContainer() - * @model - * @generated - */ -public interface DRepresentationContainer extends DView { - /** - * Returns the value of the '<em><b>Models</b></em>' reference list. The - * list contents are of type {@link org.eclipse.emf.ecore.EObject}. <!-- - * begin-user-doc --> - * <p> - * If the meaning of the '<em>Models</em>' reference list isn't clear, there - * really should be more of a description here... - * </p> - * <!-- end-user-doc --> - * - * @return the value of the '<em>Models</em>' reference list. - * @see org.eclipse.sirius.viewpoint.ViewpointPackage#getDRepresentationContainer_Models() - * @model transient="true" changeable="false" volatile="true" derived="true" - * @generated - */ - EList<EObject> getModels(); - -} // DRepresentationContainer diff --git a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/DView.java b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/DView.java index 785b9a4cdc..59779cc53a 100644 --- a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/DView.java +++ b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/DView.java @@ -12,6 +12,7 @@ package org.eclipse.sirius.viewpoint; import org.eclipse.emf.common.util.EList; +import org.eclipse.emf.ecore.EObject; import org.eclipse.sirius.viewpoint.description.Viewpoint; /** @@ -31,12 +32,13 @@ import org.eclipse.sirius.viewpoint.description.Viewpoint; * The following features are supported: * </p> * <ul> + * <li>{@link org.eclipse.sirius.viewpoint.DView#getViewpoint <em>Viewpoint</em> + * }</li> * <li>{@link org.eclipse.sirius.viewpoint.DView#getOwnedRepresentations * <em>Owned Representations</em>}</li> * <li>{@link org.eclipse.sirius.viewpoint.DView#getOwnedExtensions * <em>Owned Extensions</em>}</li> - * <li>{@link org.eclipse.sirius.viewpoint.DView#getViewpoint <em>Viewpoint</em> - * }</li> + * <li>{@link org.eclipse.sirius.viewpoint.DView#getModels <em>Models</em>}</li> * </ul> * * @see org.eclipse.sirius.viewpoint.ViewpointPackage#getDView() @@ -113,4 +115,21 @@ public interface DView extends DRefreshable { */ void setViewpoint(Viewpoint value); + /** + * Returns the value of the '<em><b>Models</b></em>' reference list. The + * list contents are of type {@link org.eclipse.emf.ecore.EObject}. <!-- + * begin-user-doc --> + * <p> + * If the meaning of the '<em>Models</em>' reference list isn't clear, there + * really should be more of a description here... + * </p> + * <!-- end-user-doc --> + * + * @return the value of the '<em>Models</em>' reference list. + * @see org.eclipse.sirius.viewpoint.ViewpointPackage#getDView_Models() + * @model transient="true" changeable="false" volatile="true" derived="true" + * @generated + */ + EList<EObject> getModels(); + } // DView diff --git a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/ViewpointFactory.java b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/ViewpointFactory.java index ef435fae3e..e6e3e3291f 100644 --- a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/ViewpointFactory.java +++ b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/ViewpointFactory.java @@ -39,15 +39,6 @@ public interface ViewpointFactory extends EFactory { DAnalysis createDAnalysis(); /** - * Returns a new object of class '<em>DRepresentation Container</em>'. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @return a new object of class '<em>DRepresentation Container</em>'. - * @generated - */ - DRepresentationContainer createDRepresentationContainer(); - - /** * Returns a new object of class '<em>DView</em>'. <!-- begin-user-doc --> * <!-- end-user-doc --> * diff --git a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/ViewpointPackage.java b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/ViewpointPackage.java index 0dfe688515..85bfd7b7eb 100644 --- a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/ViewpointPackage.java +++ b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/ViewpointPackage.java @@ -256,101 +256,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getDView() * @generated */ - int DVIEW = 9; - - /** - * The feature id for the '<em><b>Owned Representations</b></em>' - * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - * @ordered - */ - int DVIEW__OWNED_REPRESENTATIONS = ViewpointPackage.DREFRESHABLE_FEATURE_COUNT + 0; - - /** - * The feature id for the '<em><b>Owned Extensions</b></em>' containment - * reference. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - * @ordered - */ - int DVIEW__OWNED_EXTENSIONS = ViewpointPackage.DREFRESHABLE_FEATURE_COUNT + 1; - - /** - * The feature id for the '<em><b>Viewpoint</b></em>' reference. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - * @ordered - */ - int DVIEW__VIEWPOINT = ViewpointPackage.DREFRESHABLE_FEATURE_COUNT + 2; - - /** - * The number of structural features of the '<em>DView</em>' class. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - * @ordered - */ - int DVIEW_FEATURE_COUNT = ViewpointPackage.DREFRESHABLE_FEATURE_COUNT + 3; - - /** - * The meta object id for the ' - * {@link org.eclipse.sirius.viewpoint.impl.DRepresentationContainerImpl - * <em>DRepresentation Container</em>}' class. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @see org.eclipse.sirius.viewpoint.impl.DRepresentationContainerImpl - * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getDRepresentationContainer() - * @generated - */ - int DREPRESENTATION_CONTAINER = 5; - - /** - * The feature id for the '<em><b>Owned Representations</b></em>' - * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - * @ordered - */ - int DREPRESENTATION_CONTAINER__OWNED_REPRESENTATIONS = ViewpointPackage.DVIEW__OWNED_REPRESENTATIONS; - - /** - * The feature id for the '<em><b>Owned Extensions</b></em>' containment - * reference. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - * @ordered - */ - int DREPRESENTATION_CONTAINER__OWNED_EXTENSIONS = ViewpointPackage.DVIEW__OWNED_EXTENSIONS; - - /** - * The feature id for the '<em><b>Viewpoint</b></em>' reference. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - * @ordered - */ - int DREPRESENTATION_CONTAINER__VIEWPOINT = ViewpointPackage.DVIEW__VIEWPOINT; - - /** - * The feature id for the '<em><b>Models</b></em>' reference list. <!-- - * begin-user-doc --> <!-- end-user-doc --> - * - * @generated - * @ordered - */ - int DREPRESENTATION_CONTAINER__MODELS = ViewpointPackage.DVIEW_FEATURE_COUNT + 0; - - /** - * The number of structural features of the ' - * <em>DRepresentation Container</em>' class. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @generated - * @ordered - */ - int DREPRESENTATION_CONTAINER_FEATURE_COUNT = ViewpointPackage.DVIEW_FEATURE_COUNT + 1; + int DVIEW = 8; /** * The meta object id for the ' @@ -362,7 +268,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getDSemanticDecorator() * @generated */ - int DSEMANTIC_DECORATOR = 6; + int DSEMANTIC_DECORATOR = 5; /** * The feature id for the '<em><b>Target</b></em>' reference. <!-- @@ -392,7 +298,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getDRepresentation() * @generated */ - int DREPRESENTATION = 7; + int DREPRESENTATION = 6; /** * The feature id for the '<em><b>Documentation</b></em>' attribute. <!-- @@ -476,7 +382,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getDRepresentationElement() * @generated */ - int DREPRESENTATION_ELEMENT = 8; + int DREPRESENTATION_ELEMENT = 7; /** * The feature id for the '<em><b>Target</b></em>' reference. <!-- @@ -516,6 +422,51 @@ public interface ViewpointPackage extends EPackage { int DREPRESENTATION_ELEMENT_FEATURE_COUNT = ViewpointPackage.DMAPPING_BASED_FEATURE_COUNT + 3; /** + * The feature id for the '<em><b>Viewpoint</b></em>' reference. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int DVIEW__VIEWPOINT = ViewpointPackage.DREFRESHABLE_FEATURE_COUNT + 0; + + /** + * The feature id for the '<em><b>Owned Representations</b></em>' + * containment reference list. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int DVIEW__OWNED_REPRESENTATIONS = ViewpointPackage.DREFRESHABLE_FEATURE_COUNT + 1; + + /** + * The feature id for the '<em><b>Owned Extensions</b></em>' containment + * reference. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int DVIEW__OWNED_EXTENSIONS = ViewpointPackage.DREFRESHABLE_FEATURE_COUNT + 2; + + /** + * The feature id for the '<em><b>Models</b></em>' reference list. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int DVIEW__MODELS = ViewpointPackage.DREFRESHABLE_FEATURE_COUNT + 3; + + /** + * The number of structural features of the '<em>DView</em>' class. <!-- + * begin-user-doc --> <!-- end-user-doc --> + * + * @generated + * @ordered + */ + int DVIEW_FEATURE_COUNT = ViewpointPackage.DREFRESHABLE_FEATURE_COUNT + 4; + + /** * The meta object id for the ' * {@link org.eclipse.sirius.viewpoint.impl.MetaModelExtensionImpl * <em>Meta Model Extension</em>}' class. <!-- begin-user-doc --> <!-- @@ -525,7 +476,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getMetaModelExtension() * @generated */ - int META_MODEL_EXTENSION = 10; + int META_MODEL_EXTENSION = 9; /** * The feature id for the '<em><b>Extension Group</b></em>' reference. <!-- @@ -555,7 +506,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getDecoration() * @generated */ - int DECORATION = 11; + int DECORATION = 10; /** * The feature id for the '<em><b>Description</b></em>' reference. <!-- @@ -585,7 +536,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getDAnalysisCustomData() * @generated */ - int DANALYSIS_CUSTOM_DATA = 12; + int DANALYSIS_CUSTOM_DATA = 11; /** * The feature id for the '<em><b>Key</b></em>' attribute. <!-- @@ -624,7 +575,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getCustomizable() * @generated */ - int CUSTOMIZABLE = 24; + int CUSTOMIZABLE = 23; /** * The feature id for the '<em><b>Custom Features</b></em>' attribute list. @@ -654,7 +605,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getBasicLabelStyle() * @generated */ - int BASIC_LABEL_STYLE = 23; + int BASIC_LABEL_STYLE = 22; /** * The feature id for the '<em><b>Custom Features</b></em>' attribute list. @@ -729,7 +680,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getLabelStyle() * @generated */ - int LABEL_STYLE = 13; + int LABEL_STYLE = 12; /** * The feature id for the '<em><b>Custom Features</b></em>' attribute list. @@ -812,7 +763,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getStyle() * @generated */ - int STYLE = 14; + int STYLE = 13; /** * The feature id for the '<em><b>Custom Features</b></em>' attribute list. @@ -851,7 +802,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getRGBValues() * @generated */ - int RGB_VALUES = 29; + int RGB_VALUES = 28; /** * The meta object id for the '<em>Resource Descriptor</em>' data type. <!-- @@ -861,7 +812,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getResourceDescriptor() * @generated */ - int RESOURCE_DESCRIPTOR = 30; + int RESOURCE_DESCRIPTOR = 29; /** * The meta object id for the ' @@ -873,7 +824,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getDAnalysisSessionEObject() * @generated */ - int DANALYSIS_SESSION_EOBJECT = 15; + int DANALYSIS_SESSION_EOBJECT = 14; /** * The feature id for the '<em><b>Open</b></em>' attribute. <!-- @@ -949,7 +900,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getSessionManagerEObject() * @generated */ - int SESSION_MANAGER_EOBJECT = 16; + int SESSION_MANAGER_EOBJECT = 15; /** * The feature id for the '<em><b>Owned Sessions</b></em>' containment @@ -978,7 +929,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getDResource() * @generated */ - int DRESOURCE = 17; + int DRESOURCE = 16; /** * The feature id for the '<em><b>Name</b></em>' attribute. <!-- @@ -1016,7 +967,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getDFile() * @generated */ - int DFILE = 18; + int DFILE = 17; /** * The feature id for the '<em><b>Name</b></em>' attribute. <!-- @@ -1055,7 +1006,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getDResourceContainer() * @generated */ - int DRESOURCE_CONTAINER = 19; + int DRESOURCE_CONTAINER = 18; /** * The feature id for the '<em><b>Name</b></em>' attribute. <!-- @@ -1102,7 +1053,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getDProject() * @generated */ - int DPROJECT = 20; + int DPROJECT = 19; /** * The feature id for the '<em><b>Name</b></em>' attribute. <!-- @@ -1149,7 +1100,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getDFolder() * @generated */ - int DFOLDER = 21; + int DFOLDER = 20; /** * The feature id for the '<em><b>Name</b></em>' attribute. <!-- @@ -1196,7 +1147,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getDModel() * @generated */ - int DMODEL = 22; + int DMODEL = 21; /** * The feature id for the '<em><b>Name</b></em>' attribute. <!-- @@ -1234,7 +1185,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getUIState() * @generated */ - int UI_STATE = 25; + int UI_STATE = 24; /** * The feature id for the '<em><b>Inverse Selection Order</b></em>' @@ -1272,7 +1223,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getFontFormat() * @generated */ - int FONT_FORMAT = 26; + int FONT_FORMAT = 25; /** * The meta object id for the ' @@ -1284,7 +1235,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getLabelAlignment() * @generated */ - int LABEL_ALIGNMENT = 27; + int LABEL_ALIGNMENT = 26; /** * The meta object id for the ' @@ -1295,7 +1246,7 @@ public interface ViewpointPackage extends EPackage { * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getSyncStatus() * @generated */ - int SYNC_STATUS = 28; + int SYNC_STATUS = 27; /** * Returns the meta object for class ' @@ -1471,30 +1422,6 @@ public interface ViewpointPackage extends EPackage { /** * Returns the meta object for class ' - * {@link org.eclipse.sirius.viewpoint.DRepresentationContainer - * <em>DRepresentation Container</em>}'. <!-- begin-user-doc --> <!-- - * end-user-doc --> - * - * @return the meta object for class '<em>DRepresentation Container</em>'. - * @see org.eclipse.sirius.viewpoint.DRepresentationContainer - * @generated - */ - EClass getDRepresentationContainer(); - - /** - * Returns the meta object for the reference list ' - * {@link org.eclipse.sirius.viewpoint.DRepresentationContainer#getModels - * <em>Models</em>}'. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @return the meta object for the reference list '<em>Models</em>'. - * @see org.eclipse.sirius.viewpoint.DRepresentationContainer#getModels() - * @see #getDRepresentationContainer() - * @generated - */ - EReference getDRepresentationContainer_Models(); - - /** - * Returns the meta object for class ' * {@link org.eclipse.sirius.viewpoint.DSemanticDecorator * <em>DSemantic Decorator</em>}'. <!-- begin-user-doc --> <!-- end-user-doc * --> @@ -1685,6 +1612,18 @@ public interface ViewpointPackage extends EPackage { EReference getDView_Viewpoint(); /** + * Returns the meta object for the reference list ' + * {@link org.eclipse.sirius.viewpoint.DView#getModels <em>Models</em>}'. + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @return the meta object for the reference list '<em>Models</em>'. + * @see org.eclipse.sirius.viewpoint.DView#getModels() + * @see #getDView() + * @generated + */ + EReference getDView_Models(); + + /** * Returns the meta object for class ' * {@link org.eclipse.sirius.viewpoint.MetaModelExtension * <em>Meta Model Extension</em>}'. <!-- begin-user-doc --> <!-- @@ -2384,26 +2323,6 @@ public interface ViewpointPackage extends EPackage { /** * The meta object literal for the ' - * {@link org.eclipse.sirius.viewpoint.impl.DRepresentationContainerImpl - * <em>DRepresentation Container</em>}' class. <!-- begin-user-doc --> - * <!-- end-user-doc --> - * - * @see org.eclipse.sirius.viewpoint.impl.DRepresentationContainerImpl - * @see org.eclipse.sirius.viewpoint.impl.ViewpointPackageImpl#getDRepresentationContainer() - * @generated - */ - EClass DREPRESENTATION_CONTAINER = ViewpointPackage.eINSTANCE.getDRepresentationContainer(); - - /** - * The meta object literal for the '<em><b>Models</b></em>' reference - * list feature. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - EReference DREPRESENTATION_CONTAINER__MODELS = ViewpointPackage.eINSTANCE.getDRepresentationContainer_Models(); - - /** - * The meta object literal for the ' * {@link org.eclipse.sirius.viewpoint.impl.DSemanticDecoratorImpl * <em>DSemantic Decorator</em>}' class. <!-- begin-user-doc --> <!-- * end-user-doc --> @@ -2544,6 +2463,14 @@ public interface ViewpointPackage extends EPackage { EReference DVIEW__VIEWPOINT = ViewpointPackage.eINSTANCE.getDView_Viewpoint(); /** + * The meta object literal for the '<em><b>Models</b></em>' reference + * list feature. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + EReference DVIEW__MODELS = ViewpointPackage.eINSTANCE.getDView_Models(); + + /** * The meta object literal for the ' * {@link org.eclipse.sirius.viewpoint.impl.MetaModelExtensionImpl * <em>Meta Model Extension</em>}' class. <!-- begin-user-doc --> <!-- diff --git a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/impl/DRepresentationContainerImpl.java b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/impl/DRepresentationContainerImpl.java deleted file mode 100644 index d6bed9e3a2..0000000000 --- a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/impl/DRepresentationContainerImpl.java +++ /dev/null @@ -1,99 +0,0 @@ -/** - * Copyright (c) 2007, 2013 THALES GLOBAL SERVICES. - * 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: - * Obeo - initial API and implementation - * - */ -package org.eclipse.sirius.viewpoint.impl; - -import org.eclipse.emf.common.util.EList; -import org.eclipse.emf.ecore.EClass; -import org.eclipse.emf.ecore.EObject; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; -import org.eclipse.sirius.viewpoint.ViewpointPackage; - -/** - * <!-- begin-user-doc --> An implementation of the model object ' - * <em><b>DRepresentation Container</b></em>'. <!-- end-user-doc --> - * <p> - * The following features are implemented: - * </p> - * <ul> - * <li> - * {@link org.eclipse.sirius.viewpoint.impl.DRepresentationContainerImpl#getModels - * <em>Models</em>}</li> - * </ul> - * - * @generated - */ -public class DRepresentationContainerImpl extends DViewImpl implements DRepresentationContainer { - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - protected DRepresentationContainerImpl() { - super(); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - @Override - protected EClass eStaticClass() { - return ViewpointPackage.Literals.DREPRESENTATION_CONTAINER; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - @Override - public EList<EObject> getModels() { - // TODO: implement this method to return the 'Models' reference list - // Ensure that you remove @generated or mark it @generated NOT - // The list is expected to implement - // org.eclipse.emf.ecore.util.InternalEList and - // org.eclipse.emf.ecore.EStructuralFeature.Setting - // so it's likely that an appropriate subclass of - // org.eclipse.emf.ecore.util.EcoreEList should be used. - throw new UnsupportedOperationException(); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - @Override - public Object eGet(int featureID, boolean resolve, boolean coreType) { - switch (featureID) { - case ViewpointPackage.DREPRESENTATION_CONTAINER__MODELS: - return getModels(); - } - return super.eGet(featureID, resolve, coreType); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - @Override - public boolean eIsSet(int featureID) { - switch (featureID) { - case ViewpointPackage.DREPRESENTATION_CONTAINER__MODELS: - return !getModels().isEmpty(); - } - return super.eIsSet(featureID); - } - -} // DRepresentationContainerImpl diff --git a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/impl/DViewImpl.java b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/impl/DViewImpl.java index 6a2d03d119..fbcba794bd 100644 --- a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/impl/DViewImpl.java +++ b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/impl/DViewImpl.java @@ -17,6 +17,7 @@ import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.NotificationChain; import org.eclipse.emf.common.util.EList; import org.eclipse.emf.ecore.EClass; +import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.ecore.impl.ENotificationImpl; import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; @@ -35,19 +36,31 @@ import org.eclipse.sirius.viewpoint.description.Viewpoint; * The following features are implemented: * </p> * <ul> + * <li>{@link org.eclipse.sirius.viewpoint.impl.DViewImpl#getViewpoint + * <em>Viewpoint</em>}</li> * <li> * {@link org.eclipse.sirius.viewpoint.impl.DViewImpl#getOwnedRepresentations * <em>Owned Representations</em>}</li> * <li>{@link org.eclipse.sirius.viewpoint.impl.DViewImpl#getOwnedExtensions * <em>Owned Extensions</em>}</li> - * <li>{@link org.eclipse.sirius.viewpoint.impl.DViewImpl#getViewpoint - * <em>Viewpoint</em>}</li> + * <li>{@link org.eclipse.sirius.viewpoint.impl.DViewImpl#getModels + * <em>Models</em>}</li> * </ul> * * @generated */ public class DViewImpl extends MinimalEObjectImpl.Container implements DView { /** + * The cached value of the '{@link #getViewpoint() <em>Viewpoint</em>}' + * reference. <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @see #getViewpoint() + * @generated + * @ordered + */ + protected Viewpoint viewpoint; + + /** * The cached value of the '{@link #getOwnedRepresentations() * <em>Owned Representations</em>}' containment reference list. <!-- * begin-user-doc --> <!-- end-user-doc --> @@ -70,16 +83,6 @@ public class DViewImpl extends MinimalEObjectImpl.Container implements DView { protected MetaModelExtension ownedExtensions; /** - * The cached value of the '{@link #getViewpoint() <em>Viewpoint</em>}' - * reference. <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @see #getViewpoint() - * @generated - * @ordered - */ - protected Viewpoint viewpoint; - - /** * <!-- begin-user-doc --> <!-- end-user-doc --> * * @generated @@ -238,6 +241,23 @@ public class DViewImpl extends MinimalEObjectImpl.Container implements DView { * @generated */ @Override + public EList<EObject> getModels() { + // TODO: implement this method to return the 'Models' reference list + // Ensure that you remove @generated or mark it @generated NOT + // The list is expected to implement + // org.eclipse.emf.ecore.util.InternalEList and + // org.eclipse.emf.ecore.EStructuralFeature.Setting + // so it's likely that an appropriate subclass of + // org.eclipse.emf.ecore.util.EcoreEList should be used. + throw new UnsupportedOperationException(); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override public void refresh() { // TODO: implement this method // Ensure that you remove @generated or mark it @generated NOT @@ -268,6 +288,11 @@ public class DViewImpl extends MinimalEObjectImpl.Container implements DView { @Override public Object eGet(int featureID, boolean resolve, boolean coreType) { switch (featureID) { + case ViewpointPackage.DVIEW__VIEWPOINT: + if (resolve) { + return getViewpoint(); + } + return basicGetViewpoint(); case ViewpointPackage.DVIEW__OWNED_REPRESENTATIONS: return getOwnedRepresentations(); case ViewpointPackage.DVIEW__OWNED_EXTENSIONS: @@ -275,11 +300,8 @@ public class DViewImpl extends MinimalEObjectImpl.Container implements DView { return getOwnedExtensions(); } return basicGetOwnedExtensions(); - case ViewpointPackage.DVIEW__VIEWPOINT: - if (resolve) { - return getViewpoint(); - } - return basicGetViewpoint(); + case ViewpointPackage.DVIEW__MODELS: + return getModels(); } return super.eGet(featureID, resolve, coreType); } @@ -293,6 +315,9 @@ public class DViewImpl extends MinimalEObjectImpl.Container implements DView { @Override public void eSet(int featureID, Object newValue) { switch (featureID) { + case ViewpointPackage.DVIEW__VIEWPOINT: + setViewpoint((Viewpoint) newValue); + return; case ViewpointPackage.DVIEW__OWNED_REPRESENTATIONS: getOwnedRepresentations().clear(); getOwnedRepresentations().addAll((Collection<? extends DRepresentation>) newValue); @@ -300,9 +325,6 @@ public class DViewImpl extends MinimalEObjectImpl.Container implements DView { case ViewpointPackage.DVIEW__OWNED_EXTENSIONS: setOwnedExtensions((MetaModelExtension) newValue); return; - case ViewpointPackage.DVIEW__VIEWPOINT: - setViewpoint((Viewpoint) newValue); - return; } super.eSet(featureID, newValue); } @@ -315,15 +337,15 @@ public class DViewImpl extends MinimalEObjectImpl.Container implements DView { @Override public void eUnset(int featureID) { switch (featureID) { + case ViewpointPackage.DVIEW__VIEWPOINT: + setViewpoint((Viewpoint) null); + return; case ViewpointPackage.DVIEW__OWNED_REPRESENTATIONS: getOwnedRepresentations().clear(); return; case ViewpointPackage.DVIEW__OWNED_EXTENSIONS: setOwnedExtensions((MetaModelExtension) null); return; - case ViewpointPackage.DVIEW__VIEWPOINT: - setViewpoint((Viewpoint) null); - return; } super.eUnset(featureID); } @@ -336,12 +358,14 @@ public class DViewImpl extends MinimalEObjectImpl.Container implements DView { @Override public boolean eIsSet(int featureID) { switch (featureID) { + case ViewpointPackage.DVIEW__VIEWPOINT: + return viewpoint != null; case ViewpointPackage.DVIEW__OWNED_REPRESENTATIONS: return ownedRepresentations != null && !ownedRepresentations.isEmpty(); case ViewpointPackage.DVIEW__OWNED_EXTENSIONS: return ownedExtensions != null; - case ViewpointPackage.DVIEW__VIEWPOINT: - return viewpoint != null; + case ViewpointPackage.DVIEW__MODELS: + return !getModels().isEmpty(); } return super.eIsSet(featureID); } diff --git a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/impl/ViewpointFactoryImpl.java b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/impl/ViewpointFactoryImpl.java index fe7579c229..0f0b738f94 100644 --- a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/impl/ViewpointFactoryImpl.java +++ b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/impl/ViewpointFactoryImpl.java @@ -20,7 +20,7 @@ import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.impl.EFactoryImpl; import org.eclipse.emf.ecore.plugin.EcorePlugin; import org.eclipse.sirius.business.api.resource.ResourceDescriptor; -import org.eclipse.sirius.business.internal.metamodel.spec.DRepresentationContainerSpec; +import org.eclipse.sirius.business.internal.metamodel.spec.DViewSpec; import org.eclipse.sirius.common.tools.api.util.StringUtil; import org.eclipse.sirius.viewpoint.BasicLabelStyle; import org.eclipse.sirius.viewpoint.DAnalysis; @@ -30,7 +30,6 @@ import org.eclipse.sirius.viewpoint.DFile; import org.eclipse.sirius.viewpoint.DFolder; import org.eclipse.sirius.viewpoint.DModel; import org.eclipse.sirius.viewpoint.DProject; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; import org.eclipse.sirius.viewpoint.DResourceContainer; import org.eclipse.sirius.viewpoint.DView; import org.eclipse.sirius.viewpoint.Decoration; @@ -92,8 +91,6 @@ public class ViewpointFactoryImpl extends EFactoryImpl implements ViewpointFacto switch (eClass.getClassifierID()) { case ViewpointPackage.DANALYSIS: return createDAnalysis(); - case ViewpointPackage.DREPRESENTATION_CONTAINER: - return createDRepresentationContainer(); case ViewpointPackage.DVIEW: return createDView(); case ViewpointPackage.META_MODEL_EXTENSION: @@ -190,19 +187,8 @@ public class ViewpointFactoryImpl extends EFactoryImpl implements ViewpointFacto * @not-generated */ @Override - public DRepresentationContainer createDRepresentationContainer() { - DRepresentationContainerImpl dRepresentationContainer = new DRepresentationContainerSpec(); - return dRepresentationContainer; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - @Override public DView createDView() { - DViewImpl dView = new DViewImpl(); + DViewImpl dView = new DViewSpec(); return dView; } diff --git a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/impl/ViewpointPackageImpl.java b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/impl/ViewpointPackageImpl.java index b4a46269f4..e0f93a3770 100644 --- a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/impl/ViewpointPackageImpl.java +++ b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/impl/ViewpointPackageImpl.java @@ -33,7 +33,6 @@ import org.eclipse.sirius.viewpoint.DModel; import org.eclipse.sirius.viewpoint.DProject; import org.eclipse.sirius.viewpoint.DRefreshable; import org.eclipse.sirius.viewpoint.DRepresentation; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; import org.eclipse.sirius.viewpoint.DRepresentationElement; import org.eclipse.sirius.viewpoint.DResource; import org.eclipse.sirius.viewpoint.DResourceContainer; @@ -111,13 +110,6 @@ public class ViewpointPackageImpl extends EPackageImpl implements ViewpointPacka * * @generated */ - private EClass dRepresentationContainerEClass = null; - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ private EClass dSemanticDecoratorEClass = null; /** @@ -525,26 +517,6 @@ public class ViewpointPackageImpl extends EPackageImpl implements ViewpointPacka * @generated */ @Override - public EClass getDRepresentationContainer() { - return dRepresentationContainerEClass; - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - @Override - public EReference getDRepresentationContainer_Models() { - return (EReference) dRepresentationContainerEClass.getEStructuralFeatures().get(0); - } - - /** - * <!-- begin-user-doc --> <!-- end-user-doc --> - * - * @generated - */ - @Override public EClass getDSemanticDecorator() { return dSemanticDecoratorEClass; } @@ -666,7 +638,7 @@ public class ViewpointPackageImpl extends EPackageImpl implements ViewpointPacka */ @Override public EReference getDView_OwnedRepresentations() { - return (EReference) dViewEClass.getEStructuralFeatures().get(0); + return (EReference) dViewEClass.getEStructuralFeatures().get(1); } /** @@ -676,7 +648,7 @@ public class ViewpointPackageImpl extends EPackageImpl implements ViewpointPacka */ @Override public EReference getDView_OwnedExtensions() { - return (EReference) dViewEClass.getEStructuralFeatures().get(1); + return (EReference) dViewEClass.getEStructuralFeatures().get(2); } /** @@ -686,7 +658,17 @@ public class ViewpointPackageImpl extends EPackageImpl implements ViewpointPacka */ @Override public EReference getDView_Viewpoint() { - return (EReference) dViewEClass.getEStructuralFeatures().get(2); + return (EReference) dViewEClass.getEStructuralFeatures().get(0); + } + + /** + * <!-- begin-user-doc --> <!-- end-user-doc --> + * + * @generated + */ + @Override + public EReference getDView_Models() { + return (EReference) dViewEClass.getEStructuralFeatures().get(3); } /** @@ -1189,9 +1171,6 @@ public class ViewpointPackageImpl extends EPackageImpl implements ViewpointPacka dMappingBasedEClass = createEClass(ViewpointPackage.DMAPPING_BASED); - dRepresentationContainerEClass = createEClass(ViewpointPackage.DREPRESENTATION_CONTAINER); - createEReference(dRepresentationContainerEClass, ViewpointPackage.DREPRESENTATION_CONTAINER__MODELS); - dSemanticDecoratorEClass = createEClass(ViewpointPackage.DSEMANTIC_DECORATOR); createEReference(dSemanticDecoratorEClass, ViewpointPackage.DSEMANTIC_DECORATOR__TARGET); @@ -1207,9 +1186,10 @@ public class ViewpointPackageImpl extends EPackageImpl implements ViewpointPacka createEReference(dRepresentationElementEClass, ViewpointPackage.DREPRESENTATION_ELEMENT__SEMANTIC_ELEMENTS); dViewEClass = createEClass(ViewpointPackage.DVIEW); + createEReference(dViewEClass, ViewpointPackage.DVIEW__VIEWPOINT); createEReference(dViewEClass, ViewpointPackage.DVIEW__OWNED_REPRESENTATIONS); createEReference(dViewEClass, ViewpointPackage.DVIEW__OWNED_EXTENSIONS); - createEReference(dViewEClass, ViewpointPackage.DVIEW__VIEWPOINT); + createEReference(dViewEClass, ViewpointPackage.DVIEW__MODELS); metaModelExtensionEClass = createEClass(ViewpointPackage.META_MODEL_EXTENSION); createEReference(metaModelExtensionEClass, ViewpointPackage.META_MODEL_EXTENSION__EXTENSION_GROUP); @@ -1315,7 +1295,6 @@ public class ViewpointPackageImpl extends EPackageImpl implements ViewpointPacka // Set bounds for type parameters // Add supertypes to classes - dRepresentationContainerEClass.getESuperTypes().add(this.getDView()); dRepresentationEClass.getESuperTypes().add(theDescriptionPackage.getDocumentedElement()); dRepresentationEClass.getESuperTypes().add(this.getDRefreshable()); dRepresentationEClass.getESuperTypes().add(theDescriptionPackage.getDModelElement()); @@ -1375,12 +1354,6 @@ public class ViewpointPackageImpl extends EPackageImpl implements ViewpointPacka addEOperation(dMappingBasedEClass, theDescriptionPackage.getRepresentationElementMapping(), "getMapping", 0, 1, EPackageImpl.IS_UNIQUE, EPackageImpl.IS_ORDERED); //$NON-NLS-1$ - initEClass(dRepresentationContainerEClass, DRepresentationContainer.class, "DRepresentationContainer", !EPackageImpl.IS_ABSTRACT, !EPackageImpl.IS_INTERFACE, //$NON-NLS-1$ - EPackageImpl.IS_GENERATED_INSTANCE_CLASS); - initEReference(getDRepresentationContainer_Models(), theEcorePackage.getEObject(), null, "models", null, 0, -1, DRepresentationContainer.class, EPackageImpl.IS_TRANSIENT, //$NON-NLS-1$ - EPackageImpl.IS_VOLATILE, !EPackageImpl.IS_CHANGEABLE, !EPackageImpl.IS_COMPOSITE, EPackageImpl.IS_RESOLVE_PROXIES, !EPackageImpl.IS_UNSETTABLE, EPackageImpl.IS_UNIQUE, - EPackageImpl.IS_DERIVED, EPackageImpl.IS_ORDERED); - initEClass(dSemanticDecoratorEClass, DSemanticDecorator.class, "DSemanticDecorator", EPackageImpl.IS_ABSTRACT, !EPackageImpl.IS_INTERFACE, EPackageImpl.IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEReference(getDSemanticDecorator_Target(), theEcorePackage.getEObject(), null, "target", null, 1, 1, DSemanticDecorator.class, !EPackageImpl.IS_TRANSIENT, !EPackageImpl.IS_VOLATILE, //$NON-NLS-1$ EPackageImpl.IS_CHANGEABLE, !EPackageImpl.IS_COMPOSITE, EPackageImpl.IS_RESOLVE_PROXIES, !EPackageImpl.IS_UNSETTABLE, EPackageImpl.IS_UNIQUE, !EPackageImpl.IS_DERIVED, @@ -1411,15 +1384,17 @@ public class ViewpointPackageImpl extends EPackageImpl implements ViewpointPacka !EPackageImpl.IS_DERIVED, EPackageImpl.IS_ORDERED); initEClass(dViewEClass, DView.class, "DView", !EPackageImpl.IS_ABSTRACT, !EPackageImpl.IS_INTERFACE, EPackageImpl.IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ + initEReference(getDView_Viewpoint(), theDescriptionPackage.getViewpoint(), null, "viewpoint", null, 1, 1, DView.class, !EPackageImpl.IS_TRANSIENT, !EPackageImpl.IS_VOLATILE, //$NON-NLS-1$ + EPackageImpl.IS_CHANGEABLE, !EPackageImpl.IS_COMPOSITE, EPackageImpl.IS_RESOLVE_PROXIES, !EPackageImpl.IS_UNSETTABLE, EPackageImpl.IS_UNIQUE, !EPackageImpl.IS_DERIVED, + EPackageImpl.IS_ORDERED); initEReference(getDView_OwnedRepresentations(), this.getDRepresentation(), null, "ownedRepresentations", null, 0, -1, DView.class, !EPackageImpl.IS_TRANSIENT, !EPackageImpl.IS_VOLATILE, //$NON-NLS-1$ EPackageImpl.IS_CHANGEABLE, EPackageImpl.IS_COMPOSITE, EPackageImpl.IS_RESOLVE_PROXIES, !EPackageImpl.IS_UNSETTABLE, EPackageImpl.IS_UNIQUE, !EPackageImpl.IS_DERIVED, EPackageImpl.IS_ORDERED); initEReference(getDView_OwnedExtensions(), this.getMetaModelExtension(), null, "ownedExtensions", null, 0, 1, DView.class, !EPackageImpl.IS_TRANSIENT, !EPackageImpl.IS_VOLATILE, //$NON-NLS-1$ EPackageImpl.IS_CHANGEABLE, EPackageImpl.IS_COMPOSITE, EPackageImpl.IS_RESOLVE_PROXIES, !EPackageImpl.IS_UNSETTABLE, EPackageImpl.IS_UNIQUE, !EPackageImpl.IS_DERIVED, EPackageImpl.IS_ORDERED); - initEReference(getDView_Viewpoint(), theDescriptionPackage.getViewpoint(), null, "viewpoint", null, 1, 1, DView.class, !EPackageImpl.IS_TRANSIENT, !EPackageImpl.IS_VOLATILE, //$NON-NLS-1$ - EPackageImpl.IS_CHANGEABLE, !EPackageImpl.IS_COMPOSITE, EPackageImpl.IS_RESOLVE_PROXIES, !EPackageImpl.IS_UNSETTABLE, EPackageImpl.IS_UNIQUE, !EPackageImpl.IS_DERIVED, - EPackageImpl.IS_ORDERED); + initEReference(getDView_Models(), theEcorePackage.getEObject(), null, "models", null, 0, -1, DView.class, EPackageImpl.IS_TRANSIENT, EPackageImpl.IS_VOLATILE, !EPackageImpl.IS_CHANGEABLE, //$NON-NLS-1$ + !EPackageImpl.IS_COMPOSITE, EPackageImpl.IS_RESOLVE_PROXIES, !EPackageImpl.IS_UNSETTABLE, EPackageImpl.IS_UNIQUE, EPackageImpl.IS_DERIVED, EPackageImpl.IS_ORDERED); initEClass(metaModelExtensionEClass, MetaModelExtension.class, "MetaModelExtension", !EPackageImpl.IS_ABSTRACT, !EPackageImpl.IS_INTERFACE, EPackageImpl.IS_GENERATED_INSTANCE_CLASS); //$NON-NLS-1$ initEReference(getMetaModelExtension_ExtensionGroup(), theEcorePackage.getEObject(), null, "extensionGroup", null, 1, 1, MetaModelExtension.class, !EPackageImpl.IS_TRANSIENT, //$NON-NLS-1$ diff --git a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/util/ViewpointAdapterFactory.java b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/util/ViewpointAdapterFactory.java index 946f9df16a..94cbc5b7c9 100644 --- a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/util/ViewpointAdapterFactory.java +++ b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/util/ViewpointAdapterFactory.java @@ -28,7 +28,6 @@ import org.eclipse.sirius.viewpoint.DModel; import org.eclipse.sirius.viewpoint.DProject; import org.eclipse.sirius.viewpoint.DRefreshable; import org.eclipse.sirius.viewpoint.DRepresentation; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; import org.eclipse.sirius.viewpoint.DRepresentationElement; import org.eclipse.sirius.viewpoint.DResource; import org.eclipse.sirius.viewpoint.DResourceContainer; @@ -126,11 +125,6 @@ public class ViewpointAdapterFactory extends AdapterFactoryImpl { } @Override - public Adapter caseDRepresentationContainer(DRepresentationContainer object) { - return createDRepresentationContainerAdapter(); - } - - @Override public Adapter caseDSemanticDecorator(DSemanticDecorator object) { return createDSemanticDecoratorAdapter(); } @@ -338,22 +332,6 @@ public class ViewpointAdapterFactory extends AdapterFactoryImpl { /** * Creates a new adapter for an object of class ' - * {@link org.eclipse.sirius.viewpoint.DRepresentationContainer - * <em>DRepresentation Container</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.sirius.viewpoint.DRepresentationContainer - * @generated - */ - public Adapter createDRepresentationContainerAdapter() { - return null; - } - - /** - * Creates a new adapter for an object of class ' * {@link org.eclipse.sirius.viewpoint.DSemanticDecorator * <em>DSemantic Decorator</em>}'. <!-- begin-user-doc --> This default * implementation returns null so that we can easily ignore cases; it's diff --git a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/util/ViewpointSwitch.java b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/util/ViewpointSwitch.java index f3b7721aec..a102cc04b5 100644 --- a/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/util/ViewpointSwitch.java +++ b/plugins/org.eclipse.sirius/src-gen/org/eclipse/sirius/viewpoint/util/ViewpointSwitch.java @@ -28,7 +28,6 @@ import org.eclipse.sirius.viewpoint.DModel; import org.eclipse.sirius.viewpoint.DProject; import org.eclipse.sirius.viewpoint.DRefreshable; import org.eclipse.sirius.viewpoint.DRepresentation; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; import org.eclipse.sirius.viewpoint.DRepresentationElement; import org.eclipse.sirius.viewpoint.DResource; import org.eclipse.sirius.viewpoint.DResourceContainer; @@ -158,20 +157,6 @@ public class ViewpointSwitch<T> { } return result; } - case ViewpointPackage.DREPRESENTATION_CONTAINER: { - DRepresentationContainer dRepresentationContainer = (DRepresentationContainer) theEObject; - T result = caseDRepresentationContainer(dRepresentationContainer); - if (result == null) { - result = caseDView(dRepresentationContainer); - } - if (result == null) { - result = caseDRefreshable(dRepresentationContainer); - } - if (result == null) { - result = defaultCase(theEObject); - } - return result; - } case ViewpointPackage.DSEMANTIC_DECORATOR: { DSemanticDecorator dSemanticDecorator = (DSemanticDecorator) theEObject; T result = caseDSemanticDecorator(dSemanticDecorator); @@ -487,23 +472,6 @@ public class ViewpointSwitch<T> { /** * Returns the result of interpreting the object as an instance of ' - * <em>DRepresentation Container</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>DRepresentation Container</em>'. - * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) - * @generated - */ - public T caseDRepresentationContainer(DRepresentationContainer object) { - return null; - } - - /** - * Returns the result of interpreting the object as an instance of ' * <em>DSemantic Decorator</em>'. <!-- begin-user-doc --> This * implementation returns null; returning a non-null result will terminate * the switch. <!-- end-user-doc --> diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/control/SiriusControlCommand.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/control/SiriusControlCommand.java index 74a46b2684..8aac2aa84d 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/control/SiriusControlCommand.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/control/SiriusControlCommand.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013, 2015 THALES GLOBAL SERVICES. + * Copyright (c) 2013, 2016 THALES GLOBAL SERVICES. * 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 @@ -32,7 +32,6 @@ import org.eclipse.sirius.business.internal.command.control.ControlCommand; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.viewpoint.DAnalysis; import org.eclipse.sirius.viewpoint.DRepresentation; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; import org.eclipse.sirius.viewpoint.DSemanticDecorator; import org.eclipse.sirius.viewpoint.DView; import org.eclipse.sirius.viewpoint.Messages; @@ -198,15 +197,15 @@ public class SiriusControlCommand extends ControlCommand { // It is allowed to create an aird fragment with no representation Resource firstAird = session.getSessionResource(); newRepresentationsFile = firstAird.getResourceSet().createResource(representationsDestination); - // Creation of a DRepresentationContainer for each session + // Creation of a DView for each session // viewpoint. This way, we will be able to open the empty aird // fragment with the viewpoints properly set DAnalysis newDAnalysis = getDAnalysis(newRepresentationsFile); for (Viewpoint viewpoint : session.getSelectedViewpoints(false)) { - DRepresentationContainer createDRepresentationContainer = ViewpointFactory.eINSTANCE.createDRepresentationContainer(); - createDRepresentationContainer.setViewpoint(viewpoint); - newDAnalysis.getOwnedViews().add(createDRepresentationContainer); - newDAnalysis.getSelectedViews().add(createDRepresentationContainer); + DView createDView = ViewpointFactory.eINSTANCE.createDView(); + createDView.setViewpoint(viewpoint); + newDAnalysis.getOwnedViews().add(createDView); + newDAnalysis.getSelectedViews().add(createDView); } } else { @@ -238,7 +237,8 @@ public class SiriusControlCommand extends ControlCommand { * <UL> * <LI>If the controlled semantic element contains the first models of a * referencedAnalysis of the current analysis, then move this one in the new - * analysis (this corresponds to a fragmentation of intermediate level).</LI> + * analysis (this corresponds to a fragmentation of intermediate level). + * </LI> * <LI>Add the new analysis to the referencedAnalysis references</LI> * <UL> * </UL> @@ -300,9 +300,7 @@ public class SiriusControlCommand extends ControlCommand { for (EObject content : resource.getContents()) { if (content instanceof DAnalysis && !content.equals(analysisToIgnore)) { for (final DView view : ((DAnalysis) content).getOwnedViews()) { - if (view instanceof DRepresentationContainer) { - DAnalysisSessionHelper.updateModelsReferences((DAnalysis) content, Iterators.filter(((DRepresentationContainer) view).eAllContents(), DSemanticDecorator.class)); - } + DAnalysisSessionHelper.updateModelsReferences((DAnalysis) content, Iterators.filter(view.eAllContents(), DSemanticDecorator.class)); } } } diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/repair/SiriusRepairProcess.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/repair/SiriusRepairProcess.java index dcc2b1b69a..55d9cd3552 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/repair/SiriusRepairProcess.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/repair/SiriusRepairProcess.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2012, 2015 THALES GLOBAL SERVICES. + * Copyright (c) 2012, 2016 THALES GLOBAL SERVICES. * 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 @@ -57,7 +57,6 @@ import org.eclipse.sirius.common.tools.api.util.ResourceUtil; import org.eclipse.sirius.ecore.extender.tool.api.ModelUtils; import org.eclipse.sirius.viewpoint.DAnalysis; import org.eclipse.sirius.viewpoint.DRepresentation; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; import org.eclipse.sirius.viewpoint.DSemanticDecorator; import org.eclipse.sirius.viewpoint.DView; import org.eclipse.sirius.viewpoint.Messages; @@ -426,7 +425,7 @@ public class SiriusRepairProcess { * @param view * {@link DView} to inform */ - private void informModel(final DRepresentationContainer view) { + private void informModel(final DView view) { if (view.eContainer() instanceof DAnalysis) { DAnalysis analysis = (DAnalysis) view.eContainer(); // Add all semantic root elements pointed by the target of all @@ -568,9 +567,7 @@ public class SiriusRepairProcess { private void handleView(final DView view) { informViewpoint(view); // Compute the models references before cleaning the representation. - if (view instanceof DRepresentationContainer) { - informModel((DRepresentationContainer) view); - } + informModel(view); final List<DRepresentation> representationsToRemove = new LinkedList<DRepresentation>(); for (final IRepairParticipant participant : this.repairParticipants) { diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/danalysis/DAnalysisSessionHelper.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/danalysis/DAnalysisSessionHelper.java index 6bcadf2130..e7cead9b98 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/danalysis/DAnalysisSessionHelper.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/api/session/danalysis/DAnalysisSessionHelper.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2016 THALES GLOBAL SERVICES. * 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 @@ -31,7 +31,6 @@ import org.eclipse.sirius.business.internal.movida.ViewpointSelection; import org.eclipse.sirius.ext.base.Option; import org.eclipse.sirius.viewpoint.DAnalysis; import org.eclipse.sirius.viewpoint.DRepresentation; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; import org.eclipse.sirius.viewpoint.DSemanticDecorator; import org.eclipse.sirius.viewpoint.DView; import org.eclipse.sirius.viewpoint.ViewpointFactory; @@ -130,15 +129,15 @@ public final class DAnalysisSessionHelper { * the selector * @return the free container if found or <code>null</code> otherwise. */ - public static DRepresentationContainer findContainer(final EObject semanticRoot, final Viewpoint viewpoint, final Collection<DAnalysis> all, final DAnalysisSelector analysisSelector) { + public static DView findContainer(final EObject semanticRoot, final Viewpoint viewpoint, final Collection<DAnalysis> all, final DAnalysisSelector analysisSelector) { - final Collection<DRepresentationContainer> containers = getContainers(all, viewpoint); + final Collection<DView> containers = getContainers(all, viewpoint); if (containers.isEmpty()) { return null; } final Collection<DAnalysis> candidates = new ArrayList<DAnalysis>(); - for (final DRepresentationContainer container : containers) { + for (final DView container : containers) { if (container.eContainer() instanceof DAnalysis) { candidates.add((DAnalysis) container.eContainer()); } @@ -147,9 +146,9 @@ public final class DAnalysisSessionHelper { // The first DAnalysis candidates must be the main DAnalysis final DAnalysis analysis = candidates.iterator().next(); - DRepresentationContainer freeContainer = null; + DView freeContainer = null; - for (final DRepresentationContainer container : containers) { + for (final DView container : containers) { if (container.eContainer() == analysis) { freeContainer = container; break; @@ -175,17 +174,17 @@ public final class DAnalysisSessionHelper { * the added representation. * @return the free container if found or <code>null</code> otherwise. */ - public static DRepresentationContainer findContainerForAddedRepresentation(final EObject semanticRoot, final Viewpoint viewpoint, final Collection<DAnalysis> all, - final DAnalysisSelector analysisSelector, final DRepresentation representation) { + public static DView findContainerForAddedRepresentation(final EObject semanticRoot, final Viewpoint viewpoint, final Collection<DAnalysis> all, final DAnalysisSelector analysisSelector, + final DRepresentation representation) { - final Collection<DRepresentationContainer> containers = getContainers(all, viewpoint); + final Collection<DView> containers = getContainers(all, viewpoint); if (containers.isEmpty()) { return null; } final Collection<DAnalysis> candidates = Sets.newLinkedHashSet(); - for (final DRepresentationContainer container : containers) { + for (final DView container : containers) { if (container.eContainer() instanceof DAnalysis) { candidates.add((DAnalysis) container.eContainer()); } @@ -193,16 +192,16 @@ public final class DAnalysisSessionHelper { final DAnalysis analysis = selectAnalysis(viewpoint, candidates, analysisSelector, representation); - DRepresentationContainer freeContainer = null; + DView freeContainer = null; - for (final DRepresentationContainer container : containers) { + for (final DView container : containers) { if (container.eContainer() == analysis) { freeContainer = container; break; } } - // if the DRepresentationContainer of the selected DAnalysis does not + // if the DView of the selected DAnalysis does not // exist yet, and if it is located on a CDORepository if (freeContainer == null && URIQuery.CDO_URI_SCHEME.equals(analysis.eResource().getURI().scheme())) { // We create this representation container @@ -221,7 +220,7 @@ public final class DAnalysisSessionHelper { * the added representation. * @return the free container if found or <code>null</code> otherwise. */ - public static DRepresentationContainer findContainerForAddedRepresentation(DAnalysis analysis, final DRepresentation representation) { + public static DView findContainerForAddedRepresentation(DAnalysis analysis, final DRepresentation representation) { final Viewpoint viewpoint = new RepresentationDescriptionQuery(DialectManager.INSTANCE.getDescription(representation)).getParentViewpoint(); return getContainer(analysis, viewpoint); } @@ -238,15 +237,15 @@ public final class DAnalysisSessionHelper { * @return the free container if found or <code>null</code> otherwise. * @since 0.9.0 */ - public static DRepresentationContainer findFreeContainer(final Viewpoint viewpoint, final Collection<DAnalysis> analyses, final DAnalysisSelector analysisSelector) { + public static DView findFreeContainer(final Viewpoint viewpoint, final Collection<DAnalysis> analyses, final DAnalysisSelector analysisSelector) { - final Collection<DRepresentationContainer> views = getContainers(analyses, null); + final Collection<DView> views = getContainers(analyses, null); if (views.isEmpty()) { return null; } final Collection<DAnalysis> candidates = new ArrayList<DAnalysis>(); - for (final DRepresentationContainer view : views) { + for (final DView view : views) { if (view.eContainer() instanceof DAnalysis) { candidates.add((DAnalysis) view.eContainer()); } @@ -255,9 +254,9 @@ public final class DAnalysisSessionHelper { // The first DAnalysis candidates must be the main DAnalysis final DAnalysis analysis = candidates.iterator().next(); - DRepresentationContainer freeView = null; + DView freeView = null; - for (final DRepresentationContainer view : views) { + for (final DView view : views) { if (view.eContainer() == analysis) { freeView = view; break; @@ -282,16 +281,16 @@ public final class DAnalysisSessionHelper { * the added representation. * @return the free container if found or <code>null</code> otherwise. */ - public static DRepresentationContainer findFreeContainerForAddedRepresentation(final Viewpoint viewpoint, final EObject semantic, final Collection<DAnalysis> analyses, - final DAnalysisSelector analysisSelector, final DRepresentation representation) { + public static DView findFreeContainerForAddedRepresentation(final Viewpoint viewpoint, final EObject semantic, final Collection<DAnalysis> analyses, final DAnalysisSelector analysisSelector, + final DRepresentation representation) { - final Collection<DRepresentationContainer> views = getContainers(analyses, null); + final Collection<DView> views = getContainers(analyses, null); if (views.isEmpty()) { return null; } final Collection<DAnalysis> candidates = new ArrayList<DAnalysis>(); - for (final DRepresentationContainer view : views) { + for (final DView view : views) { if (view.eContainer() instanceof DAnalysis) { candidates.add((DAnalysis) view.eContainer()); } @@ -299,9 +298,9 @@ public final class DAnalysisSessionHelper { final DAnalysis analysis = DAnalysisSessionHelper.selectAnalysis(viewpoint, candidates, analysisSelector, representation); - DRepresentationContainer freeView = null; + DView freeView = null; - for (final DRepresentationContainer view : views) { + for (final DView view : views) { if (view.eContainer() == analysis) { freeView = view; break; @@ -402,11 +401,11 @@ public final class DAnalysisSessionHelper { * selected viewpoint * @return all representation container found */ - private static Collection<DRepresentationContainer> getContainers(Iterable<DAnalysis> allAnalysis, Viewpoint viewpoint) { - final List<DRepresentationContainer> containers = new ArrayList<DRepresentationContainer>(); + private static Collection<DView> getContainers(Iterable<DAnalysis> allAnalysis, Viewpoint viewpoint) { + final List<DView> containers = new ArrayList<DView>(); for (DAnalysis analysis : allAnalysis) { - DRepresentationContainer container = getContainer(analysis, viewpoint); + DView container = getContainer(analysis, viewpoint); if (container != null) { containers.add(container); } @@ -424,11 +423,11 @@ public final class DAnalysisSessionHelper { * selected viewpoint * @return the first representation container found */ - private static DRepresentationContainer getContainer(DAnalysis analysis, Viewpoint viewpoint) { - DRepresentationContainer result = null; + private static DView getContainer(DAnalysis analysis, Viewpoint viewpoint) { + DView result = null; for (final DView view : analysis.getOwnedViews()) { - if (view instanceof DRepresentationContainer && viewpoint == view.getViewpoint()) { - result = (DRepresentationContainer) view; + if (view instanceof DView && viewpoint == view.getViewpoint()) { + result = (DView) view; break; } } @@ -445,8 +444,8 @@ public final class DAnalysisSessionHelper { * selected viewpoint * @return the new representation container */ - private static DRepresentationContainer createContainer(DAnalysis analysis, Viewpoint viewpoint) { - DRepresentationContainer newContainer = ViewpointFactory.eINSTANCE.createDRepresentationContainer(); + private static DView createContainer(DAnalysis analysis, Viewpoint viewpoint) { + DView newContainer = ViewpointFactory.eINSTANCE.createDView(); newContainer.setViewpoint(viewpoint); analysis.getOwnedViews().add(newContainer); analysis.getSelectedViews().add(newContainer); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/metamodel/description/spec/MetamodelExtensionSettingSpec.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/metamodel/description/spec/MetamodelExtensionSettingSpec.java index b96f13c10f..6df289d9b3 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/metamodel/description/spec/MetamodelExtensionSettingSpec.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/metamodel/description/spec/MetamodelExtensionSettingSpec.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2008 THALES GLOBAL SERVICES. + * Copyright (c) 2008, 2016 THALES GLOBAL SERVICES. * 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 @@ -11,7 +11,7 @@ package org.eclipse.sirius.business.internal.metamodel.description.spec; import org.eclipse.emf.ecore.EObject; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; +import org.eclipse.sirius.viewpoint.DView; import org.eclipse.sirius.viewpoint.MetaModelExtension; import org.eclipse.sirius.viewpoint.SiriusPlugin; import org.eclipse.sirius.viewpoint.ViewpointFactory; @@ -27,9 +27,9 @@ public class MetamodelExtensionSettingSpec extends MetamodelExtensionSettingImpl /** * {@inheritDoc} * - * @see org.eclipse.sirius.description.impl.SiriusOperationImpl#updateAnalysis(org.eclipse.sirius.viewpoint.DRepresentationContainer) + * @see org.eclipse.sirius.description.impl.SiriusOperationImpl#updateAnalysis(org.eclipse.sirius.viewpoint.DView) */ - public void updateAnalysis(final DRepresentationContainer analysis) { + public void updateAnalysis(final DView analysis) { if (getExtensionGroup() != null && SiriusPlugin.getDefault().getModelAccessorRegistry().getModelAccessor(analysis).eInstanceOf(getExtensionGroup(), "ExtensionGroup")) { //$NON-NLS-1$ final EObject group = getExtensionGroup(); final MetaModelExtension extension = ViewpointFactory.eINSTANCE.createMetaModelExtension(); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/metamodel/spec/DRepresentationContainerSpec.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/metamodel/spec/DViewSpec.java index 730b8484a8..3ab1f97bcf 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/metamodel/spec/DRepresentationContainerSpec.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/metamodel/spec/DViewSpec.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2008 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2016 THALES GLOBAL SERVICES. * 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 @@ -25,14 +25,14 @@ import org.eclipse.sirius.viewpoint.DRepresentation; import org.eclipse.sirius.viewpoint.DSemanticDecorator; import org.eclipse.sirius.viewpoint.SiriusPlugin; import org.eclipse.sirius.viewpoint.ViewpointPackage; -import org.eclipse.sirius.viewpoint.impl.DRepresentationContainerImpl; +import org.eclipse.sirius.viewpoint.impl.DViewImpl; /** - * Implementation of {@link DRepresentationContainerSpec}. + * Implementation of {@link DViewSpec}. * * @author cbrun */ -public class DRepresentationContainerSpec extends DRepresentationContainerImpl { +public class DViewSpec extends DViewImpl { /** * Refresh the functionnal analysis. @@ -79,7 +79,7 @@ public class DRepresentationContainerSpec extends DRepresentationContainerImpl { models.add(getModel(((DSemanticDecorator) representation).getTarget())); } } - return new EcoreEList.UnmodifiableEList<EObject>(eInternalContainer(), ViewpointPackage.eINSTANCE.getDRepresentationContainer_Models(), models.size(), models.toArray()); + return new EcoreEList.UnmodifiableEList<EObject>(eInternalContainer(), ViewpointPackage.eINSTANCE.getDView_Models(), models.size(), models.toArray()); } private EObject getModel(final EObject target) { diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java index 3989c259ac..b5e09abe86 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2013, 2016 THALES GLOBAL SERVICES, Obeo + * Copyright (c) 2013, 2016 THALES GLOBAL SERVICES 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 @@ -88,7 +88,6 @@ import org.eclipse.sirius.tools.internal.interpreter.ODesignGenericInterpreter; import org.eclipse.sirius.tools.internal.resource.ResourceSetUtil; import org.eclipse.sirius.viewpoint.DAnalysis; import org.eclipse.sirius.viewpoint.DRepresentation; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; import org.eclipse.sirius.viewpoint.DSemanticDecorator; import org.eclipse.sirius.viewpoint.DView; import org.eclipse.sirius.viewpoint.Messages; @@ -459,8 +458,8 @@ public class DAnalysisSessionImpl extends DAnalysisSessionEObjectImpl implements throw new LockedInstanceException(representation); } final EObject semantic; - if (representation.eContainer() instanceof DRepresentationContainer && !((DRepresentationContainer) representation.eContainer()).getModels().isEmpty()) { - semantic = ((DRepresentationContainer) representation.eContainer()).getModels().iterator().next(); + if (representation.eContainer() instanceof DView && !((DView) representation.eContainer()).getModels().isEmpty()) { + semantic = ((DView) representation.eContainer()).getModels().iterator().next(); } else { semantic = null; } @@ -1360,25 +1359,25 @@ public class DAnalysisSessionImpl extends DAnalysisSessionEObjectImpl implements } /** - * Get collection of available {@link DRepresentationContainer} for the + * Get collection of available {@link DView} for the * {@link RepresentationDescription}. * * @param representationDescription * the representation description. * @return available representation containers */ - public Collection<DRepresentationContainer> getAvailableRepresentationContainers(RepresentationDescription representationDescription) { + public Collection<DView> getAvailableRepresentationContainers(RepresentationDescription representationDescription) { final Viewpoint viewpoint = new RepresentationDescriptionQuery(representationDescription).getParentViewpoint(); Collection<DAnalysis> allAnalysis = allAnalyses(); - final List<DRepresentationContainer> containers = new ArrayList<DRepresentationContainer>(); + final List<DView> containers = new ArrayList<DView>(); for (DAnalysis analysis : allAnalysis) { - DRepresentationContainer container = null; + DView container = null; for (final DView view : analysis.getOwnedViews()) { - if (view instanceof DRepresentationContainer && viewpoint == view.getViewpoint() && view.eContainer() instanceof DAnalysis) { - container = (DRepresentationContainer) view; + if (view instanceof DView && viewpoint == view.getViewpoint() && view.eContainer() instanceof DAnalysis) { + container = (DView) view; break; } } // for diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionServicesImpl.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionServicesImpl.java index 18048ec824..afced762c1 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionServicesImpl.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionServicesImpl.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2010 THALES GLOBAL SERVICES. + * Copyright (c) 2007, 2016 THALES GLOBAL SERVICES. * 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 @@ -35,7 +35,6 @@ import org.eclipse.sirius.viewpoint.DAnalysis; import org.eclipse.sirius.viewpoint.DAnalysisCustomData; import org.eclipse.sirius.viewpoint.DFeatureExtension; import org.eclipse.sirius.viewpoint.DRepresentation; -import org.eclipse.sirius.viewpoint.DRepresentationContainer; import org.eclipse.sirius.viewpoint.DSemanticDecorator; import org.eclipse.sirius.viewpoint.DView; import org.eclipse.sirius.viewpoint.SiriusPlugin; @@ -316,7 +315,7 @@ public class DAnalysisSessionServicesImpl implements SessionService, DAnalysisSe private void addRepresentationToContainer(final DRepresentation representation, final Resource res) { final EObject semanticRoot = res.getContents().iterator().next(); final Viewpoint viewpoint = new RepresentationDescriptionQuery(DialectManager.INSTANCE.getDescription(representation)).getParentViewpoint(); - DRepresentationContainer existingContainer = DAnalysisSessionHelper.findContainerForAddedRepresentation(semanticRoot, viewpoint, session.allAnalyses(), analysisSelector, representation); + DView existingContainer = DAnalysisSessionHelper.findContainerForAddedRepresentation(semanticRoot, viewpoint, session.allAnalyses(), analysisSelector, representation); if (existingContainer == null) { existingContainer = DAnalysisSessionHelper.findFreeContainerForAddedRepresentation(viewpoint, semanticRoot, session.getAnalyses(), analysisSelector, representation); @@ -325,7 +324,7 @@ public class DAnalysisSessionServicesImpl implements SessionService, DAnalysisSe } } if (existingContainer == null) { - existingContainer = ViewpointFactory.eINSTANCE.createDRepresentationContainer(); + existingContainer = ViewpointFactory.eINSTANCE.createDView(); existingContainer.setViewpoint(viewpoint); final DAnalysis analysis = DAnalysisSessionHelper.selectAnalysis(viewpoint, session.allAnalyses(), analysisSelector, representation); analysis.getOwnedViews().add(existingContainer); diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DViewOperations.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DViewOperations.java index 8dee48b1d1..409aa51a57 100644 --- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DViewOperations.java +++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DViewOperations.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2007, 2015 THALES GLOBAL SERVICES, Obeo + * Copyright (c) 2007, 2016 THALES GLOBAL SERVICES, Obeo * 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 @@ -232,7 +232,7 @@ final class DViewOperations { if (orphan != null) { return orphan; } else { - return ViewpointFactory.eINSTANCE.createDRepresentationContainer(); + return ViewpointFactory.eINSTANCE.createDView(); } } |
