directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From fel...@apache.org
Subject svn commit: r592089 [5/5] - in /directory/sandbox/felixk/studio-ldifeditor: ./ META-INF/ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/directory/ src/main/java/org/apache/directory/studio/ src/main/...
Date Mon, 05 Nov 2007 17:04:59 GMT
Added: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifRecordRule.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifRecordRule.java?rev=592089&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifRecordRule.java
(added)
+++ directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifRecordRule.java
Mon Nov  5 09:04:52 2007
@@ -0,0 +1,222 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+
+package org.apache.directory.studio.ldifeditor.editor.text;
+
+
+import org.eclipse.jface.text.rules.ICharacterScanner;
+import org.eclipse.jface.text.rules.IPredicateRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.Token;
+
+
+/**
+ * Rule to detect LDIF records. A LDIF record must start with "dn:" at column 0
+ * and end with new line at column 0.
+ * 
+ * 
+ */
+public class LdifRecordRule implements IPredicateRule
+{
+
+    private static char[] DN_SEQUENCE = new char[]
+        { 'd', 'n', ':' };
+
+    private IToken recordToken;
+
+
+    public LdifRecordRule( IToken recordToken )
+    {
+        this.recordToken = recordToken;
+    }
+
+
+    public IToken getSuccessToken()
+    {
+        return this.recordToken;
+    }
+
+
+    /**
+     * Checks for new line "\n", "\r" or "\r\n".
+     * 
+     * @param scanner
+     * @return
+     */
+    private int matchNewline( ICharacterScanner scanner )
+    {
+
+        int c = scanner.read();
+
+        if ( c == '\r' )
+        {
+            c = scanner.read();
+            if ( c == '\n' )
+            {
+                return 2;
+            }
+            else
+            {
+                scanner.unread();
+                return 1;
+            }
+        }
+        else if ( c == '\n' )
+        {
+            c = scanner.read();
+            if ( c == '\r' )
+            {
+                return 2;
+            }
+            else
+            {
+                scanner.unread();
+                return 1;
+            }
+        }
+        else
+        {
+            scanner.unread();
+            return 0;
+        }
+    }
+
+
+    /**
+     * Checks for "dn:".
+     * 
+     * @param scanner
+     * @return
+     */
+    private int matchDnAndColon( ICharacterScanner scanner )
+    {
+
+        for ( int i = 0; i < DN_SEQUENCE.length; i++ )
+        {
+
+            int c = scanner.read();
+
+            if ( c != DN_SEQUENCE[i] )
+            {
+                while ( i >= 0 )
+                {
+                    scanner.unread();
+                    i--;
+                }
+                return 0;
+            }
+
+        }
+
+        return DN_SEQUENCE.length;
+    }
+
+
+    private boolean matchEOF( ICharacterScanner scanner )
+    {
+        int c = scanner.read();
+        if ( c == ICharacterScanner.EOF )
+        {
+            return true;
+        }
+        else
+        {
+            scanner.unread();
+            return false;
+        }
+    }
+
+
+    public IToken evaluate( ICharacterScanner scanner, boolean resume )
+    {
+
+        if ( scanner.getColumn() != 0 )
+        {
+            return Token.UNDEFINED;
+        }
+
+        int c;
+
+        do
+        {
+            c = scanner.read();
+
+            if ( c == '\r' || c == '\n' )
+            {
+
+                // check end of record
+                scanner.unread();
+
+                if ( this.matchNewline( scanner ) > 0 )
+                {
+
+                    int nlCount = this.matchNewline( scanner );
+                    if ( nlCount > 0 )
+                    {
+                        int dnCount = this.matchDnAndColon( scanner );
+                        if ( dnCount > 0 )
+                        {
+                            while ( dnCount > 0 )
+                            {
+                                scanner.unread();
+                                dnCount--;
+                            }
+                            return this.recordToken;
+                        }
+                        else if ( this.matchEOF( scanner ) )
+                        {
+                            return this.recordToken;
+                        }
+                        else
+                        {
+                            while ( nlCount > 0 )
+                            {
+                                scanner.unread();
+                                nlCount--;
+                            }
+                        }
+                    }
+                    else if ( this.matchEOF( scanner ) )
+                    {
+                        return this.recordToken;
+                    }
+                }
+                else if ( this.matchEOF( scanner ) )
+                {
+                    return this.recordToken;
+                }
+
+            }
+            else if ( c == ICharacterScanner.EOF )
+            {
+                return this.recordToken;
+            }
+        }
+        while ( true );
+
+    }
+
+
+    public IToken evaluate( ICharacterScanner scanner )
+    {
+        return this.evaluate( scanner, false );
+    }
+
+}

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifRecordRule.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifTextHover.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifTextHover.java?rev=592089&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifTextHover.java
(added)
+++ directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifTextHover.java
Mon Nov  5 09:04:52 2007
@@ -0,0 +1,87 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+
+package org.apache.directory.studio.ldifeditor.editor.text;
+
+
+import org.apache.directory.studio.ldapbrowser.core.model.ldif.LdifFile;
+import org.apache.directory.studio.ldapbrowser.core.model.ldif.LdifPart;
+import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifContainer;
+import org.apache.directory.studio.ldapbrowser.core.model.ldif.lines.LdifValueLineBase;
+import org.apache.directory.studio.ldifeditor.editor.ILdifEditor;
+
+import org.eclipse.jface.text.IRegion;
+import org.eclipse.jface.text.ITextHover;
+import org.eclipse.jface.text.ITextViewer;
+import org.eclipse.jface.text.Region;
+
+
+public class LdifTextHover implements ITextHover
+{
+
+    private ILdifEditor editor;
+
+
+    public LdifTextHover( ILdifEditor editor )
+    {
+        this.editor = editor;
+    }
+
+
+    public String getHoverInfo( ITextViewer textViewer, IRegion hoverRegion )
+    {
+
+        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 )
+                {
+                    if ( part instanceof LdifValueLineBase )
+                    {
+                        LdifValueLineBase line = ( LdifValueLineBase ) part;
+                        if ( line.isValueTypeBase64() )
+                        {
+                            return line.getValueAsString();
+                        }
+                    }
+                }
+            }
+        }
+
+        return null;
+    }
+
+
+    public IRegion getHoverRegion( ITextViewer textViewer, int offset )
+    {
+
+        if ( this.editor != null )
+        {
+            return new Region( offset, 0 );
+        }
+
+        return null;
+    }
+
+}

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifTextHover.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifValueRule.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifValueRule.java?rev=592089&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifValueRule.java
(added)
+++ directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifValueRule.java
Mon Nov  5 09:04:52 2007
@@ -0,0 +1,121 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+
+package org.apache.directory.studio.ldifeditor.editor.text;
+
+
+import org.eclipse.jface.text.rules.ICharacterScanner;
+import org.eclipse.jface.text.rules.IRule;
+import org.eclipse.jface.text.rules.IToken;
+import org.eclipse.jface.text.rules.Token;
+
+
+public class LdifValueRule implements IRule
+{
+
+    private IToken token;
+
+
+    public LdifValueRule( IToken token )
+    {
+        this.token = token;
+    }
+
+
+    public IToken evaluate( ICharacterScanner scanner )
+    {
+
+        if ( matchContent( scanner ) )
+        {
+            return this.token;
+        }
+        else
+        {
+            return Token.UNDEFINED;
+        }
+
+    }
+
+
+    protected boolean matchContent( ICharacterScanner scanner )
+    {
+
+        int count = 0;
+
+        int c = scanner.read();
+        while ( c != ICharacterScanner.EOF )
+        {
+
+            // check for folding
+            if ( c == '\n' || c == '\r' )
+            {
+                StringBuffer temp = new StringBuffer( 3 );
+                if ( c == '\r' )
+                {
+                    c = scanner.read();
+                    if ( c == '\n' )
+                    {
+                        temp.append( c );
+                    }
+                    else
+                    {
+                        scanner.unread();
+                    }
+                }
+                else if ( c == '\n' )
+                {
+                    c = scanner.read();
+                    if ( c == '\r' )
+                    {
+                        temp.append( c );
+                    }
+                    else
+                    {
+                        scanner.unread();
+                    }
+                }
+
+                c = scanner.read();
+                if ( c == ' ' && c != ICharacterScanner.EOF )
+                {
+                    // space after newline, continue
+                    temp.append( c );
+                    count += temp.length();
+                    c = scanner.read();
+                }
+                else
+                {
+                    for ( int i = 0; i < temp.length(); i++ )
+                        scanner.unread();
+                    break;
+                }
+            }
+            else
+            {
+                count++;
+                c = scanner.read();
+            }
+        }
+        scanner.unread();
+
+        return count > 0;
+    }
+
+}

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifValueRule.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/widgets/LdifEditorWidget.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/widgets/LdifEditorWidget.java?rev=592089&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/widgets/LdifEditorWidget.java
(added)
+++ directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/widgets/LdifEditorWidget.java
Mon Nov  5 09:04:52 2007
@@ -0,0 +1,215 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+
+package org.apache.directory.studio.ldifeditor.widgets;
+
+
+import org.apache.directory.studio.ldapbrowser.common.widgets.BrowserWidget;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.ldif.LdifFile;
+import org.apache.directory.studio.ldifeditor.editor.ILdifEditor;
+import org.apache.directory.studio.ldifeditor.editor.LdifDocumentProvider;
+import org.apache.directory.studio.ldifeditor.editor.LdifSourceViewerConfiguration;
+import org.apache.directory.studio.ldifeditor.editor.NonExistingLdifEditorInput;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.jface.resource.JFaceResources;
+import org.eclipse.jface.text.IDocument;
+import org.eclipse.jface.text.ITextListener;
+import org.eclipse.jface.text.TextEvent;
+import org.eclipse.jface.text.source.SourceViewer;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Composite;
+
+
+/**
+ * The LdifEditorWidget provides basic LDIF editor functionality like 
+ * syntax highlighting and content assistent.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class LdifEditorWidget extends BrowserWidget implements ILdifEditor, ITextListener
+{
+
+    /** The connection. */
+    private IBrowserConnection connection;
+
+    /** The initial LDIF. */
+    private String initialLdif;
+
+    /** The content assist enabled. */
+    private boolean contentAssistEnabled;
+
+    /** The editor input. */
+    private NonExistingLdifEditorInput editorInput;
+
+    /** The document provider. */
+    private LdifDocumentProvider documentProvider;
+
+    /** The source viewer. */
+    private SourceViewer sourceViewer;
+
+    /** The source viewer configuration. */
+    private LdifSourceViewerConfiguration sourceViewerConfiguration;
+
+
+    /**
+     * Creates a new instance of LdifEditorWidget.
+     * 
+     * @param contentAssistEnabled the content assist enabled
+     * @param initialLdif the initial ldif
+     * @param connection the connection
+     */
+    public LdifEditorWidget( IBrowserConnection connection, String initialLdif, boolean contentAssistEnabled
)
+    {
+        this.connection = connection;
+        this.initialLdif = initialLdif;
+        this.contentAssistEnabled = contentAssistEnabled;
+    }
+
+
+    /**
+     * Disposes this widget.
+     */
+    public void dispose()
+    {
+        if ( editorInput != null )
+        {
+            sourceViewer.removeTextListener( this );
+            documentProvider.disconnect( editorInput );
+            // documentProvider = null;
+            editorInput = null;
+        }
+    }
+
+
+    /**
+     * Creates the widget.
+     * 
+     * @param parent the parent
+     */
+    public void createWidget( Composite parent )
+    {
+        Composite composite = new Composite( parent, SWT.NONE );
+        composite.setLayoutData( new GridData( GridData.FILL_BOTH ) );
+        GridLayout layout = new GridLayout( 1, false );
+        layout.marginWidth = 0;
+        layout.marginHeight = 0;
+        composite.setLayout( layout );
+
+        // create source viewer
+        // sourceViewer = new ProjectionViewer(parent, ruler,
+        // getOverviewRuler(), true, styles);
+        sourceViewer = new SourceViewer( composite, null, null, false, SWT.BORDER | SWT.V_SCROLL
| SWT.H_SCROLL );
+        sourceViewer.getControl().setLayoutData( new GridData( GridData.FILL_BOTH ) );
+
+        // configure
+        sourceViewerConfiguration = new LdifSourceViewerConfiguration( this, this.contentAssistEnabled
);
+        sourceViewer.configure( sourceViewerConfiguration );
+
+        // set font
+        Font font = JFaceResources.getFont( JFaceResources.TEXT_FONT );
+        sourceViewer.getTextWidget().setFont( font );
+
+        // setup document
+        try
+        {
+            editorInput = new NonExistingLdifEditorInput();
+            documentProvider = new LdifDocumentProvider();
+            documentProvider.connect( editorInput );
+
+            IDocument document = documentProvider.getDocument( editorInput );
+            document.set( initialLdif );
+            sourceViewer.setDocument( document );
+        }
+        catch ( CoreException e )
+        {
+            e.printStackTrace();
+        }
+
+        // listener
+        sourceViewer.addTextListener( this );
+
+        // focus
+        sourceViewer.getControl().setFocus();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public IBrowserConnection getConnection()
+    {
+        return connection;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public LdifFile getLdifModel()
+    {
+        return documentProvider.getLdifModel();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public Object getAdapter( Class adapter )
+    {
+        return null;
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void textChanged( TextEvent event )
+    {
+        super.notifyListeners();
+    }
+
+
+    /**
+     * Gets the source viewer.
+     * 
+     * @return the source viewer
+     */
+    public SourceViewer getSourceViewer()
+    {
+        return sourceViewer;
+    }
+
+
+    /**
+     * Gets the source viewer configuration.
+     * 
+     * @return the source viewer configuration
+     */
+    public LdifSourceViewerConfiguration getSourceViewerConfiguration()
+    {
+        return sourceViewerConfiguration;
+    }
+
+}

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/widgets/LdifEditorWidget.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/wizards/NewLdifFileWizard.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/wizards/NewLdifFileWizard.java?rev=592089&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/wizards/NewLdifFileWizard.java
(added)
+++ directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/wizards/NewLdifFileWizard.java
Mon Nov  5 09:04:52 2007
@@ -0,0 +1,108 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+
+package org.apache.directory.studio.ldifeditor.wizards;
+
+
+import org.apache.directory.studio.ldifeditor.editor.LdifEditor;
+import org.apache.directory.studio.ldifeditor.editor.NonExistingLdifEditorInput;
+import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.jface.wizard.Wizard;
+import org.eclipse.ui.IEditorInput;
+import org.eclipse.ui.INewWizard;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PartInitException;
+
+
+/**
+ * The NewLdifFileWizard is used to add a "New LDIF" action to the platforms
+ * "New..." menu. It just opens an editor with a dummy LDIF editor input.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+
+public class NewLdifFileWizard extends Wizard implements INewWizard
+{
+
+    /** The window. */
+    private IWorkbenchWindow window;
+
+
+    /**
+     * Creates a new instance of NewLdifFileWizard.
+     */
+    public NewLdifFileWizard()
+    {
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void init( IWorkbench workbench, IStructuredSelection selection )
+    {
+        window = workbench.getActiveWorkbenchWindow();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public void dispose()
+    {
+        window = null;
+    }
+
+
+    /**
+     * Gets the id.
+     * 
+     * @return the id
+     */
+    public static String getId()
+    {
+        return NewLdifFileWizard.class.getName();
+    }
+
+
+    /**
+     * {@inheritDoc}
+     */
+    public boolean performFinish()
+    {
+        IEditorInput input = new NonExistingLdifEditorInput();
+        String editorId = LdifEditor.getId();
+
+        try
+        {
+            IWorkbenchPage page = window.getActivePage();
+            page.openEditor( input, editorId );
+        }
+        catch ( PartInitException e )
+        {
+            return false;
+        }
+        return true;
+    }
+
+}

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/wizards/NewLdifFileWizard.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/org/apache/directory/studio/ldifeditor/messages.properties
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/resources/org/apache/directory/studio/ldifeditor/messages.properties?rev=592089&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldifeditor/src/main/resources/org/apache/directory/studio/ldifeditor/messages.properties
(added)
+++ directory/sandbox/felixk/studio-ldifeditor/src/main/resources/org/apache/directory/studio/ldifeditor/messages.properties
Mon Nov  5 09:04:52 2007
@@ -0,0 +1,20 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+ldifeditor__contentassistproposal_label=Content Assist
+ldifeditor__contentassistproposal_tooltip=Content Assist
+ldifeditor__contentassistproposal_description=Content Assist

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/org/apache/directory/studio/ldifeditor/messages.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/entry.gif
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/entry.gif?rev=592089&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/entry.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/execute.gif
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/execute.gif?rev=592089&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/execute.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_add.gif
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_add.gif?rev=592089&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_add.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_attribute.gif
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_attribute.gif?rev=592089&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_attribute.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_comment.gif
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_comment.gif?rev=592089&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_comment.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_delete.gif
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_delete.gif?rev=592089&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_delete.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_dn.gif
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_dn.gif?rev=592089&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_dn.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_mod_add.gif
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_mod_add.gif?rev=592089&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_mod_add.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_mod_delete.gif
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_mod_delete.gif?rev=592089&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_mod_delete.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_mod_replace.gif
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_mod_replace.gif?rev=592089&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_mod_replace.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_modify.gif
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_modify.gif?rev=592089&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_modify.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_rename.gif
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_rename.gif?rev=592089&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_rename.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_value.gif
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_value.gif?rev=592089&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_value.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldifeditor.gif
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldifeditor.gif?rev=592089&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldifeditor.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldifeditor_new.gif
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldifeditor_new.gif?rev=592089&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldifeditor_new.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/template.gif
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/template.gif?rev=592089&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/template.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/templates/templates.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/templates/templates.xml?rev=592089&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/templates/templates.xml
(added)
+++ directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/templates/templates.xml
Mon Nov  5 09:04:52 2007
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one
+  or more contributor license agreements.  See the NOTICE file
+  distributed with this work for additional information
+  regarding copyright ownership.  The ASF licenses this file
+  to you under the Apache License, Version 2.0 (the
+  "License"); you may not use this file except in compliance
+  with the License.  You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing,
+  software distributed under the License is distributed on an
+  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+  KIND, either express or implied.  See the License for the
+  specific language governing permissions and limitations
+  under the License.
+-->
+<templates>
+
+	<template 
+		id="org.apache.directory.studio.ldifeditor.templates.ldifContentRecord" 
+		name="dn: " 
+		description="LDIF content record"
+		context="org.apache.directory.studio.ldifeditor.templates.ldifFile" 
+		enabled="true" 
+		image="icons/ldif_add.gif"
+		icon="icons/ldif_add.gif"
+		deleted="false">dn: ${dn}
+objectClass: ${objectClass}
+${cursor}
+</template>
+	<template 
+		id="org.apache.directory.studio.ldifeditor.templates.ldifChangeAddRecord" 
+		name="changetype: add" 
+		description="LDIF change add record"
+		context="org.apache.directory.studio.ldifeditor.templates.ldifFile" 
+		enabled="true" 
+		deleted="false">dn: ${dn}
+changetype: add
+objectClass: ${objectClass}
+${cursor}
+</template>
+	<template 
+		id="org.apache.directory.studio.ldifeditor.templatesldifChangeModifyRecord" 
+		name="changetype: modify" 
+		description="LDIF change modify record"
+		context="org.apache.directory.studio.ldifeditor.templates.ldifFile" 
+		enabled="true" 
+		deleted="false">dn: ${dn}
+changetype: modify
+${cursor}
+</template>
+	<template 
+		id="org.apache.directory.studio.ldifeditor.templates.ldifChangeDeleteRecord" 
+		name="changetype: delete" 
+		description="LDIF change delete record"
+		context="org.apache.directory.studio.ldifeditor.templates.ldifFile" 
+		enabled="true" 
+		deleted="false">dn: ${dn}
+changetype: delete
+${cursor}
+</template>
+	<template 
+		id="org.apache.directory.studio.ldifeditor.templates.ldifChangeModdnRecord" 
+		name="changetype: moddn" 
+		description="LDIF change modify dn record"
+		context="org.apache.directory.studio.ldifeditor.templates.ldifFile" 
+		enabled="true" 
+		deleted="false">dn: ${dn}
+changetype: moddn
+newrdn: ${newrdn}
+deleteoldrdn: 1
+newsuperior: ${newsuperior}
+${cursor}
+</template>
+
+	<template 
+		id="org.apache.directory.studio.ldifeditor.templates.ldifModificationRecordAddModification"

+		name="add: " 
+		description="Add value"
+		context="org.apache.directory.studio.ldifeditor.templates.ldifModificationRecord" 
+		enabled="true" >add: ${attribute}
+${attribute}: ${value}
+-
+${cursor}</template>
+	<template 
+		id="org.apache.directory.studio.ldifeditor.ui.templates.ldifModificationRecordReplaceModification"

+		name="replace: " 
+		description="Replace value"
+		context="org.apache.directory.studio.ldifeditor.templates.ldifModificationRecord" 
+		enabled="true" >replace: ${attribute}
+${attribute}: ${value}
+-
+${cursor}</template>
+	<template 
+		id="org.apache.directory.studio.ldifeditor.templates.ldifModificationRecordDeleteModification"

+		name="delete: " 
+		description="Delete value"
+		context="org.apache.directory.studio.ldifeditor.templates.ldifModificationRecord" 
+		enabled="true" >delete: ${attribute}
+${attribute}: ${value}
+-
+${cursor}</template>
+	<template 
+		id="org.apache.directory.studio.ldifeditor.templates.ldifModificationRecordDelete2Modification"

+		name="delete: " 
+		description="Delete attribute"
+		context="org.apache.directory.studio.ldifeditor.templates.ldifModificationRecord" 
+		enabled="true" >delete: ${attribute}
+-
+${cursor}</template>
+
+</templates>
\ No newline at end of file

Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/templates/templates.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: directory/sandbox/felixk/studio-ldifeditor/studio.png
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/studio.png?rev=592089&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/sandbox/felixk/studio-ldifeditor/studio.png
------------------------------------------------------------------------------
    svn:mime-type = image/png



Mime
View raw message