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

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


                if ( search.getSearchResults() != null )
                {
                    ISearchResult[] searchResults = search.getSearchResults();
                    for ( int k = 0; k < searchResults.length; k++ )
                    {
                        ISearchResult result = searchResults[k];
                        if ( oldEntry.equals( result.getEntry() ) )
                        {
                            ISearchResult[] newsrs = new ISearchResult[searchResults.length - 1];
                            System.arraycopy( searchResults, 0, newsrs, 0, k );
                            System.arraycopy( searchResults, k + 1, newsrs, k, searchResults.length - k - 1 );
                            search.setSearchResults( newsrs );
View Full Code Here


                if ( search.getSearchResults() != null )
                {
                    ISearchResult[] searchResults = search.getSearchResults();
                    for ( int k = 0; k < searchResults.length; k++ )
                    {
                        ISearchResult result = searchResults[k];
                        if ( entryToDelete.equals( result.getEntry() ) )
                        {
                            ISearchResult[] newsrs = new ISearchResult[searchResults.length - 1];
                            System.arraycopy( searchResults, 0, newsrs, 0, k );
                            System.arraycopy( searchResults, k + 1, newsrs, k, searchResults.length - k - 1 );
                            search.setSearchResults( newsrs );
View Full Code Here

                                referralSearch.getConnection().search( referralSearch, monitor );

                                ISearchResult[] referralSearchResults = referralSearch.getSearchResults();
                                for ( int j = 0; referralSearchResults != null && j < referralSearchResults.length; j++ )
                                {
                                    ISearchResult referralSearchResult = referralSearchResults[j];
                                    referralSearchResult.setSearch( search );
                                    searchResultList.add( referralSearchResult );
                                }
                            }
                        }
                    }
View Full Code Here

                    if ( search.getSearchResults() != null )
                    {
                        ISearchResult[] searchResults = search.getSearchResults();
                        for ( int k = 0; k < searchResults.length; k++ )
                        {
                            ISearchResult result = searchResults[k];
                            if ( oldEntry.equals( result.getEntry() ) )
                            {
                                ISearchResult[] newsrs = new ISearchResult[searchResults.length - 1];
                                System.arraycopy( searchResults, 0, newsrs, 0, k );
                                System.arraycopy( searchResults, k + 1, newsrs, k, searchResults.length - k - 1 );
                                search.setSearchResults( newsrs );
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

        // 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

        if ( obj != null && obj instanceof ISearchResult )
        {
            String property;
            try
            {
                ISearchResult result = ( ISearchResult ) obj;

                if ( this.showDn && index == 0 )
                {
                    property = BrowserUIConstants.DN;
                }
                else if ( this.showDn && index > 0 )
                {
                    property = this.search.getReturningAttributes()[index - 1];
                }
                else
                {
                    property = this.search.getReturningAttributes()[index];
                }

                if ( property == BrowserUIConstants.DN )
                {
                    return result.getDn().toString();
                }
                else
                {
                    AttributeHierarchy ah = result.getAttributeWithSubtypes( property );
                    return getDisplayValue( ah );
                }

            }
            catch ( ArrayIndexOutOfBoundsException aioobe )
View Full Code Here

    public Font getFont( Object element, int index )
    {

        if ( element instanceof ISearchResult )
        {
            ISearchResult result = ( ISearchResult ) element;
            String property = null;

            if ( this.showDn && index == 0 )
            {
                property = BrowserUIConstants.DN;
            }
            else if ( this.showDn && index > 0 && index - 1 < result.getSearch().getReturningAttributes().length )
            {
                property = result.getSearch().getReturningAttributes()[index - 1];
            }
            else if ( index < result.getSearch().getReturningAttributes().length )
            {
                property = result.getSearch().getReturningAttributes()[index];
            }

            if ( property != null && property == BrowserUIConstants.DN )
            {
                return null;
            }
            else if ( property != null )
            {
                AttributeHierarchy ah = result.getAttributeWithSubtypes( property );
                if ( ah != null )
                {
                    for ( int i = 0; i < ah.getAttributes().length; i++ )
                    {
                        IAttribute attribute = ah.getAttributes()[i];
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.