summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJuergen Becker2011-10-17 09:55:07 (EDT)
committerJuergen Becker2011-10-17 09:55:07 (EDT)
commit2bc5c11d1da9858c9fe9f98112dd230bb4ac5ba4 (patch)
treefadd3ce1b573a083ee3354e91f6ce43fb871880f
parent87e9c22d194633c7daa9543feac18bff535fa805 (diff)
downloadorg.eclipse.riena-2bc5c11d1da9858c9fe9f98112dd230bb4ac5ba4.zip
org.eclipse.riena-2bc5c11d1da9858c9fe9f98112dd230bb4ac5ba4.tar.gz
org.eclipse.riena-2bc5c11d1da9858c9fe9f98112dd230bb4ac5ba4.tar.bz2
fixed recursive activation bug for views with no focusable ridgets
-rw-r--r--org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleView.java2
-rw-r--r--org.eclipse.riena.navigation.ui/src/org/eclipse/riena/navigation/ui/controllers/SubModuleController.java23
2 files changed, 24 insertions, 1 deletions
diff --git a/org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleView.java b/org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleView.java
index e48993e..a7621ab 100644
--- a/org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleView.java
+++ b/org.eclipse.riena.navigation.ui.swt/src/org/eclipse/riena/navigation/ui/swt/views/SubModuleView.java
@@ -345,7 +345,7 @@ public abstract class SubModuleView extends ViewPart implements INavigationNodeV
}
private IRidget getFocusRidget() {
- return currentController != null ? currentController.getInitialFocus() : null;
+ return currentController != null ? currentController.getFocusableRidget() : null;
}
public void unbind() {
diff --git a/org.eclipse.riena.navigation.ui/src/org/eclipse/riena/navigation/ui/controllers/SubModuleController.java b/org.eclipse.riena.navigation.ui/src/org/eclipse/riena/navigation/ui/controllers/SubModuleController.java
index 933cc38..dbf51b2 100644
--- a/org.eclipse.riena.navigation.ui/src/org/eclipse/riena/navigation/ui/controllers/SubModuleController.java
+++ b/org.eclipse.riena.navigation.ui/src/org/eclipse/riena/navigation/ui/controllers/SubModuleController.java
@@ -31,6 +31,7 @@ import org.eclipse.riena.ui.ridgets.IActionRidget;
import org.eclipse.riena.ui.ridgets.IComplexRidget;
import org.eclipse.riena.ui.ridgets.IDefaultActionManager;
import org.eclipse.riena.ui.ridgets.IInfoFlyoutRidget;
+import org.eclipse.riena.ui.ridgets.IMarkableRidget;
import org.eclipse.riena.ui.ridgets.IRidget;
import org.eclipse.riena.ui.ridgets.IWindowRidget;
import org.eclipse.riena.ui.ridgets.listener.IWindowRidgetListener;
@@ -136,6 +137,28 @@ public class SubModuleController extends NavigationNodeController<ISubModuleNode
}
/**
+ * Returns the ridget that should get the focus. If a ridget is set via
+ * {@see setInitialFocus}, it will be returned. Otherwise a ridget which can
+ * receive the focus is searched, if none is found null is returned.
+ *
+ * @return a IRidget instance or null.
+ * @since 4.0
+ */
+ public IRidget getFocusableRidget() {
+ if (getInitialFocus() != null) {
+ return getInitialFocus();
+ }
+ for (final IRidget ridget : getRidgets()) {
+ final boolean markable = ridget instanceof IMarkableRidget;
+ if (ridget.isFocusable() && ridget.isEnabled() && ridget.isVisible()
+ && (!markable || (markable && !((IMarkableRidget) ridget).isOutputOnly()))) {
+ return ridget;
+ }
+ }
+ return null;
+ }
+
+ /**
* Returns the controller of the parent module.
*
* @return module controller or {@code null} if not parent module controller