本文整理汇总了Java中org.eclipse.swtbot.swt.finder.widgets.SWTBotText类的典型用法代码示例。如果您正苦于以下问题:Java SWTBotText类的具体用法?Java SWTBotText怎么用?Java SWTBotText使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SWTBotText类属于org.eclipse.swtbot.swt.finder.widgets包,在下文中一共展示了SWTBotText类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: checkApply
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入依赖的package包/类
@Test
public void checkApply() throws Exception {
assertEquals(config.getDescription(), bot.table(0).cell(1, 1));
bot.table(0).click(1, 1);
SWTBotText text = bot.text(0);
assertNotNull(text);
assertEquals("Hello World", text.getText());
assertEquals("Hello World", config.getDescription());
text.setText("Something else");
assertEquals("Hello World", config.getDescription());
assertEquals("Something else", text.getText());
text.display.syncExec(()->viewer.applyEditorValue());
assertEquals("Something else", config.getDescription());
assertEquals("Something else", bot.table(0).cell(1, 1));
}
开发者ID:eclipse,项目名称:scanning,代码行数:22,代码来源:SampleInformationTest.java
示例2: validateRun
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入依赖的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
示例3: addFourOrdersToOrdersOverview
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入依赖的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();
}
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:27,代码来源:InitOrderOverviewStatement.java
示例4: getTheProgramArgsTextBox
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入依赖的package包/类
public static String getTheProgramArgsTextBox(SWTWorkbenchBot bot) {
SwtBotUtils.print("Retrieve Args");
// When I open debug configuration
SwtBotMenuActions.openDebugConfiguration(bot);
// Focus on the Arguments Tab
bot.cTabItem("Arguments").activate().setFocus();
// Get the program arguments
SWTBotText programArgs = bot.textInGroup("Program arguments:");
String text = programArgs.getText();
// And close the debug configuration dialog
bot.button("Close").click();
// And closing may cause a save change dialog
SwtBotProjectDebug.closeSaveChangesDialogIfNeedBe(bot);
SwtBotUtils.print("Retrieved Args");
return text;
}
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:24,代码来源:SwtBotProjectDebug.java
示例5: gotoSeg
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入依赖的package包/类
/**
* 跳到指定文本段
* @param segNum
* 文本段行号
*/
public void gotoSeg(int segNum) {
getNatTable();
nattable.click(1, 1);
int targetRowIndex;
if (isHorizontalLayout()) {
targetRowIndex = segNum - 1;
} else {
targetRowIndex = (segNum - 1) * 2;
}
int selectedRowIndex = nattable.indexOfSelectedRow(positionOfTargetTextColumn());
// 先判断指定文本段是否已经被选中,若未被选中才继续
if (segNum != 1 && targetRowIndex != selectedRowIndex) {
SWTBotText text = editorBot.text(lineNumLastValue);
text.setText(String.valueOf(segNum));
text.pressShortcut(Keystrokes.LF);
lineNumLastValue = String.valueOf(segNum);
// 确认选中了指定文本段
bot.waitUntil(new IsSegmentSelected(this, targetRowIndex));
}
}
开发者ID:heartsome,项目名称:translationstudio8,代码行数:27,代码来源:XlfEditor.java
示例6: checkNameIneditable
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入依赖的package包/类
@Test(expected=Exception.class)
public void checkNameIneditable() throws Exception {
// stage_x is mm and T is K. This tests picking up the units from the scannable!
assertEquals(bbox.getFastAxisName(), bot.table(0).cell(0, 1));
bot.table(0).click(0, 1); // Make the file editor
// This does pass if fast axis name is editable, I checked by doing that in BoundingBox.
SWTBotText text = bot.performWithTimeout(()->bot.text(0), 500);
assertNull(text);
}
开发者ID:eclipse,项目名称:scanning,代码行数:13,代码来源:BoundingBoxTest.java
示例7: checkSettingFastValue
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入依赖的package包/类
@Test
public void checkSettingFastValue() throws Exception {
// stage_x is mm and T is K. This tests picking up the units from the scannable!
assertEquals(bbox.getFastAxisStart()+" mm", bot.table(0).cell(1, 1));
bot.table(0).click(1, 1); // Make the file editor
SWTBotText text = bot.text(0);
assertNotNull(text);
text.setText("10");
text.display.syncExec(()->viewer.applyEditorValue());
assertEquals("10.0 mm", bbox.getFastAxisStart()+" mm");
}
开发者ID:eclipse,项目名称:scanning,代码行数:16,代码来源:BoundingBoxTest.java
示例8: focusOut
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入依赖的package包/类
protected void focusOut(SWTBotGefEditPart part,SWTBotText text,String tab ) {
editor.setFocus();
selectPart(part);
selectTab(part, tab);
try {
text.setFocus();
} catch (Throwable e) {
}
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:10,代码来源:GraphElementProperties.java
示例9: setSharedName
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入依赖的package包/类
public void setSharedName(SWTBotGefEditPart part, String sharedname, boolean enabled) {
selectPart(part);
SWTBotText text = botView.bot().textWithId(VertexDefaultSection.WIDGET_ID,
VertexDefaultSection.WIDGET_TEXT_SHAREDNAME);
if (enabled) {
text.setText(sharedname);
editor.setFocus();
text.setFocus();
} else {
TestCase.assertFalse("Text should be disabled", text.isEnabled());
}
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:13,代码来源:VertexProperties.java
示例10: setRequirement
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入依赖的package包/类
public void setRequirement(SWTBotGefEditPart part, String requirement) {
selectPart(part);
SWTBotText text = botView.bot().textWithId(VertexDefaultSection.WIDGET_ID,
VertexDefaultSection.WIDGET_TEXT_REQUIREMENTS);
text.setText(requirement);
editor.setFocus();
text.setFocus();
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:9,代码来源:VertexProperties.java
示例11: setWeight
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入依赖的package包/类
public void setWeight(SWTBotGefEditPart part, double value) {
selectPart(part);
selectTab(part, PROPERTIES);
final SWTBotText text = botView.bot().textWithId(WIDGET_ID,WIDGET_TEXT_WEIGHT);
text.setText(value+"");
Display.getDefault().asyncExec(new Runnable () {
@Override
public void run() {
//SWTBotText text = botView.bot().textWithId(WIDGET_ID,WIDGET_TEXT_WEIGHT);
text.widget.notifyListeners(SWT.FocusOut, createFocusEvent((Control)text.widget));
}
});
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:15,代码来源:EdgeProperties.java
示例12: getWeight
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入依赖的package包/类
public String getWeight(SWTBotGefEditPart part) {
selectPart(part);
SWTBotText text = botView.bot().textWithId(WIDGET_ID,WIDGET_TEXT_DESCRIPTION);
String s = text.getText();
if (s==null) return "";
return s;
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:8,代码来源:EdgeProperties.java
示例13: hasRequirements
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入依赖的package包/类
public boolean hasRequirements (Set<String> requirements) {
SWTBotText st = bot.textWithId(GraphModelPropertyPage.GW4E_FILE_REQUIREMENT_TEXT_ID,GraphModelPropertyPage.GW4E_FILE_REQUIREMENT_TEXT_ID);
String currentText = st.getText();
for (String req : requirements) {
if (currentText.indexOf(req)!=-1) continue;
return false;
}
return true;
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:10,代码来源:GraphModelProperties.java
示例14: hasMethods
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入依赖的package包/类
public boolean hasMethods (Set<String> methods) {
SWTBotText st = bot.textWithId(GraphModelPropertyPage.GW4E_FILE_METHODS_TEXT_ID,GraphModelPropertyPage.GW4E_FILE_METHODS_TEXT_ID);
String currentText = st.getText();
for (String method : methods) {
if (currentText.indexOf(method)!=-1) continue;
return false;
}
return true;
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:10,代码来源:GraphModelProperties.java
示例15: refactorModelName
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入依赖的package包/类
public void refactorModelName (String newName,String [] nodes) {
SWTBotTree tree = getProjectTree();
SWTBotTreeItem item = tree.expandNode(nodes);
item.select();
item.setFocus();
SWTBotMenu menu = item.contextMenu("Refactor").contextMenu("Rename...");
menu.click();
bot.waitUntil(Conditions.shellIsActive("Rename Resource"));
SWTBotShell shell = bot.shell("Rename Resource");
SWTBotText text = shell.bot().textWithLabel("New name:");
text.setText(newName);
ICondition condition = new DefaultCondition () {
@Override
public boolean test() throws Exception {
return shell.bot().button("OK").isEnabled();
}
@Override
public String getFailureMessage() {
return "OK button not enabled";
}
};
bot.waitUntil(condition);
shell.bot().button("OK").click();
bot.waitUntil(Conditions.shellCloses(shell));
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:34,代码来源:ModelRefactoring.java
示例16: refactorRenameFolder
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入依赖的package包/类
public void refactorRenameFolder (String [] nodes, String name) {
SWTBotTree tree = getProjectTree();
SWTBotTreeItem item = tree.expandNode(nodes);
item.select();
item.setFocus();
SWTBotMenu menu = item.contextMenu("Refactor").contextMenu("Rename...");
menu.click();
bot.waitUntil(Conditions.shellIsActive("Rename Package"));
SWTBotShell shell = bot.shell("Rename Package");
SWTBotText text = shell.bot().textWithLabel("New name:");
text.setText(name);
ICondition condition = new DefaultCondition () {
@Override
public boolean test() throws Exception {
return shell.bot().button("OK").isEnabled();
}
@Override
public String getFailureMessage() {
return "OK button not enabled";
}
};
bot.waitUntil(condition);
shell.bot().button("OK").click();
bot.waitUntil(Conditions.shellCloses(shell), 30 * 1000);
}
开发者ID:gw4e,项目名称:gw4e.project,代码行数:35,代码来源:ModelRefactoring.java
示例17: enterOrderNumber
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入依赖的package包/类
/**
*
*/
public void enterOrderNumber(final String orderNumber) {
SWTBotText text = bot.textWithLabel("&Order Number");
text.typeText(orderNumber);
bot.sleep(100);
scenariooWriterHelper.writeStep("order_number_entered", PageName.SEARCH_DIALOG, screenshot());
}
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:10,代码来源:SearchOrdersDialogPageObject.java
示例18: createOrderTemp
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入依赖的package包/类
private void createOrderTemp() {
// add new Order, As we don't want to interfere with other test cases
bot.toolbarButtonWithTooltip("Create Order").click();
SWTBotText text = bot.textWithLabel("&Order Number");
text.typeText(ORDER_NUMBER_TEMP);
bot.button("Next >").click();
bot.buttonWithTooltip("Add Position").click();
// Select Item in Table
SWTBotTable table = bot.table();
// Position Amount
table.click(0, 4);
bot.sleep(100);
bot.text(1).setText("2");
// Select Item
bot.table().click(0, 2);
bot.sleep(100);
bot.ccomboBox(0).setSelection(13);
// loose Focus
table.click(0, 3);
bot.sleep(100);
// click Finish
bot.button("Finish").click();
bot.sleep(500);
LOGGER.info("\n"
+ "-----------------------------------------------------------------\n"
+ "create temp order rule : order " + ORDER_NUMBER_TEMP + " created.\n"
+ "-----------------------------------------------------------------\n\n");
}
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:37,代码来源:CreateTempOrderRule.java
示例19: enterOrderNumberAndGenerateDocu
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入依赖的package包/类
private void enterOrderNumberAndGenerateDocu() {
SWTBotText text = bot.textWithLabel("&Order Number");
text.setText("");
text.typeText(TARGET_ORDER_NUMBER);
bot.sleep(100);
scenariooWriterHelper.writeStep("order_number_entered", PageName.ORDER_DETAIL, screenshot());
}
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:8,代码来源:EditOrderNumberUpdatesOpenedPositionsNotYetImplementedTest.java
示例20: checkTextRejectsInvalidInput
import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入依赖的package包/类
/**
* Checks that the widget denies changes when the spinner's associated text
* widget is set to an invalid time.
*/
@Test
public void checkTextRejectsInvalidInput() {
// Get the text widget. We will try feeding it invalid times.
SWTBotText widget = getTimeText();
// Create a list of invalid times.
List<String> invalidTimes = new ArrayList<String>();
invalidTimes.add("");
invalidTimes.add("infinite improbability");
invalidTimes.add(" ");
// Get the initial time.
final AtomicReference<Double> time = new AtomicReference<Double>();
getDisplay().syncExec(new Runnable() {
@Override
public void run() {
time.set(timeComposite.getTime());
}
});
final double initialTime = time.get();
for (String invalidTime : invalidTimes) {
// Try setting an invalid time string.
widget.selectAll();
widget.typeText(invalidTime + SWT.CR + SWT.LF);
getDisplay().syncExec(new Runnable() {
@Override
public void run() {
time.set(timeComposite.getTime());
}
});
// Ensure that the time did not change.
assertEquals(initialTime, time.get(), epsilon);
}
return;
}
开发者ID:eclipse,项目名称:eavp,代码行数:43,代码来源:TimeSliderCompositeTester.java
注:本文中的org.eclipse.swtbot.swt.finder.widgets.SWTBotText类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论