Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarkus Tiede2015-02-03 11:51:55 +0000
committerMarkus Tiede2015-02-03 11:51:55 +0000
commit6c9d68c116ef4f0628f1937b61240f2a28b5a51c (patch)
tree64e2e2b21360e91f3b106476e5d400a55093a7a7 /org.eclipse.jubula.rc.swt
parentd0cc618d2adf11e68126390652fc8d166caebd99 (diff)
downloadorg.eclipse.jubula.core-6c9d68c116ef4f0628f1937b61240f2a28b5a51c.tar.gz
org.eclipse.jubula.core-6c9d68c116ef4f0628f1937b61240f2a28b5a51c.tar.xz
org.eclipse.jubula.core-6c9d68c116ef4f0628f1937b61240f2a28b5a51c.zip
Non-sprint task - major refactoring: added generic type information to IEventThreadQueuer - fix for introduced p1 issue http://bugzilla.bredex.de/1627
Diffstat (limited to 'org.eclipse.jubula.rc.swt')
-rw-r--r--org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/driver/RobotSwtImpl.java27
-rw-r--r--org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/tester/adapter/AbstractComponentAdapter.java3
-rw-r--r--org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/tester/adapter/TableAdapter.java43
3 files changed, 36 insertions, 37 deletions
diff --git a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/driver/RobotSwtImpl.java b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/driver/RobotSwtImpl.java
index f7fdbb370..85148977e 100644
--- a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/driver/RobotSwtImpl.java
+++ b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/driver/RobotSwtImpl.java
@@ -85,15 +85,13 @@ import org.eclipse.swt.widgets.Widget;
*
* <p>
* The <code>click()</code> and <code>move()</code> implementations expect
- * that the graphics component is of type {@link java.awt.Component}and the
- * constraints object is <code>null</code> or of type
- * {@link java.awt.Rectangle}.
+ * that the graphics component is of type {@link java.awt.Component}.
* </p>
*
* @author BREDEX GmbH
* @created 17.03.2005
*/
-public class RobotSwtImpl implements IRobot {
+public class RobotSwtImpl implements IRobot<Rectangle> {
/** the logger */
private static AutServerLogger log = new AutServerLogger(
RobotSwtImpl.class);
@@ -698,7 +696,7 @@ public class RobotSwtImpl implements IRobot {
/**
* {@inheritDoc}
*/
- public void click(Object graphicsComponent, Object constraints)
+ public void click(Object graphicsComponent, Rectangle constraints)
throws RobotException {
click(graphicsComponent, constraints, ClickOptions.create());
@@ -708,7 +706,7 @@ public class RobotSwtImpl implements IRobot {
* {@inheritDoc}
* java.lang.Object, org.eclipse.jubula.rc.swt.robot.ClickOptions)
*/
- public void click(Object graphicsComponent, Object constraints,
+ public void click(Object graphicsComponent, Rectangle constraints,
ClickOptions clickOptions) throws RobotException {
clickImpl(graphicsComponent, constraints, clickOptions);
@@ -717,8 +715,9 @@ public class RobotSwtImpl implements IRobot {
/**
* {@inheritDoc}
*/
- public void move(final Object graphicsComponent, final Object constraints)
- throws RobotException {
+ public void move(final Object graphicsComponent,
+ final Rectangle constraints)
+ throws RobotException {
moveToCenter(graphicsComponent);
}
@@ -1071,7 +1070,7 @@ public class RobotSwtImpl implements IRobot {
/**
* {@inheritDoc}
*/
- public void scrollToVisible(Object graphicsComponent, Object constraints)
+ public void scrollToVisible(Object graphicsComponent, Rectangle constraints)
throws RobotException {
if (graphicsComponent instanceof Control) {
@@ -1517,8 +1516,8 @@ public class RobotSwtImpl implements IRobot {
/**
* {@inheritDoc}
*/
- public void mousePress(final Object graphicsComponent, Object constraints,
- final int button) throws RobotException {
+ public void mousePress(final Object graphicsComponent,
+ Rectangle constraints, final int button) throws RobotException {
if (graphicsComponent != null) {
move(graphicsComponent, constraints);
}
@@ -1533,8 +1532,8 @@ public class RobotSwtImpl implements IRobot {
/**
* {@inheritDoc}
*/
- public void mouseRelease(final Object graphicsComponent, Object constraints,
- final int button) throws RobotException {
+ public void mouseRelease(final Object graphicsComponent,
+ Rectangle constraints, final int button) throws RobotException {
if (graphicsComponent != null) {
move(graphicsComponent, constraints);
@@ -1639,7 +1638,7 @@ public class RobotSwtImpl implements IRobot {
/**
* {@inheritDoc}
*/
- public void click(Object graphicsComponent, Object constraints,
+ public void click(Object graphicsComponent, Rectangle constraints,
ClickOptions clickOptions, int xPos, boolean xAbsolute,
int yPos, boolean yAbsolute) throws RobotException {
diff --git a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/tester/adapter/AbstractComponentAdapter.java b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/tester/adapter/AbstractComponentAdapter.java
index 468527a03..bb3bea64e 100644
--- a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/tester/adapter/AbstractComponentAdapter.java
+++ b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/tester/adapter/AbstractComponentAdapter.java
@@ -8,6 +8,7 @@ import org.eclipse.jubula.rc.common.exception.RobotException;
import org.eclipse.jubula.rc.common.tester.adapter.interfaces.IComponent;
import org.eclipse.jubula.rc.swt.driver.KeyCodeConverter;
import org.eclipse.jubula.rc.swt.driver.RobotFactoryConfig;
+import org.eclipse.swt.graphics.Rectangle;
/**
* @author BREDEX GmBH
*/
@@ -39,7 +40,7 @@ public abstract class AbstractComponentAdapter implements IComponent {
* @return The Robot
* @throws RobotException If the Robot cannot be created.
*/
- protected IRobot getRobot() throws RobotException {
+ protected IRobot<Rectangle> getRobot() throws RobotException {
return AUTServer.getInstance().getRobot();
}
diff --git a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/tester/adapter/TableAdapter.java b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/tester/adapter/TableAdapter.java
index 479e41c6f..29b001eeb 100644
--- a/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/tester/adapter/TableAdapter.java
+++ b/org.eclipse.jubula.rc.swt/src/org/eclipse/jubula/rc/swt/tester/adapter/TableAdapter.java
@@ -23,6 +23,7 @@ import org.eclipse.jubula.rc.common.util.MatchUtil;
import org.eclipse.jubula.rc.swt.listener.TableSelectionTracker;
import org.eclipse.jubula.rc.swt.tester.CAPUtil;
import org.eclipse.jubula.rc.swt.tester.TableTester;
+import org.eclipse.jubula.rc.swt.utils.SwtPointUtil;
import org.eclipse.jubula.rc.swt.utils.SwtUtils;
import org.eclipse.jubula.tools.internal.constants.SwtToolkitConstants;
import org.eclipse.jubula.tools.internal.objects.event.EventFactory;
@@ -293,25 +294,24 @@ public class TableAdapter extends ControlAdapter implements ITableComponent {
});
checkRowColBounds(row, col);
- final Rectangle cellBoundsRelativeToParent = TableTester.getCellBounds(
- getEventThreadQueuer(), m_table, row, col);
-
+ final org.eclipse.swt.graphics.Rectangle cBoundsRelToParent =
+ SwtPointUtil.toSwtRectangle(TableTester.getCellBounds(
+ getEventThreadQueuer(), m_table, row, col));
+
getEventThreadQueuer().invokeAndWait("getCellBoundsRelativeToParent", //$NON-NLS-1$
- new IRunnable<Void>() {
- public Void run() {
- org.eclipse.swt.graphics.Point cellOriginRelativeToParent =
- table.getDisplay().map(
- table, table.getParent(),
- new org.eclipse.swt.graphics.Point(
- cellBoundsRelativeToParent.x,
- cellBoundsRelativeToParent.y));
- cellBoundsRelativeToParent.x =
- cellOriginRelativeToParent.x;
- cellBoundsRelativeToParent.y =
- cellOriginRelativeToParent.y;
- return null;
- }
- });
+ new IRunnable<Void>() {
+ public Void run() {
+ org.eclipse.swt.graphics.Point cOriginRelToParent =
+ table.getDisplay().map(table,
+ table.getParent(),
+ new org.eclipse.swt.graphics.Point(
+ cBoundsRelToParent.x,
+ cBoundsRelToParent.y));
+ cBoundsRelToParent.x = cOriginRelToParent.x;
+ cBoundsRelToParent.y = cOriginRelToParent.y;
+ return null;
+ }
+ });
Control parent = getEventThreadQueuer().invokeAndWait("getParent", //$NON-NLS-1$
new IRunnable<Control>() {
@@ -320,7 +320,7 @@ public class TableAdapter extends ControlAdapter implements ITableComponent {
}
});
- getRobot().scrollToVisible(parent, cellBoundsRelativeToParent);
+ getRobot().scrollToVisible(parent, cBoundsRelToParent);
return getVisibleBounds(TableTester.getCellBounds(
getEventThreadQueuer(), m_table, row, col));
@@ -446,9 +446,8 @@ public class TableAdapter extends ControlAdapter implements ITableComponent {
org.eclipse.swt.graphics.Rectangle swtRect =
new org.eclipse.swt.graphics.Rectangle(rect.x, rect.y,
rect.width, rect.height);
- getRobot().click(m_table,
- swtRect,
- ClickOptions.create().setClickCount(1));
+ getRobot().click(m_table, swtRect,
+ ClickOptions.create().setClickCount(1));
return SwtUtils.getCursorControl();

Back to the top