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


Java VoidResult类代码示例

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


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

示例1: testImportSession

import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
@Test
public void testImportSession() {
  // given
  UIThreadRunnable.syncExec(new VoidResult() {
    public void run() {
      try {
        PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().showView("org.eclipse.eclemma.ui.CoverageView");
      } catch (PartInitException e) {
        e.printStackTrace();
      }
    }
  });

  // when
  SWTBotView view = bot.viewByTitle("Coverage");
  view.bot().tree().contextMenu("Import Session...").click();

  // then
  bot.shell("Import").activate();
  bot.text(" Please select an existing execution data file.");
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:22,代码来源:CoverageViewTest.java

示例2: testStarted

import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
@SuppressWarnings("PMD.JUnit4TestShouldUseTestAnnotation")
public void testStarted(final Description description) {
  if (!screenshotsCleared) {
    deleteDirectoryContents(new File(screenshotFolder));
    screenshotsCleared = true;
  }
  testFailed = false;
  testStepStarted = false;
  if (description.getTestClass() != null) {
    testClassName = description.getTestClass().getName();
  } else {
    testClassName = testClass.getSimpleName();
  }
  testMethodName = description.getMethodName();
  AbstractTestStep.registerTestStepListener(this);
  UIThreadRunnable.syncExec(new VoidResult() {
    @Override
    public void run() {
      PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().addMouseListener(TestRunRecording.this);
    }
  });
  start();
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:26,代码来源:TestRunRecording.java

示例3: testFinished

import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
/** {@inheritDoc} */
@Override
@SuppressWarnings("PMD.JUnit4TestShouldUseTestAnnotation")
public void testFinished(final Description description) {
  stop();
  AbstractTestStep.removeTestStepListener(this);
  UIThreadRunnable.syncExec(new VoidResult() {
    @Override
    public void run() {
      PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell().removeMouseListener(TestRunRecording.this);
    }
  });
  if (!testFailed) {
    deleteScreenshots();
  }
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:17,代码来源:TestRunRecording.java

示例4: click

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

示例5: openEditorAsync

import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
/**
 * Opens the editor asynchronously.
 *
 * @param file
 *          the file
 * @param editorId
 *          the editor id
 * @param activate
 *          true to activate, false otherwise
 */
protected void openEditorAsync(final IFile file, final String editorId, final boolean activate) {
  asyncExec(new VoidResult() {
    @Override
    public void run() {
      try {
        IWorkbench workbench = PlatformUI.getWorkbench();
        IWorkbenchPage activePage = workbench.getActiveWorkbenchWindow().getActivePage();
        final int matchFlags = IWorkbenchPage.MATCH_ID | IWorkbenchPage.MATCH_INPUT;
        final IEditorInput input = new FileEditorInput(file);
        IEditorPart editor = activePage.openEditor(input, editorId, activate, matchFlags);
        editor.setFocus();
        waitForEditorJobs(editor);
      } catch (PartInitException e) {
        if (LOGGER.isDebugEnabled()) {
          LOGGER.debug(e.getMessage(), e);
        }
      }
    }
  });
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:31,代码来源:AbstractUiTest.java

示例6: beforeClass

import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
public static void beforeClass() {
	UIThreadRunnable.syncExec(new VoidResult() {
		public void run() {
			resetWorkbench();
			resetToolbox();
			
			// close browser-based welcome screen (if open)
			SWTWorkbenchBot bot = new SWTWorkbenchBot();
			try {
				SWTBotView welcomeView = bot.viewByTitle("Welcome");
				welcomeView.close();
			} catch (WidgetNotFoundException e) {
				return;
			}
		}
	});
}
 
开发者ID:tlaplus,项目名称:tlaplus,代码行数:18,代码来源:RCPTestSetupHelper.java

示例7: testController

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

示例8: testController

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

示例9: createTag

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

示例10: addServer

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

示例11: baseBeforeTest

import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
@Before
public void baseBeforeTest() {
	// Sets codenvy fake API
	CodenvyAPI.setClient(new FakeCodenvyClient());
	    	
    UIThreadRunnable.syncExec(new VoidResult() {
        @Override
        public void run() {
            final Shell eclipseShell = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell();
            eclipseShell.forceFocus();
        }
    });

    try {

        final SWTBotView welcomeView = bot.viewByTitle("Welcome");
        welcomeView.close();

    } catch (WidgetNotFoundException e) {
        // ignore the exception
    }
}
 
开发者ID:codenvy-legacy,项目名称:eclipse-plugin,代码行数:23,代码来源:SWTBotBaseTest.java

示例12: selectTab

import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
protected void selectTab(SWTBotGefEditPart part, String label) {
	selectPart(part);
	Matcher<TabbedPropertyList> matcher = new BaseMatcher<TabbedPropertyList>() {
		@Override
		public boolean matches(Object item) {
			if (item instanceof TabbedPropertyList) {
				return true;
			}
			return false;
		}
		@Override
		public void describeTo(Description description) {
		}
	};
	List<TabbedPropertyList> allWidgets = widget(matcher);
	UIThreadRunnable.syncExec(Display.getDefault(), new VoidResult() {
		@Override
		public void run() {
			for (final TabbedPropertyList tabbedProperty : allWidgets) {
				final ListElement tabItem = getTabItem(label, tabbedProperty);
				if (tabItem != null) {
					final Event mouseEvent = createEvent(tabItem);
					tabItem.notifyListeners(SWT.MouseUp, mouseEvent);
					tabItem.setFocus();
					return;
				}
			}
			throw new IllegalStateException("Unable to select the tab " + label);
		}
	});
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:32,代码来源:GraphElementProperties.java

示例13: setInit

import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
public void setInit(SWTBotGefEditPart part, String script) {
	selectPart(part);
	selectTab(part, INIT);
	SWTBotStyledText st = bot.styledTextWithId( WIDGET_ID,  WIDGET_SCRIPT);
	st.setText(script);
	UIThreadRunnable.syncExec(Display.getDefault(), new VoidResult() {
		@Override
		public void run() {
			st.widget.notifyListeners(SWT.FocusOut, null);
			editor.setFocus();
		}
	});
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:14,代码来源:VertexProperties.java

示例14: syncWithUIThread

import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
protected void syncWithUIThread() {
	UIThreadRunnable.syncExec(new VoidResult() {
		public void run() {
			while (PlatformUI.getWorkbench().getDisplay().readAndDispatch()) {
			}
		}
	});
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:9,代码来源:GraphHelper.java

示例15: setGuard

import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
public void setGuard(SWTBotGefEditPart part, String script) {
	selectPart(part);
	selectTab(part, GUARD);
	SWTBotStyledText st = bot.styledTextWithId(WIDGET_ID, WIDGET_GUARD_SCRIPT);
	st.setText(script);
	UIThreadRunnable.syncExec(Display.getDefault(), new VoidResult() {
		@Override
		public void run() {
			st.widget.notifyListeners(SWT.FocusOut, null);
			editor.setFocus();
		}
	});
}
 
开发者ID:gw4e,项目名称:gw4e.project,代码行数:14,代码来源:EdgeProperties.java


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