Java Code Examples for org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot#textWithLabel()

The following examples show how to use org.eclipse.swtbot.eclipse.finder.SWTWorkbenchBot#textWithLabel() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GuiUtils.java    From CodeCheckerEclipsePlugin with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * You MUST navigate to the correct preferences page, or the method fails and
 * possibly throws widget not found exception. Sets The CodeChecker Directory on
 * the preferences pages.
 * 
 * @param method
 *            The associated radio button to the {@link ResolutionMethodTypes}
 *            will be clicked on the preferences/properties page.
 * @param ccDir
 *            Path to the CodeChecker Root directory.
 * @param bot
 *            The bot to be guided.
 * @param root
 *            TODO
 */
public static void setCCBinDir(ResolutionMethodTypes method, Path ccDir, SWTWorkbenchBot bot, boolean root) {
    SWTBotRadio radio = null;
    switch (method) {
        case PATH:
            radio = bot.radio("Search in PATH");
            break;
        case PRE:
            radio = bot.radio("Pre built package");
            break;
        default:
            break;
    }
    radio.click();
    if (method != ResolutionMethodTypes.PATH || ccDir != null) {
        SWTBotText text = bot.textWithLabel(GuiUtils.CC_DIR_WIDGET);
        // if the given path is the package root, extend it to the concrete binary else
        // it could be used directly.
        text.setText(root ? ccDir.resolve(Paths.get(BIN, CODECHECKER)).toString() : ccDir.toString());
        bot.sleep(SHORT_WAIT_TIME);
    }
}
 
Example 2
Source File: SwtBotProjectHelper.java    From xtext-xtend with Eclipse Public License 2.0 6 votes vote down vote up
public static SWTBotEclipseEditor newJavaEditor(final SWTWorkbenchBot it, final String typeName, final String packageName, final String sourceFolderPath) {
  SWTBotEclipseEditor _xblockexpression = null;
  {
    SwtBotProjectHelper.fileNew(it, "Class");
    it.shell("New Java Class").activate();
    SWTBotText _textWithLabel = it.textWithLabel("Source folder:");
    _textWithLabel.setText(sourceFolderPath);
    SWTBotText _textWithLabel_1 = it.textWithLabel("Package:");
    _textWithLabel_1.setText(packageName);
    SWTBotText _textWithLabel_2 = it.textWithLabel("Name:");
    _textWithLabel_2.setText(typeName);
    it.button("Finish").click();
    _xblockexpression = it.editorByTitle((typeName + ".java")).toTextEditor();
  }
  return _xblockexpression;
}
 
Example 3
Source File: SwtBotProjectHelper.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
public static SWTBotShell newXtendProject(final SWTWorkbenchBot it, final String projectName) {
  SWTBotShell _xblockexpression = null;
  {
    final SWTBotShell shell = it.activeShell();
    final Function1<SWTBotView, Boolean> _function = (SWTBotView it_1) -> {
      String _title = it_1.getTitle();
      return Boolean.valueOf(Objects.equal(_title, "Welcome"));
    };
    SWTBotView _findFirst = IterableExtensions.<SWTBotView>findFirst(it.views(), _function);
    if (_findFirst!=null) {
      _findFirst.close();
    }
    it.perspectiveByLabel("Java").activate();
    SwtBotProjectHelper.fileNew(it, "Project...");
    it.shell("New Project").activate();
    SwtBotProjectHelper.expandNode(it.tree(), "Java").select("Java Project");
    it.button("Next >").click();
    SWTBotText _textWithLabel = it.textWithLabel("Project name:");
    _textWithLabel.setText(projectName);
    it.button("Next >").click();
    it.tabItem("Libraries").activate();
    it.button("Add Library...").click();
    it.shell("Add Library").activate();
    it.list().select("Xtend Library");
    it.button("Next >").click();
    it.button("Finish").click();
    it.button("Finish").click();
    _xblockexpression = shell.activate();
  }
  return _xblockexpression;
}