当前位置: 首页>>代码示例>>Java>>正文


Java SWTBotText.setText方法代码示例

本文整理汇总了Java中org.eclipse.swtbot.swt.finder.widgets.SWTBotText.setText方法的典型用法代码示例。如果您正苦于以下问题:Java SWTBotText.setText方法的具体用法?Java SWTBotText.setText怎么用?Java SWTBotText.setText使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swtbot.swt.finder.widgets.SWTBotText的用法示例。


在下文中一共展示了SWTBotText.setText方法的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));

}
 
开发者ID:eclipse,项目名称:scanning,代码行数:22,代码来源:SampleInformationTest.java

示例2: 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

示例3: 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

示例4: 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

示例5: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: testPreferences

import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入方法依赖的package包/类
/**
 * Checks whether the preferences are displayed correctly.
 */
@Test
public void testPreferences() {
  openFeedbackPreferencePage();

  final SWTBotText text = bot.textWithLabel(LABELS__FEEDBACK_HANDLER_URL);
  assertThat(text.getText()).isEqualTo(DEFAULT_VALUES__FEEDBACK_HANDLER_URL);

  text.setText(SAMPLE_FEEDBACK_HANDLER_URL);

  pressOk();

  final String feedbackHandlerUrl = FeedbackPreferences.getString(FeedbackPreferences.FEEDBACK_HANDLER__URL);
  assertThat(feedbackHandlerUrl).isEqualTo(SAMPLE_FEEDBACK_HANDLER_URL);
}
 
开发者ID:sealuzh,项目名称:PerformanceHat,代码行数:18,代码来源:FeedbackPreferencesTest.java

示例11: createLocalProject

import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入方法依赖的package包/类
private void createLocalProject() {
	final int localProjectsSize = ESWorkspaceProvider.INSTANCE.getWorkspace().getLocalProjects().size();
	UIThreadRunnable.asyncExec(new VoidResult() {
		public void run() {
			final UICreateLocalProjectController localProjectController = new UICreateLocalProjectController(
				bot.getDisplay().getActiveShell());
			localProject = localProjectController.execute();
		}
	});
	final SWTBotText text = bot.text(0);
	text.setText("quux");
	final SWTBotButton button = bot.button("OK");
	button.click();
	bot.waitUntil(new DefaultCondition() {

		// BEGIN SUPRESS CATCH EXCEPTION
		public boolean test() throws Exception {
			return localProjectsSize + 1 == ESWorkspaceProvider.INSTANCE.getWorkspace().getLocalProjects().size();
		}

		// END SURPRESS CATCH EXCEPTION

		public String getFailureMessage() {
			return "Create local project did not succeed.";
		}
	});
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:28,代码来源:UIShareProjectControllerTest.java

示例12: testController

import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入方法依赖的package包/类
@Override
@Test
public void testController() throws ESException {
	final int remoteProjectsSize = server.getRemoteProjects(usersession).size();
	UIThreadRunnable.asyncExec(new VoidResult() {
		public void run() {
			createRemoteProjectController = new UICreateRemoteProjectController(
				bot.getDisplay().getActiveShell(),
				usersession);
			createRemoteProjectController.execute();
		}
	});
	final SWTBotText text = bot.text(0);
	text.setText("foo");
	final SWTBotButton okButton = bot.button("OK");
	okButton.click();
	bot.waitUntil(new DefaultCondition() {
		// BEGIN SUPRESS CATCH EXCEPTION
		public boolean test() throws Exception {
			return server.getRemoteProjects(usersession).size() == remoteProjectsSize + 1;
		}

		// END SUPRESS CATCH EXCEPTION

		public String getFailureMessage() {
			return "Create remote project did not succeed.";
		}
	}, timeout());
	assertEquals(remoteProjectsSize + 1, server.getRemoteProjects(usersession).size());
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:31,代码来源:UICreateRemoteProjectControllerTest.java

示例13: checkFilePath

import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入方法依赖的package包/类
@Test
public void checkFilePath() throws Exception {

	assertEquals(config.getMicroscopeImage(), bot.table(0).cell(0, 1));

	bot.table(0).click(0, 1); // Make the file editor

	SWTBotText text = bot.text(0);
	assertNotNull(text);
	assertEquals(config.getMicroscopeImage(), text.getText());

	text.setText("Invalid Path");

	Color red = new Color(bot.getDisplay(), 255, 0, 0, 255);
       assertEquals(red, text.foregroundColor());

       File file = File.createTempFile("a_testFile", ".txt");
       file.deleteOnExit();
	text.setText(file.getAbsolutePath());

	Color black = new Color(bot.getDisplay(), 0, 0, 0, 255);
       assertEquals(black, text.foregroundColor());


}
 
开发者ID:eclipse,项目名称:scanning,代码行数:26,代码来源:AxisConfigurationTest.java

示例14: checkFastStart

import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入方法依赖的package包/类
@Test
public void checkFastStart() throws Exception {

	assertEquals(String.valueOf(config.getFastAxisStart())+" mm", bot.table(0).cell(3, 1));

	bot.table(0).click(3, 1); // Make the file editor

	SWTBotText text = bot.text(0);
	assertNotNull(text);
	assertEquals(String.valueOf(config.getFastAxisStart()), text.getText());

	Color red = new Color(bot.getDisplay(), 255, 0, 0, 255);
	Color black = new Color(bot.getDisplay(), 0, 0, 0, 255);
       assertEquals(black, text.foregroundColor());

       text.setText("-2000");
       assertEquals(red, text.foregroundColor());

       text.setText("1");
       assertEquals(black, text.foregroundColor());

       text.setText("1001");
       assertEquals(red, text.foregroundColor());

}
 
开发者ID:eclipse,项目名称:scanning,代码行数:26,代码来源:AxisConfigurationTest.java

示例15: setNameText

import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入方法依赖的package包/类
public void setNameText (String value) {
	SWTBotText text= botView.bot().textWithId(OutLineComposite.GW_WIDGET_ID, OutLineComposite.GW_OUTLINE_NAME_TEXT);
	text.setText(value);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:5,代码来源:OutLineView.java


注:本文中的org.eclipse.swtbot.swt.finder.widgets.SWTBotText.setText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。