< prev index next >
application/uitests/org.openjdk.jmc.test.jemmy/src/test/java/org/openjdk/jmc/test/jemmy/misc/wrappers/MCTable.java
Print this page
@@ -47,10 +47,11 @@
import org.jemmy.Point;
import org.jemmy.control.Wrap;
import org.jemmy.input.StringPopupOwner;
import org.jemmy.input.StringPopupSelectableOwner;
import org.jemmy.interfaces.Keyboard.KeyboardButtons;
+import org.jemmy.interfaces.Keyboard.KeyboardModifiers;
import org.jemmy.interfaces.Parent;
import org.jemmy.interfaces.Selectable;
import org.jemmy.lookup.Lookup;
import org.jemmy.resources.StringComparePolicy;
import org.jemmy.swt.ItemWrap;
@@ -729,10 +730,26 @@
public boolean select(int index) {
return select(index, 0);
}
/**
+ * Selects the table row at a specified "start" index, and uses SHIFT+DOWN to
+ * add to the selection up until a specified "end" index
+ *
+ * @param from
+ * the row index to start from
+ * @param to
+ * the row index to stop selecting
+ */
+ public void selectItems(int start, int end) {
+ select(start);
+ for (int i = 0; i < end; i++) {
+ getShell().keyboard().pushKey(KeyboardButtons.DOWN, new KeyboardModifiers[] {KeyboardModifiers.SHIFT_DOWN_MASK});
+ }
+ }
+
+ /**
* Context clicks the currently selected table item and chooses the supplied option
*
* @param desiredState
* the selection state to which the context choice is to be to set to
* @param choice
< prev index next >