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


Java UIThreadRunnable.asyncExec方法代码示例

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


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

示例1: click

import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable; //导入方法依赖的package包/类
/**
 * Clicks on the {@link MenuItem}.
 *
 * @param menuItem
 *          the {@link MenuItem} to click on
 */
private static void click(final MenuItem menuItem) {
  final Event event = new Event();
  event.time = (int) System.currentTimeMillis();
  event.widget = menuItem;
  event.display = menuItem.getDisplay();
  event.type = SWT.Selection;

  UIThreadRunnable.asyncExec(menuItem.getDisplay(), new VoidResult() {
    @Override
    public void run() {
      if (SWTUtils.hasStyle(menuItem, SWT.CHECK) || SWTUtils.hasStyle(menuItem, SWT.RADIO)) {
        menuItem.setSelection(!menuItem.getSelection());
      }
      menuItem.notifyListeners(SWT.Selection, event);
    }
  });
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:24,代码来源:ContextActionUiTestUtil.java

示例2: testController

import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable; //导入方法依赖的package包/类
@Override
@Test
public void testController() throws ESException {

	final Player player = createPlayerAndCommit();

	UIThreadRunnable.asyncExec(new VoidResult() {
		public void run() {
			final UIShowHistoryController showHistoryController =
				new UIShowHistoryController(bot.getDisplay().getActiveShell(), player);
			showHistoryController.execute();
		}
	});

	final SWTBotView historyView = bot.viewById(
		"org.eclipse.emf.emfstore.client.ui.views.historybrowserview.HistoryBrowserView");

	assertNotNull(historyView);
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:20,代码来源:UIShowHistoryControllerForElementTest.java

示例3: testController

import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable; //导入方法依赖的package包/类
@Override
@Test
public void testController() throws ESException {

	createPlayerAndCommit();
	UIThreadRunnable.asyncExec(new VoidResult() {
		public void run() {
			final UIShowHistoryController showHistoryController =
				new UIShowHistoryController(bot.getDisplay().getActiveShell(), localProject);
			showHistoryController.execute();
		}
	});

	final SWTBotView historyView = bot.viewById(
		"org.eclipse.emf.emfstore.client.ui.views.historybrowserview.HistoryBrowserView");

	assertNotNull(historyView);
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:19,代码来源:UIShowHistoryControllerTest.java

示例4: createTag

import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable; //导入方法依赖的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

示例5: addServer

import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable; //导入方法依赖的package包/类
private void addServer() {
	final int howManyServers = ESWorkspaceProvider.INSTANCE.getWorkspace().getServers().size();
	UIThreadRunnable.asyncExec(new VoidResult() {
		public void run() {
			final UIAddServerController addServerController = new UIAddServerController(
				bot.getDisplay().getActiveShell());
			addServerController.execute();
		}
	});
	bot.button("Finish").click();
	bot.waitUntil(new DefaultCondition() {
		// BEGIN SUPRESS CATCH EXCEPTION

		public boolean test() throws Exception {
			return howManyServers + 1 == ESWorkspaceProvider.INSTANCE.getWorkspace().getServers().size();
		}

		public String getFailureMessage() {
			return "Add server did not succeed.";
		}
		// END SUPRESS CATCH EXCEPTION

	});
	assertEquals(howManyServers + 1, ESWorkspaceProvider.INSTANCE.getWorkspace().getServers().size());
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:26,代码来源:UIServerControllerTest.java

示例6: asyncPrint

import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable; //导入方法依赖的package包/类
public   void asyncPrint(final List<MenuItem> list) {
	UIThreadRunnable.asyncExec(bot.getDisplay(), new VoidResult() {
		public void run() {
			for (MenuItem menuItem : list) {
				System.out.println(menuItem.getText());
			}
		}
	});

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

示例7: shareProject

import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable; //导入方法依赖的package包/类
private void shareProject() {
	final ESShareObserver observer = createShareObserver();
	ESWorkspaceProviderImpl.getInstance();
	ESWorkspaceProviderImpl.getObserverBus().register(observer);

	UIThreadRunnable.asyncExec(new VoidResult() {
		public void run() {
			final UIShareProjectController shareProjectController = new UIShareProjectController(
				bot.getDisplay().getActiveShell(),
				localProject);
			shareProjectController.execute();
		}
	});

	bot.waitUntil(new DefaultCondition() {
		// BEGIN SUPRESS CATCH EXCEPTION
		public boolean test() throws Exception {
			return didShare;
		}

		// END SUPRESS CATCH EXCEPTION

		public String getFailureMessage() {
			return "Share did not succeed.";
		}
	}, timeout());
	final SWTBotButton confirmButton = bot.button("OK");
	confirmButton.click();
	ESWorkspaceProviderImpl.getInstance();
	ESWorkspaceProviderImpl.getObserverBus().unregister(observer);
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:32,代码来源:UIShareProjectControllerTest.java

示例8: createLocalProject

import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable; //导入方法依赖的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

示例9: testController

import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable; //导入方法依赖的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

示例10: commit

import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable; //导入方法依赖的package包/类
protected void commit(final ESLocalProject localProject) {
	final ESPrimaryVersionSpec baseVersion = localProject.getBaseVersion();
	UIThreadRunnable.asyncExec(new VoidResult() {
		public void run() {
			ESUIControllerFactory.INSTANCE.commitProject(
				bot.getDisplay().getActiveShell(),
				localProject);
		}
	});

	final SWTBotButton buttonWithLabel = bot.button("OK");
	buttonWithLabel.click();

	bot.waitUntil(new DefaultCondition() {
		// BEGIN SUPRESS CATCH EXCEPTION
		public boolean test() throws Exception {
			return baseVersion.getIdentifier() + 1 == localProject.getBaseVersion()
				.getIdentifier();
		}

		// END SUPRESS CATCH EXCEPTION

		public String getFailureMessage() {
			return "Commit did not succeed.";
		}
	}, AllUITests.TIMEOUT);

	assertEquals(baseVersion.getIdentifier() + 1,
		localProject.getBaseVersion().getIdentifier());
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:31,代码来源:AbstractUIControllerTestWithCommit.java

示例11: checkout

import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable; //导入方法依赖的package包/类
protected void checkout() {
	UIThreadRunnable.asyncExec(new VoidResult() {

		public void run() {
			UICheckoutController checkoutController;
			try {
				checkoutController = new UICheckoutController(
					bot.getDisplay().getActiveShell(),
					localProject.getRemoteProject());
				checkedoutCopy = checkoutController.execute();
			} catch (final ESException e) {
				fail(e.getMessage());
			}
		}
	});

	bot.text().setText("checkout");
	bot.button("OK").click();

	bot.waitUntil(new DefaultCondition() {
		// BEGIN SUPRESS CATCH EXCEPTION
		public boolean test() throws Exception {
			return checkedoutCopy != null;
		}

		// END SUPRESS CATCH EXCEPTION

		public String getFailureMessage() {
			return "Checkout did not succeed";
		}
	}, timeout());
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:33,代码来源:AbstractUIControllerTestWithCommit.java

示例12: updateCopy

import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable; //导入方法依赖的package包/类
protected ESPrimaryVersionSpec updateCopy() {
	SWTBotPreferences.PLAYBACK_DELAY = 100;
	didUpdate = false;

	final ESUpdateObserver updateObserver = createUpdateObserver();
	ESWorkspaceProviderImpl.getInstance();
	ESWorkspaceProviderImpl.getObserverBus().register(updateObserver);

	UIThreadRunnable.asyncExec(new VoidResult() {
		public void run() {
			final UIUpdateProjectController updateProjectController = new UIUpdateProjectController(
				bot.getDisplay().getActiveShell(),
				getCopy());
			updateProjectController.execute();
		}
	});

	final Matcher<Shell> matcher = withText("Update");
	bot.waitUntil(waitForShell(matcher));
	bot.button("OK").click();

	bot.waitUntil(new DefaultCondition() {
		// BEGIN SUPRESS CATCH EXCEPTION
		public boolean test() throws Exception {
			return didUpdate;
		}

		// END SUPRESS CATCH EXCEPTION

		public String getFailureMessage() {
			return "Update did not succeed.";
		}
	}, timeout());

	ESWorkspaceProviderImpl.getInstance();
	ESWorkspaceProviderImpl.getObserverBus().unregister(updateObserver);

	return getCopy().getBaseVersion();
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:40,代码来源:AbstractUIControllerTestWithCommit.java

示例13: removeTag

import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable; //导入方法依赖的package包/类
private void removeTag(final ESHistoryInfo historyInfo, ESPathQuery pathQuery) throws ESException {
	UIThreadRunnable.asyncExec(new VoidResult() {
		public void run() {
			UIRemoveTagController removeTagController = new UIRemoveTagController(
				bot.getDisplay().getActiveShell(), historyInfo);
			removeTagController.execute();
		}
	});
	List<ESHistoryInfo> historyInfos = localProject.getHistoryInfos(pathQuery, new NullProgressMonitor());
	assertEquals(2, historyInfos.size());
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:12,代码来源:UIAddTagControllerTest.java

示例14: testController

import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable; //导入方法依赖的package包/类
@Override
@Test
public void testController() throws ESException {
	final int remoteProjectsSize = server.getRemoteProjects().size();
	UIThreadRunnable.asyncExec(new VoidResult() {
		public void run() {
			UIDeleteRemoteProjectController deleteRemoteProjectController;
			try {
				deleteRemoteProjectController = new UIDeleteRemoteProjectController(bot.getDisplay()
					.getActiveShell(),
					usersession, localProject.getRemoteProject());
				deleteRemoteProjectController.execute();
			} catch (final ESException e) {
				fail();
			}
		}
	});
	bot.button("Yes").click();
	bot.waitUntil(new DefaultCondition() {

		// BEGIN SUPRESS CATCH EXCEPTION
		public boolean test() throws Exception {
			return server.getRemoteProjects().size() == remoteProjectsSize - 1;
		}

		// END SUPRESS CATCH EXCEPTION

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

示例15: testController

import org.eclipse.swtbot.swt.finder.finders.UIThreadRunnable; //导入方法依赖的package包/类
@Override
@Test
public void testController() throws ESException {
	UIThreadRunnable.asyncExec(new VoidResult() {
		public void run() {
			ESUIControllerFactory.INSTANCE.commitProject(
				bot.getDisplay().getActiveShell(),
				localProject);
		}
	});

	bot.shell("No local changes");
	bot.button("OK").click();
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:15,代码来源:NoLocalChangesCommitControllerTest.java


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