Package org.apache.directory.studio.ldapbrowser.core.model

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


                 * Thus, a dummy input with the real entry but a null extension is set.
                 * This avoids to modification of the navigation history.
                 * Afterwards the real input is set.
                 */
                IEntry entry = eei.getEntryInput();
                ISearchResult searchResult = eei.getSearchResultInput();
                IBookmark bookmark = eei.getBookmarkInput();
                EntryEditorInput dummyInput;
                if ( entry != null )
                {
                    dummyInput = new EntryEditorInput( entry, null );
View Full Code Here


            objectToSelect = search;
        }
        if ( obj instanceof ISearchResult )
        {
            ISearchResult searchResult = ( ISearchResult ) obj;
            ISearch search = searchResult.getSearch();

            universalListener.setInput( search.getBrowserConnection() );

            mainWidget.getViewer().expandToLevel( search, 1 );
View Full Code Here

                        entry = entry.getBrowserConnection().getEntryFromCache( entry.getDn() );
                        select( entry );
                    }
                    else if ( obj instanceof ISearchResult )
                    {
                        ISearchResult sr = ( ISearchResult ) obj;
                        ISearch search = sr.getSearch();
                        // The search may be a clone, lookup original search from search manager.
                        // The result may be null, in that case the selection won't change.
                        search = search.getBrowserConnection().getSearchManager().getSearch( search.getName() );
                        select( search );
                    }
View Full Code Here

    public AttributeHierarchy getSelectedAttributeHierarchy()
    {
        if ( !isDisposed() && getRow() != null && viewer != null && viewer.getColumnProperties() != null
            && viewer.getColumnProperties().length >= getColumn() + 1 )
        {
            ISearchResult sr = getSelectedSearchResult();
            String property = ( String ) viewer.getColumnProperties()[getColumn()];
            if ( sr != null && !BrowserUIConstants.DN.equals( property ) )
            {
                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

        if ( !isDisposed() && getRow() != null )
        {
            Object o = getRow().getData();
            if ( o instanceof ISearchResult )
            {
                ISearchResult sr = ( ISearchResult ) o;
                if ( !sr.equals( workingCopy ) )
                {
                    IEntry entry = sr.getEntry();
                    IEntry referenceEntry = new CompoundModification().cloneEntry( entry );
                    referenceCopy = new SearchResult( referenceEntry, sr.getSearch() );
                    IEntry workingEntry = new CompoundModification().cloneEntry( entry );
                    workingCopy = new SearchResult( workingEntry, sr.getSearch() );
                }

                return workingCopy;
            }
        }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public ISelection getSelection()
    {
        ISearchResult searchResult = getSelectedSearchResult();
        AttributeHierarchy ah = getSelectedAttributeHierarchy();
        String property = getSelectedProperty();

        List<Object> list = new ArrayList<Object>();
        if ( searchResult != null )
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().getName() );
                    dnLink.setUnderlined( true );
                    dnLink.setFont( item.getFont() );
                    dnLink.setForeground( item.getForeground() );
                    dnLink.setBackground( item.getBackground() );
                    dnLink.setBounds( item.getBounds( 0 ) );
View Full Code Here

                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

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

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

                if ( property == BrowserUIConstants.DN )
                {
                    return result.getDn().getName();
                }
                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 ( showDn && index == 0 )
            {
                property = BrowserUIConstants.DN;
            }
            else if ( 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.studio.ldapbrowser.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.