Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZeb Ford-Reitz2012-04-25 13:36:12 +0000
committerZeb Ford-Reitz2012-05-08 08:58:13 +0000
commit59d0940f9b920a740a4a4b1cd314506dbf3503ab (patch)
treee5aaf8f294bb9199251b0991506ccd10aaf688ae
parent3aac273bf415bf24dd34b3123bc320b2167ce321 (diff)
downloadorg.eclipse.jubula.core-59d0940f9b920a740a4a4b1cd314506dbf3503ab.tar.gz
org.eclipse.jubula.core-59d0940f9b920a740a4a4b1cd314506dbf3503ab.tar.xz
org.eclipse.jubula.core-59d0940f9b920a740a4a4b1cd314506dbf3503ab.zip
fixes https://bxapps.bredex.de/bugzilla/show_bug.cgi?id=252
Changes the implementation for selecting items from SWT context menus and dropdown menus to use PopupMenuUtil instead of MenuUtil.
-rw-r--r--org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/implclasses/PopupMenuImplClass.java32
1 files changed, 32 insertions, 0 deletions
diff --git a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/implclasses/PopupMenuImplClass.java b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/implclasses/PopupMenuImplClass.java
index c8afc7457..a7c6e47fd 100644
--- a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/implclasses/PopupMenuImplClass.java
+++ b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/implclasses/PopupMenuImplClass.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.jubula.rc.swt.implclasses;
+import org.eclipse.jubula.rc.common.exception.StepExecutionException;
+import org.eclipse.jubula.tools.objects.event.EventFactory;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Widget;
@@ -57,4 +59,34 @@ public class PopupMenuImplClass extends MenuImplClass {
int pathLength = pathItems != null ? pathItems.length : 0;
PopupMenuUtil.closePopup(getRobot(), (Menu)getComponent(), pathLength);
}
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void selectMenuItem(String namePath, final String operator) {
+ final String[] pathItems = MenuUtil.splitPath(namePath);
+ if (pathItems.length == 0) {
+ throw new StepExecutionException("empty path to menuitem not allowed", //$NON-NLS-1$
+ EventFactory.createActionError());
+ }
+
+ PopupMenuUtil.selectMenuItem(getRobot(), (Menu)getComponent(),
+ pathItems, operator);
+ }
+
+ /**
+ *
+ * {@inheritDoc}
+ */
+ public void selectMenuItemByIndexpath(String indexPath) {
+ final int[] indexItems = MenuUtil.splitIndexPath(indexPath);
+ if (indexItems.length == 0) {
+ throw new StepExecutionException("empty path to menuitem not allowed", //$NON-NLS-1$
+ EventFactory.createActionError());
+ }
+
+ PopupMenuUtil.selectMenuItem(getRobot(), (Menu)getComponent(),
+ indexItems);
+ }
}

Back to the top