Examples of ISearchResult


Examples of org.apache.directory.studio.ldapbrowser.core.model.ISearchResult

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

Examples of org.apache.directory.studio.ldapbrowser.core.model.ISearchResult

        // add entry to Root DSE
        ISearchResult[] results = search.getSearchResults();
        if ( results != null && results.length == 1 )
        {
            ISearchResult result = results[0];
            entry = result.getEntry();
            browserConnection.getRootDSE().addChild( entry );
        }
    }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.ISearchResult

            IBookmark bookmark = ( IBookmark ) obj;
            return bookmark.getName();
        }
        else if ( obj instanceof ISearchResult )
        {
            ISearchResult sr = ( ISearchResult ) obj;

            if ( !sr.getSearch().getBrowserConnection().equals( sr.getEntry().getBrowserConnection() ) )
            {
                return sr.getEntry().getUrl().toString();
            }
            else if ( sr.getEntry().hasParententry() || sr.getEntry() instanceof IRootDSE )
            {
                String label = "";
                if ( sr.getEntry() instanceof IRootDSE )
                {
                    label = "Root DSE";
                }
                else if ( preferences.getSearchResultLabel() == BrowserCommonConstants.SHOW_DN )
                {
                    label = sr.getEntry().getDn().getUpName();
                }
                else if ( preferences.getSearchResultLabel() == BrowserCommonConstants.SHOW_RDN )
                {
                    label = sr.getEntry().getRdn().getUpName();
                }
                else if ( preferences.getSearchResultLabel() == BrowserCommonConstants.SHOW_RDN_VALUE )
                {
                    label = ( String ) sr.getEntry().getRdn().getUpValue();
                }

                if ( preferences.isSearchResultAbbreviate()
                    && label.length() > preferences.getSearchResultAbbreviateMaxLength() )
                {
                    label = Utils.shorten( label, preferences.getSearchResultAbbreviateMaxLength() );
                }

                return label;
            }
            else
            {
                return sr.getEntry().getDn().getUpName();
            }

        }
        else if ( obj instanceof BrowserCategory )
        {
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.ISearchResult

        {
            return BrowserCommonActivator.getDefault().getImage( BrowserCommonConstants.IMG_BOOKMARK );
        }
        else if ( obj instanceof ISearchResult )
        {
            ISearchResult sr = ( ISearchResult ) obj;
            IEntry entry = sr.getEntry();
            return getImageByRdn( entry );
        }
        else if ( obj instanceof BrowserCategory )
        {
            BrowserCategory category = ( BrowserCategory ) obj;
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.ISearchResult

        // add entry to Root DSE
        ISearchResult[] results = search.getSearchResults();
        if ( results != null && results.length == 1 )
        {
            ISearchResult result = results[0];
            entry = result.getEntry();
            browserConnection.getRootDSE().addChild( entry );
        }
    }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.ISearchResult

                            ISearchResult[] searchResults = search.getSearchResults();
                            List<ISearchResult> searchResultList = new ArrayList<ISearchResult>();
                            searchResultList.addAll( Arrays.asList( searchResults ) );
                            for ( Iterator<ISearchResult> it = searchResultList.iterator(); it.hasNext(); )
                            {
                                ISearchResult result = it.next();
                                if ( entryToDelete.equals( result.getEntry() ) )
                                {
                                    it.remove();
                                    searchesToUpdateSet.add( search );
                                }
                            }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.ISearchResult

        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().getUpName();
                }
                else
                {
                    AttributeHierarchy ah = result.getAttributeWithSubtypes( property );
                    return getDisplayValue( ah );
                }

            }
            catch ( ArrayIndexOutOfBoundsException aioobe )
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.ISearchResult

    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

Examples of org.apache.directory.studio.ldapbrowser.core.model.ISearchResult

        {
            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 )
                {
                    ah = new AttributeHierarchy( sr.getEntry(), property, new IAttribute[]
                        { new Attribute( sr.getEntry(), property ) } );
                }

                return ah;
            }
        }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.ISearchResult

    }


    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
TOP
Copyright © 2018 www.massapi.com. 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.