Examples of EntryEditorInput


Examples of org.apache.directory.studio.entryeditors.EntryEditorInput

        {
            inShowEditorInput = true;

            if ( input instanceof EntryEditorInput )
            {
                EntryEditorInput eei = ( EntryEditorInput ) input;

                /*
                 * Optimization: no need to set the input again if the same input is already set
                 */
                if ( getEntryEditorInput() != null
                    && getEntryEditorInput().getResolvedEntry() == eei.getResolvedEntry() )
                {
                    return;
                }

                // If the editor is dirty, let's ask for a save before changing the input
                if ( isDirty() )
                {
                    if ( !EntryEditorUtils.askSaveSharedWorkingCopyBeforeInputChange( this ) )
                    {
                        return;
                    }
                }

                /*
                 * Workaround to make link-with-editor working for the single-tab editor:
                 * The call of firePropertyChange is used to inform the link-with-editor action.
                 * However firePropertyChange also modifies the navigation history.
                 * 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 );
                }
                else if ( searchResult != null )
                {
                    dummyInput = new EntryEditorInput( searchResult, null );
                }
                else
                {
                    dummyInput = new EntryEditorInput( bookmark, null );
                }
                doSetInput( dummyInput );
                firePropertyChange( IEditorPart.PROP_INPUT );

                // now set the real input and mark history location
View Full Code Here

Examples of org.apache.directory.studio.entryeditors.EntryEditorInput

    private EntryEditorInput getEntryEditorInput()
    {
        Object editorInput = getInput();
        if ( editorInput != null && editorInput instanceof EntryEditorInput )
        {
            EntryEditorInput entryEditorInput = ( EntryEditorInput ) editorInput;
            return entryEditorInput;
        }

        return null;
    }
View Full Code Here

Examples of org.apache.directory.studio.entryeditors.EntryEditorInput

                    && ( !editor.getEntryEditorInput().getExtension().isMultiWindow() ) )
                {

                    EntryEditorExtension extension = editor.getEntryEditorInput().getExtension();
                    String editorId = extension.getEditorId();
                    EntryEditorInput input = new EntryEditorInput( ( IEntry ) null, extension );
                    try
                    {
                        view.getSite().getPage().openEditor( input, editorId, false );
                    }
                    catch ( PartInitException e )
View Full Code Here

Examples of org.apache.directory.studio.entryeditors.EntryEditorInput

            {
                IEditorPart editor = ( IEditorPart ) part;
                IEditorInput input = editor.getEditorInput();
                if ( input != null && input instanceof EntryEditorInput )
                {
                    EntryEditorInput eei = ( EntryEditorInput ) input;
                    IEntry entry = eei.getResolvedEntry();
                    if ( entry != null )
                    {
                        objectToSelect = entry.getBrowserConnection().getConnection();
                    }
                }
View Full Code Here

Examples of org.apache.directory.studio.entryeditors.EntryEditorInput

            {
                IEditorPart editor = ( IEditorPart ) part;
                IEditorInput input = editor.getEditorInput();
                if ( input != null && input instanceof EntryEditorInput )
                {
                    EntryEditorInput eei = ( EntryEditorInput ) input;
                    objectToSelect = eei.getInput();
                }
                else if ( input != null && input instanceof SearchResultEditorInput )
                {
                    SearchResultEditorInput srei = ( SearchResultEditorInput ) input;
                    objectToSelect = srei.getSearch();
View Full Code Here

Examples of org.apache.directory.studio.entryeditors.EntryEditorInput

     */
    public void run()
    {
        if ( entryEditor != null )
        {
            EntryEditorInput editorInput = entryEditor.getEntryEditorInput();

            if ( editorInput != null )
            {
                IEntry entry = editorInput.getResolvedEntry();

                if ( entry != null )
                {
                    select( entry );
                }
View Full Code Here

Examples of org.apache.directory.studio.entryeditors.EntryEditorInput

     */
    public void setInput( IEditorInput input )
    {
        super.setInput( input );

        EntryEditorInput eei = getEntryEditorInput();
        setEntryEditorWidgetInput( eei );
        setEditorName( eei );

        // refresh outline
        if ( outlinePage != null )
View Full Code Here

Examples of org.apache.directory.studio.entryeditors.EntryEditorInput

     */
    public void doSave( final IProgressMonitor monitor )
    {
        if ( !isAutoSave() )
        {
            EntryEditorInput eei = getEntryEditorInput();
            eei.saveSharedWorkingCopy( true, this );
        }
    }
View Full Code Here

Examples of org.apache.directory.studio.entryeditors.EntryEditorInput

             * However firePropertyChange also modifies the navigation history.
             * 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.
             */
            EntryEditorInput eei = ( EntryEditorInput ) input;
            IEntry entry = eei.getEntryInput();
            ISearchResult searchResult = eei.getSearchResultInput();
            IBookmark bookmark = eei.getBookmarkInput();
            EntryEditorInput dummyInput;
            if ( entry != null )
            {
                dummyInput = new EntryEditorInput( entry, null );
            }
            else if ( searchResult != null )
            {
                dummyInput = new EntryEditorInput( searchResult, null );
            }
            else
            {
                dummyInput = new EntryEditorInput( bookmark, null );
            }
            setInput( dummyInput );
            firePropertyChange( IEditorPart.PROP_INPUT );

            // now set the real input and mark history location
View Full Code Here

Examples of org.apache.directory.studio.entryeditors.EntryEditorInput

                throw new CoreException( new Status( IStatus.ERROR, BrowserUIConstants.PLUGIN_ID, NLS.bind( Messages
                    .getString( "LdifEntryEditorDocumentProvider.InvalidLdif" ), cont.getInvalidString() ) ) ); //$NON-NLS-1$
            }
        }

        EntryEditorInput input = getEntryEditorInput( element );
        try
        {
            Dn newDn = new Dn( records[0].getDnLine().getValueAsString() );
            if ( !newDn.equals( input.getResolvedEntry().getDn() ) )
            {
                throw new CoreException( new Status( IStatus.ERROR, BrowserUIConstants.PLUGIN_ID, NLS.bind( Messages
                    .getString( "LdifEntryEditorDocumentProvider.ModDnNotSupported" ), records[0].getInvalidString() ) ) ); //$NON-NLS-1$
            }
        }
        catch ( LdapInvalidDnException e )
        {
            throw new CoreException( new Status( IStatus.ERROR, BrowserUIConstants.PLUGIN_ID, Messages
                .getString( "LdifEntryEditorDocumentProvider.InvalidDN" ) ) ); //$NON-NLS-1$
        }

        IStatus status = input.saveSharedWorkingCopy( false, editor );
        if ( status != null && !status.isOK() )
        {
            BrowserUIPlugin.getDefault().getLog().log( status );
            throw new CoreException( status );
        }
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.