< 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
@@ -279,10 +279,23 @@
}
/**
* Finds tables by column header (first match only)
*
+ * @param shellText
+ * text to look up the shell that contains the table
+ * @param headerName
+ * the name of the column header
+ * @return a {@link MCTable}
+ */
+ public static MCTable getByColumnHeader(String shellText , String headerName) {
+ return getByColumnHeader(getShellByText(shellText), headerName);
+ }
+
+ /**
+ * Finds tables by column header (first match only)
+ *
* @param shell
* the shell in which to look for the table
* @param headerName
* the name of the column header
* @return a {@link MCTable}
@@ -511,10 +524,28 @@
setOutput(count);
}
};
Display.getDefault().syncExec(fetcher);
return fetcher.getOutput().intValue();
+ }
+
+ /**
+ * Gets the number of items selected in the table
+ *
+ * @return the number of items selected in the table
+ */
+ public int getSelectionCount() {
+ final Table table = getWrap().getControl();
+ Fetcher<Integer> fetcher = new Fetcher<Integer>() {
+ @Override
+ public void run() {
+ int count = table.getSelectionCount();
+ setOutput(count);
+ }
+ };
+ Display.getDefault().syncExec(fetcher);
+ return fetcher.getOutput().intValue();
}
/**
* Whether or not the table contains the text given
*
< prev index next >