Java Code Examples for org.eclipse.swtbot.swt.finder.widgets.SWTBotTree#setFocus()

The following examples show how to use org.eclipse.swtbot.swt.finder.widgets.SWTBotTree#setFocus() . 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: SWTBotTestUtil.java    From bonita-studio with GNU General Public License v2.0 6 votes vote down vote up
/**
 * select an event in the overview tree. Becarefull, if treeViewer exists in other views SWTBot may not find the one in
 * overview
 *
 * @param bot
 * @param poolName
 * @param eventName
 */
public static void selectElementFromOverview(final SWTGefBot bot, final String poolName, final String laneName,
        final String eventName) {
    final SWTBotView view = bot.viewById(SWTBotTestUtil.VIEWS_TREE_OVERVIEW);
    view.show();
    view.setFocus();
    final SWTBotTree tree = bot.treeWithId(BONITA_OVERVIEW_TREE_ID);
    tree.setFocus();
    tree.getTreeItem(poolName).click();
    if (laneName == null) {
        tree.expandNode(poolName).select(eventName);
    } else {
        tree.expandNode(poolName).expandNode(laneName);
        if (eventName != null) {
            tree.getTreeItem(eventName);
        }
    }
}
 
Example 2
Source File: SWTBotImportWizardUtils.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * While in the import wizard, select the specified directory as a source.
 *
 * @param bot
 *            the SWTBot
 * @param directoryPath
 *            the directory path to set as a source
 */
public static void selectImportFromDirectory(SWTBot bot, String directoryPath) {
    SWTBotRadio button = bot.radio("Select roo&t directory:");
    button.click();

    SWTBotCombo sourceCombo = bot.comboBox();
    File traceFolderParent = new File(directoryPath);
    sourceCombo.setFocus();
    sourceCombo.setText(traceFolderParent.getAbsolutePath());

    /* the resource tree gets updated when the combo loses focus */
    SWTBotTree tree = bot.tree();
    tree.setFocus();
}
 
Example 3
Source File: SWTBotImportWizardUtils.java    From tracecompass with Eclipse Public License 2.0 5 votes vote down vote up
/**
 * While in the import wizard, select the specified archive as a source.
 *
 * @param bot
 *            the SWTBot
 * @param archivePath
 *            the archive path to set as a source
 */
public static void selectImportFromArchive(SWTBot bot, String archivePath) {
    SWTBotRadio button = bot.radio("Select &archive file:");
    button.click();

    SWTBotCombo sourceCombo = bot.comboBox(1);

    sourceCombo.setFocus();
    sourceCombo.setText(new File(archivePath).getAbsolutePath());

    /* the resource tree gets updated when the combo loses focus */
    SWTBotTree tree = bot.tree();
    tree.setFocus();
}
 
Example 4
Source File: BotBdmModelEditor.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
public BotBdmModelEditor renameBusinessObject(String packageName, String oldName, String newName) {
    SWTBotTree businessObjectTree = getBusinessObjectTree();
    bot.waitUntil(treeItemAvailable(businessObjectTree, packageName));
    SWTBotTreeItem packageItem = businessObjectTree.getTreeItem(packageName);
    packageItem.expand();
    bot.waitUntil(nodeAvailable(packageItem, oldName));
    packageItem.getNode(oldName).click();
    bot.textWithId(SWTBOT_ID_BO_NAME_TEXTEDITOR)
            .setText(newName)
            .pressShortcut(Keystrokes.CR);
    businessObjectTree.setFocus();
    return this;
}
 
Example 5
Source File: SWTBotTestUtil.java    From bonita-studio with GNU General Public License v2.0 5 votes vote down vote up
public static void selectElementFromFormOverview(final SWTGefBot bot, final String widgetName) {
    final SWTBotView view = bot.viewById(SWTBotTestUtil.VIEWS_TREE_OVERVIEW);
    view.show();
    view.setFocus();
    final SWTBotTree tree = bot.treeWithId(BONITA_OVERVIEW_TREE_ID);
    tree.setFocus();
    bot.waitUntil(Conditions.widgetIsEnabled(tree.getTreeItem(widgetName)));
    tree.select(widgetName);
}