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


Java SWTBotButton类代码示例

本文整理汇总了Java中org.eclipse.swtbot.swt.finder.widgets.SWTBotButton的典型用法代码示例。如果您正苦于以下问题:Java SWTBotButton类的具体用法?Java SWTBotButton怎么用?Java SWTBotButton使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


SWTBotButton类属于org.eclipse.swtbot.swt.finder.widgets包,在下文中一共展示了SWTBotButton类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: validateRun

import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入依赖的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

示例2: testEnablement_nonExistentStagingLocation

import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入依赖的package包/类
@Test
public void testEnablement_nonExistentStagingLocation() {
  selector.selectAccount("[email protected]");
  component.setCloudProjectText("project");
  join();
  component.setStagingLocationText("non-existent-bucket");
  component.startStagingLocationCheck(0); // force right now
  join();
  component.validate();
  bot.waitUntil(widgetIsEnabled(new SWTBotButton(createButton)));
  assertTrue(selector.isEnabled());
  assertNotNull(selector.getSelectedCredential());
  assertTrue(projectID.isEnabled());
  assertTrue(stagingLocations.isEnabled());
  assertTrue(createButton.isEnabled());
  assertFalse(page.isPageComplete());
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:18,代码来源:RunOptionsDefaultsComponentTest.java

示例3: testBucketNameStatus_createIsOk

import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入依赖的package包/类
@Test
public void testBucketNameStatus_createIsOk() {
  component.selectAccount("[email protected]");
  component.setCloudProjectText("project");
  join();
  component.setStagingLocationText("gs://alice-bucket-non-existent");
  join();
  Mockito.reset(messageTarget);
  component.validate();
  verify(messageTarget).setError("Could not fetch bucket alice-bucket-non-existent.");
  
  Mockito.reset(messageTarget);
  new SWTBotButton(createButton).click();
  join();
  verify(messageTarget).setInfo("Created staging location at gs://alice-bucket-non-existent");
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:17,代码来源:RunOptionsDefaultsComponentTest.java

示例4: closeDialog

import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入依赖的package包/类
private void closeDialog(CloseAction closeAction) {
  switch (closeAction) {
    case PRESS_OK:
      Button okButton = CompositeUtil.findButton(dialog.getShell(), "Share");
      assertNotNull(okButton);
      new SWTBotButton(okButton).click();
      break;

    case PRESS_CANCEL:
      Button cancelButton = CompositeUtil.findButton(dialog.getShell(), "Do Not Share");
      assertNotNull(cancelButton);
      new SWTBotButton(cancelButton).click();
      break;

    case CLOSE_SHELL:
      dialog.getShell().close();
      break;

    case DISPOSE_SHELL:
      dialog.getShell().dispose();
      break;

    default:
      throw new RuntimeException("bug");
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:27,代码来源:OptInDialogTest.java

示例5: createTag

import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入依赖的package包/类
private ESPathQuery createTag() throws ESException {
	ESPrimaryVersionSpec baseVersion = localProject.getBaseVersion();
	createPlayerAndCommit();
	ESPathQuery pathQuery = ESHistoryQuery.FACTORY
		.pathQuery(baseVersion, localProject.getBaseVersion(), true, true);
	List<ESHistoryInfo> historyInfos = localProject.getHistoryInfos(pathQuery, new NullProgressMonitor());
	assertEquals(2, historyInfos.size());
	final ESHistoryInfo historyInfo = historyInfos.get(1);
	assertEquals(2, historyInfo.getTagSpecs().size());
	UIThreadRunnable.asyncExec(
		new VoidResult() {
			public void run() {
				UIAddTagController addTagController = new UIAddTagController(bot.getDisplay().getActiveShell(),
					localProject, historyInfo);
				addTagController.execute();
			}
		});

	bot.table(0).select(0);
	SWTBotButton button = bot.button("OK");
	button.click();
	return pathQuery;
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:24,代码来源:UIAddTagControllerTest.java

示例6: prepareconvertTo

import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入依赖的package包/类
public boolean prepareconvertTo(String project, String packageRootFragment, String pkg, String targetFilename,
		String targetFormat, String checkTestBox,String annotationStartElement,
		String targetvertex,String startElement,String [] contexts, String... nodes) {
	ConvertDialog cd = prepareConvertTo(project, packageRootFragment, pkg, targetFilename, targetFormat, nodes);
	boolean ret = cd.create(project, packageRootFragment, pkg, targetFilename, targetFormat, checkTestBox, false);
	if (!ret) {
		SWTBotShell shell = bot.shell("GW4E Conversion File");
		shell.bot().button("Cancel").click();
		bot.waitUntil(Conditions.shellCloses(shell));
		return false;
	}

	SWTBotButton fbutton = bot.button("Next >");
	fbutton.click();

	GraphWalkerTestUIPageTest gwid = new GraphWalkerTestUIPageTest(cd.getShell());
	gwid.completeFullPage("random(edge_coverage(100))", "GROUP1;GROUP2", annotationStartElement);
	gwid.nextPage();
	
	JUnitGraphWalkerTestUIPageTest jugw = new JUnitGraphWalkerTestUIPageTest(cd.getShell());
	jugw.completeFullPage(targetvertex, startElement, contexts);
	jugw.nextPage();

	GraphWalkerTestHookPageTest gwth = new GraphWalkerTestHookPageTest(cd.getShell());
	gwth.completeFullPage();
	gwth.finish();

	bot.waitUntil(Conditions.shellCloses(cd.getShell()), 6 * SWTBotPreferences.TIMEOUT);

	return true;
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:32,代码来源:GW4EProject.java

示例7: assertNextStepPage

import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入依赖的package包/类
public void assertNextStepPage(SWTBotShell page, String description, String result) {
	SWTBotButton nextButton = bot.button("&Next >");
	nextButton.click();
	String defaultResult = MessageUtil.getString("enter_a_result_if_verification_failed");
	if (result != null && result.trim().length() > 0 && !result.equals(defaultResult)) {
		new StepPage().setResult(page, result).setFailed(page);
	}
	new StepPage().assertActionAndResult(page, description, result);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:10,代码来源:RunAsManualWizard.java

示例8: feed

import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入依赖的package包/类
public void feed(boolean exportAsTest, String workbookfile, String workbooktitle, String caseid, boolean updatemode,
		String componentname, String priority, String dateformat) {
	SWTBotButton nextButton = bot.button("&Next >");
	nextButton.click();
	SavePage page = new SavePage();
	page.feed(exportAsTest, workbookfile, workbooktitle, caseid, updatemode, componentname, priority, dateformat);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:8,代码来源:RunAsManualWizard.java

示例9: create

import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入依赖的package包/类
public boolean create (String project,String packageRootFragment, String pkg,String targetFilename,String targetFormat,String checkTestBox,boolean finish) {
	try {
		prepare  (project,packageRootFragment,pkg,targetFilename,targetFormat,  checkTestBox);
		if (!finish) return true;
		SWTBotButton fbutton  = bot.button("Finish");
		fbutton.click();
		bot.waitUntil(Conditions.shellCloses(this.shell), 10 * SWTBotPreferences.TIMEOUT);
		return true;
	} catch (TimeoutException e) {
		return false;
	}
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:13,代码来源:ConvertDialog.java

示例10: ok

import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入依赖的package包/类
public void ok ( ) {
	String name="OK";
	if (GW4EPlatform.isEclipse47()) {
		name = "Apply and Close";
	}
	SWTBotButton button = shell.bot().button(name);
	button.click();
	parentBot.waitUntil(Conditions.shellCloses(shell));	
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:10,代码来源:GW4EProjectProperties.java

示例11: importProjectFromZip

import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入依赖的package包/类
public static void importProjectFromZip(SWTWorkbenchBot bot, String path) {
	int timeout = 10000;
	bot.menu("File").menu("Import...").click();
	bot.waitUntil(Conditions.shellIsActive("Import"));
	SWTBotShell shell = bot.shell("Import").activate();

	shell.bot().tree().expandNode("General").select("Existing Projects into Workspace");
	shell.bot().button("Next >").click();
	shell.bot().radio("Select archive file:").click();

	shell.bot().comboBox(1).setText(path);
	shell.bot().comboBox(1).pressShortcut(SWT.CR, SWT.LF);
	SWTBotButton finishButton = shell.bot().button("Finish");
	ICondition buttonEnabled = new DefaultCondition() {
		@Override
		public boolean test() throws Exception {
			return finishButton.isEnabled();
		}

		@Override
		public String getFailureMessage() {
			return "Finish button not enabled";
		}
	};

	shell.bot().waitUntil(buttonEnabled, timeout);
	finishButton.click();

	bot.waitUntil(Conditions.shellCloses(shell), timeout);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:31,代码来源:ImportHelper.java

示例12: addRowValue

import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入依赖的package包/类
void addRowValue(final String stringtoadd) {
	SWTBotTable table = getTable();
	bot.waitUntil(waitForTable());

	int currentCount = table.rowCount();
	SWTBotButton addButton = getAddButton();
	addButton.click();
	waitForRowAdded(table, currentCount + 1);
	int row = 0;
 
	editRowWithValue (table,MessageUtil.getString("enteranewvalue"), stringtoadd);
	
	leaveEditingCellClickingOnAnotherCell(table, row + 1);
	waitForExpectedValueAtRowCol(table,stringtoadd);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:16,代码来源:GW4EPreferencePage.java

示例13: removeRow

import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入依赖的package包/类
void removeRow( String stringtoremove) {
	SWTBotTable table = getTable();
	bot.waitUntil(waitForTable());
	
	selectRowWithValue(table,stringtoremove);
	waitForExpectedValueAtRowCol(table,stringtoremove);

	int currentCount = table.rowCount();
	SWTBotButton removeButton = getRemoveButton();
	
	removeButton.click();
	waitForRowAdded(table, currentCount - 1);
	waitForNotExpectedValueAtRowCol(table,stringtoremove);
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:15,代码来源:GW4EPreferencePage.java

示例14: clickButtonAndWaitForWindowChange

import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入依赖的package包/类
/** Click the button, wait for the window change. */
public static void clickButtonAndWaitForWindowChange(SWTBot bot, final SWTBotButton button) {
  performAndWaitForWindowChange(bot, new Runnable() {
    @Override
    public void run() {
      button.click();
    }
  });
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:10,代码来源:SwtBotTestingUtilities.java

示例15: clickButtonAndWaitForWindowClose

import org.eclipse.swtbot.swt.finder.widgets.SWTBotButton; //导入依赖的package包/类
/** Click the button, wait for the window close. */
public static void clickButtonAndWaitForWindowClose(SWTBot bot, final SWTBotButton button) {
  performAndWaitForWindowClose(bot, new Runnable() {
    @Override
    public void run() {
      button.click();
    }
  });
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:10,代码来源:SwtBotTestingUtilities.java


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