Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaged Elaasar2017-06-01 19:18:42 +0000
committerFlorian Noyrit2017-06-06 15:05:32 +0000
commit17f500ad54d8dc9362b31a737ec19cd24627f297 (patch)
tree7afbc1ea66c80c935f0080f283f784ed99cc3720 /plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common
parent273dd997e6462e2e1709e72dadb311460a60725c (diff)
downloadorg.eclipse.papyrus-17f500ad54d8dc9362b31a737ec19cd24627f297.tar.gz
org.eclipse.papyrus-17f500ad54d8dc9362b31a737ec19cd24627f297.tar.xz
org.eclipse.papyrus-17f500ad54d8dc9362b31a737ec19cd24627f297.zip
Bug 516901 - Replaced references to Architecture model elements by their
unique ids instead. This will avoid such elements being loaded in user model resource sets. Also, refactored the Architecture metamodel by moving the id and icon attributes to ADElement so that all elements in the model have them. This also include refactoring of the uml.architecture model to give ids to various diagrams and tables. Also, changed the UMLDiagramReconciler_1_3 to put the diagramKindId attribute instead of the diagramKind reference in the PapyrusDiagramStyle. Also, change the UMLTableReconciler_1_3 to a) test the proxy URI of the old prototype instead of name (since the legacy viewpoint configuration models were deleted earlier resulting in proxies) and to set the tableKindId instead of changing the prototype (which is now deprecated). Change-Id: I99413c1dd6daeaf395fc8c70b8b7ed2e0573acd1 Signed-off-by: Maged Elaasar <melaasar@gmail.com>
Diffstat (limited to 'plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common')
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/PolicyDefinedTableHandler.java2
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableCommandHelper.java7
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/modelresource/PapyrusNattableModel.java21
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/internal/common/commands/CreateAndOpenTableEditorCommand.java2
4 files changed, 10 insertions, 22 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/PolicyDefinedTableHandler.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/PolicyDefinedTableHandler.java
index 8fbbdc8f8b5..4e30a69d92c 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/PolicyDefinedTableHandler.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/handlers/PolicyDefinedTableHandler.java
@@ -70,7 +70,7 @@ public class PolicyDefinedTableHandler extends CreateNatTableEditorHandler {
Table table = PolicyDefinedTableHandler.this.doExecute(serviceRegistry, name, this.description);
TableVersioningUtils.stampCurrentVersion(table);
table.setOwner(context);
- table.setPrototype(prototype.getRepresentationKind());
+ table.setTableKindId(prototype.getRepresentationKind().getId());
} catch (Exception ex) {
Activator.log.error(ex);
}
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableCommandHelper.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableCommandHelper.java
index 91c65dc7534..c5f111d0082 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableCommandHelper.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/helper/TableCommandHelper.java
@@ -18,7 +18,9 @@ import java.util.Map;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
+import org.eclipse.papyrus.infra.architecture.ArchitectureDomainManager;
import org.eclipse.papyrus.infra.architecture.representation.PapyrusRepresentationKind;
+import org.eclipse.papyrus.infra.core.architecture.RepresentationKind;
import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
import org.eclipse.papyrus.infra.nattable.representation.PapyrusTable;
import org.eclipse.papyrus.infra.nattable.representation.RepresentationPackage;
@@ -66,7 +68,7 @@ public class TableCommandHelper implements IViewTypeHelper {
return false;
}
Table table = (Table) view;
- return (table.getPrototype() instanceof PapyrusTable);
+ return (table.getTableKindId() != null);
}
@Override
@@ -75,7 +77,8 @@ public class TableCommandHelper implements IViewTypeHelper {
return null;
}
PolicyChecker checker = PolicyChecker.getFor(view);
- PapyrusTable repKind = (PapyrusTable) ((Table)view).getPrototype();
+ ArchitectureDomainManager manager = ArchitectureDomainManager.getInstance();
+ PapyrusTable repKind = (PapyrusTable) manager.getRepresentationKindById(((Table)view).getTableKindId());
if (checker.isInViewpoint(repKind))
return getPrototypeFor(repKind);
return ViewPrototype.UNAVAILABLE_VIEW;
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/modelresource/PapyrusNattableModel.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/modelresource/PapyrusNattableModel.java
index c5451e99276..3edb2c3e985 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/modelresource/PapyrusNattableModel.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/modelresource/PapyrusNattableModel.java
@@ -29,7 +29,6 @@ import org.eclipse.papyrus.infra.core.resource.BadArgumentExcetion;
import org.eclipse.papyrus.infra.core.resource.IModel;
import org.eclipse.papyrus.infra.core.resource.ModelSet;
import org.eclipse.papyrus.infra.core.resource.NotFoundException;
-import org.eclipse.papyrus.infra.nattable.common.helper.TableViewPrototype;
import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
@@ -223,16 +222,8 @@ public class PapyrusNattableModel extends AbstractModelWithSharedResource<Table>
for (EObject element : current.getContents()) {
if (element instanceof Table) {
Table table = (Table) element;
- EObject prototype = table.getPrototype();
- if (prototype instanceof TableViewPrototype) {
- final String implementationID = ((TableViewPrototype) prototype).getImplementation();
- if (tableType.equals(implementationID)) {
- matchingTables.add(table);
- }
- } else {
- if (tableType.equals(table.getTableConfiguration().getType())) {
- matchingTables.add(table);
- }
+ if (tableType.equals(table.getTableConfiguration().getType())) {
+ matchingTables.add(table);
}
}
}
@@ -313,13 +304,7 @@ public class PapyrusNattableModel extends AbstractModelWithSharedResource<Table>
matchName = tableName.equals(table.getName());
}
if (tableType != null) {
- EObject prototype = table.getPrototype();
- if (prototype instanceof TableViewPrototype) {
- final String implementationID = ((TableViewPrototype) prototype).getImplementation();
- matchType = tableType.equals(implementationID);
- } else {
- matchType = tableType.equals(table.getTableConfiguration().getType());
- }
+ matchType = tableType.equals(table.getTableConfiguration().getType());
}
if (tableOwner != null) {
matchOwner = tableOwner.equals(table.getOwner());
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/internal/common/commands/CreateAndOpenTableEditorCommand.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/internal/common/commands/CreateAndOpenTableEditorCommand.java
index 182dd99ec1e..4187ad3f85e 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/internal/common/commands/CreateAndOpenTableEditorCommand.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/internal/common/commands/CreateAndOpenTableEditorCommand.java
@@ -227,7 +227,7 @@ public class CreateAndOpenTableEditorCommand extends RecordingCommand {
} else {
table.setOwner(this.owner);
}
- table.setPrototype(tableViewPrototype.getRepresentationKind());
+ table.setTableKindId(tableViewPrototype.getRepresentationKind().getId());
if (this.pageManager != null) {
this.pageManager.openPage(table);
}

Back to the top