Java 类org.eclipse.swtbot.eclipse.finder.widgets.SWTBotPerspective 实例源码

项目:gwt-eclipse-plugin    文件:SwtBotMenuActions.java   
public static void openPerspective(SWTWorkbenchBot bot, String perspectiveLabel) {
  SwtBotUtils.print("Opening Perspective: " + perspectiveLabel);

  SWTBotShell shell = null;
  try {
    menu(bot, "Window").menu("Open Perspective").menu("Other...").click();

    shell = bot.shell("Open Perspective");

    bot.waitUntil(ActiveWidgetCondition.widgetMakeActive(shell));
    shell.bot().table().select(perspectiveLabel);

    shell.bot().button("OK").click();
    bot.waitUntil(Conditions.shellCloses(shell));
  } catch (Exception e) {
    if (shell != null && shell.isOpen()) shell.close();
    SwtBotUtils.printError("Couldn't open perspective '" + perspectiveLabel + "'\n"
        + "trying to activate already open perspective instead");
    // maybe somehow the perspective is already opened (by another test before us)
    SWTBotPerspective perspective = bot.perspectiveByLabel(perspectiveLabel);
    perspective.activate();
  }

  SwtBotUtils.print("Opened Perspective: " + perspectiveLabel);
}
项目:gw4e.project    文件:GW4EProject.java   
public void resetToJavPerspective() {
    final SWTBotPerspective javaPerspective = bot.perspectiveById(JavaUI.ID_PERSPECTIVE);
    javaPerspective.activate();
    bot.waitUntil(new DefaultCondition() {
        @Override
        public boolean test() throws Exception {
            return javaPerspective.isActive();
        }

        @Override
        public String getFailureMessage() {
            return JavaUI.ID_PERSPECTIVE + " has not become active in time";
        }
    });
}
项目:translationstudio8    文件:TS.java   
/**
 * @return 透视图:默认布局;
 */
public SWTBotPerspective psptvBtnDefault() {
    return bot.perspectiveByLabel(TsUIConstants
            .getString("psptvBtnDefault"));
}
项目:tmxeditor8    文件:TS.java   
/**
 * @return 透视图:默认布局;
 */
public SWTBotPerspective psptvBtnDefault() {
    return bot.perspectiveByLabel(TsUIConstants
            .getString("psptvBtnDefault"));
}