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

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


        IBrowserConnection browserConnection1 = browserConnectionManager.getBrowserConnectionByName( "SearchTest1" );
        IBrowserConnection browserConnection2 = browserConnectionManager.getBrowserConnectionByName( "SearchTest2" );
        assertEquals( 0, browserConnection1.getSearchManager().getSearches().size() );
        assertEquals( 0, browserConnection2.getSearchManager().getSearches().size() );

        SWTBotTree connectionsTree = SWTBotUtils.getConnectionsTree( bot );
        SWTBotTree browserTree = SWTBotUtils.getLdapBrowserTree( bot );

        // create a search for in connection 1
        connectionsTree.select( "SearchTest1" );
        SWTBotUtils.selectEntry( bot, browserTree, false, "DIT", "Root DSE", "ou=system" );
        ContextMenuHelper.clickContextMenu( browserTree, "New", "New Search..." );
View Full Code Here


     *             the exception
     */
    @Test
    public void testAddEditDeleteAttribute() throws Exception
    {
        final SWTBotTree browserTree = SWTBotUtils.getLdapBrowserTree( bot );
        SWTBotUtils.selectEntry( bot, browserTree, false, "DIT", "Root DSE", "ou=system", "ou=users",
            "cn=Barbara Jensen" );

        final SWTBotTree entryEditorTree = SWTBotUtils.getEntryEditorTree( bot, "cn=Barbara Jensen,ou=users,ou=system" );
        entryEditorTree.setFocus();

        // add description attribute
        entryEditorTree.contextMenu( "New Attribute..." ).click();
        bot.comboBoxWithLabel( "Attribute type:" ).setText( "description" );
        bot.button( "Finish" ).click();
        bot.text( "" ).setText( "This is the 1st description." );
        entryEditorTree.getTreeItem( "objectClass" ).click();

        // add second value
        entryEditorTree.getTreeItem( "description" ).click();
        entryEditorTree.contextMenu( "New Value" ).click();
        bot.text( "" ).setText( "This is the 2nd description." );
        entryEditorTree.getTreeItem( "objectClass" ).click();

        // edit second value
        entryEditorTree.select( 7 );
        entryEditorTree.contextMenu( "Edit Value" ).click();
        bot.text( "This is the 2nd description." ).setText( "This is the 3rd description." );
        entryEditorTree.getTreeItem( "objectClass" ).click();

        // delete second value
        entryEditorTree.select( 7 );
        entryEditorTree.contextMenu( "Delete Value" ).click();
        bot.shell( "Delete Value" );
        bot.button( "OK" ).click();

        // edit 1st value
        entryEditorTree.select( 6 );
        entryEditorTree.contextMenu( "Edit Value" ).click();
        bot.text( "This is the 1st description." ).setText( "This is the final description." );
        entryEditorTree.getTreeItem( "objectClass" ).click();

        // delete 1st value/attribute
        entryEditorTree.select( 6 );
        entryEditorTree.contextMenu( "Delete Value" ).click();
        bot.shell( "Delete Value" );
        bot.button( "OK" ).click();
    }
View Full Code Here

     *             the exception
     */
    @Test
    public void testDnValueEditor() throws Exception
    {
        SWTBotTree browserTree = SWTBotUtils.getLdapBrowserTree( bot );
        SWTBotUtils.selectEntry( bot, browserTree, false, "DIT", "Root DSE", "ou=system", "ou=users",
            "cn=\\#\\\\\\+\\, \\\"\u00F6\u00E9\\\"" );
        SWTBotUtils.selectEntry( bot, browserTree, false, "DIT", "Root DSE", "ou=system", "ou=groups", "cn=My Group" );

        SWTBotTree entryEditorTree = SWTBotUtils.getEntryEditorTree( bot, "cn=My Group,ou=groups,ou=system" );
        entryEditorTree.setFocus();
        entryEditorTree.contextMenu( "New Attribute..." ).click();
        bot.shell( "New Attribute" );
        bot.comboBoxWithLabel( "Attribute type:" ).setText( "member" );
        bot.button( "Finish" ).click();

        // DN Editor automatically opened
        bot.shell( "DN Editor" );
        bot.button( "Browse..." ).click();

        // select value from DN picker
        bot.shell( "Select DN" );
        SWTBotTree tree = bot.tree( 0 );
        SWTBotUtils.selectEntry( bot, tree, false, "Root DSE", "ou=system", "ou=users",
            "cn=\\#\\\\\\+\\, \\\"\u00F6\u00E9\\\"" );
        bot.button( "OK" ).click();

        // assert value after selection
View Full Code Here

    }


    private SWTBotTreeItem getEntry( String... path )
    {
        SWTBotTree browserTree = getBrowserTree();
        List<String> pathList = new ArrayList<String>( Arrays.asList( path ) );
        SWTBotTreeItem entry = null;

        while ( !pathList.isEmpty() )
        {
            String node = pathList.remove( 0 );

            if ( entry == null )
            {
                node = adjustNodeName( browserTree, node );
                entry = browserTree.getTreeItem( node );
            }
            else
            {
                // adjust current path, because the label is decorated with the
                // number of children
View Full Code Here

    private SWTBotTree getBrowserTree()
    {
        SWTBotView view = bot.viewByTitle( "LDAP Browser" );
        view.show();
        SWTBotTree tree = view.bot().tree();
        return tree;
    }
View Full Code Here

    }


    public List<String> getAttributeValues()
    {
        SWTBotTree tree = bot.tree();
        List<String> attributes = new ArrayList<String>();
        int rowCount = tree.rowCount();
        for ( int i = 0; i < rowCount; i++ )
        {
            String attribute = tree.cell( i, 0 );
            String value = tree.cell( i, 1 );
            attributes.add( attribute + ": " + value );
        }
        return attributes;
    }
View Full Code Here

   * @return a {@link SWTBotTree} with the specified <code>label</code>.
   */
  @SuppressWarnings("unchecked")
  public SWTBotTree treeWithLabel(String label, int index) {
    Matcher matcher = allOf(widgetOfType(Tree.class), withLabel(label));
    return new SWTBotTree((Tree) widget(matcher, index), matcher);
  }
View Full Code Here

   * @return a {@link SWTBotTree} with the specified <code>key/value</code>.
   */
  @SuppressWarnings("unchecked")
  public SWTBotTree treeWithId(String key, String value, int index) {
    Matcher matcher = allOf(widgetOfType(Tree.class), withId(key, value));
    return new SWTBotTree((Tree) widget(matcher, index), matcher);
  }
View Full Code Here

   * @return a {@link SWTBotTree} with the specified <code>value</code>.
   */
  @SuppressWarnings("unchecked")
  public SWTBotTree treeWithId(String value, int index) {
    Matcher matcher = allOf(widgetOfType(Tree.class), withId(value));
    return new SWTBotTree((Tree) widget(matcher, index), matcher);
  }
View Full Code Here

   * @return a {@link SWTBotTree} with the specified <code>inGroup</code>.
   */
  @SuppressWarnings("unchecked")
  public SWTBotTree treeInGroup(String inGroup, int index) {
    Matcher matcher = allOf(widgetOfType(Tree.class), inGroup(inGroup));
    return new SWTBotTree((Tree) widget(matcher, index), matcher);
  }
View Full Code Here

TOP

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

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.