Package org.eclipse.swtbot.swt.finder.waits

Examples of org.eclipse.swtbot.swt.finder.waits.DefaultCondition


            }
        } );

        if ( wait )
        {
            bot.waitUntil( new DefaultCondition()
            {
                public boolean test() throws Exception
                {
                    //                    if ( nextNode != null )
                    //                    {
View Full Code Here



    private void createAndDeleteEntry( final SWTBotTree browserTree, final String name ) throws Exception
    {
        SWTBotUtils.selectEntry( bot, browserTree, true, "DIT", "Root DSE", "ou=system" );
        SWTBotUtils.asyncClick( bot, browserTree.contextMenu( "New Entry..." ), new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return bot.shell( "New Entry" ) != null;
            }


            public String getFailureMessage()
            {
                return "Could not find dialog 'New Entry'";
            }
        } );

        bot.radio( "Create entry from scratch" ).click();
        bot.button( "Next >" ).click();

        bot.table( 0 ).select( "organization" );
        bot.button( "Add" ).click();
        bot.button( "Next >" ).click();

        SWTBotCombo typeCombo = bot.comboBox( "" );
        typeCombo.setText( "o" );
        SWTBotText valueText = bot.text( "" );
        valueText.setText( name );
        SWTBotUtils.asyncClick( bot, bot.button( "Next >" ), new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return bot.button( "Finish" ).isEnabled();
            }


            public String getFailureMessage()
            {
                return "Finish button is not enabled";
            }
        } );

        // click finish to create the entry
        SWTBotUtils.asyncClick( bot, bot.button( "Finish" ), new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return browserTree.selection().get( 0 ).get( 0 ).startsWith( "o=" + name );
            }


            public String getFailureMessage()
            {
                return "Could not select 'o=" + name + "'";
            }
        } );

        // delete the entry
        SWTBotUtils.selectEntry( bot, browserTree, false, "DIT", "Root DSE", "ou=system", "o=" + name );
        SWTBotUtils.asyncClick( bot, browserTree.contextMenu( "Delete Entry" ), new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return bot.shell( "Delete Entry" ) != null;
            }


            public String getFailureMessage()
            {
                return "Could not find dialog 'New Entry'";
            }
        } );
        SWTBotUtils.asyncClick( bot, bot.button( "OK" ), new DefaultCondition()
        {
            public boolean test() throws Exception
            {
                return browserTree.selection().get( 0 ).get( 0 ).startsWith( "ou=system" );
            }
View Full Code Here

   *
   * @throws TimeoutException if the condition does not evaluate to true after {@link SWTBotPreferences#TIMEOUT}
   *             milliseconds.
   */
  public static void waitForDisplayToAppear() {
    waitUntil(new DefaultCondition() {

      public String getFailureMessage() {
        return "Could not find a display"; //$NON-NLS-1$
      }

View Full Code Here

   * @return the tree item with the specified text.
   * @throws WidgetNotFoundException if the node was not found.
   */
  public SWTBotTreeItem getTreeItem(final String nodeText) throws WidgetNotFoundException {
    try {
      new SWTBot().waitUntil(new DefaultCondition() {
        public String getFailureMessage() {
          return "Could not find node with text " + nodeText; //$NON-NLS-1$
        }

        public boolean test() throws Exception {
View Full Code Here

   */
  protected SWTBotMenu contextMenu(final Control control, final String text) {
    final Matcher<?> matcher = allOf(instanceOf(MenuItem.class), withMnemonic(text));
    final ContextMenuFinder menuFinder = new ContextMenuFinder(control);

    new SWTBot().waitUntil(new DefaultCondition() {
      public String getFailureMessage() {
        return "Could not find context menu with text: " + text; //$NON-NLS-1$
      }

      public boolean test() throws Exception {
View Full Code Here

    }


    public void waitForConnection( final String connectionName )
    {
        bot.waitUntil( new DefaultCondition()
        {

            public boolean test() throws Exception
            {
                for ( SWTBotTreeItem item : getConnectionsTree().getAllItems() )
View Full Code Here

      }
    });

    notify(SWT.Selection, createEvent(), tabFolder());

    new SWTBot().waitUntil(new DefaultCondition() {
      public boolean test() throws Exception {
        return isActive();
      }

      public String getFailureMessage() {
View Full Code Here

   * @return the tree item with the specified text.
   * @throws WidgetNotFoundException if the node was not found.
   */
  public SWTBotTreeItem getTreeItem(final String nodeText) throws WidgetNotFoundException {
    try {
      new SWTBot().waitUntil(new DefaultCondition() {
        public String getFailureMessage() {
          return "Could not find node with text " + nodeText; //$NON-NLS-1$
        }

        public boolean test() throws Exception {
View Full Code Here

   * @throws WidgetNotFoundException if the node was not found.
   * @since 1.3
   */
  public SWTBotTableItem getTableItem(final String itemText) throws WidgetNotFoundException {
    try {
      new SWTBot().waitUntil(new DefaultCondition() {
        public String getFailureMessage() {
          return "Could not find node with text " + itemText; //$NON-NLS-1$
        }

        public boolean test() throws Exception {
View Full Code Here

   * @throws WidgetNotFoundException if the node was not found.
   * @since 2.0
   */
  public SWTBotTableItem getTableItem(final int row) throws WidgetNotFoundException {
    try {
      new SWTBot().waitUntil(new DefaultCondition() {
        public String getFailureMessage() {
          return "Could not find table item for row " + row; //$NON-NLS-1$
        }

        public boolean test() throws Exception {
View Full Code Here

TOP

Related Classes of org.eclipse.swtbot.swt.finder.waits.DefaultCondition

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.