本文整理汇总了Java中org.eclipse.swtbot.swt.finder.widgets.SWTBotTable类的典型用法代码示例。如果您正苦于以下问题:Java SWTBotTable类的具体用法?Java SWTBotTable怎么用?Java SWTBotTable使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SWTBotTable类属于org.eclipse.swtbot.swt.finder.widgets包,在下文中一共展示了SWTBotTable类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateKeyCustomProperty
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入依赖的package包/类
public void updateKeyCustomProperty(SWTBotGefEditPart part, String key, String newkey) {
GraphElement element = selectPart(part);
selectTab(part, CUSTOM);
SWTBotTable table = botView.bot().tableWithId(CustomProperties.PROJECT_PROPERTY_PAGE_WIDGET_ID, CustomProperties.CUSTOM_PROPERTY_LIST_WITH_BUTTON);
bot.waitUntil(new DefaultCondition() {
@Override
public boolean test() throws Exception {
int row = table.indexOf(key, "PROPERTY");
if (row == -1) return true;
table.click(row, 0);
bot.sleep(1000);
bot.text(key, 0).setText(newkey);
bot.text(KeyStroke.getInstance(SWT.TAB)+"" , 0);
return false;
}
@Override
public String getFailureMessage() {
return "key not set";
}
},2 * 60 * 1000);
}
示例2: updateValueCustomProperty
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入依赖的package包/类
public void updateValueCustomProperty(SWTBotGefEditPart part, String key, String oldvalue, String newValue) {
GraphElement element = selectPart(part);
selectTab(part, CUSTOM);
SWTBotTable table = botView.bot().tableWithId(CustomProperties.PROJECT_PROPERTY_PAGE_WIDGET_ID, CustomProperties.CUSTOM_PROPERTY_LIST_WITH_BUTTON);
bot.waitUntil(new DefaultCondition() {
@Override
public boolean test() throws Exception {
int row = table.indexOf(oldvalue, "VALUE");
if (row == -1) return true;
table.click(row, 1);
bot.sleep(1000);
bot.text(oldvalue, 0).setText(newValue);
bot.text(KeyStroke.getInstance(SWT.TAB)+"" , 0);
return false;
}
@Override
public String getFailureMessage() {
return "value not set";
}
},2 * 60 * 1000);
}
示例3: deleteCustomProperty
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入依赖的package包/类
public void deleteCustomProperty(SWTBotGefEditPart part, String key) {
GraphElement element = selectPart(part);
selectTab(part, CUSTOM);
SWTBotTable table = botView.bot().tableWithId(CustomProperties.PROJECT_PROPERTY_PAGE_WIDGET_ID, CustomProperties.CUSTOM_PROPERTY_LIST_WITH_BUTTON);
bot.waitUntil(new DefaultCondition() {
@Override
public boolean test() throws Exception {
int row = table.indexOf(key, "PROPERTY");
table.click(row, 0);
table.contextMenu("Remove entry").click();
return table.indexOf(key, 0) == -1;
}
@Override
public String getFailureMessage() {
return "row not deleted";
}
},2 * 60 * 1000);
}
示例4: testSelectBookmarksFile
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入依赖的package包/类
@Test
public void testSelectBookmarksFile() throws Exception {
// Given
File file = createBookmarksFile(gdriveConnectionUser1, "bookmarks1", "any");
openDialog(shell -> createDialog(shell, gdriveConnectionUser1,
Optional.of(gdriveConnectionUser1.getApplicationFolderId())));
// When
SWTBotTable botTable = bot.table();
assertEquals(1, botTable.rowCount());
botTable.select(0);
clickOkButton();
// Then
assertEquals(file.getId(), dialog.getFile().getId());
}
示例5: testAddLinkAndSelectBookmarksFile
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入依赖的package包/类
@Test
@Ignore("Currently fails when run with maven")
public void testAddLinkAndSelectBookmarksFile() throws Exception {
// Given
File file = createBookmarksFile(gdriveConnectionUser2, "bookmarks from user2", "any");
shareWithAnyoneWithLink(gdriveConnectionUser2, file.getId());
openDialog(shell -> createDialog(shell, gdriveConnectionUser1,
Optional.of(gdriveConnectionUser1.getApplicationFolderId())));
// When
SWTBotTable botTable = bot.table();
assertEquals(0, botTable.rowCount());
addLink(file.getAlternateLink());
botTable.getTableItem(0).select();
clickOkButton();
// Then
assertEquals(file.getId(), dialog.getFile().getId());
}
示例6: 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();
}
}
}
}
示例7: addFourOrdersToOrdersOverview
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入依赖的package包/类
private void addFourOrdersToOrdersOverview() {
SWTBotView view = wbBot.partById(BaseSWTBotTest.PART_ID_ORDER_OVERVIEW);
view.toolbarButton("Search Order").click();
SWTBotText text = bot.textWithLabel("&Order Number");
text.typeText("Order");
bot.buttonWithTooltip("Start Search").click();
// Select Item in Table
SWTBotTable table = bot.table();
totalPersistedOrders = table.rowCount();
table.click(0, 5);
bot.sleep(100);
table.click(1, 5);
bot.sleep(100);
table.click(3, 5);
bot.sleep(100);
table.click(5, 5);
bot.sleep(100);
// click Finish
bot.button("OK").click();
}
示例8: 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());
}
}
示例9: getCustomProperty
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入依赖的package包/类
public String getCustomProperty(SWTBotGefEditPart part, String key) {
GraphElement element = selectPart(part);
selectTab(part, CUSTOM);
SWTBotTable table = botView.bot().tableWithId(CustomProperties.PROJECT_PROPERTY_PAGE_WIDGET_ID, CustomProperties.CUSTOM_PROPERTY_LIST_WITH_BUTTON);
int row = table.indexOf(key, "PROPERTY");
return table.cell(row, "VALUE");
}
示例10: 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);
}
}
示例11: assertTargetElements
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入依赖的package包/类
public void assertTargetElements(String... names) {
SWTBotTable table = bot.tableWithId(GraphElementSelectionUIPage.GW4E_CONVERSION_WIDGET_ID,
GraphElementSelectionUIPage.GW4E_CONVERSION_TARGET_TABLE_ID);
for (String name : names) {
int index = table.indexOf(name, 0);
if (index == -1)
org.junit.Assert.fail(name + " not found in the target column");
}
}
示例12: assertSourceElements
import org.eclipse.swtbot.swt.finder.widgets.SWTBotTable; //导入依赖的package包/类
public void assertSourceElements(String... names) {
SWTBotTable table = bot.tableWithId(GraphElementSelectionUIPage.GW4E_CONVERSION_WIDGET_ID,
GraphElementSelectionUIPage.GW4E_CONVERSION_SOURCE_TABLE_ID);
for (String name : names) {
int index = table.indexOf(name, 0);
if (index == -1)
org.junit.Assert.fail(name + " not found in the source column");
}
}
示例13: 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();
};
}
}
}
}
示例14: 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();
}
}
}
}
示例15: 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;
}