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

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


        monitor.beginTask( " ", searches.length + 1 ); //$NON-NLS-1$
        monitor.reportProgress( " " ); //$NON-NLS-1$

        for ( int pi = 0; pi < searches.length; pi++ )
        {
            ISearch search = searches[pi];

            monitor.setTaskName( BrowserCoreMessages.bind( BrowserCoreMessages.jobs__search_task, new String[]
                { search.getName() } ) );
            monitor.worked( 1 );

            if ( search.getConnection() != null && search.getConnection().isOpened() )
            {

                // // clear search result attributes
                // if(search.getSearchResults() != null) {
                // ISearchResult[] srs = search.getSearchResults();
                // for (int s = 0; s < srs.length; s++) {
                // IEntry entry = srs[s].getEntry();
                // entry.setAttributesInitialized(false, entry.getConnection());
                // }
                // }

                search.getConnection().search( search, monitor );
            }
        }
    }
View Full Code Here


                { entry.getDn().toString() } ) );

        // entry.setAttributesInitialized(false, entry.getConnection());

        // search
        ISearch search = new Search( null, entry.getConnection(), entry.getDn(), ISearch.FILTER_TRUE, attributes,
            ISearch.SCOPE_OBJECT, 0, 0, IConnection.DEREFERENCE_ALIASES_NEVER, IConnection.HANDLE_REFERRALS_IGNORE,
            false, false, null );
        entry.getConnection().search( search, monitor );

        // set initialized state
View Full Code Here

     *
     * This viewer selects the updated search.
     */
    public void searchUpdated( SearchUpdateEvent searchUpdateEvent )
    {
        ISearch search = searchUpdateEvent.getSearch();
        viewer.refresh();

        if ( Arrays.asList( search.getConnection().getSearchManager().getSearches() ).contains( search ) )
        {
            viewer.setSelection( new StructuredSelection( search ), true );
        }
        else
        {
View Full Code Here

            }
            else if ( "ISearchResult".equals( type ) )
            {
                IConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getConnection(
                    memento.getString( "CONNECTION" ) );
                ISearch search = connection.getSearchManager().getSearch( memento.getString( "SEARCH" ) );
                ISearchResult[] searchResults = search.getSearchResults();
                DN dn = new DN( memento.getString( "DN" ) );
                for ( int i = 0; i < searchResults.length; i++ )
                {
                    if ( dn.equals( searchResults[i].getDn() ) )
                    {
View Full Code Here

        // update state
        String url = "";
        boolean enabled = true;
        if ( input != null && input instanceof ISearch )
        {
            ISearch search = ( ISearch ) input;

            if ( filteredAndSortedElements.length < elements.length )
            {
                url += filteredAndSortedElements.length + " of ";
            }

            if ( search.getSearchResults() == null )
            {
                url += "Search not performed  -  ";
                enabled = false;
            }
            else if ( search.getSearchResults().length == 1 )
            {
                url += search.getSearchResults().length + " Result  -  ";
            }
            else
            {
                url += search.getSearchResults().length + " Results  -  ";
            }

            // url += search.getURL();
            url += "Search Base: " + search.getSearchBase().toString() + "  -  ";
            url += "Filter: " + search.getFilter();

            boolean showDn = BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
                BrowserUIConstants.PREFERENCE_SEARCHRESULTEDITOR_SHOW_DN )
                || search.getReturningAttributes().length == 0;
            this.configuration.getFilter().inputChanged( search, showDn );
            this.configuration.getSorter().inputChanged( search, showDn );
        }
        else
        {
View Full Code Here

    public Object[] getElements( Object inputElement )
    {
        if ( inputElement != null && inputElement instanceof ISearch )
        {
            ISearch search = ( ISearch ) inputElement;
            return search.getSearchResults() != null ? search.getSearchResults() : new Object[0];
        }
        else
        {
            return new Object[]
                {};
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public String getText()
    {
        ISearch search = getSearch();
        if ( search != null )
        {
            return "Search " + search.getName();
        }
        else
        {
            return super.getText();
        }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public void saveState( IMemento memento )
    {
        ISearch search = getSearch();
        memento.putString( "SEARCH", search.getName() );
        memento.putString( "CONNECTION", search.getConnection().getName() );
    }
View Full Code Here

     */
    public void restoreState( IMemento memento )
    {
        IConnection connection = BrowserCorePlugin.getDefault().getConnectionManager().getConnection(
            memento.getString( "CONNECTION" ) );
        ISearch search = connection.getSearchManager().getSearch( memento.getString( "SEARCH" ) );
        super.setInput( new SearchResultEditorInput( search ) );
    }
View Full Code Here

        {
            return false;
        }

        SearchResultEditorNavigationLocation location = ( SearchResultEditorNavigationLocation ) currentLocation;
        ISearch other = location.getSearch();
        ISearch search = getSearch();

        if ( other == null && search == null )
        {
            return true;
        }
        else if ( other == null || search == null )
        {
            return false;
        }
        else
        {
            return search.equals( other );
        }
    }
View Full Code Here

TOP

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

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.