Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastien Revol2016-08-11 10:14:54 +0000
committervincent lorenzo2016-09-12 15:50:24 +0000
commitf7329611e7937a33e5897565892d6eed9aa8cac2 (patch)
treea2d526bcf33324c3852671931c47b0583474a619 /plugins/infra/nattable
parenta0f875761d4fbaca0953e1e1acb1d7905a9b05a5 (diff)
downloadorg.eclipse.papyrus-f7329611e7937a33e5897565892d6eed9aa8cac2.tar.gz
org.eclipse.papyrus-f7329611e7937a33e5897565892d6eed9aa8cac2.tar.xz
org.eclipse.papyrus-f7329611e7937a33e5897565892d6eed9aa8cac2.zip
Bug 499541: Provide propertyTester for NatTableProperty Editor
Change-Id: I3ca29c56dbc31d723b86fa21b8e3e3101e6f9c4d Signed-off-by: Sebastien Revol <sebastien.revol@cea.fr>
Diffstat (limited to 'plugins/infra/nattable')
-rwxr-xr-xplugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java25
1 files changed, 24 insertions, 1 deletions
diff --git a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java
index 923314b11e6..198fe7996f9 100755
--- a/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java
+++ b/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable/src/org/eclipse/papyrus/infra/nattable/manager/table/NattableModelManager.java
@@ -128,7 +128,9 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IWorkbenchPartSite;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.commands.ICommandService;
+import org.eclipse.ui.swt.IFocusService;
import com.google.common.collect.BiMap;
import com.google.common.collect.HashBiMap;
@@ -208,6 +210,8 @@ public class NattableModelManager extends AbstractNattableWidgetManager implemen
private final AdapterImpl changeAxisProviderHistory;
+
+ private IFocusService focusService;
/**
* the listener on the table cells
@@ -504,7 +508,21 @@ public class NattableModelManager extends AbstractNattableWidgetManager implemen
}
this.focusListener = this;
nattable.addFocusListener(this.focusListener);
-
+
+ //registering to focusService allows to declare properties tester on "activeFocusControl" and "activeFocusControlId" variables
+ focusService = (IFocusService) PlatformUI.getWorkbench().getService(IFocusService.class);
+ if (focusService!=null){
+ String id=null;
+ if (getTable().getTableConfiguration()!= null){
+ id = getTable().getTableConfiguration().getType();
+ }
+ if (id == null){
+ id = getTableName();
+ }
+ focusService.addFocusTracker(nattable,id);
+ }
+
+
this.layerListener = new ILayerListener() {
@Override
@@ -873,6 +891,11 @@ public class NattableModelManager extends AbstractNattableWidgetManager implemen
}
}
+ if (focusService != null && this.natTable!=null){
+ focusService.removeFocusTracker(this.natTable);
+ focusService = null;
+ }
+
removeListeners();
super.dispose();
}

Back to the top