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


Java SWTBotText.typeText方法代码示例

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


在下文中一共展示了SWTBotText.typeText方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

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

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

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

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

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

示例6: enterOrderNumberAndGenerateDocu

import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入方法依赖的package包/类
private void enterOrderNumberAndGenerateDocu() {
	SWTBotText text = bot.textWithLabel("&Order Number");
	text.typeText(ORDER_NUMBER);
	bot.sleep(100);
	scenariooWriterHelper.writeStep("order_number_entered", PageName.ORDER_NEW_1, screenshot());
}
 
开发者ID:scenarioo,项目名称:scenarioo-example-swtbot-e4,代码行数:7,代码来源:CreateOrderTest.java

示例7: checkPauseOnNewSelectionByWidget

import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入方法依赖的package包/类
/**
 * Checks that, when any of the time widgets are updated, the active play
 * action is cancelled.
 */
@Test
public void checkPauseOnNewSelectionByWidget() {

	SWTBotButton playButton = getPlayPauseButton();

	SWTBotText text = getTimeText();
	String firstTime = text.getText();

	// Set the framerate to 1 frame every 10 seconds.
	getDisplay().syncExec(new Runnable() {
		@Override
		public void run() {
			timeComposite.setFPS(0.1);
		}
	});

	// Pause by clicking the play button.
	playButton.click();
	assertTrue(isPlaying());
	playButton.click();
	assertFalse(isPlaying());

	// Pause by clicking the time scale.
	playButton.click();
	assertTrue(isPlaying());
	getTimeScale().setValue(1);
	assertFalse(isPlaying());

	// Pause by typing text.
	playButton.click();
	assertTrue(isPlaying());
	text.selectAll();
	text.typeText(firstTime + SWT.CR + SWT.LF);
	assertFalse(isPlaying());

	// Pause by clicking the next button.
	playButton.click();
	assertTrue(isPlaying());
	getNextButton().click();
	assertFalse(isPlaying());

	// Pause by clicking the previous button.
	playButton.click();
	assertTrue(isPlaying());
	getPrevButton().click();
	assertFalse(isPlaying());

	return;
}
 
开发者ID:eclipse,项目名称:eavp,代码行数:54,代码来源:TimeSliderCompositeTester.java

示例8: checkTextNotifiesSelectionListeners

import org.eclipse.swtbot.swt.finder.widgets.SWTBotText; //导入方法依赖的package包/类
/**
 * Checks that listeners are updated when the spinner's associated text
 * widget changes.
 */
@Test
public void checkTextNotifiesSelectionListeners() {

	/*
	 * IMPORTANT NOTE ABOUT THIS TEST!
	 * 
	 * Simulating input into a Text widget with SWTBot is tricky.
	 * widget.setText(String) does not notify listeners, so you must use
	 * widget.selectAll() [highlights all the text] and
	 * widget.typeText(String) [replaces the text].
	 * 
	 * However, this can be finicky and fail if you are touching the
	 * keyboard or the mouse, so try running this test again when you are
	 * not actively using your computer's input. :)
	 */

	// Get the first and last time.
	Double firstTime = testTimes.get(0);
	Double lastTime = testTimes.get(testTimes.size() - 1);

	// Get the specific widget that will be used to set the time.
	SWTBotText widget = getTimeText();

	// Register the second fake listener.
	getDisplay().syncExec(new Runnable() {
		@Override
		public void run() {
			timeComposite.addSelectionListener(fakeListener2);
		}
	});

	// They should both be notified when the widget is used to change the
	// values.
	widget.selectAll();
	widget.typeText(lastTime.toString() + SWT.CR + SWT.LF);
	assertTrue(fakeListener1.wasNotified());
	assertTrue(fakeListener2.wasNotified());

	// Unregister this listener.
	getDisplay().syncExec(new Runnable() {
		@Override
		public void run() {
			timeComposite.removeSelectionListener(fakeListener2);
		}
	});

	// It should not be notified when the widget changes, but the other
	// should still be notified.
	widget.selectAll();
	widget.typeText(firstTime.toString() + SWT.CR + SWT.LF);
	assertFalse(fakeListener2.wasNotified()); // Test this one first!
	assertTrue(fakeListener1.wasNotified());

	return;
}
 
开发者ID:eclipse,项目名称:eavp,代码行数:60,代码来源:TimeSliderCompositeTester.java


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