From 4f2ca938abf46ea689b454493f6dd36e6f98fb01 Mon Sep 17 00:00:00 2001 From: Asma Smaoui Date: Mon, 31 May 2021 10:15:57 +0200 Subject: Bug 573840 - [Properties] empty line table displayed in the Properties view is not linked to AF, KindId is null to be able to display an empty line table in the Properties view, we should not rely on the KindId property of the table. the table config is not always referenced in the AF. use the typeID instead Change-Id: Ie25f17fbea3b5787d3a9db2af1af7b6dc343fe4f Signed-off-by: Asma Smaoui --- .../resources/uml.architecture | 2 +- .../eclipse/papyrus/example/uml/nattable/empty/line/Activator.java | 5 +++-- .../empty/line/managers/cell/CustomEmptyAxisCellManager.java | 5 +++-- .../empty/line/providers/CustomRowHeaderLabelProvider.java | 5 +++-- .../papyrus/uml/properties/widgets/NattablePropertyEditor.java | 7 ++++--- 5 files changed, 14 insertions(+), 10 deletions(-) diff --git a/examples/uml/org.eclipse.papyrus.example.uml.nattable.empty.line/resources/uml.architecture b/examples/uml/org.eclipse.papyrus.example.uml.nattable.empty.line/resources/uml.architecture index fba163a48f0..4ee6fcd3141 100755 --- a/examples/uml/org.eclipse.papyrus.example.uml.nattable.empty.line/resources/uml.architecture +++ b/examples/uml/org.eclipse.papyrus.example.uml.nattable.empty.line/resources/uml.architecture @@ -32,7 +32,7 @@ - + diff --git a/examples/uml/org.eclipse.papyrus.example.uml.nattable.empty.line/src/org/eclipse/papyrus/example/uml/nattable/empty/line/Activator.java b/examples/uml/org.eclipse.papyrus.example.uml.nattable.empty.line/src/org/eclipse/papyrus/example/uml/nattable/empty/line/Activator.java index 24fe93e517c..9f36529c049 100755 --- a/examples/uml/org.eclipse.papyrus.example.uml.nattable.empty.line/src/org/eclipse/papyrus/example/uml/nattable/empty/line/Activator.java +++ b/examples/uml/org.eclipse.papyrus.example.uml.nattable.empty.line/src/org/eclipse/papyrus/example/uml/nattable/empty/line/Activator.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2020 CEA LIST + * Copyright (c) 2020,2021 CEA LIST * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -10,6 +10,7 @@ * * Contributors: * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation + * Asma SMAOUI (CEA LIST) - bug 573840 *****************************************************************************/ package org.eclipse.papyrus.example.uml.nattable.empty.line; @@ -27,7 +28,7 @@ public class Activator extends AbstractUIPlugin { public static final String TABLE_TYPE = "ExampleGenericTreeTableEmptyLines";//$NON-NLS-1$ - public static final String TABLE_KIND_ID = "org.eclipse.papyrus.uml.table.genericTree.empty.lines"; //$NON-NLS-1$ + // public static final String TABLE_KIND_ID = "org.eclipse.papyrus.uml.table.genericTree.empty.lines"; //$NON-NLS-1$ // The shared instance private static Activator plugin; diff --git a/examples/uml/org.eclipse.papyrus.example.uml.nattable.empty.line/src/org/eclipse/papyrus/example/uml/nattable/empty/line/managers/cell/CustomEmptyAxisCellManager.java b/examples/uml/org.eclipse.papyrus.example.uml.nattable.empty.line/src/org/eclipse/papyrus/example/uml/nattable/empty/line/managers/cell/CustomEmptyAxisCellManager.java index dceeda26c2f..1bf362c227a 100755 --- a/examples/uml/org.eclipse.papyrus.example.uml.nattable.empty.line/src/org/eclipse/papyrus/example/uml/nattable/empty/line/managers/cell/CustomEmptyAxisCellManager.java +++ b/examples/uml/org.eclipse.papyrus.example.uml.nattable.empty.line/src/org/eclipse/papyrus/example/uml/nattable/empty/line/managers/cell/CustomEmptyAxisCellManager.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2020 CEA LIST + * Copyright (c) 2020,2021 CEA LIST * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -10,6 +10,7 @@ * * Contributors: * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation + * Asma SMAOUI (CEA LIST) - bug 573840 *****************************************************************************/ package org.eclipse.papyrus.example.uml.nattable.empty.line.managers.cell; @@ -29,7 +30,7 @@ public class CustomEmptyAxisCellManager extends AbstractEmptyAxisCellManager { * @param tableKindId */ public CustomEmptyAxisCellManager() { - super(Activator.TABLE_KIND_ID); + super(Activator.TABLE_TYPE); } } diff --git a/examples/uml/org.eclipse.papyrus.example.uml.nattable.empty.line/src/org/eclipse/papyrus/example/uml/nattable/empty/line/providers/CustomRowHeaderLabelProvider.java b/examples/uml/org.eclipse.papyrus.example.uml.nattable.empty.line/src/org/eclipse/papyrus/example/uml/nattable/empty/line/providers/CustomRowHeaderLabelProvider.java index 16a3d028bf2..95ac7b9cd96 100755 --- a/examples/uml/org.eclipse.papyrus.example.uml.nattable.empty.line/src/org/eclipse/papyrus/example/uml/nattable/empty/line/providers/CustomRowHeaderLabelProvider.java +++ b/examples/uml/org.eclipse.papyrus.example.uml.nattable.empty.line/src/org/eclipse/papyrus/example/uml/nattable/empty/line/providers/CustomRowHeaderLabelProvider.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2020 CEA LIST + * Copyright (c) 2020,2021 CEA LIST * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -10,6 +10,7 @@ * * Contributors: * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation + * Asma SMAOUI (CEA LIST) - bug 573840 *****************************************************************************/ package org.eclipse.papyrus.example.uml.nattable.empty.line.providers; @@ -30,7 +31,7 @@ public class CustomRowHeaderLabelProvider extends AbstractEmptyLineRowHeaderLabe * @param tableKind */ public CustomRowHeaderLabelProvider() { - super(Activator.TABLE_KIND_ID); + super(Activator.TABLE_TYPE); } /** diff --git a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/NattablePropertyEditor.java b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/NattablePropertyEditor.java index 12827e3d84a..4681a8a2652 100644 --- a/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/NattablePropertyEditor.java +++ b/plugins/uml/properties/org.eclipse.papyrus.uml.properties/src/org/eclipse/papyrus/uml/properties/widgets/NattablePropertyEditor.java @@ -1,5 +1,5 @@ /***************************************************************************** - * Copyright (c) 2015, 2016, 2017 CEA LIST, Christian W. Damus, and others. + * Copyright (c) 2015, 2016, 2017, 2021 CEA LIST, Christian W. Damus, and others. * * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -12,7 +12,7 @@ * Nicolas FAUVERGUE (CEA LIST) nicolas.fauvergue@cea.fr - Initial API and implementation, Bug 502160, 494531 * Christian W. Damus - bugs 493858, 493853, 516310, 517313 * Vincent Lorenzo (CEA-LIST) vincent.lorenzo@cea.fr - bugs 494537, 504745 - * + * Asma SMAOUI (CEA LIST) - bug 573840 *****************************************************************************/ package org.eclipse.papyrus.uml.properties.widgets; @@ -802,7 +802,8 @@ public class NattablePropertyEditor extends AbstractPropertyEditor { } table.setName(getLabel()); - + // for table used in property view, the kindId was null, because it is given by the AF. So we propose to use the type for kindId + table.setTableKindId(table.getTableConfiguration().getType()); AbstractAxisProvider rowProvider = tableConfiguration.getDefaultRowAxisProvider(); if (rowProvider == null) { rowProvider = NattableaxisproviderFactory.eINSTANCE.createMasterObjectAxisProvider(); -- cgit v1.2.3