• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java VoidResult类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: setAction

import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
public void setAction(SWTBotGefEditPart part, String script) {
	selectPart(part);
	selectTab(part, ACTION);
	SWTBotStyledText st = bot.styledTextWithId(WIDGET_ID, WIDGET_ACTION_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


示例17: asyncPrint

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


示例18: openCoverageView

import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
private static void openCoverageView() {
	UIThreadRunnable.syncExec(new VoidResult() {
		public void run() {
			try {
				PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage()
						.showView("org.eclipse.eclemma.ui.CoverageView");
			} catch (PartInitException e) {
				e.printStackTrace();
			}
		}
	});
}
 
开发者ID:eclipse,项目名称:eclemma,代码行数:13,代码来源:DumpExecutionDataTest.java


示例19: printTree

import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
private static void printTree(final TreeItem tree) {
  UIThreadRunnable.syncExec(new VoidResult() {
    @Override
    public void run() {
      System.err.println(String.format("%s has %d items:", tree.getText(), tree.getItemCount()));
      for (TreeItem item : tree.getItems()) {
        System.err.println(String.format("  - %s", item.getText()));
      }
    }
  });
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:12,代码来源:SwtBotTreeUtilities.java


示例20: click

import org.eclipse.swtbot.swt.finder.results.VoidResult; //导入依赖的package包/类
/**
 * {@inheritDoc} A customized version to fix bug: https://bugs.eclipse.org/bugs/show_bug.cgi?id=344484.
 */
@Override
public SwtBotRadio click() {
  if (isSelected()) {
    log.debug(MessageFormat.format("Widget {0} is already selected, not clicking again.", this)); //$NON-NLS-1$
    return this;
  }
  waitForEnabled();

  log.debug(MessageFormat.format("Clicking on {0}", this)); //$NON-NLS-1$

  final SwtBotRadio otherSelectedButton = otherSelectedButton();
  if (otherSelectedButton != null) {
    otherSelectedButton.notify(SWT.Deactivate);
    asyncExec(new VoidResult() {
      public void run() {
        otherSelectedButton.widget.setSelection(false);
      }
    });
  }

  notify(SWT.Activate);
  notify(SWT.MouseDown, createMouseEvent(0, 0, 1, 0, 1));
  notify(SWT.MouseUp, createMouseEvent(0, 0, 1, SWT.BUTTON1, 1));
  asyncExec(new VoidResult() {
    public void run() {
      widget.setSelection(true);
    }
  });
  notify(SWT.Selection);

  log.debug(MessageFormat.format("Clicked on {0}", this)); //$NON-NLS-1$
  return this;
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:37,代码来源:SwtBotRadio.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java UIEvent类代码示例发布时间:2022-05-22
下一篇:
Java PackagePart类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap