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

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


     * @return
     *      the selected Entry
     */
    protected IEntry getEntry()
    {
        IEntry entry = null;
        if ( getSelectedEntries().length > 0 )
        {
            entry = getSelectedEntries()[0];
        }
        else if ( getSelectedSearchResults().length > 0 )
View Full Code Here


    /**
     * {@inheritDoc}
     */
    public void run()
    {
        IEntry entry = getSelectedSearchResults().length > 0 ? getSelectedSearchResults()[0].getEntry() : null;
        if ( entry != null )
        {
            // disable action handlers
            actionGroup.deactivateGlobalActionHandlers();

View Full Code Here

        }

        ISearchResult sr1 = ( ISearchResult ) o1;
        ISearchResult sr2 = ( ISearchResult ) o2;

        IEntry entry1 = sr1.getEntry();
        IEntry entry2 = sr2.getEntry();

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

        if ( attributeName == BrowserUIConstants.DN )
        {
            // compare normalized names
            return compare( entry1.getDn().getNormName(), entry2.getDn().getNormName() );
        }
        else
        {
            AttributeHierarchy ah1 = entry1.getAttributeWithSubtypes( attributeName );
            AttributeHierarchy ah2 = entry2.getAttributeWithSubtypes( attributeName );
            if ( ah1 == null && ah2 == null )
            {
                return equal();
            }
            else if ( ah1 == null && ah2 != null )
View Full Code Here

        {
            ISearchResult[] searchResults = search.getSearchResults();
            ISearchResult[] clonedSearchResults = new ISearchResult[searchResults.length];
            for ( int i = 0; i < searchResults.length; i++ )
            {
                IEntry entry = searchResults[i].getEntry();
                IEntry clonedEntry = new CompoundModification().cloneEntry( entry );
                clonedSearchResults[i] = new SearchResult( clonedEntry, workingCopy );
            }

            EventRegistry.suspendEventFiringInCurrentThread();
            workingCopy.setSearchResults( clonedSearchResults );
View Full Code Here

                Schema schema = editor.getConnection() != null ? editor.getConnection().getSchema()
                    : Schema.DEFAULT_SCHEMA;
                IBrowserConnection dummyConnection = new DummyConnection( schema );

                IEntry dummyEntry = null;
                if ( containers[0] instanceof LdifContentRecord )
                {
                    dummyEntry = ModelConverter.ldifContentRecordToEntry( ( LdifContentRecord ) containers[0],
                        dummyConnection );
                }
View Full Code Here

        if ( document != null )
        {
            try
            {
                inSetContent = true;
                IEntry sharedWorkingCopy = input.getSharedWorkingCopy( editor );
                setDocumentInput( document, sharedWorkingCopy );

                // reset dirty state
                if ( !input.isSharedWorkingCopyDirty( editor ) )
                {
View Full Code Here

    @Override
    protected IDocument createDocument( Object element ) throws CoreException
    {
        input = getEntryEditorInput( element );
        IEntry entry = getEntryEditorInput( element ).getSharedWorkingCopy( editor );
        IDocument document = new Document();
        if ( entry != null )
        {
            setDocumentInput( document, entry );
        }
View Full Code Here

    public boolean isModifiable( Object element )
    {
        if ( element instanceof EntryEditorInput )
        {
            EntryEditorInput editorInput = ( EntryEditorInput ) element;
            IEntry entry = editorInput.getSharedWorkingCopy( editor );
            return ( entry != null );
        }

        return false;
    }
View Full Code Here

        if ( !quickSearchRunButton.isEnabled() )
        {
            return;
        }

        IEntry entry = getSelectedEntry();
        if ( entry == null )
        {
            return;
        }

        HistoryUtils.save( ATTRIBUTE_HISTORY_DIALOGSETTING_KEY, quickSearchAttributeCombo.getText() );
        String[] attributes = HistoryUtils.load( ATTRIBUTE_HISTORY_DIALOGSETTING_KEY );
        quickSearchAttributeCombo.setItems( attributes );
        quickSearchAttributeCombo.select( 0 );
        HistoryUtils.save( VALUE_HISTORY_DIALOGSETTING_KEY, quickSearchValueCombo.getText() );
        String[] values = HistoryUtils.load( VALUE_HISTORY_DIALOGSETTING_KEY );
        quickSearchValueCombo.setItems( values );
        quickSearchValueCombo.select( 0 );
        quickSearchValuePP.setProposals( Arrays.asList( values ) );

        IBrowserConnection conn = entry.getBrowserConnection();

        QuickSearch quickSearch = new QuickSearch( entry );
        quickSearch.setName( "Quick Search" );
        quickSearch.setBrowserConnection( conn );
        quickSearch.setSearchBase( entry.getDn() );
        quickSearch.setReturningAttributes( ISearch.NO_ATTRIBUTES );
        quickSearch.setAliasesDereferencingMethod( conn.getAliasesDereferencingMethod() );
        quickSearch.setReferralsHandlingMethod( conn.getReferralsHandlingMethod() );
        quickSearch.setCountLimit( conn.getCountLimit() );
        quickSearch.setTimeLimit( conn.getTimeLimit() );
View Full Code Here

        ISelection selection = browserWidget.getViewer().getSelection();
        IEntry[] entries = BrowserSelectionUtils.getEntries( selection );
        ISearch[] searches = BrowserSelectionUtils.getSearches( selection );
        if ( entries != null && entries.length == 1 )
        {
            IEntry entry = entries[0];
            return entry;
        }
        else if ( searches != null && searches.length == 1 && ( searches[0] instanceof IQuickSearch ) )
        {
            IQuickSearch quickSearch = ( IQuickSearch ) searches[0];
            IEntry entry = quickSearch.getSearchBaseEntry();
            return entry;
        }
        else
        {
            return null;
View Full Code Here

TOP

Related Classes of org.apache.directory.studio.ldapbrowser.core.model.IEntry

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.