本文整理汇总了Java中org.eclipse.swtbot.swt.finder.widgets.SWTBotText类的典型用法代码示例。如果您正苦于以下问题:Java SWTBotText类的具体用法?Java SWTBotText怎么用?Java SWTBotText使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SWTBotText类属于org.eclipse.swtbot.swt.finder.widgets包,在下文中一共展示了SWTBotText类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));
}
示例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));
}
示例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();
}
示例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;
}
示例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));
}
}
示例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);
}
示例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");
}
示例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) {
}
}
示例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());
}
}
示例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();
}
示例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));
}
});
}
示例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;
}
示例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;
}
示例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;
}
示例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));
}