Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarvin Mueller2014-11-06 12:54:08 +0000
committerMarvin Mueller2014-11-06 13:16:41 +0000
commitd3eb0834744e8ee9dee70b4e0f87aae533bc178b (patch)
tree7461a4f9a8ecf9fe5c8dd75b18d2966ed93f21ad /org.eclipse.jubula.rc.swing/src
parentcc21cd6ee23eec83c51186f8829418ea9f272375 (diff)
downloadorg.eclipse.jubula.core-d3eb0834744e8ee9dee70b4e0f87aae533bc178b.tar.gz
org.eclipse.jubula.core-d3eb0834744e8ee9dee70b4e0f87aae533bc178b.tar.xz
org.eclipse.jubula.core-d3eb0834744e8ee9dee70b4e0f87aae533bc178b.zip
Sprint task - adjust rc side to use new created enum
Diffstat (limited to 'org.eclipse.jubula.rc.swing/src')
-rw-r--r--org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/driver/RobotAwtImpl.java21
-rw-r--r--org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/KeyAcceptor.java8
-rw-r--r--org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/RecordActions.java4
3 files changed, 17 insertions, 16 deletions
diff --git a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/driver/RobotAwtImpl.java b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/driver/RobotAwtImpl.java
index 5c0e36c7a..9ac8377b3 100644
--- a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/driver/RobotAwtImpl.java
+++ b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/driver/RobotAwtImpl.java
@@ -57,7 +57,7 @@ import org.eclipse.jubula.rc.common.util.LocalScreenshotUtil;
import org.eclipse.jubula.rc.common.util.PointUtil;
import org.eclipse.jubula.rc.swing.utils.SwingUtils;
import org.eclipse.jubula.toolkit.enums.ValueSets;
-import org.eclipse.jubula.tools.internal.constants.InputConstants;
+import org.eclipse.jubula.toolkit.enums.ValueSets.InteractionMode;
import org.eclipse.jubula.tools.internal.constants.StringConstants;
import org.eclipse.jubula.tools.internal.constants.TimingConstantsServer;
import org.eclipse.jubula.tools.internal.i18n.I18n;
@@ -517,16 +517,17 @@ public class RobotAwtImpl implements IRobot {
* @return the InputEvent button mask
*/
private int getButtonMask(int button) {
- switch (button) {
- case InputConstants.MOUSE_BUTTON_LEFT:
- return InputEvent.BUTTON1_MASK;
- case InputConstants.MOUSE_BUTTON_MIDDLE:
- return InputEvent.BUTTON2_MASK;
- case InputConstants.MOUSE_BUTTON_RIGHT:
- return InputEvent.BUTTON3_MASK;
- default:
- throw new RobotException("unsupported mouse button", null); //$NON-NLS-1$
+ if (button == InteractionMode.primary.rcIntValue()) {
+ return InputEvent.BUTTON1_MASK;
}
+ if (button == InteractionMode.tertiary.rcIntValue()) {
+ return InputEvent.BUTTON2_MASK;
+ }
+ if (button == InteractionMode.secondary.rcIntValue()) {
+ return InputEvent.BUTTON3_MASK;
+ }
+ throw new RobotException("unsupported mouse button", null); //$NON-NLS-1$
+
}
/**
diff --git a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/KeyAcceptor.java b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/KeyAcceptor.java
index fee48d39c..93d98da20 100644
--- a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/KeyAcceptor.java
+++ b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/KeyAcceptor.java
@@ -17,7 +17,7 @@ import java.util.Iterator;
import java.util.SortedSet;
import org.eclipse.jubula.rc.common.AUTServerConfiguration;
-import org.eclipse.jubula.tools.internal.constants.InputConstants;
+import org.eclipse.jubula.toolkit.enums.ValueSets.InteractionMode;
/**
@@ -77,13 +77,13 @@ public class KeyAcceptor {
int button = ((MouseEvent)event).getButton();
switch (button) {
case MouseEvent.BUTTON1:
- inputCode = InputConstants.MOUSE_BUTTON_LEFT;
+ inputCode = InteractionMode.primary.rcIntValue();
break;
case MouseEvent.BUTTON2:
- inputCode = InputConstants.MOUSE_BUTTON_MIDDLE;
+ inputCode = InteractionMode.tertiary.rcIntValue();
break;
case MouseEvent.BUTTON3:
- inputCode = InputConstants.MOUSE_BUTTON_RIGHT;
+ inputCode = InteractionMode.secondary.rcIntValue();
break;
default:
break;
diff --git a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/RecordActions.java b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/RecordActions.java
index 3a0ffd5db..c5c61a4ba 100644
--- a/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/RecordActions.java
+++ b/org.eclipse.jubula.rc.swing/src/org/eclipse/jubula/rc/swing/listener/RecordActions.java
@@ -51,8 +51,8 @@ import org.eclipse.jubula.rc.common.Constants;
import org.eclipse.jubula.rc.common.exception.NoIdentifierForComponentException;
import org.eclipse.jubula.rc.common.logger.AutServerLogger;
import org.eclipse.jubula.rc.common.util.MatchUtil;
+import org.eclipse.jubula.toolkit.enums.ValueSets.InteractionMode;
import org.eclipse.jubula.tools.internal.constants.CharacterConstants;
-import org.eclipse.jubula.tools.internal.constants.InputConstants;
import org.eclipse.jubula.tools.internal.constants.StringConstants;
import org.eclipse.jubula.tools.internal.exception.CommunicationException;
import org.eclipse.jubula.tools.internal.objects.IComponentIdentifier;
@@ -239,7 +239,7 @@ public class RecordActions {
treValues.add(nodepath);
treValues.add(Constants.REC_OPERATOR);
treValues.add(clCount);
- treValues.add(String.valueOf(InputConstants.MOUSE_BUTTON_LEFT));
+ treValues.add(String.valueOf(InteractionMode.primary.rcIntValue()));
treValues.add(Constants.REC_EXT_SELECTION);
String logName = createLogicalName(jtre, id);

Back to the top