本文整理汇总了Java中org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo类的典型用法代码示例。如果您正苦于以下问题:Java SWTBotCombo类的具体用法?Java SWTBotCombo怎么用?Java SWTBotCombo使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SWTBotCombo类属于org.eclipse.swtbot.swt.finder.widgets包,在下文中一共展示了SWTBotCombo类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: feed
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo; //导入依赖的package包/类
public void feed(boolean exportAsTest, String workbookfile, String workbooktitle, String caseid,
boolean updatemode, String componentname, String priority, String dateformat) {
if (exportAsTest) {
getExportAsTestResultButton().click();
} else {
getExportAsTestTemplateButton().click();
}
try {
SWTBotCombo combo = getComboWorkBook();
combo.setSelection(workbookfile);
} catch (Exception e) {
getTextWorkBook().setText(workbookfile);
}
getTextWorkbookTitle().setText(workbooktitle);
getTextCaseId().setText(caseid);
if (updatemode) {
getBtnUpdateIfTestcaseid().click();
}
getTextComponentName().setText(componentname);
getComboPriority().setSelection(priority);
if (dateformat != null)
getTextDateFormat().setText(dateformat);
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:26,代码来源:RunAsManualWizard.java
示例2: setPathGenerator
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo; //导入依赖的package包/类
private void setPathGenerator (String pathGenerator) {
ICondition condition = new DefaultCondition () {
@Override
public boolean test() throws Exception {
try {
SWTBotCombo combo = bot.comboBoxWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID, GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_COMBO_PATH_GENERATOR);
combo.setSelection(pathGenerator);
} catch (Exception e) {
return false;
}
return true;
}
@Override
public String getFailureMessage() {
return "Unable to set " + pathGenerator+ " in the combo";
}
};
bot.waitUntil(condition);
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:22,代码来源:GW4EManualRunner.java
示例3: validateRun
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo; //导入依赖的package包/类
public void validateRun (String configurationName,String projectName,String filepath,boolean printUnvisited,boolean verbose,String startElement,String generator) {
SWTBotShell shell = openExistingRun (configurationName);
SWTBotText projectText = shell.bot().textWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_TEXT_ID_PROJECT);
assertEquals("Wrong project name",projectName,projectText.getText());
SWTBotText modelText = shell.bot().textWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_TEXT_ID_MODEL);
assertEquals("Wrong model name",filepath,modelText.getText());
SWTBotCheckBox verboseButton = shell.bot().checkBoxWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_BUTTON_ID_VERBOSE);
assertEquals("Wrong verbose value",verbose,verboseButton.isChecked());
SWTBotCheckBox unvisitedButton = shell.bot().checkBoxWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_BUTTON_ID_PRINT_UNVISITED);
assertEquals("Wrong verbose value",verbose,unvisitedButton.isChecked());
SWTBotText startElementText = shell.bot().textWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_TEXT_ID_START_ELEMENT);
assertEquals("Wrong start element",startElement,startElementText.getText());
SWTBotCombo generatorCombo = shell.bot().comboBoxWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_COMBO_PATH_GENERATOR_ID_MODEL);
assertEquals("Wrong generator value",generator,generatorCombo.getText());
SWTBotButton closeButton = bot.button("Close");
closeButton.click();
bot.waitUntil(Conditions.shellCloses(shell));
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:27,代码来源:GW4EOfflineRunner.java
示例4: selectComboPathGenerator
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo; //导入依赖的package包/类
private void selectComboPathGenerator (String path) {
DefaultCondition condition = new DefaultCondition() {
@Override
public boolean test() throws Exception {
try {
SWTBotCombo combo = bot.comboBoxWithId(GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_CONTROL_ID,GW4ELaunchConfigurationTab.GW4E_LAUNCH_CONFIGURATION_COMBO_PATH_GENERATOR_ID_MODEL);
combo.setSelection(path);
return true;
} catch (Exception e) {
e.printStackTrace();
return false;
}
}
@Override
public String getFailureMessage() {
return "Unable to open the path generator combo";
}
};
bot.waitUntil(condition);
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:23,代码来源:GW4EOfflineRunner.java
示例5: assertStagingLocationCombo
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo; //导入依赖的package包/类
private void assertStagingLocationCombo(final String... buckets) {
bot.waitUntil(new DefaultCondition() {
@Override
public boolean test() throws Exception {
spinEvents();
return new SWTBotCombo(stagingLocations).itemCount() == buckets.length;
}
@Override
public String getFailureMessage() {
return "missing staging buckets";
}
});
Assert.assertArrayEquals(buckets, stagingLocations.getItems());
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:17,代码来源:RunOptionsDefaultsComponentTest.java
示例6: selectArticleAndGenerateDocu
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo; //导入依赖的package包/类
public void selectArticleAndGenerateDocu(final int indexArticleCB) {
final SWTBotCombo combo = bot.comboBoxWithLabel("&Article Number");
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
combo.widget.setListVisible(true);
bot.waitUntil(new PopUpOpenedCondition(combo));
}
});
generateDocu("combo_popup_opened");
combo.setSelection(indexArticleCB);
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
combo.widget.setListVisible(false);
bot.waitUntil(new ComboListClosedCondition(combo));
}
});
generateDocu("article_combo_box_selected");
}
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:24,代码来源:PositionDetailPageObject.java
示例7: selectArticleAndGenerateDocu
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo; //导入依赖的package包/类
private void selectArticleAndGenerateDocu(final String existingAssignedArticle) {
final SWTBotCombo combo = bot.comboBoxWithLabel("&Article Number");
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
combo.widget.setListVisible(true);
bot.waitUntil(new PopUpOpenedCondition(combo));
}
});
bot.sleep(500);
scenariooWriterHelper.writeStep("combo_popup_opened", PageName.POSITION_DETAIL, screenshot());
combo.setSelection(1); // General Ackbar
Display.getDefault().syncExec(new Runnable() {
@Override
public void run() {
combo.widget.setListVisible(false);
bot.waitUntil(new PopUpDisappearedCondition(combo));
}
});
bot.sleep(100);
scenariooWriterHelper.writeStep("article_selected", PageName.POSITION_DETAIL, screenshot());
}
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:26,代码来源:ChangeArticleUpdatesTheOrderOverviewTest.java
示例8: assertExtensionValue
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo; //导入依赖的package包/类
public void assertExtensionValue(int index,String value) {
SWTBotCombo combo = bot.comboBoxWithId(ExecutionContextSelectionUIPage.GW4E_CONVERSION_WIDGET_ID,
ExecutionContextSelectionUIPage.GW4E_CONVERSION_COMBO_ANCESTOR_EXTEND_TEST);
String[] items = combo.items();
try {
org.junit.Assert.assertEquals (value, items[index]);
} catch (Exception ex) {
String all = "";
for (String string : items) {
all = all + string + ",";
}
org.junit.Assert.fail(" Cannot find " + value + " in " + all);
}
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:15,代码来源:StaticGeneratorWizard.java
示例9: getItemCount
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo; //导入依赖的package包/类
/**
* Gets the item count.
*
* @param control
* the control
* @return the item count
*/
private static int getItemCount(final AbstractSWTBotControl<?> control) {
int itemCount;
if (control instanceof SWTBotCCombo) {
itemCount = ((SWTBotCCombo) control).itemCount();
} else if (control instanceof SWTBotList) {
itemCount = ((SWTBotList) control).itemCount();
} else if (control instanceof SWTBotCombo) {
itemCount = ((SWTBotCombo) control).itemCount();
} else {
throw new WrappedException("Control not supported", null);
}
return itemCount;
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:21,代码来源:SwtBotControlUtils.java
示例10: selectInComboBox
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo; //导入依赖的package包/类
/**
* Makes a selection in the combo box with given label. Selects element of given index.
*
* @param boxLabel
* the box label
* @param selectionIndex
* the selection index
*/
public void selectInComboBox(final String boxLabel, final int selectionIndex) {
SWTBotCombo combo = comboBoxWithLabel(boxLabel);
if (selectionIndex >= combo.itemCount()) {
throw new IndexOutOfBoundsException(NLS.bind("Illegal selection provided, {0} items exist", combo.itemCount()));
} else if (selectionIndex == UNDEFINED_COMBO_BOX_INDEX) {
return; // Do nothing, nothing should be selected
}
combo.setSelection(selectionIndex);
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:18,代码来源:SwtWizardBot.java
示例11: checkDefaults
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo; //导入依赖的package包/类
/**
* Checks the default appearance for
*/
@Test
public void checkDefaults() {
// Create a basic, default dialog.
dialog = new ComboDialog(getShell(), false);
// Open the dialog and get an SWTBot for it.
openDialog();
// Get the widgets.
SWTBotLabel label = getInfoLabel();
SWTBotCombo combo = getCombo();
SWTBotButton okButton = getOKButton();
SWTBotButton cancelButton = getCancelButton();
// Check the default appearance.
assertEquals("", getBot().activeShell().getText()); // Check the title.
assertEquals("Please select a value.", label.getText());
assertEnabled(combo);
assertEquals("", getCombo().getText());
assertEquals(0, getCombo().itemCount());
assertNotEnabled(okButton);
assertEnabled(cancelButton);
// Check the default value.
assertNull(dialog.getValue());
// Close the dialog.
closeDialog();
return;
}
开发者ID:eclipse,项目名称:eavp,代码行数:34,代码来源:ComboDialogTester.java
示例12: checkSetAllowedValues
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo; //导入依赖的package包/类
/**
* Checks that setting the allowed values properly updates the contents of
* the underlying combo widget.
*/
@Test
public void checkSetAllowedValues() {
// Set up some invalid input.
List<String> listWithNulls = new ArrayList<String>(allowedValues);
List<String> nullList = null;
listWithNulls.add(2, null);
dialog = new ComboDialog(getShell(), false);
// Trying to set a valid list of allowed values should return true.
// Trying to set the same set or invalid sets should return false.
assertTrue(dialog.setAllowedValues(allowedValues));
assertFalse(dialog.setAllowedValues(allowedValues));
assertFalse(dialog.setAllowedValues(listWithNulls));
assertFalse(dialog.setAllowedValues(nullList));
openDialog();
SWTBotCombo combo = getCombo();
// The combo should be enabled.
assertEnabled(combo);
// Check all of the items in the combo.
assertEquals(allowedValues.size(), combo.itemCount());
String[] items = combo.items();
for (int i = 0; i < items.length; i++) {
assertEquals(allowedValues.get(i), items[i]);
}
closeDialog();
return;
}
开发者ID:eclipse,项目名称:eavp,代码行数:39,代码来源:ComboDialogTester.java
示例13: getLangCombo
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo; //导入依赖的package包/类
/**
* @return SWTBotCombo 编辑器中的语言对下拉列表
*/
public SWTBotCombo getLangCombo() {
Pattern langCode = Pattern.compile("[a-z]{2}(-[A-Z]{2})? -> [a-z]{2}(-[A-Z]{2})?");
int index = 0;
while (true) {
Matcher m = langCode.matcher(editorBot.comboBox(index).getText());
if (m.find()) {
return editorBot.comboBox(index);
}
index++;
}
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:15,代码来源:XlfEditor.java
示例14: selectLangPair
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo; //导入依赖的package包/类
/**
* 选择指定的语言对
* @param srcLang
* 源语言代码
* @param tgtLang
* 目标语言代码
*/
public void selectLangPair(String srcLang, String tgtLang) {
String langPair = srcLang + " -> " + tgtLang;
SWTBotCombo langCombo = getLangCombo();
langCombo.setSelection(langPair);
bot.waitUntil(new IsComboEquals(langCombo, langPair));
SWTBotAssert.assertText(langPair, langCombo);
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:15,代码来源:XlfEditor.java
示例15: getSegFilterCombo
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo; //导入依赖的package包/类
/**
* 得到文本段过滤器下拉列表
* @return SWTBotCombo 文本段过滤器下拉列表
*/
public SWTBotCombo getSegFilterCombo() {
String defaultFilter = TsUIConstants.getString("cmbSegFilterAllSegments");
int index = 0;
while (true) {
SWTBotCombo segFilterCombo = editorBot.comboBox(index);
if (segFilterCombo.getText().equals(defaultFilter)) {
return segFilterCombo;
}
index++;
}
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:16,代码来源:XlfEditor.java
示例16: selectSegFilter
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo; //导入依赖的package包/类
/**
* 选择指定的文本段过滤器
* @param filterName
* 过滤器名称
*/
public void selectSegFilter(final String filterName) {
SWTBotCombo segFilterCombo = getSegFilterCombo();
segFilterCombo.setSelection(filterName);
bot.waitUntil(new IsComboEquals(segFilterCombo, filterName));
SWTBotAssert.assertText(filterName, segFilterCombo);
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:12,代码来源:XlfEditor.java
示例17: importCodenvyProject
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo; //导入依赖的package包/类
public void importCodenvyProject(String workspaceName, String projectName) {
final SWTBotShell shell = openImportProjectWizardPage();
final SWTBotCombo workspaceCombo = bot.comboBox(0);
workspaceCombo.setSelection(workspaceName);
final SWTBotTable projectTable = bot.table(0);
bot.waitUntil(new TableHasRows(projectTable));
for (int i = 0; i < projectTable.rowCount(); i++) {
if (projectTable.cell(i, 0).equals(projectName)) {
projectTable.getTableItem(i).check();
}
}
bot.table(0).getTableItem(projectName).check();
bot.button("Finish").click();
bot.waitUntil(shellCloses(shell));
try {
Job.getJobManager().join(CodenvyPlugin.FAMILY_CODENVY, null);
} catch (OperationCanceledException | InterruptedException e) {
throw new RuntimeException(e);
}
}
开发者ID:codenvy-legacy,项目名称:eclipse-plugin,代码行数:28,代码来源:SWTBotBaseTest.java
示例18: testThatAllWorkspacesAreAvailable
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo; //导入依赖的package包/类
@Test
public void testThatAllWorkspacesAreAvailable() {
openImportProjectWizardPage();
final SWTBotCombo workspaceComboBox = bot.comboBox(0);
Assert.assertEquals(MOCK_WORKSPACE_NAME, workspaceComboBox.items()[0]);
Assert.assertTrue(workspaceComboBox.itemCount() == 4);
}
开发者ID:codenvy-legacy,项目名称:eclipse-plugin,代码行数:10,代码来源:ProjectWizardPageTest.java
示例19: testThatWorkingSetComboAndButtonAreDisabledByDefault
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo; //导入依赖的package包/类
@Test
public void testThatWorkingSetComboAndButtonAreDisabledByDefault() {
openImportProjectWizardPage();
final SWTBotCombo workingSetComboBox = bot.comboBox(1);
final SWTBotButton workingSetSelectButton = bot.button("Select...");
Assert.assertFalse(workingSetComboBox.isEnabled());
Assert.assertFalse(workingSetSelectButton.isEnabled());
}
开发者ID:codenvy-legacy,项目名称:eclipse-plugin,代码行数:11,代码来源:ProjectWizardPageTest.java
示例20: setOperatorComboTo
import org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo; //导入依赖的package包/类
private void setOperatorComboTo(String value) {
SWTBotCombo combo = botView.bot().comboBoxWithId(OutLineComposite.GW_WIDGET_ID, OutLineComposite.GW_OUTLINE_WEIGHT_OPERATOR_COMBO);
combo.setSelection(value);
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:5,代码来源:OutLineView.java
注:本文中的org.eclipse.swtbot.swt.finder.widgets.SWTBotCombo类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论