Package org.apache.directory.studio.entryeditors

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


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

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

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

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

             * 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

                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
        {
            LdapDN newDN = new LdapDN( records[0].getDnLine().getUnfoldedDn() );
            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 ( InvalidNameException 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

    public IDocument getDocument( Object element )
    {
        if ( element instanceof EntryEditorInput )
        {
            EntryEditorInput input = ( EntryEditorInput ) element;
            if ( input.getExtension() == null )
            {
                // this is a performance optimization
                return null;
            }
        }
View Full Code Here

    private EntryEditorInput getEntryEditorInput( Object element ) throws CoreException
    {
        if ( element instanceof EntryEditorInput )
        {
            EntryEditorInput input = ( EntryEditorInput ) element;
            return input;
        }
        else
        {
            throw new CoreException( new Status( IStatus.ERROR, BrowserUIConstants.PLUGIN_ID,
View Full Code Here

    @Override
    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

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

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

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

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

TOP

Related Classes of org.apache.directory.studio.entryeditors.EntryEditorInput

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.