Package net.sf.swtbot.widgets

Examples of net.sf.swtbot.widgets.SWTBotShell


   * @param shellText the text on the shell.
   * @return a wrapper around a shell with the specified text.
   * @throws WidgetNotFoundException if the widget is not found.
   */
  public SWTBotShell shell(String shellText) throws WidgetNotFoundException {
    return new SWTBotShell(finder, shellText);
  }
View Full Code Here


   * @param index the index of the shell in case there are multiple shells with the same text.
   * @return a wrapper around a shell with the specified text.
   * @throws WidgetNotFoundException if the widget is not found.
   */
  public SWTBotShell shell(String shellText, int index) throws WidgetNotFoundException {
    return new SWTBotShell(finder, shellText, index);
  }
View Full Code Here

   *
   * @return the current active shell
   * @throws WidgetNotFoundException if the widget is not found.
   */
  public SWTBotShell activeShell() throws WidgetNotFoundException {
    return new SWTBotShell(finder.activeShell());
  }
View Full Code Here

   */
  public SWTBotShell[] shells() throws WidgetNotFoundException {
    Shell[] shells = finder.getShells();
    SWTBotShell[] result = new SWTBotShell[shells.length];
    for (int i = 0; i < result.length; i++)
      result[i] = new SWTBotShell(shells[i]);
    return result;
  }
View Full Code Here

   * @param quickFixIndex the index of the quickfix item to apply.
   * @throws QuickFixNotFoundException if the quickfix could not be found.
   * @throws WidgetNotFoundException if the quickfix could not be found.
   */
  public void quickfix(int quickFixIndex) throws QuickFixNotFoundException, WidgetNotFoundException {
    SWTBotShell quickFixShell = activateQuickFixShell();
    SWTBotTable quickFixTable = getQuickFixTable(quickFixShell);
    applyQuickFix(quickFixTable, quickFixIndex);
  }
View Full Code Here

   * @param quickFixName the name of the quick fix to apply.
   * @throws QuickFixNotFoundException if the quickfix could not be found.
   */
  public void quickfix(String quickFixName) throws QuickFixNotFoundException {
    int retries = 10;
    SWTBotShell quickFixShell = activateQuickFixShell();
    SWTBotTable quickFixTable = getQuickFixTable(quickFixShell);
    applyQuickFix(quickFixTable, quickFixName, retries);
  }
View Full Code Here

   * @return the list of all available quickfixes.
   * @throws QuickFixNotFoundException if the quickfix could not be found.
   * @since 1.2
   */
  public List getQuickFixes() throws QuickFixNotFoundException {
    SWTBotShell quickFixShell = activateQuickFixShell();
    SWTBotTable quickFixTable = getQuickFixTable(quickFixShell);
    int rowCount = quickFixTable.rowCount();
    List result = new ArrayList();
    for (int i = 0; i < rowCount; i++)
      result.add(quickFixTable.cell(i, 0));
View Full Code Here

   * @return the number of quickfix items in the quickfix proposals.
   * @throws QuickFixNotFoundException if the quickfix could not be found.
   * @since 1.2
   */
  public int getQuickfixListItemCount() throws QuickFixNotFoundException {
    SWTBotShell quickFixShell = activateQuickFixShell();
    SWTBotTable quickFixTable = getQuickFixTable(quickFixShell);
    return quickFixTable.rowCount();
  }
View Full Code Here

   * @return The shell.
   * @throws QuickFixNotFoundException Throw if a quick fix problem occurs.
   */
  private SWTBotShell activatePopupShell() throws QuickFixNotFoundException {
    try {
      SWTBotShell shell = bot.shell("", 1);
      shell.activate();
      if (log.isDebugEnabled())
        log.debug("Activated quickfix shell.");
      return shell;
    } catch (Exception e) {
      throw new QuickFixNotFoundException("Quickfix popup not found. Giving up.", e);
View Full Code Here

   * @since 1.2
   */
  public List getAutoCompleteProposals(String insertText) throws QuickFixNotFoundException, TimeoutException {
    styledText.typeText(insertText);
    bot.sleep(1000);
    SWTBotShell autoCompleteShell = activateAutoCompleteShell();
    final SWTBotTable autoCompleteTable = getQuickFixTable(autoCompleteShell);
    List result = syncExec(new ListResult() {
      public List run() {
        TableItem[] items = ((Table) autoCompleteTable.widget).getItems();
        ArrayList result = new ArrayList();
        for (int i = 0; i < items.length; i++) {
          TableItem tableItem = items[i];
          result.add(tableItem.getText());
        }
        return result;
      }
    });
    // makeProposalsDisappear();
    autoCompleteShell.close();
    return result;
  }
View Full Code Here

TOP

Related Classes of net.sf.swtbot.widgets.SWTBotShell

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.