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

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


        IEntry entry = null;

        if ( element instanceof ISearchResult )
        {
            ISearchResult searchResult = ( ISearchResult ) element;
            entry = searchResult.getEntry();
            decoration.addOverlay( BrowserUIPlugin.getDefault().getImageDescriptor(
                BrowserUIConstants.IMG_OVR_SEARCHRESULT ), IDecoration.BOTTOM_RIGHT );
        }
        else if ( element instanceof IEntry )
        {
View Full Code Here


    public void select( Object obj )
    {
        if ( obj instanceof ISearchResult )
        {
            ISearchResult searchResult = ( ISearchResult ) obj;
            ISearch search = searchResult.getSearch();

            this.mainWidget.getViewer().expandToLevel( search, 1 );

            this.mainWidget.getViewer().reveal( searchResult );
            this.mainWidget.getViewer().refresh( searchResult, true );
View Full Code Here

                        select( entry );

                    }
                    else if ( obj instanceof ISearchResult )
                    {
                        ISearchResult sr = ( ISearchResult ) obj;
                        ISearch search = sr.getSearch();
                        select( search );
                    }
                    System.out.println( "BrowserView: " + context.getInput() + "," + context.getSelection() );
                    return true;
                }
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

        dnLink.setMenu( viewer.getTable().getMenu() );
        dnLink.addHyperlinkListener( new IHyperlinkListener()
        {
            public void linkActivated( HyperlinkEvent e )
            {
                ISearchResult sr = ( ISearchResult ) e.widget.getData();
                OpenSearchResultAction action = new OpenSearchResultAction();
                action.setSelectedSearchResults( new ISearchResult[]
                    { sr } );
                action.run();
            }
View Full Code Here

                // viewer.setSelection(new StructuredSelection(getRow()), true);
                // viewer.getTable().setSelection(new TableItem[]{getRow()});
                viewer.setSelection( null, true );
                viewer.getTable().setSelection( new TableItem[0] );

                ISearchResult result = cursor.getSelectedSearchResult();
                String property = cursor.getSelectedProperty();
                if ( property != null && result != null && viewer.getCellModifier().canModify( result, property ) )
                {
                    cursor.setBackground( Display.getDefault().getSystemColor( SWT.COLOR_LIST_SELECTION ) );
                }
View Full Code Here

            {
                Object data = item.getData();

                if ( data instanceof ISearchResult )
                {
                    ISearchResult sr = ( ISearchResult ) data;

                    item.getFont();
                    viewer.getTable().getColumn( 0 ).getWidth();
                    viewer.getTable().getItemHeight();

                    // dnLink.setText("<a>"+sr.getDn().toString()+"</a>");
                    dnLink.setData( sr );
                    dnLink.setText( sr.getDn().toString() );
                    dnLink.setUnderlined( true );
                    dnLink.setFont( item.getFont() );
                    dnLink.setForeground( item.getForeground() );
                    dnLink.setBackground( item.getBackground() );
                    dnLink.setBounds( item.getBounds( 0 ) );
View Full Code Here

            {
                return this.greaterThan();
            }
            else
            {
                ISearchResult sr1 = ( ISearchResult ) o1;
                ISearchResult sr2 = ( ISearchResult ) o2;

                int cat1 = this.category( sr1 );
                int cat2 = this.category( sr2 );
                if ( cat1 != cat2 )
                {
                    return cat1 - cat2;
                }
                else if ( preferences.getSortBy() == BrowserCoreConstants.SORT_BY_NONE )
                {
                    return this.equal();
                }
                else if ( preferences.getSortBy() == BrowserCoreConstants.SORT_BY_RDN )
                {
                    return this.compareRdns( sr1.getEntry(), sr2.getEntry() );
                }
                else if ( preferences.getSortBy() == BrowserCoreConstants.SORT_BY_RDN_VALUE )
                {
                    return this.compareRdnValues( sr1.getEntry(), sr2.getEntry() );
                }
                else
                {
                    return this.equal();
                }
View Full Code Here

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

            if ( !sr.getSearch().getConnection().equals( sr.getEntry().getConnection() ) )
            {
                return sr.getEntry().getUrl().toString();
            }
            else if ( sr.getEntry().hasParententry() )
            {
                String label = "";
                if ( this.preferences.getSearchResultLabel() == BrowserUIConstants.SHOW_DN )
                {
                    label = sr.getEntry().getDn().toString();
                }
                else if ( this.preferences.getSearchResultLabel() == BrowserUIConstants.SHOW_RDN )
                {
                    label = sr.getEntry().getRdn().toString();
                }
                else if ( this.preferences.getSearchResultLabel() == BrowserUIConstants.SHOW_RDN_VALUE )
                {
                    label = sr.getEntry().getRdn().getValue();
                }

                if ( this.preferences.isSearchResultAbbreviate()
                    && label.length() > this.preferences.getSearchResultAbbreviateMaxLength() )
                {
                    label = Utils.shorten( label, this.preferences.getSearchResultAbbreviateMaxLength() );
                    // label =
                    // label.substring(0,this.preferences.getSearchResultAbbreviateMaxLength()/2)
                    // + "..." +
                    // label.substring(label.length()-this.preferences.getSearchResultAbbreviateMaxLength()/2,
                    // label.length());
                }

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

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

            // IBookmark bookmark = (IBookmark) obj;
            return BrowserUIPlugin.getDefault().getImage( BrowserUIConstants.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

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.