Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPauline DEVILLE2019-09-27 11:43:49 +0000
committervincent lorenzo2019-10-07 12:53:11 +0000
commit14d6cfe11a63baf87d420ef1a0f35eda84269285 (patch)
tree67500486b33cec76f301b40bb9d8ac57545544d5 /plugins/infra
parent7a225a39cc9f7cb3a001956cc4d744adaf4d881e (diff)
downloadorg.eclipse.papyrus-14d6cfe11a63baf87d420ef1a0f35eda84269285.tar.gz
org.eclipse.papyrus-14d6cfe11a63baf87d420ef1a0f35eda84269285.tar.xz
org.eclipse.papyrus-14d6cfe11a63baf87d420ef1a0f35eda84269285.zip
Bug 551558 - [Table] Test build is failing since the TableReconciler is
incorrect * Fix table reconciler * Update nattable model tests to be build with the architecture framework Change-Id: I3e25fd720d0a34e0ba1c7e3f7acabdb1bccbecd5 Signed-off-by: Pauline DEVILLE <pauline.deville@cea.fr>
Diffstat (limited to 'plugins/infra')
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/utils/TableUtil.java79
1 files changed, 42 insertions, 37 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/utils/TableUtil.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/utils/TableUtil.java
index 71678527970..80563ce2f2e 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/utils/TableUtil.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.common/src/org/eclipse/papyrus/infra/nattable/common/utils/TableUtil.java
@@ -11,6 +11,8 @@
* Contributors:
* Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
* Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Bug 550568
+ * Pauline DEVILLE (CEA LIST) pauline.deville@cea.fr - Bug 551558
+ *
*****************************************************************************/
package org.eclipse.papyrus.infra.nattable.common.utils;
@@ -162,53 +164,56 @@ public class TableUtil {
ArchitectureDomainManager manager = ArchitectureDomainManager.getInstance();
PapyrusTable repKind = null;
String tableKindId = table.getTableKindId();
- if (manager.getRepresentationKindById(tableKindId) instanceof PapyrusTable) {
- repKind = (PapyrusTable) manager.getRepresentationKindById(tableKindId);
- } else {
- Activator.log.info("Unexpected table kind: " + tableKindId + " Your notation file might be broken or created with a previous version of the architecture framework."); //$NON-NLS-1$ //$NON-NLS-2$
- }
-
- // Check if the selected viewpoint contains the diagram model kind
- if (repKind != null) {
-
- if (!checkViewpoint || checker.isInViewpoint(repKind)) {
- return ViewPrototype.get(repKind);
+ if (manager.getRepresentationKindById(tableKindId) != null) {
+ if (manager.getRepresentationKindById(tableKindId) instanceof PapyrusTable) {
+ repKind = (PapyrusTable) manager.getRepresentationKindById(tableKindId);
+ } else {
+ Activator.log.info("Unexpected table kind: " + tableKindId + " Your notation file might be broken or created with a previous version of the architecture framework."); //$NON-NLS-1$ //$NON-NLS-2$
}
- // Check if the selected viewpoint contains an ancestor of the diagram model kind
- PapyrusRepresentationKind tableParentView = repKind.getParent();
- while (tableParentView != null && !checker.isInViewpoint(tableParentView)) {
- tableParentView = tableParentView.getParent();
- }
- if (tableParentView != null) {
- return ViewPrototype.get(tableParentView);
- }
+ // Check if the selected viewpoint contains the diagram model kind
+ if (repKind != null) {
- // Check if the selected viewpoint contains a descendant of the diagram model kind
- String tableConfigName = repKind.getName();
- if (tableConfigName != null) { // the model kind name is used as a "semantic" key to test equality
- for (final MergedArchitectureViewpoint viewpoint : checker.getViewpoints()) {
- for (final RepresentationKind representationKind : viewpoint.getRepresentationKinds()) {
- if (representationKind instanceof PapyrusRepresentationKind) {
- PapyrusRepresentationKind papyrusRepresentationKind = (PapyrusRepresentationKind) representationKind;
+ if (!checkViewpoint || checker.isInViewpoint(repKind)) {
+ return ViewPrototype.get(repKind);
+ }
- if (tableConfigName.equals(papyrusRepresentationKind.getName())) {
- ViewPrototype.get(papyrusRepresentationKind);
- }
+ // Check if the selected viewpoint contains an ancestor of the diagram model kind
+ PapyrusRepresentationKind tableParentView = repKind.getParent();
+ while (tableParentView != null && !checker.isInViewpoint(tableParentView)) {
+ tableParentView = tableParentView.getParent();
+ }
+ if (tableParentView != null) {
+ return ViewPrototype.get(tableParentView);
+ }
- PapyrusRepresentationKind parentPapyrusRepresentationKind = papyrusRepresentationKind.getParent();
- while (parentPapyrusRepresentationKind != null && !tableConfigName.equals(parentPapyrusRepresentationKind.getName())) {
- parentPapyrusRepresentationKind = parentPapyrusRepresentationKind.getParent();
- }
- if (parentPapyrusRepresentationKind != null) {
- return ViewPrototype.get(papyrusRepresentationKind);
+ // Check if the selected viewpoint contains a descendant of the diagram model kind
+ String tableConfigName = repKind.getName();
+ if (tableConfigName != null) { // the model kind name is used as a "semantic" key to test equality
+ for (final MergedArchitectureViewpoint viewpoint : checker.getViewpoints()) {
+ for (final RepresentationKind representationKind : viewpoint.getRepresentationKinds()) {
+ if (representationKind instanceof PapyrusRepresentationKind) {
+ PapyrusRepresentationKind papyrusRepresentationKind = (PapyrusRepresentationKind) representationKind;
+
+ if (tableConfigName.equals(papyrusRepresentationKind.getName())) {
+ ViewPrototype.get(papyrusRepresentationKind);
+ }
+
+ PapyrusRepresentationKind parentPapyrusRepresentationKind = papyrusRepresentationKind.getParent();
+ while (parentPapyrusRepresentationKind != null && !tableConfigName.equals(parentPapyrusRepresentationKind.getName())) {
+ parentPapyrusRepresentationKind = parentPapyrusRepresentationKind.getParent();
+ }
+ if (parentPapyrusRepresentationKind != null) {
+ return ViewPrototype.get(papyrusRepresentationKind);
+ }
}
}
}
}
- }
+ }
+ return ViewPrototype.get(checker, table.getTableKindId(), table.getOwner(), table.getContext());
}
- return ViewPrototype.get(checker, table.getTableKindId(), table.getOwner(), table.getContext());
+ return ViewPrototype.get(checker, table.getTableConfiguration().getType(), table.getOwner(), table.getContext());
}
}

Back to the top