Examples of LdifFile


Examples of org.apache.directory.ldapstudio.browser.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

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

        public Object[] getChildren( Object element )
        {
            // file --> records
            if ( element instanceof LdifFile )
            {
                LdifFile ldifFile = ( LdifFile ) element;
                return ldifFile.getRecords();
            }

            // record --> Array of List of AttrValLine
            else if ( element instanceof LdifContentRecord )
            {
View Full Code Here

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

            int newOffset = oldOffset;
            int newLength = oldLength - replacedTextLength + insertedTextLength;
            String textToParse = document.get( newOffset, newLength );

            // parse partion content to containers (offset=0)
            LdifFile newModel = this.ldifParser.parse( textToParse );
            LdifContainer[] newContainers = newModel.getContainers();

            // replace old containers with new containers
            // must adjust offsets of all following containers in model
            this.ldifModel.replace( oldContainers, newContainers );
View Full Code Here

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

        public Object[] getChildren( Object element )
        {
            // file --> records
            if ( element instanceof LdifFile )
            {
                LdifFile ldifFile = ( LdifFile ) element;
                return ldifFile.getRecords();
            }

            // record --> Array of List of AttrValLine
            else if ( element instanceof LdifContentRecord )
            {
View Full Code Here

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


    public void updateAnnotations()
    {

        LdifFile model = editor.getLdifModel();
        ISourceViewer viewer = ( ISourceViewer ) editor.getAdapter( ISourceViewer.class );
        if ( viewer == null )
            return;

        IDocument document = viewer.getDocument();
        IAnnotationModel annotationModel = viewer.getAnnotationModel();
        if ( document == null || annotationModel == null || model == null )
            return;

        if ( annotationModel instanceof IAnnotationModelExtension )
        {
            ( ( IAnnotationModelExtension ) annotationModel ).removeAllAnnotations();

            List positionList = new ArrayList();

            LdifContainer[] containers = model.getContainers();
            for ( int i = 0; i < containers.length; i++ )
            {
                LdifContainer container = containers[i];

                // LdifPart errorPart = null;
View Full Code Here

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


    public void createPresentation( TextPresentation presentation, ITypedRegion damage )
    {

        LdifFile ldifModel = this.editor.getLdifModel();
        LdifContainer[] allContainers = ldifModel.getContainers();
        List containerList = new ArrayList();
        for ( int i = 0; i < allContainers.length; i++ )
        {
            LdifContainer container = allContainers[i];
            Region containerRegion = new Region( container.getOffset(), container.getLength() );
View Full Code Here

Examples of org.apache.directory.ldapstudio.browser.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.ldapstudio.browser.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.ldapstudio.browser.core.model.ldif.LdifFile

                int offset = partition.getOffset();
                int relativePos = cursorPos - offset;

                // parse partition
                String s = document.get( partition.getOffset(), partition.getLength() );
                LdifFile model = parser.parse( s );
                LdifContainer container = LdifFile.getContainer( model, relativePos );
                if ( container != null )
                {
                    LdifPart part = LdifFile.getContainerContent( container, relativePos );
View Full Code Here

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

    }


    protected LdifFile getLdifModel()
    {
        LdifFile model = editor.getLdifModel();
        return model;
    }
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.