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

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.container.LdifContainer


        TextAttribute MODDN_TEXT_ATTRIBUTE = geTextAttribute( BrowserUIConstants.PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEMODDN );

        for ( int z = 0; z < containers.length; z++ )
        {

            LdifContainer container = containers[z];

            LdifPart[] parts = container.getParts();

            for ( int i = 0; i < parts.length; i++ )
            {

                // int offset = damage.getOffset() + parts[i].getOffset();
View Full Code Here


        {
            if ( this.editor != null )
            {

                int offset = sourceViewer.getDocument().getLineOffset( lineNumber );
                LdifContainer container = LdifFile.getContainer( this.editor.getLdifModel(), offset );
                if ( container != null )
                {
                    LdifPart part = LdifFile.getContainerContent( container, offset );
                    if ( part != null )
                    {
                        // return container.getClass().getName() + " - " +
                        // part.getClass().getName();
                        return container.getInvalidString() + " - " + part.getInvalidString();
                    }
                }
            }
        }
        catch ( BadLocationException e )
View Full Code Here

    {

        if ( this.editor != null )
        {

            LdifContainer container = LdifFile.getContainer( this.editor.getLdifModel(), hoverRegion.getOffset() );
            if ( container != null )
            {
                LdifPart part = LdifFile.getContainerContent( container, hoverRegion.getOffset() );
                if ( part != null )
                {
View Full Code Here

            .getInt( BrowserUIConstants.PREFERENCE_LDIFEDITOR_CONTENTASSIST_AUTOACTIVATIONDELAY ) );

        List proposalList = new ArrayList();

        LdifFile model = editor.getLdifModel();
        LdifContainer container = LdifFile.getContainer( model, offset );
        LdifContainer innerContainer = container != null ? LdifFile.getInnerContainer( container, offset ) : null;
        LdifPart part = container != null ? LdifFile.getContainerContent( container, offset ) : null;
        int documentLine = -1;
        int documentLineOffset = -1;
        String prefix = "";
        try
View Full Code Here

    {

        int offset = region.getOffset();

        LdifFile model = editor.getLdifModel();
        LdifContainer container = LdifFile.getContainer( model, offset );
        LdifContainer innerContainer = container != null ? LdifFile.getInnerContainer( container, offset ) : null;
        LdifPart part = container != null ? LdifFile.getContainerContent( container, offset ) : null;
        int documentLine = -1;
        int documentLineOffset = -1;
        String prefix = "";
        try
View Full Code Here

     */
    public void scrollToNewest()
    {
        try
        {
            LdifContainer record = view.getMainWidget().getLdifModel().getLastContainer();
            int offset = record.getOffset();
            int line = view.getMainWidget().getSourceViewer().getDocument().getLineOfOffset( offset );
            if ( line > 3 )
                line -= 3;
            view.getMainWidget().getSourceViewer().setTopIndex( line );
        }
View Full Code Here

        LdifContainer[] containers = getSelectedLdifContainers();
        if ( containers.length == 1
            && ( containers[0] instanceof LdifContentRecord || containers[0] instanceof LdifChangeAddRecord ) )
        {

            LdifContainer container = containers[0];

            LdifEntryEditorDialog dialog = null;
            if ( container instanceof LdifContentRecord )
            {
                dialog = new LdifEntryEditorDialog( editor.getEditorSite().getShell(), editor.getConnection(),
                    ( LdifContentRecord ) container );
            }
            else
            {
                dialog = new LdifEntryEditorDialog( editor.getEditorSite().getShell(), editor.getConnection(),
                    ( LdifChangeAddRecord ) container );
            }

            editor.deactivateGlobalActionHandlers();
            if ( dialog.open() == LdifEntryEditorDialog.OK )
            {
                LdifRecord record = dialog.getLdifRecord();

                IDocument document = editor.getDocumentProvider().getDocument( editor.getEditorInput() );
                String old = document.get();
                StringBuffer sb = new StringBuffer();
                sb.append( old.substring( 0, container.getOffset() ) );
                sb.append( record.toFormattedString() );
                sb.append( old.substring( container.getOffset() + container.getLength(), old.length() ) );
                document.set( sb.toString() );
            }
            editor.activateGlobalActionHandlers();
        }
    }
View Full Code Here

    public void scrollToNewest()
    {
        try
        {
            LdifContainer record = this.view.getMainWidget().getLdifModel().getLastContainer();
            int offset = record.getOffset();
            int line = this.view.getMainWidget().getSourceViewer().getDocument().getLineOfOffset( offset );
            if ( line > 3 )
                line -= 3;
            this.view.getMainWidget().getSourceViewer().setTopIndex( line );
        }
View Full Code Here

        int errorCount = 0;
        try
        {
            while ( !monitor.isCanceled() && enumeration.hasNext( monitor ) )
            {
                LdifContainer container = enumeration.next( monitor );

                if ( container instanceof LdifRecord )
                {

                    LdifRecord record = ( LdifRecord ) container;
                    try
                    {
                        this.applyModificationAndLog( record, monitor );

                        String dn = record.getDnLine().getValueAsString();
                        IEntry entry = connection.getEntryFromCache( new DN( dn ) );
                        if ( entry != null )
                        {
                            if ( record instanceof LdifChangeDeleteRecord )
                            {
                                connection.uncacheEntry( entry );
                            }
                            else
                            {
                                entry.setAttributesInitialized( false );
                            }
                        }

                        logModification( logWriter, record, monitor );

                        importedCount++;
                    }
                    catch ( Exception e )
                    {

                        logModificationError( logWriter, record, e, monitor );

                        errorCount++;

                        if ( !continueOnError )
                        {
                            monitor.reportError( e );
                            return;
                        }
                    }

                    monitor.reportProgress( BrowserCoreMessages.bind(
                        BrowserCoreMessages.ldif__imported_n_entries_m_errors, new String[]
                            { "" + importedCount, "" + errorCount } ) ); //$NON-NLS-1$ //$NON-NLS-2$
                }
                else
                {
                    logWriter.write( container.toRawString() );
                }
            }

            if ( errorCount > 0 )
            {
View Full Code Here

        {
            LdifParser parser = new LdifParser();
            LdifEnumeration enumeration = parser.parse( reader );
            if ( enumeration.hasNext( null ) )
            {
                LdifContainer container = enumeration.next( null );
                if ( container instanceof LdifContentRecord )
                {
                    LdifContentRecord schemaRecord = ( LdifContentRecord ) container;
                    this.parseSchemaRecord( schemaRecord );
                }
View Full Code Here

TOP

Related Classes of org.apache.directory.ldapstudio.browser.core.model.ldif.container.LdifContainer

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.