Package org.eclipse.swtbot.swt.finder.widgets

Examples of org.eclipse.swtbot.swt.finder.widgets.SWTBotButton


    assertEnabled(bot.button("One"));
  }

  @Test
  public void assertEnabledThrowsExceptionWhenWidgetIsDisable() throws Exception {
    final SWTBotButton button = bot.button("One");
    UIThreadRunnable.syncExec(new VoidResult() {
      public void run() {
        button.widget.setEnabled(false);
      }
    });
View Full Code Here


    assertTrue(bot.button("Two").isActive());
  }

  @Test
  public void findsGetsIdOfAControl() throws Exception {
    final SWTBotButton button = bot.button("Two");
    assertNull(button.getId());
    syncExec(new VoidResult() {
      public void run() {
        button.widget.setData(SWTBotPreferences.DEFAULT_KEY, "foo");
      }
    });
    assertEquals("foo", button.getId());
  }
View Full Code Here

        cEditor.setActivePage(page.getId());
        assertNotNull("Could not load beans page.", page.getMasterPart());
      }
    });

    SWTBotButton newBeanButton = bot.flatButton("New Bean...");
    SWTBotButton upButton = bot.flatButton("Up");
    SWTBotButton downButton = bot.flatButton("Down");
    assertFalse(upButton.isEnabled());
    assertFalse(downButton.isEnabled());

    UIThreadRunnable.syncExec(new VoidResult() {
      public void run() {
        TreeViewer treeViewer = (TreeViewer) page.getMasterPart().getViewer();
        TreeItem root = treeViewer.getTree().getItem(0);
        TreeItem beanItem = root.getItem(1);
        page.setSelection(new StructuredSelection(beanItem.getData()));
      }
    });

    assertTrue(upButton.isEnabled());
    assertTrue(downButton.isEnabled());
    newBeanButton.click();

    SWTBotShell newBeanDialog = bot.shell("Create New Bean");
    assertTrue(newBeanDialog.isOpen());
    newBeanDialog.close();
View Full Code Here

TOP

Related Classes of org.eclipse.swtbot.swt.finder.widgets.SWTBotButton

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.