Package org.apache.directory.ldapstudio.browser.core.model

Examples of org.apache.directory.ldapstudio.browser.core.model.ISearchResult


            }
        }

        if ( getSelectedSearchResults().length == 1 && getSelectedAttributeHierarchies().length == 0 )
        {
            ISearchResult result = getSelectedSearchResults()[0];
            return new ConnectionAndDn( result.getEntry().getConnection(), result.getEntry().getDn() );
        }

        return null;
    }
View Full Code Here


        {
            Object o = this.getRow().getData();
            String property = ( String ) this.viewer.getColumnProperties()[this.getColumn()];
            if ( o instanceof ISearchResult && !BrowserUIConstants.DN.equals( property ) )
            {
                ISearchResult sr = ( ISearchResult ) o;
                AttributeHierarchy ah = sr.getAttributeWithSubtypes( property );

                if ( ah == null )
                {
                    try
                    {
                        ah = new AttributeHierarchy( sr.getEntry(), property, new IAttribute[]
                            { new Attribute( sr.getEntry(), property ) } );
                    }
                    catch ( ModelModificationException e )
                    {
                        e.printStackTrace();
                    }
View Full Code Here

    }


    public ISelection getSelection()
    {
        ISearchResult searchResult = this.getSelectedSearchResult();
        AttributeHierarchy ah = this.getSelectedAttributeHierarchie();
        String property = this.getSelectedProperty();
        // String attributeName = this.getSelectedAttributeName();

        // System.out.println(attributes.length);
View Full Code Here

    public boolean select( Viewer viewer, Object parentElement, Object element )
    {

        if ( element instanceof ISearchResult )
        {
            ISearchResult searchResult = ( ISearchResult ) element;

            String[] returningAttributes = searchResult.getSearch().getReturningAttributes();
            for ( int r = 0; r < returningAttributes.length; r++ )
            {
                String ra = returningAttributes[r];
                AttributeHierarchy ah = searchResult.getAttributeWithSubtypes( ra );
                if ( ah != null )
                {
                    IAttribute[] attributes = ah.getAttributes();
                    for ( int i = 0; i < attributes.length; i++ )
                    {
                        IValue[] values = attributes[i].getValues();
                        for ( int k = 0; k < values.length; k++ )
                        {
                            if ( this.goesThroughQuickFilter( values[k] ) )
                            {
                                return true;
                            }
                        }
                    }
                }
            }

            // IAttribute[] attributes = searchResult.getAttributes();
            // for (int i = 0; i < attributes.length; i++) {
            // IValue[] values = attributes[i].getValues();
            // for (int k = 0; k < values.length; k++) {
            // if (this.goesThroughQuickFilter(values[k])) {
            // return true;
            // }
            // }
            // }
            if ( this.showDn
                && searchResult.getDn().toString().toUpperCase().indexOf( this.quickFilterValue.toUpperCase() ) > -1 )
            {
                return true;
            }

            return false;
View Full Code Here

        // else if((o1 instanceof ISearchResult) && !(o2 instanceof
        // ISearchResult)) {
        // return this.greaterThan();
        // }
        // else {
        ISearchResult sr1 = ( ISearchResult ) o1;
        ISearchResult sr2 = ( ISearchResult ) o2;

        IEntry entry1 = sr1.getEntry();
        IEntry entry2 = sr2.getEntry();

        String attributeName;
        if ( showDn && this.sortBy == 0 )
        {
            attributeName = BrowserUIConstants.DN;
View Full Code Here

    public boolean canModify( Object element, String property )
    {

        if ( element != null && element instanceof ISearchResult && property != null )
        {
            ISearchResult result = ( ISearchResult ) element;
            AttributeHierarchy ah = result.getAttributeWithSubtypes( property );

            // check DN
            if ( BrowserUIConstants.DN.equals( property ) )
            {
                return false;
            }

            // attribute dummy
            if ( ah == null )
            {
                try
                {
                    ah = new AttributeHierarchy( result.getEntry(), property, new IAttribute[]
                        { new Attribute( result.getEntry(), property ) } );
                }
                catch ( ModelModificationException e )
                {
                    e.printStackTrace();
                    return false;
View Full Code Here

    public Object getValue( Object element, String property )
    {

        if ( element != null && element instanceof ISearchResult && property != null )
        {
            ISearchResult result = ( ISearchResult ) element;
            AttributeHierarchy ah = result.getAttributeWithSubtypes( property );

            if ( !this.canModify( element, property ) )
            {
                return null;
            }

            if ( ah == null )
            {
                try
                {
                    ah = new AttributeHierarchy( result.getEntry(), property, new IAttribute[]
                        { new Attribute( result.getEntry(), property ) } );
                }
                catch ( ModelModificationException e )
                {
                    e.printStackTrace();
                    return null;
View Full Code Here

            element = ( ( Item ) element ).getData();
        }

        if ( element != null && element instanceof ISearchResult && property != null )
        {
            ISearchResult result = ( ISearchResult ) element;
            AttributeHierarchy ah = result.getAttributeWithSubtypes( property );

            try
            {
                // switch operation:
                if ( ah == null && newRawValue != null )
                {
                    this.valueEditorManager.getCurrentValueEditor( result.getEntry(), property ).createValue(
                        result.getEntry(), property, newRawValue );
                }
                else if ( ah != null && newRawValue == null )
                {
                    this.valueEditorManager.getCurrentValueEditor( ah ).deleteAttribute( ah );
                }
View Full Code Here

                exampleSearch.setConnection( entry.getConnection() );
                exampleSearch.setSearchBase( entry.getDn() );
            }
            else if ( obj instanceof ISearchResult )
            {
                ISearchResult searchResult = ( ISearchResult ) obj;
                exampleSearch.setConnection( searchResult.getEntry().getConnection() );
                exampleSearch.setSearchBase( searchResult.getEntry().getDn() );
            }
            else if ( obj instanceof IBookmark )
            {
                IBookmark bookmark = ( IBookmark ) obj;
                exampleSearch.setConnection( bookmark.getConnection() );
View Full Code Here

                        0, IConnection.DEREFERENCE_ALIASES_NEVER, IConnection.HANDLE_REFERRALS_IGNORE, false, false, null );
                    search( search, monitor );
                    ISearchResult[] results = search.getSearchResults();
                    for ( int k = 0; results != null && k < results.length; k++ )
                    {
                        ISearchResult result = results[k];
                        IEntry entry = result.getEntry();
                        rootDSE.addChild( entry );
                    }
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.directory.ldapstudio.browser.core.model.ISearchResult

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.