Examples of LdifFile


Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.LdifFile

        LdifContainer[] containers = null;

        ISourceViewer sourceViewer = ( ISourceViewer ) editor.getAdapter( ISourceViewer.class );
        if ( sourceViewer != null )
        {
            LdifFile model = editor.getLdifModel();
            Point selection = sourceViewer.getSelectedRange();
            containers = LdifFile.getContainers( model, selection.x, selection.y );
        }

        return containers != null ? containers : new LdifContainer[0];
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.LdifFile


    public LdifFile parse( String ldif )
    {

        LdifFile model = new LdifFile();

        try
        {
            LdifEnumeration enumeration = this.parse( new StringReader( ldif ) );
            while ( enumeration.hasNext( null ) )
            {
                LdifContainer container = enumeration.next( null );
                model.addContainer( container );
            }
        }
        catch ( ConnectionException e )
        {
            // doesn't occur on the internal LdifEnumeration implementation
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.LdifFile

            public boolean hasNext( org.apache.directory.ldapstudio.browser.core.jobs.ExtendedProgressMonitor monitor )
            {
                if ( containerList.isEmpty() )
                {

                    LdifFile model = new LdifFile();

                    // parse header
                    if ( !headerParsed )
                    {
                        checkAndParseComment( model );
                        checkAndParseVersion( model );
                        checkAndParseComment( model );
                        headerParsed = true;
                    }

                    // parse body (in a loop)
                    if ( headerParsed && !bodyParsed )
                    {
                        // parse comment lines
                        if ( !checkAndParseComment( model ) )
                        {
                            // parse record
                            if ( !checkAndParseRecord( model ) )
                            {
                                // parse unknown
                                if ( !checkAndParseOther( model ) )
                                {
                                    // end of body
                                    bodyParsed = true;
                                }
                            }
                        }
                    }

                    // parse footer
                    if ( headerParsed && bodyParsed && !footerParsed )
                    {
                        checkAndParseComment( model );
                        footerParsed = true;
                    }

                    LdifContainer[] containers = model.getContainers();
                    this.containerList.addAll( Arrays.asList( containers ) );
                    return !containerList.isEmpty() && !( containers[0] instanceof LdifEOFContainer );

                }
                else
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.LdifFile

        contentAssistant.setAutoActivationDelay( store
            .getInt( LdifEditorConstants.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;
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.LdifFile

    protected TemplateContextType getContextType( ITextViewer viewer, IRegion region )
    {

        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;
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.LdifFile


    public void customizeDocumentCommand( IDocument d, DocumentCommand c )
    {

        LdifFile model = editor.getLdifModel();
        LdifContainer container = LdifFile.getContainer( model, c.offset );
        LdifContainer innerContainer = container != null ? LdifFile.getInnerContainer( container, c.offset ) : null;
        LdifPart part = container != null ? LdifFile.getContainerContent( container, c.offset ) : null;

        boolean smartInsertAttributeInModSpec = LdifEditorActivator.getDefault().getPreferenceStore().getBoolean(
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.core.model.ldif.LdifFile

        LdifPart[] parts = null;

        ISourceViewer sourceViewer = ( ISourceViewer ) editor.getAdapter( ISourceViewer.class );
        if ( sourceViewer != null )
        {
            LdifFile model = editor.getLdifModel();
            Point selection = sourceViewer.getSelectedRange();
            parts = LdifFile.getParts( model, selection.x, selection.y );

        }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.ldif.LdifFile


    private void validate()
    {

        LdifFile model = ldifEditorWidget.getLdifModel();
        LdifContainer[] containers = model.getContainers();
        if ( containers.length == 0 )
        {
            setPageComplete( false );
            return;
        }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.ldif.LdifFile

    private void validate()
    {

        String dummyLdif = "dn: cn=dummy" + BrowserCoreConstants.LINE_SEPARATOR + modWidget.getLdifFragment();
        LdifFile model = new LdifParser().parse( dummyLdif );
        LdifContainer[] containers = model.getContainers();
        if ( containers.length == 0 )
        {
            setPageComplete( false );
            return;
        }
View Full Code Here

Examples of org.apache.directory.studio.ldapbrowser.core.model.ldif.LdifFile

                    {
                        StringBuffer sb = new StringBuffer();
                        new CopyEntryAsLdifAction( CopyEntryAsLdifAction.MODE_INCLUDE_OPERATIONAL_ATTRIBUTES )
                            .serialializeEntries( new IEntry[]
                                { ( IEntry ) o }, sb );
                        LdifFile model = new LdifParser().parse( sb.toString() );
                        treeViewer.setInput( model );
                        treeViewer.expandToLevel( 2 );
                    }
                }
            }
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.