summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Kriese2010-10-12 03:39:30 (EDT)
committerSteffen Kriese2010-10-12 03:39:30 (EDT)
commit0130af9e2e2531afeaddd830978585bdd2a2f48c (patch)
treecd15150066e982898cf00f5ee5ebbb362dc947c2
parentd1493b928e9d2bbd4b64840e31fd62230dbcb040 (diff)
downloadorg.eclipse.riena.rap-0130af9e2e2531afeaddd830978585bdd2a2f48c.zip
org.eclipse.riena.rap-0130af9e2e2531afeaddd830978585bdd2a2f48c.tar.gz
org.eclipse.riena.rap-0130af9e2e2531afeaddd830978585bdd2a2f48c.tar.bz2
Applied patch #326645 ROR: ModuleView needs double click
-rw-r--r--org.eclipse.riena.ui.swt.rap/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.riena.ui.swt.rap/src/org/eclipse/riena/ui/swt/facades/SWTFacadeRAP.java6
-rw-r--r--org.eclipse.riena.ui.swt.rap/src/org/eclipse/riena/ui/swt/facades/internal/ModuleNavigationListenerRAP.java64
3 files changed, 71 insertions, 0 deletions
diff --git a/org.eclipse.riena.ui.swt.rap/META-INF/MANIFEST.MF b/org.eclipse.riena.ui.swt.rap/META-INF/MANIFEST.MF
index 438481e..a10483b 100644
--- a/org.eclipse.riena.ui.swt.rap/META-INF/MANIFEST.MF
+++ b/org.eclipse.riena.ui.swt.rap/META-INF/MANIFEST.MF
@@ -9,6 +9,7 @@ Require-Bundle: org.eclipse.riena.core,
org.eclipse.riena.ui.common,
org.eclipse.riena.ui.ridgets,
org.eclipse.riena.ui.swt,
+ org.eclipse.riena.navigation.ui.swt,
org.eclipse.rap.rwt;resolution:=optional;visibility:=reexport,
org.eclipse.rap.ui.workbench;resolution:=optional;visibility:=reexport
Bundle-Activator: org.eclipse.riena.internalui.swt.rap.Activator
diff --git a/org.eclipse.riena.ui.swt.rap/src/org/eclipse/riena/ui/swt/facades/SWTFacadeRAP.java b/org.eclipse.riena.ui.swt.rap/src/org/eclipse/riena/ui/swt/facades/SWTFacadeRAP.java
index c2c1990..32cb084 100644
--- a/org.eclipse.riena.ui.swt.rap/src/org/eclipse/riena/ui/swt/facades/SWTFacadeRAP.java
+++ b/org.eclipse.riena.ui.swt.rap/src/org/eclipse/riena/ui/swt/facades/SWTFacadeRAP.java
@@ -31,6 +31,7 @@ import org.eclipse.riena.ui.swt.InfoFlyout;
import org.eclipse.riena.ui.swt.facades.internal.CompletionComboRAP;
import org.eclipse.riena.ui.swt.facades.internal.CompletionComboWithImageRAP;
import org.eclipse.riena.ui.swt.facades.internal.InfoFlyoutRAP;
+import org.eclipse.riena.ui.swt.facades.internal.ModuleNavigationListenerRAP;
/**
* Implements {@link SWTFacade} for RAP.
@@ -83,6 +84,11 @@ public final class SWTFacadeRAP extends SWTFacade {
}
@Override
+ public void attachModuleNavigationListener(final Tree tree) {
+ new ModuleNavigationListenerRAP(tree);
+ }
+
+ @Override
public void copyEventKeyLocation(final Event source, final Event target) {
}
diff --git a/org.eclipse.riena.ui.swt.rap/src/org/eclipse/riena/ui/swt/facades/internal/ModuleNavigationListenerRAP.java b/org.eclipse.riena.ui.swt.rap/src/org/eclipse/riena/ui/swt/facades/internal/ModuleNavigationListenerRAP.java
new file mode 100644
index 0000000..94d26e9
--- /dev/null
+++ b/org.eclipse.riena.ui.swt.rap/src/org/eclipse/riena/ui/swt/facades/internal/ModuleNavigationListenerRAP.java
@@ -0,0 +1,64 @@
+/*******************************************************************************
+ * Copyright (c) 2007, 2010 compeople AG and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * compeople AG - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.riena.ui.swt.facades.internal;
+
+import org.eclipse.rwt.internal.lifecycle.UICallBackServiceHandler;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+
+import org.eclipse.riena.navigation.INavigationNode;
+import org.eclipse.riena.navigation.ui.swt.views.ModuleNavigationListener;
+
+/**
+ * Adds RAP specific behavior to {@link ModuleNavigationListener}.
+ */
+public class ModuleNavigationListenerRAP extends ModuleNavigationListener {
+
+ public ModuleNavigationListenerRAP(final Tree moduleTree) {
+ super(moduleTree);
+ }
+
+ @Override
+ protected NodeSwitcher createNodeSwitcher(final TreeItem item) {
+ return new NodeSwitcherRAP(item.getDisplay(), (INavigationNode<?>) item.getData());
+ }
+
+ private final static class NodeSwitcherRAP extends ModuleNavigationListener.NodeSwitcher {
+ private final String id;
+
+ NodeSwitcherRAP(final Display display, final INavigationNode<?> node) {
+ super(display, node);
+ id = node.getNodeId().getInstanceId();
+ }
+
+ @Override
+ public synchronized void start() {
+ // the callback must be activated from the UIThread not from this thread
+ UICallBackServiceHandler.activateUICallBacksFor(id);
+ super.start();
+ }
+
+ @Override
+ public void run() {
+ try {
+ super.run();
+ } finally {
+ display.syncExec(new Runnable() {
+ public void run() {
+ UICallBackServiceHandler.deactivateUICallBacksFor(id);
+ }
+ });
+ }
+ }
+ }
+
+}