本文整理汇总了Java中org.eclipse.swtbot.swt.finder.widgets.SWTBotTable.getTableItem方法的典型用法代码示例。如果您正苦于以下问题:Java SWTBotTable.getTableItem方法的具体用法?Java SWTBotTable.getTableItem怎么用?Java SWTBotTable.getTableItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.swtbot.swt.finder.widgets.SWTBotTable
的用法示例。
在下文中一共展示了SWTBotTable.getTableItem方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: waitForTableItems
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入方法依赖的package包/类
/**
* Wait for table items.
*
* @param table
* the table
* @param timeout
* the timeout
*/
@SuppressWarnings("PMD.ConfusingTernary")
public static void waitForTableItems(final SWTBotTable table, final int timeout) {
final long endTimeMillis = System.currentTimeMillis() + timeout;
while (System.currentTimeMillis() < endTimeMillis) {
if (table.getTableItem(0) != null) {
return;
} else {
try {
Thread.sleep(THREAD_SLEEP_TIME);
} catch (InterruptedException e) {
e.fillInStackTrace();
}
}
}
}
示例2: testThatAllProjectsAreDeselectedWithDeselectAll
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入方法依赖的package包/类
@Test
public void testThatAllProjectsAreDeselectedWithDeselectAll() {
openImportProjectWizardPage();
final SWTBotTable projectTable = bot.table(0);
for (int i = 0; i < projectTable.rowCount(); i++) {
projectTable.getTableItem(i).check();
}
bot.button("Deselect All").click();
for (int i = 0; i < projectTable.rowCount(); i++) {
final SWTBotTableItem oneProjectRow = projectTable.getTableItem(i);
Assert.assertFalse(oneProjectRow.isChecked());
}
}
示例3: assertContext
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入方法依赖的package包/类
public void assertContext(SWTBotShell page, SummaryExecutionRow[] rows) {
SWTBotTable table = bot.tableWithId(
org.gw4e.eclipse.wizard.runasmanual.SummaryExecutionPage.GW4E_MANUAL_ELEMENT_ID,
org.gw4e.eclipse.wizard.runasmanual.SummaryExecutionPage.GW4E_MANUAL_TABLE_VIEWER_SUMMARY_ID);
int max = table.rowCount();
for (int i = 0; i < max; i++) {
SWTBotTableItem item = table.getTableItem(i);
String status = getStatus(item);
String step = item.getText(1);
String result = item.getText(2);
String description = item.getText(4);
String statusExpected = rows[i].getStatus() + "";
String stepExpected = rows[i].getStepname();
String resultExpected = rows[i].getResult();
String defaultResult = MessageUtil.getString("enter_a_result_if_verification_failed");
if (defaultResult.equalsIgnoreCase(resultExpected)) {
resultExpected = "";
}
String descriptionExpected = rows[i].getDescription();
org.junit.Assert.assertEquals("Invalid status", statusExpected, status);
org.junit.Assert.assertEquals("Invalid step", stepExpected, step);
org.junit.Assert.assertEquals("Invalid result", resultExpected, result);
org.junit.Assert.assertEquals("Invalid description", descriptionExpected, description);
}
}
示例4: selectAdditionalContext
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入方法依赖的package包/类
public void selectAdditionalContext (String [] additionalsContext) {
SWTBotTable table = bot.tableWithId(JUnitGW4ETestUIPage.GW4E_CONVERSION_WIDGET_ID,JUnitGW4ETestUIPage.GW4E_LAUNCH_TEST_CONFIGURATION_ADDITIONAL_CONTEXT);
int count = table.rowCount();
for (String context : additionalsContext) {
for (int i = 0; i < count; i++) {
SWTBotTableItem item = table.getTableItem(i);
int cols = table.columnCount();
for (int j = 0; j < cols; j++) {
if (item.getText(j).equals(context)) {
item.check();
};
}
}
}
}
示例5: selectGenerators
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入方法依赖的package包/类
public void selectGenerators (String [] generators) {
SWTBotTable table = bot.tableWithId(BuildPoliciesCheckboxTableViewer.GW4E_CONVERSION_WIDGET_ID, BuildPoliciesCheckboxTableViewer.GW4E_CONVERSION_TABLE_GENERATORS);
int max = table.rowCount();
for (int i = 0; i < max; i++) {
SWTBotTableItem item = table.getTableItem(i);
for (String generator : generators) {
if (generator.equalsIgnoreCase(item.getText())) {
item.check();
}
}
}
}
示例6: hasGenerator
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入方法依赖的package包/类
public boolean hasGenerator (String value) {
SWTBotTable table = getBuildPoliciesTable();
int max = table.rowCount();
for (int i = 0; i < max; i++) {
SWTBotTableItem item = table.getTableItem(i);
if (value.equalsIgnoreCase(item.getText())) {
return true;
}
}
return false;
}
示例7: setSelectionFileStatus
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入方法依赖的package包/类
public void setSelectionFileStatus (String path,boolean checked) {
SWTBotTable table= getTable ();
int max=table.rowCount();
for (int i = 0; i < max; i++) {
SWTBotTableItem tableItem = table.getTableItem(i);
ModelData d = (ModelData) tableItem.widget.getData();
if (d.getName().equalsIgnoreCase(path)) {
tableItem.widget.setChecked(checked);
}
}
}
示例8: selectPathGenerator
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入方法依赖的package包/类
public void selectPathGenerator (String file,String path) {
SWTBotTable table= getTable ();
int max=table.rowCount();
for (int i = 0; i < max; i++) {
SWTBotTableItem tableItem = table.getTableItem(i);
ModelData d = (ModelData) tableItem.widget.getData();
if (d.getName().equalsIgnoreCase(file)) {
selectComboPathGenerator(tableItem,path);
}
}
}
示例9: testThatAllProjectsAreSelectedWithSelectAll
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入方法依赖的package包/类
@Test
public void testThatAllProjectsAreSelectedWithSelectAll() {
openImportProjectWizardPage();
final SWTBotTable projectTable = bot.table(0);
bot.button("Select All").click();
for (int i = 0; i < projectTable.rowCount(); i++) {
final SWTBotTableItem oneProjectRow = projectTable.getTableItem(i);
Assert.assertTrue(oneProjectRow.isChecked());
}
}
示例10: testThatAlreadyImportedProjectIsGrayedInProjectTable
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入方法依赖的package包/类
@Test
public void testThatAlreadyImportedProjectIsGrayedInProjectTable() throws CoreException {
importCodenvyProject(MOCK_WORKSPACE_NAME, MOCK_PROJECT_NAME);
openImportProjectWizardPage();
final SWTBotTable projectTable = bot.table(0);
for (int i = 0; i < projectTable.rowCount(); i++) {
final SWTBotTableItem oneProjectRow = projectTable.getTableItem(i);
Assert.assertTrue(oneProjectRow.isGrayed() == MOCK_PROJECT_NAME.equals(projectTable.cell(i, 0)));
}
}
示例11: executeQuickFixForErrorMessage
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入方法依赖的package包/类
public void executeQuickFixForErrorMessage(String expectedErrorMessageInProblemView, String quickfixmessage,
ICondition[] conditions) throws CoreException {
print ();
bot.waitUntil(new ErrorIsInProblemView(this, expectedErrorMessageInProblemView));
SWTBotTreeItem item = findErrorItemWithText(expectedErrorMessageInProblemView);
item.setFocus();
item.click();
bot.waitUntil(new IsItemSelectedInErrors(this, item));
ICondition condition = new DefaultCondition () {
@Override
public boolean test() throws Exception {
item.contextMenu().menu("Quick Fix").click();
try {
bot.waitUntil(Conditions.shellIsActive("Quick Fix"), 2 * 1000 );
} catch (Exception e) {
return false;
}
return true;
}
@Override
public String getFailureMessage() {
return "Unable to open the Quick fix";
}
};
bot.waitUntil(condition, 15 * 1000);
SWTBotShell shell = bot.shell("Quick Fix");
SWTBotTable table = shell.bot().tableWithLabel("Select a fix:");
SWTBotTableItem thequickFixItem = table.getTableItem(quickfixmessage);
thequickFixItem.click();
thequickFixItem.select();
SWTBotButton button = shell.bot().button("Finish");
button.click();
bot.waitUntil(Conditions.shellCloses(shell),TIMEOUT);
bot.saveAllEditors();
GW4EProject.fullBuild();
if (conditions != null) {
for (int i = 0; i < conditions.length; i++) {
bot.waitUntil(conditions[i], TIMEOUT);
}
}
}
示例12: selectRowWithValue
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入方法依赖的package包/类
void selectRowWithValue (SWTBotTable table,String value) {
SWTBotTableItem item = table.getTableItem(value);
item.select();
item.click();
}
示例13: verifyRemovedOrderHasNotBeenDeleted
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入方法依赖的package包/类
private void verifyRemovedOrderHasNotBeenDeleted() {
SearchOrdersDialogPageObject searchOrdersDialog = new SearchOrdersDialogPageObject(
scenariooWriterHelper);
searchOrdersDialog.open();
searchOrdersDialog.enterOrderNumber("Order");
searchOrdersDialog.startSearch();
SWTBotTable table = bot.table();
SWTBotTableItem item = table.getTableItem(REMOVED_ORDER_NUMBER);
LOGGER.info(item.toString());
Assert.assertNotNull(item);
bot.button("Cancel").click();
}
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:20,代码来源:RemoveOrderFromOrderOverviewAndVerifyThatTheOrderStillExistsTest.java