Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas FAUVERGUE2017-04-04 15:27:19 +0000
committerGerrit Code Review @ Eclipse.org2017-04-28 15:24:56 +0000
commit1472e4abad054847f8e6e27c195f5df2adce1f87 (patch)
treeefc408ebfe5e4d90cbc1e7a226e51d8befa4cab2 /plugins
parentdd82bec9a46a6a8a48ac59e365fc15160a130905 (diff)
downloadorg.eclipse.papyrus-1472e4abad054847f8e6e27c195f5df2adce1f87.tar.gz
org.eclipse.papyrus-1472e4abad054847f8e6e27c195f5df2adce1f87.tar.xz
org.eclipse.papyrus-1472e4abad054847f8e6e27c195f5df2adce1f87.zip
Bug 514720: [Table] Paste ouside of a table when a table is opened
display pop-up https://bugs.eclipse.org/bugs/show_bug.cgi?id=514720 When we checked the nattable widget with propertyTester, check the current shell too. Change-Id: I8998ade4c20118b3982bd492a005c66386916619 Signed-off-by: Nicolas FAUVERGUE <nicolas.fauvergue@cea.fr>
Diffstat (limited to 'plugins')
-rw-r--r--plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/NattableWidgetPropertyTester.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/NattableWidgetPropertyTester.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/NattableWidgetPropertyTester.java
index 37aab8b9ff1..f86fb0c6139 100644
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/NattableWidgetPropertyTester.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/utils/NattableWidgetPropertyTester.java
@@ -14,6 +14,7 @@
package org.eclipse.papyrus.infra.nattable.utils;
import org.eclipse.core.expressions.PropertyTester;
+import org.eclipse.nebula.widgets.nattable.NatTable;
import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattableaxisprovider.ISlaveAxisProvider;
import org.eclipse.papyrus.infra.nattable.model.nattable.nattablestyle.DisplayStyle;
@@ -44,7 +45,7 @@ public class NattableWidgetPropertyTester extends PropertyTester {
public boolean test(final Object receiver, final String property, final Object[] args, final Object expectedValue) {
final INattableModelManager manager = getNattableModelManager();
if (IS_NATTABLE_WIDGET.equals(property) && expectedValue instanceof Boolean) {
- return expectedValue.equals(manager != null);
+ return expectedValue.equals(null != manager) && ((!(Boolean)expectedValue) || manager.getAdapter(NatTable.class).isFocusControl());
}
if (manager != null && expectedValue instanceof Boolean) {
if (HAS_FEATURE_ROW_HEADER_CONFIGURATION.equals(property)) {
@@ -77,7 +78,7 @@ public class NattableWidgetPropertyTester extends PropertyTester {
/**
*
* @return
- * the current nattable model manager or <code>null</code> if not found
+ * the current nattable model manager or <code>null</code> if not found
*/
protected INattableModelManager getNattableModelManager() {
final IWorkbench workbench = PlatformUI.getWorkbench();

Back to the top