directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r526698 [1/5] - in /directory/ldapstudio/trunk/ldapstudio-ldifeditor: ./ META-INF/ resources/ resources/icons/ resources/templates/ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/director...
Date Mon, 09 Apr 2007 09:59:22 GMT
Author: seelmann
Date: Mon Apr  9 02:59:19 2007
New Revision: 526698

URL: http://svn.apache.org/viewvc?view=rev&rev=526698
Log:
Added ldapstudio-ldifeditor (DIRSTUDIO-78)

Added:
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/.classpath
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/.project
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/META-INF/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/META-INF/MANIFEST.MF
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/build.properties
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/build.xml
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/ivy.xml
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/plugin.xml
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/entry.gif   (with props)
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/execute.gif   (with props)
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_add.gif   (with props)
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_attribute.gif   (with props)
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_comment.gif   (with props)
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_delete.gif   (with props)
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_dn.gif   (with props)
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_mod_add.gif   (with props)
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_mod_delete.gif   (with props)
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_mod_replace.gif   (with props)
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_modify.gif   (with props)
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_rename.gif   (with props)
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_value.gif   (with props)
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldifeditor.gif   (with props)
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldifeditor_new.gif   (with props)
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/template.gif   (with props)
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/templates/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/templates/templates.xml
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/LdifEditorActivator.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/LdifEditorConstants.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/LdifEditorPreferencesInitializer.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/dialogs/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/dialogs/LdifEntryEditorDialog.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/dialogs/preferences/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/dialogs/preferences/LdifEditorContentAssistPreferencePage.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/dialogs/preferences/LdifEditorPreferencePage.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/dialogs/preferences/LdifEditorSyntaxColoringPreferencePage.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/dialogs/preferences/LdifEditorTemplatesPreferencePage.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/ExecuteLdifAction.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/ILdifEditor.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/LdifDocumentProvider.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/LdifDocumentSetupParticipant.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/LdifEditor.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/LdifEditorContributor.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/LdifOutlinePage.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/LdifSourceViewerConfiguration.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/NonExistingLdifEditorInput.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/PathEditorInput.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/actions/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/actions/AbstractLdifAction.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/actions/AbstractOpenValueEditorAction.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/actions/EditLdifAttributeAction.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/actions/EditLdifRecordAction.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/actions/FormatLdifDocumentAction.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/actions/FormatLdifRecordAction.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/actions/OpenBestValueEditorAction.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/actions/OpenDefaultValueEditorAction.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/actions/OpenValueEditorAction.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/reconciler/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/reconciler/LdifAnnotationUpdater.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/reconciler/LdifFoldingRegionUpdater.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/reconciler/LdifReconcilingStrategy.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/text/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/text/LdifAnnotationHover.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/text/LdifAutoEditStrategy.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/text/LdifCompletionProcessor.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/text/LdifDamagerRepairer.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/text/LdifDoubleClickStrategy.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/text/LdifExternalAnnotationModel.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/text/LdifPartitionScanner.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/text/LdifRecordRule.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/text/LdifTextHover.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/editor/text/LdifValueRule.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/widgets/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/widgets/LdifEditorWidget.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/wizards/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/wizards/NewLdifFileWizard.java
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/resources/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/resources/org/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/resources/org/apache/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/resources/org/apache/directory/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/resources/org/apache/directory/ldapstudio/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/resources/org/apache/directory/ldapstudio/ldifeditor/
    directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/resources/org/apache/directory/ldapstudio/ldifeditor/messages.properties

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/.classpath
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/.classpath?view=auto&rev=526698
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-ldifeditor/.classpath (added)
+++ directory/ldapstudio/trunk/ldapstudio-ldifeditor/.classpath Mon Apr  9 02:59:19 2007
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" path="src/main/java"/>
+	<classpathentry kind="src" path="src/main/resources"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/.project
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/.project?view=auto&rev=526698
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-ldifeditor/.project (added)
+++ directory/ldapstudio/trunk/ldapstudio-ldifeditor/.project Mon Apr  9 02:59:19 2007
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>ldapstudio-ldifeditor</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.pde.PluginNature</nature>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/META-INF/MANIFEST.MF?view=auto&rev=526698
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-ldifeditor/META-INF/MANIFEST.MF (added)
+++ directory/ldapstudio/trunk/ldapstudio-ldifeditor/META-INF/MANIFEST.MF Mon Apr  9 02:59:19 2007
@@ -0,0 +1,28 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: LDAP Studio LDIF Editor Plug-in
+Bundle-SymbolicName: org.apache.directory.ldapstudio.ldifeditor;singleton:=true
+Bundle-Version: 0.0.0.SNAPSHOT
+Bundle-Activator: org.apache.directory.ldapstudio.ldifeditor.LdifEditorActivator
+Bundle-Vendor: Apache Software Foundation
+Bundle-Localization: plugin
+Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.core.filesystem,
+ org.eclipse.search,
+ org.eclipse.ui,
+ org.eclipse.ui.editors,
+ org.eclipse.ui.workbench.texteditor,
+ org.eclipse.ui.views,
+ org.eclipse.ui.forms,
+ org.eclipse.jface.text,
+ org.apache.directory.ldapstudio.browser.core,
+ org.apache.directory.ldapstudio.browser.common
+Eclipse-LazyStart: true
+Export-Package: org.apache.directory.ldapstudio.ldifeditor,
+ org.apache.directory.ldapstudio.ldifeditor.dialogs,
+ org.apache.directory.ldapstudio.ldifeditor.editor,
+ org.apache.directory.ldapstudio.ldifeditor.editor.actions,
+ org.apache.directory.ldapstudio.ldifeditor.editor.reconciler,
+ org.apache.directory.ldapstudio.ldifeditor.editor.text,
+ org.apache.directory.ldapstudio.ldifeditor.widgets,
+ org.apache.directory.ldapstudio.ldifeditor.wizards

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/build.properties
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/build.properties?view=auto&rev=526698
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-ldifeditor/build.properties (added)
+++ directory/ldapstudio/trunk/ldapstudio-ldifeditor/build.properties Mon Apr  9 02:59:19 2007
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/build.xml
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/build.xml?view=auto&rev=526698
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-ldifeditor/build.xml (added)
+++ directory/ldapstudio/trunk/ldapstudio-ldifeditor/build.xml Mon Apr  9 02:59:19 2007
@@ -0,0 +1,162 @@
+<!--
+  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.
+-->
+<project default="jar" xmlns:ivy="antlib:fr.jayasoft.ivy.ant">
+	<property name="project.name" value="org.apache.directory.ldapstudio.ldifeditor" />
+	<property name="project.version" value="0.0.0.SNAPSHOT" />
+
+	<property name="project.output" value="${basedir}/target" />
+	<property name="project.build" value="${project.output}/build" />
+	<property name="project.src" value="${basedir}/src/main/java" />
+
+	<property name="lib.dir" value="lib" />
+
+	<property name="repository.dir" location="../dependencies/externals/"/>
+
+	<!-- Configuring Ivy (Needs to be AFTER the $repository.dir declaration) -->
+	<ivy:configure file="../tools/ivyconf.xml"/>
+	
+	<!-- ================================== -->
+	<!--               RESOLVE              -->
+	<!-- ================================== -->
+	<target name="resolve" description="--> retreive dependencies with ivy">
+		<mkdir dir="${basedir}/${lib.dir}" />
+		<ivy:retrieve/>
+	</target>
+		
+	<!-- ================================== -->
+	<!--             CLASSPATH              -->
+	<!-- ================================== -->
+	<target name="build-classpath" description="Computes a classpath according to current OS" >
+		
+		<path id="classpath">
+			<fileset dir="../dependencies/eclipse/3.2">
+				<include name="**/*.jar"/>
+			</fileset>
+			<fileset dir="${lib.dir}" />
+			<pathelement location="${basedir}/../ldapstudio-browser-core/target/classes"/>
+			<pathelement location="${basedir}/../ldapstudio-browser-core/target/build"/>
+			<pathelement location="${basedir}/../ldapstudio-browser-common/target/classes"/>
+			<pathelement location="${basedir}/../ldapstudio-browser-common/target/build"/>
+	        <pathelement location="target/classes"/>
+		</path>
+				
+	</target>
+	
+	<!-- ================================== -->
+	<!--             COMPILE                -->
+	<!-- ================================== -->
+	<target name="compile" depends="resolve,checkclasses,build-classpath" unless="classes-up2date" description="Compiles the plugin">
+		
+		<mkdir dir="${project.build}" />
+		<copy todir="${project.build}">
+			<fileset dir="${basedir}">
+				<include name="plugin.xml" />
+				<include name="plugin.properties" />
+				<include name="about.html" />
+			</fileset>
+		</copy>
+		<mkdir dir="${project.build}/${lib.dir}" />
+		<copy todir="${project.build}/${lib.dir}">
+			<fileset dir="${basedir}/${lib.dir}">
+				<include name="*.jar" />
+			</fileset>
+		</copy>		
+		<mkdir dir="${project.build}/META-INF" />
+		<copy todir="${project.build}/META-INF">
+			<fileset dir="${basedir}/META-INF">
+				<include name="**" />
+			</fileset>
+		</copy>
+		<mkdir dir="${project.build}/resources" />
+		<copy todir="${project.build}/resources">
+			<fileset dir="${basedir}/resources">
+				<include name="**" />
+			</fileset>
+		</copy>
+		
+		<copy todir="${project.build}">
+			<fileset dir="${basedir}/src/main/resources">
+				<include name="**" />
+			</fileset>
+		</copy>	
+			
+		<javac
+			source="1.5"
+			debug="yes"
+			srcdir="${project.src}"
+			excludes=""
+			destdir="${project.build}"
+			classpathref="classpath"
+			listfiles="yes" verbose="false" />
+
+		<tstamp>
+			<format pattern="yyyy-MMM-dd, HH:mm 'GMT'Z" property="timestamp" locale="en" />
+		</tstamp>
+		<echo message="${project.name}-${project.version} compiled ${timestamp} by ${user.name}" file="${project.build}/compile.timestamp" />
+	</target>
+
+	<target name="checkclasses">
+		<uptodate property="classes-up2date" targetfile="${project.build}/compile.timestamp">
+			<srcfiles dir="${project.src}" />
+		</uptodate>
+	</target>
+
+	<!-- ================================== -->
+	<!--              JAVADOC               -->
+	<!-- ================================== -->
+	<target name="javadoc" description="Generate Javadoc files">
+		<mkdir dir="${basedir}/doc" />
+		<javadoc destdir="${basedir}/doc">
+			<fileset dir="src/main/java" defaultexcludes="yes">
+				<include name="org/apache/directory/ldapstudio/**/*.java"/>
+			</fileset>
+		</javadoc>
+	</target>
+	
+	<!-- ================================== -->
+	<!--              JAR                   -->
+	<!-- ================================== -->
+	<target name="jar" description="Creates jar file" depends="compile">
+		<jar destfile="${project.output}/${project.name}_${project.version}.jar" manifest="${project.build}/META-INF/MANIFEST.MF">
+			<fileset dir="${project.build}" excludes="compile.timestamp" />
+		</jar>
+	</target>
+
+	<!-- ================================== -->
+	<!--               CLEAN                -->
+	<!-- ================================== -->
+	<target name="clean" description="Deletes any generated file (javadoc, classes, jars, distribution)">
+		<delete includeemptydirs="true">
+			<fileset dir="${basedir}">
+				<exclude name=".classpath"/>
+				<exclude name=".project"/>
+				<exclude name="about.html"/>
+				<exclude name="build.properties"/>
+				<exclude name="build.xml"/>
+				<exclude name="ivy.xml"/>
+				<exclude name="plugin.properties"/>
+				<exclude name="plugin.xml"/>
+				<exclude name="about_files/**"/>
+				<exclude name="resources/**"/>
+				<exclude name="META-INF/**"/>
+				<exclude name="src/**" />
+			</fileset>
+		</delete>
+	</target>
+</project>

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/ivy.xml
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/ivy.xml?view=auto&rev=526698
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-ldifeditor/ivy.xml (added)
+++ directory/ldapstudio/trunk/ldapstudio-ldifeditor/ivy.xml Mon Apr  9 02:59:19 2007
@@ -0,0 +1,21 @@
+<!--
+  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.
+-->
+<ivy-module version="1.0">
+	<info organisation="org.apache.directory.ldapstudio" module="ldapstudio-ldifeditor"/>
+</ivy-module>
\ No newline at end of file

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/plugin.xml
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/plugin.xml?view=auto&rev=526698
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-ldifeditor/plugin.xml (added)
+++ directory/ldapstudio/trunk/ldapstudio-ldifeditor/plugin.xml Mon Apr  9 02:59:19 2007
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+   <extension
+         point="org.eclipse.ui.editors">
+    <editor
+          class="org.apache.directory.ldapstudio.ldifeditor.editor.LdifEditor"
+          contributorClass="org.apache.directory.ldapstudio.ldifeditor.editor.LdifEditorContributor"
+          default="true"
+          extensions="ldif, ldiflog"
+          icon="resources/icons/ldifeditor.gif"
+          id="org.apache.directory.ldapstudio.ldifeditor.editor.LdifEditor"
+          name="LDIF Editor"/>         
+   </extension>
+
+   <extension
+         point="org.eclipse.ui.newWizards">
+      <wizard
+            canFinishEarly="true"
+            category="org.apache.directory.ldapstudio.browser.ui.newWizards.category"
+            class="org.apache.directory.ldapstudio.ldifeditor.wizards.NewLdifFileWizard"
+            hasPages="false"
+            icon="resources/icons/ldifeditor_new.gif"
+            id="org.apache.directory.ldapstudio.ldifeditor.wizards.NewLdifFileWizard"
+            name="LDIF File"
+            project="false"/>
+   </extension>
+
+   <extension
+         point="org.eclipse.core.runtime.preferences">
+      <initializer class="org.apache.directory.ldapstudio.ldifeditor.LdifEditorPreferencesInitializer"/>
+   </extension>   
+      
+   <extension
+         point="org.eclipse.ui.preferencePages">
+      <page
+            category="org.apache.directory.ldapstudio.browser.ui.dialogs.preferences.MainPreferencePage"
+            class="org.apache.directory.ldapstudio.ldifeditor.dialogs.preferences.LdifEditorPreferencePage"
+            id="org.apache.directory.ldapstudio.ldifeditor.dialogs.preferences.LdifEditorPreferencePage"
+            name="LDIF Editor">
+         <keywordReference id="org.apache.directory.ldapstudio.browser.keyword.ldap"/>
+         <keywordReference id="org.apache.directory.ldapstudio.browser.keyword.ldif"/>
+      </page>
+      <page
+            category="org.apache.directory.ldapstudio.ldifeditor.dialogs.preferences.LdifEditorPreferencePage"
+            class="org.apache.directory.ldapstudio.ldifeditor.dialogs.preferences.LdifEditorContentAssistPreferencePage"
+            id="org.apache.directory.ldapstudio.ldifeditor.dialogs.preferences.LdifEditorContentAssistPreferencePage"
+            name="Content Assist">
+         <keywordReference id="org.apache.directory.ldapstudio.browser.keyword.ldap"/>
+         <keywordReference id="org.apache.directory.ldapstudio.browser.keyword.ldif"/>
+      </page>
+      <page
+            category="org.apache.directory.ldapstudio.ldifeditor.dialogs.preferences.LdifEditorPreferencePage"
+            class="org.apache.directory.ldapstudio.ldifeditor.dialogs.preferences.LdifEditorSyntaxColoringPreferencePage"
+            id="org.apache.directory.ldapstudio.ldifeditor.dialogs.preferences.LdifEditorSyntaxColoringPreferencePage"
+            name="Syntax Coloring">
+         <keywordReference id="org.apache.directory.ldapstudio.browser.keyword.ldap"/>
+         <keywordReference id="org.apache.directory.ldapstudio.browser.keyword.ldif"/>
+         <keywordReference id="org.apache.directory.ldapstudio.browser.keyword.colors"/>
+      </page>
+      <page
+            category="org.apache.directory.ldapstudio.ldifeditor.dialogs.preferences.LdifEditorPreferencePage"
+            class="org.apache.directory.ldapstudio.ldifeditor.dialogs.preferences.LdifEditorTemplatesPreferencePage"
+            id="org.apache.directory.ldapstudio.ldifeditor.dialogs.preferences.LdifEditorTemplatesPreferencePage"
+            name="Templates">
+         <keywordReference id="org.apache.directory.ldapstudio.browser.keyword.ldap"/>
+         <keywordReference id="org.apache.directory.ldapstudio.browser.keyword.ldif"/>
+      </page>
+   </extension>      
+
+   <extension
+         point="org.eclipse.ui.editors.templates">
+      <contextType
+            class="org.eclipse.jface.text.templates.TemplateContextType"
+            id="org.apache.directory.ldapstudio.ldifeditor.templates.ldifFile"
+            name="LDIF File"/>
+      <contextType
+            class="org.eclipse.jface.text.templates.TemplateContextType"
+            id="org.apache.directory.ldapstudio.ldifeditor.templates.ldifAttrValRecord"
+            name="LDIF Attribute Value Record"/>
+      <contextType
+            class="org.eclipse.jface.text.templates.TemplateContextType"
+            id="org.apache.directory.ldapstudio.ldifeditor.templates.ldifModificationRecord"
+            name="LDIF Modification Record"/>
+      <contextType
+            class="org.eclipse.jface.text.templates.TemplateContextType"
+            id="org.apache.directory.ldapstudio.ldifeditor.templates.ldifModificationItem"
+            name="LDIF Modification Item"/>
+      <contextType
+            class="org.eclipse.jface.text.templates.TemplateContextType"
+            id="org.apache.directory.ldapstudio.ldifeditor.templates.ldifModdnRecord"
+            name="LDIF Moddn Record"/>
+      <include file="resources/templates/templates.xml"/>
+   </extension>
+
+</plugin>

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/entry.gif
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/entry.gif?view=auto&rev=526698
==============================================================================
Binary file - no diff available.

Propchange: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/entry.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/execute.gif
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/execute.gif?view=auto&rev=526698
==============================================================================
Binary file - no diff available.

Propchange: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/execute.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_add.gif
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_add.gif?view=auto&rev=526698
==============================================================================
Binary file - no diff available.

Propchange: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_add.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_attribute.gif
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_attribute.gif?view=auto&rev=526698
==============================================================================
Binary file - no diff available.

Propchange: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_attribute.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_comment.gif
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_comment.gif?view=auto&rev=526698
==============================================================================
Binary file - no diff available.

Propchange: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_comment.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_delete.gif
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_delete.gif?view=auto&rev=526698
==============================================================================
Binary file - no diff available.

Propchange: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_delete.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_dn.gif
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_dn.gif?view=auto&rev=526698
==============================================================================
Binary file - no diff available.

Propchange: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_dn.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_mod_add.gif
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_mod_add.gif?view=auto&rev=526698
==============================================================================
Binary file - no diff available.

Propchange: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_mod_add.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_mod_delete.gif
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_mod_delete.gif?view=auto&rev=526698
==============================================================================
Binary file - no diff available.

Propchange: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_mod_delete.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_mod_replace.gif
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_mod_replace.gif?view=auto&rev=526698
==============================================================================
Binary file - no diff available.

Propchange: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_mod_replace.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_modify.gif
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_modify.gif?view=auto&rev=526698
==============================================================================
Binary file - no diff available.

Propchange: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_modify.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_rename.gif
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_rename.gif?view=auto&rev=526698
==============================================================================
Binary file - no diff available.

Propchange: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_rename.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_value.gif
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_value.gif?view=auto&rev=526698
==============================================================================
Binary file - no diff available.

Propchange: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldif_value.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldifeditor.gif
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldifeditor.gif?view=auto&rev=526698
==============================================================================
Binary file - no diff available.

Propchange: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldifeditor.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldifeditor_new.gif
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldifeditor_new.gif?view=auto&rev=526698
==============================================================================
Binary file - no diff available.

Propchange: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/ldifeditor_new.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/template.gif
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/template.gif?view=auto&rev=526698
==============================================================================
Binary file - no diff available.

Propchange: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/icons/template.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/templates/templates.xml
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/templates/templates.xml?view=auto&rev=526698
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/templates/templates.xml (added)
+++ directory/ldapstudio/trunk/ldapstudio-ldifeditor/resources/templates/templates.xml Mon Apr  9 02:59:19 2007
@@ -0,0 +1,166 @@
+<?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.ldapstudio.ldifeditor.templates.ldifContentRecord" 
+		name="dn: " 
+		description="LDIF content record"
+		context="org.apache.directory.ldapstudio.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.ldapstudio.ldifeditor.templates.ldifChangeAddRecord" 
+		name="changetype: add" 
+		description="LDIF change add record"
+		context="org.apache.directory.ldapstudio.ldifeditor.templates.ldifFile" 
+		enabled="true" 
+		deleted="false">dn: ${dn}
+changetype: add
+objectClass: ${objectClass}
+${cursor}
+</template>
+	<template 
+		id="org.apache.directory.ldapstudio.ldifeditor.templatesldifChangeModifyRecord" 
+		name="changetype: modify" 
+		description="LDIF change modify record"
+		context="org.apache.directory.ldapstudio.ldifeditor.templates.ldifFile" 
+		enabled="true" 
+		deleted="false">dn: ${dn}
+changetype: modify
+${cursor}
+</template>
+	<template 
+		id="org.apache.directory.ldapstudio.ldifeditor.templates.ldifChangeDeleteRecord" 
+		name="changetype: delete" 
+		description="LDIF change delete record"
+		context="org.apache.directory.ldapstudio.ldifeditor.templates.ldifFile" 
+		enabled="true" 
+		deleted="false">dn: ${dn}
+changetype: delete
+${cursor}
+</template>
+	<template 
+		id="org.apache.directory.ldapstudio.ldifeditor.templates.ldifChangeModdnRecord" 
+		name="changetype: moddn" 
+		description="LDIF change modify dn record"
+		context="org.apache.directory.ldapstudio.ldifeditor.templates.ldifFile" 
+		enabled="true" 
+		deleted="false">dn: ${dn}
+changetype: moddn
+newrdn: ${newrdn}
+deleteoldrdn: 1
+newsuperior: ${newsuperior}
+${cursor}
+</template>
+
+	<template 
+		id="org.apache.directory.ldapstudio.ldifeditor.templates.ldifModificationRecordAddModification" 
+		name="add: " 
+		description="Add value"
+		context="org.apache.directory.ldapstudio.ldifeditor.templates.ldifModificationRecord" 
+		enabled="true" >add: ${attribute}
+${attribute}: ${value}
+-
+${cursor}</template>
+	<template 
+		id="org.apache.directory.ldapstudio.ldifeditor.ui.templates.ldifModificationRecordReplaceModification" 
+		name="replace: " 
+		description="Replace value"
+		context="org.apache.directory.ldapstudio.ldifeditor.templates.ldifModificationRecord" 
+		enabled="true" >replace: ${attribute}
+${attribute}: ${value}
+-
+${cursor}</template>
+	<template 
+		id="org.apache.directory.ldapstudio.ldifeditor.templates.ldifModificationRecordDeleteModification" 
+		name="delete: " 
+		description="Delete value"
+		context="org.apache.directory.ldapstudio.ldifeditor.templates.ldifModificationRecord" 
+		enabled="true" >delete: ${attribute}
+${attribute}: ${value}
+-
+${cursor}</template>
+	<template 
+		id="org.apache.directory.ldapstudio.ldifeditor.templates.ldifModificationRecordDelete2Modification" 
+		name="delete: " 
+		description="Delete attribute"
+		context="org.apache.directory.ldapstudio.ldifeditor.templates.ldifModificationRecord" 
+		enabled="true" >delete: ${attribute}
+-
+${cursor}</template>
+
+
+
+
+<!-- 
+	<template 
+		id="org.apache.directory.ldapstudio.browser.ui.templates.ldif.ldifChangeModifyRecordAdd" 
+		name="changetype: modify (add)" 
+		description="LDIF modify record"
+		context="org.apache.directory.ldapstudio.browser.ui.templates.ldif" 
+		enabled="true" 
+		deleted="false">dn: ${dn}
+changetype: modify
+add: ${attribute}
+${attribute}: ${value}
+-
+${cursor}
+</template>
+-->
+<!-- 
+	<template 
+		id="org.apache.directory.ldapstudio.browser.ui.templates.ldif.ldifChangeModifyRecordReplace" 
+		name="changetype: modify (replace)" 
+		description="LDIF modify record"
+		context="org.apache.directory.ldapstudio.browser.ui.templates.ldif" 
+		enabled="true" 
+		deleted="false">dn: ${dn}
+changetype: modify
+replace: ${attribute}
+${attribute}: ${value}
+-
+${cursor}
+</template>
+-->
+<!-- 
+	<template 
+		id="org.apache.directory.ldapstudio.browser.ui.templates.ldif.ldifChangeModifyRecordDelete" 
+		name="changetype: modify (delete)" 
+		description="LDIF modify record"
+		context="org.apache.directory.ldapstudio.browser.ui.templates.ldif" 
+		enabled="true" 
+		deleted="false">dn: ${dn}
+changetype: modify
+delete: ${attribute}
+${attribute}: ${value}
+-
+${cursor}
+</template>
+-->
+
+
+
+</templates>
\ No newline at end of file

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/LdifEditorActivator.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/LdifEditorActivator.java?view=auto&rev=526698
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/LdifEditorActivator.java (added)
+++ directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/LdifEditorActivator.java Mon Apr  9 02:59:19 2007
@@ -0,0 +1,267 @@
+package org.apache.directory.ldapstudio.ldifeditor;
+
+
+import java.io.IOException;
+import java.net.URL;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.core.runtime.FileLocator;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.jface.resource.ColorRegistry;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.text.templates.ContextTypeRegistry;
+import org.eclipse.jface.text.templates.GlobalTemplateVariables;
+import org.eclipse.jface.text.templates.persistence.TemplateStore;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry;
+import org.eclipse.ui.editors.text.templates.ContributionTemplateStore;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class LdifEditorActivator extends AbstractUIPlugin
+{
+
+    /** The plugin ID */
+    public static final String PLUGIN_ID = "org.apache.directory.ldapstudio.ldifeditor";
+
+    /** The shared instance */
+    private static LdifEditorActivator plugin;
+
+    /** Resource bundle */
+    private ResourceBundle resourceBundle;
+    
+    /** The color registry */
+    private ColorRegistry colorRegistry;
+
+    /** The template store */
+    private ContributionTemplateStore ldifTemplateStore;
+
+    /** The context type registry */
+    private ContributionContextTypeRegistry ldifTemplateContextTypeRegistry;
+
+
+    /**
+     * The constructor
+     */
+    public LdifEditorActivator()
+    {
+        plugin = this;
+        
+        try
+        {
+            resourceBundle = ResourceBundle.getBundle( "org.apache.directory.ldapstudio.ldifeditor.messages" );
+        }
+        catch ( MissingResourceException x )
+        {
+            resourceBundle = null;
+        }
+    }
+
+
+    /**
+     * {@inheritDoc} 
+     */
+    public void start( BundleContext context ) throws Exception
+    {
+        super.start( context );
+
+        if ( colorRegistry == null )
+        {
+            colorRegistry = new ColorRegistry( getWorkbench().getDisplay() );
+        }
+
+        if ( ldifTemplateContextTypeRegistry == null )
+        {
+            ldifTemplateContextTypeRegistry = new ContributionContextTypeRegistry();
+
+            ldifTemplateContextTypeRegistry.addContextType( LdifEditorConstants.LDIF_FILE_TEMPLATE_ID );
+            ldifTemplateContextTypeRegistry.getContextType( LdifEditorConstants.LDIF_FILE_TEMPLATE_ID ).addResolver(
+                new GlobalTemplateVariables.Cursor() );
+
+            ldifTemplateContextTypeRegistry.addContextType( LdifEditorConstants.LDIF_ATTR_VAL_RECORD_TEMPLATE_ID );
+            ldifTemplateContextTypeRegistry.getContextType( LdifEditorConstants.LDIF_ATTR_VAL_RECORD_TEMPLATE_ID )
+                .addResolver( new GlobalTemplateVariables.Cursor() );
+
+            ldifTemplateContextTypeRegistry.addContextType( LdifEditorConstants.LDIF_MODIFICATION_RECORD_TEMPLATE_ID );
+            ldifTemplateContextTypeRegistry.getContextType( LdifEditorConstants.LDIF_MODIFICATION_RECORD_TEMPLATE_ID )
+                .addResolver( new GlobalTemplateVariables.Cursor() );
+
+            ldifTemplateContextTypeRegistry.addContextType( LdifEditorConstants.LDIF_MODIFICATION_ITEM_TEMPLATE_ID );
+
+            ldifTemplateContextTypeRegistry.addContextType( LdifEditorConstants.LDIF_MODDN_RECORD_TEMPLATE_ID );
+        }
+
+        if ( ldifTemplateStore == null )
+        {
+            ldifTemplateStore = new ContributionTemplateStore( getLdifTemplateContextTypeRegistry(),
+                getPreferenceStore(), "templates" );
+            try
+            {
+                ldifTemplateStore.load();
+            }
+            catch ( IOException e )
+            {
+                e.printStackTrace();
+            }
+        }
+    }
+
+
+    /**
+     * {@inheritDoc} 
+     */
+    public void stop( BundleContext context ) throws Exception
+    {
+        plugin = null;
+        super.stop( context );
+
+        if ( colorRegistry != null )
+        {
+            colorRegistry = null;
+        }
+
+        if ( ldifTemplateContextTypeRegistry != null )
+        {
+            ldifTemplateContextTypeRegistry = null;
+        }
+
+        if ( ldifTemplateStore != null )
+        {
+            try
+            {
+                ldifTemplateStore.save();
+            }
+            catch ( IOException e )
+            {
+                e.printStackTrace();
+            }
+            ldifTemplateStore = null;
+        }
+    }
+
+
+    /**
+     * Returns the shared instance
+     *
+     * @return the shared instance
+     */
+    public static LdifEditorActivator getDefault()
+    {
+        return plugin;
+    }
+
+
+    /**
+     * Use this method to get SWT colors. A ColorRegistry is used to manage
+     * the RGB->Color mapping.
+     * <p>
+     * Note: Don't dispose the returned color. It is disposed automatically
+     * when the plugin is stopped.
+     * 
+     * @param rgb
+     *                the rgb color data
+     * @return The SWT Color
+     */
+    public Color getColor( RGB rgb )
+    {
+        if ( !colorRegistry.hasValueFor( rgb.toString() ) )
+        {
+            colorRegistry.put( rgb.toString(), rgb );
+        }
+
+        return colorRegistry.get( rgb.toString() );
+    }
+
+
+    /**
+     * Use this method to get SWT images. Use the IMG_ constants from
+     * LdifEditorConstants for the key.
+     * 
+     * @param key
+     *                The key (relative path to the image im filesystem)
+     * @return The image discriptor or null
+     */
+    public ImageDescriptor getImageDescriptor( String key )
+    {
+        if ( key != null )
+        {
+            URL url = FileLocator.find( getBundle(), new Path( key ), null );
+            if ( url != null )
+                return ImageDescriptor.createFromURL( url );
+            else
+                return null;
+        }
+        else
+        {
+            return null;
+        }
+    }
+
+
+    /**
+     * Use this method to get SWT images. Use the IMG_ constants from
+     * LdifEditorConstants for the key. A ImageRegistry is used to manage the
+     * the key->Image mapping.
+     * <p>
+     * Note: Don't dispose the returned SWT Image. It is disposed
+     * automatically when the plugin is stopped.
+     * 
+     * @param key
+     *                The key (relative path to the image im filesystem)
+     * @return The SWT Image or null
+     * @see LdifEditorConstants
+     */
+    public Image getImage( String key )
+    {
+        Image image = getImageRegistry().get( key );
+        if ( image == null )
+        {
+            ImageDescriptor id = getImageDescriptor( key );
+            if ( id != null )
+            {
+                image = id.createImage();
+                getImageRegistry().put( key, image );
+            }
+        }
+        return image;
+    }
+
+
+    /**
+     * 
+     * @return The LDIF template context type registry
+     */
+    public ContextTypeRegistry getLdifTemplateContextTypeRegistry()
+    {
+        return ldifTemplateContextTypeRegistry;
+    }
+    
+
+    /**
+     * 
+     * @return The LDIF template store
+     */
+    public TemplateStore getLdifTemplateStore()
+    {
+        return ldifTemplateStore;
+    }
+    
+    
+    /**
+     * Gets the resource bundle.
+     * 
+     * @return the resource bundle
+     */
+    public ResourceBundle getResourceBundle()
+    {
+        return resourceBundle;
+    }
+
+}

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/LdifEditorConstants.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/LdifEditorConstants.java?view=auto&rev=526698
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/LdifEditorConstants.java (added)
+++ directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/LdifEditorConstants.java Mon Apr  9 02:59:19 2007
@@ -0,0 +1,105 @@
+
+package org.apache.directory.ldapstudio.ldifeditor;
+
+public interface LdifEditorConstants
+{
+
+    public static final String ACTION_ID_EDIT_RECORD = "org.apache.directory.ldapstudio.browser.action.editRecord";
+
+    public static final String PREFERENCE_LDIFEDITOR_FORMATTER_AUTOWRAP = "ldifEditorFormatterAutoWrap";
+
+    public static final String PREFERENCE_LDIFEDITOR_FOLDING_ENABLE = "ldifEditorFoldingEnable";
+
+    public static final String PREFERENCE_LDIFEDITOR_FOLDING_INITIALLYFOLDCOMMENTS = "ldifEditorFoldingInitiallyFoldComments";
+
+    public static final String PREFERENCE_LDIFEDITOR_FOLDING_INITIALLYFOLDRECORDS = "ldifEditoroldingInitiallyFoldRecords";
+
+    public static final String PREFERENCE_LDIFEDITOR_FOLDING_INITIALLYFOLDWRAPPEDLINES = "ldifEditorFoldingInitiallyFoldWrappedLines";
+
+    public static final String PREFERENCE_LDIFEDITOR_DOUBLECLICK_USELDIFDOUBLECLICK = "ldifEditorDoubleClickUserLdifDoubleClick";
+
+    public static final String PREFERENCE_LDIFEDITOR_CONTENTASSIST_INSERTSINGLEPROPOSALAUTO = "ldifEditorCodeAssistInsertSingleProposalAuto";
+
+    public static final String PREFERENCE_LDIFEDITOR_CONTENTASSIST_ENABLEAUTOACTIVATION = "ldifEditorCodeAssistEnableAutoActivation";
+
+    public static final String PREFERENCE_LDIFEDITOR_CONTENTASSIST_AUTOACTIVATIONDELAY = "ldifEditorCodeAssistAutoActivationDelay";
+
+    public static final String PREFERENCE_LDIFEDITOR_CONTENTASSIST_SMARTINSERTATTRIBUTEINMODSPEC = "ldifEditorCodeAssistInsertAttributeInModSpec";
+
+    public static final String PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX = "_RGB";
+
+    public static final String PREFERENCE_LDIFEDITOR_SYNTAX_STYLE_SUFFIX = "_STYLE";
+
+    public static final String PREFERENCE_LDIFEDITOR_SYNTAX_COMMENT = "ldifEditorSyntaxComment";
+
+    public static final String PREFERENCE_LDIFEDITOR_SYNTAX_KEYWORD = "ldifEditorSyntaxKeyword";
+
+    public static final String PREFERENCE_LDIFEDITOR_SYNTAX_DN = "ldifEditorSyntaxDn";
+
+    public static final String PREFERENCE_LDIFEDITOR_SYNTAX_ATTRIBUTE = "ldifEditorSyntaxAttribute";
+
+    public static final String PREFERENCE_LDIFEDITOR_SYNTAX_VALUETYPE = "ldifEditorSyntaxValueType";
+
+    public static final String PREFERENCE_LDIFEDITOR_SYNTAX_VALUE = "ldifEditorSyntaxValue";
+
+    public static final String PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEADD = "ldifEditorSyntaxChangetypeAdd";
+
+    public static final String PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEMODIFY = "ldifEditorSyntaxChangetypeModify";
+
+    public static final String PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEDELETE = "ldifEditorSyntaxChangetypeDelete";
+
+    public static final String PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEMODDN = "ldifEditorSyntaxChangetypeModdn";
+
+    public static final String PREFERENCEPAGEID_LDIFEDITOR = "org.apache.directory.ldapstudio.ldifeditor.dialogs.preferences.LdifEditorPreferencePage";
+
+    public static final String PREFERENCEPAGEID_LDIFEDITOR_CONTENTASSIST = "org.apache.directory.ldapstudio.ldifeditor.dialogs.preferences.LdifEditorContentAssistPreferencePage";
+
+    public static final String PREFERENCEPAGEID_LDIFEDITOR_SYNTAXCOLORING = "org.apache.directory.ldapstudio.ldifeditor.dialogs.preferences.LdifEditorSyntaxColoringPreferencePage";
+
+    public static final String PREFERENCEPAGEID_LDIFEDITOR_TEMPLATES = "org.apache.directory.ldapstudio.ldifeditor.dialogs.preferences.TemplatesPreferencePage";
+
+    public static final String LDIF_FILE_TEMPLATE_ID = "org.apache.directory.ldapstudio.ldifeditor.templates.ldifFile";
+
+    public static final String LDIF_ATTR_VAL_RECORD_TEMPLATE_ID = "org.apache.directory.ldapstudio.ldifeditor.templates.ldifAttrValRecord";
+
+    public static final String LDIF_MODIFICATION_RECORD_TEMPLATE_ID = "org.apache.directory.ldapstudio.ldifeditor.templates.ldifModificationRecord";
+
+    public static final String LDIF_MODIFICATION_ITEM_TEMPLATE_ID = "org.apache.directory.ldapstudio.ldifeditor.templates.ldifModificationItem";
+
+    public static final String LDIF_MODDN_RECORD_TEMPLATE_ID = "org.apache.directory.ldapstudio.ldifeditor.templates.ldifModdnRecord";
+
+    public static final String IMG_LDIF_ADD = "resources/icons/ldif_add.gif";
+
+    public static final String IMG_LDIF_MODIFY = "resources/icons/ldif_modify.gif";
+
+    public static final String IMG_LDIF_DELETE = "resources/icons/ldif_delete.gif";
+
+    public static final String IMG_LDIF_RENAME = "resources/icons/ldif_rename.gif";
+
+    public static final String IMG_LDIF_ATTRIBUTE = "resources/icons/ldif_attribute.gif";
+
+    public static final String IMG_LDIF_VALUE = "resources/icons/ldif_value.gif";
+
+    public static final String IMG_LDIF_MOD_ADD = "resources/icons/ldif_mod_add.gif";
+
+    public static final String IMG_LDIF_MOD_REPLACE = "resources/icons/ldif_mod_replace.gif";
+
+    public static final String IMG_LDIF_MOD_DELETE = "resources/icons/ldif_mod_delete.gif";
+
+    public static final String IMG_LDIF_COMMENT = "resources/icons/ldif_comment.gif";
+
+    public static final String IMG_LDIF_DN = "resources/icons/ldif_dn.gif";
+
+    public static final String IMG_ENTRY = "resources/icons/entry.gif";
+
+    public static final String IMG_TEMPLATE = "resources/icons/template.gif";
+    
+    public static final String IMG_BROWSER_LDIFEDITOR = "resources/icons/browser_ldifeditor.gif";
+
+    public static final String IMG_LDIFEDITOR_NEW = "resources/icons/ldifeditor_new.gif";
+    
+    public static final String IMG_EXECUTE = "resources/icons/execute.gif";
+
+
+
+}

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/LdifEditorPreferencesInitializer.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/LdifEditorPreferencesInitializer.java?view=auto&rev=526698
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/LdifEditorPreferencesInitializer.java (added)
+++ directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/LdifEditorPreferencesInitializer.java Mon Apr  9 02:59:19 2007
@@ -0,0 +1,101 @@
+/*
+ *  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.ldapstudio.ldifeditor;
+
+
+import org.eclipse.core.runtime.preferences.AbstractPreferenceInitializer;
+import org.eclipse.jface.preference.IPreferenceStore;
+import org.eclipse.jface.preference.PreferenceConverter;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.RGB;
+
+
+/**
+ * This class is used to set default preference values.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class LdifEditorPreferencesInitializer extends AbstractPreferenceInitializer
+{
+    /**
+     * {@inheritDoc}
+     */
+    public void initializeDefaultPreferences()
+    {
+
+        IPreferenceStore store = LdifEditorActivator.getDefault().getPreferenceStore();
+
+        // LDIF Editor
+        store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_FORMATTER_AUTOWRAP, true );
+        store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_FOLDING_ENABLE, true );
+        store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_FOLDING_INITIALLYFOLDCOMMENTS, true );
+        store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_FOLDING_INITIALLYFOLDRECORDS, false );
+        store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_FOLDING_INITIALLYFOLDWRAPPEDLINES, true );
+        store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_DOUBLECLICK_USELDIFDOUBLECLICK, true );
+        store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_CONTENTASSIST_INSERTSINGLEPROPOSALAUTO, true );
+        store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_CONTENTASSIST_ENABLEAUTOACTIVATION, true );
+        store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_CONTENTASSIST_AUTOACTIVATIONDELAY, 200 );
+        store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_CONTENTASSIST_SMARTINSERTATTRIBUTEINMODSPEC, true );
+        PreferenceConverter.setDefault( store, LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_COMMENT
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, new RGB( 63, 127, 95 ) );// green
+        store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_COMMENT
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_STYLE_SUFFIX, SWT.NORMAL );
+        PreferenceConverter.setDefault( store, LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_KEYWORD
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, new RGB( 128, 128, 128 ) );// gray
+        store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_KEYWORD
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_STYLE_SUFFIX, SWT.BOLD );
+        PreferenceConverter.setDefault( store, LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_DN
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, new RGB( 0, 0, 0 ) );// black
+        store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_DN
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_STYLE_SUFFIX, SWT.BOLD );
+        PreferenceConverter.setDefault( store, LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_ATTRIBUTE
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, new RGB( 127, 0, 85 ) );// violett
+        store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_ATTRIBUTE
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_STYLE_SUFFIX, SWT.BOLD );
+        PreferenceConverter.setDefault( store, LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_VALUETYPE
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, new RGB( 255, 0, 0 ) );// red
+        store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_VALUETYPE
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_STYLE_SUFFIX, SWT.BOLD );
+        PreferenceConverter.setDefault( store, LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_VALUE
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, new RGB( 0, 0, 192 ) );// blue
+        store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_VALUE
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_STYLE_SUFFIX, SWT.NORMAL );
+        PreferenceConverter.setDefault( store, LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEADD
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, new RGB( 123, 170, 91 ) );// green
+        store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEADD
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_STYLE_SUFFIX, SWT.BOLD );
+        PreferenceConverter.setDefault( store, LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEMODIFY
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, new RGB( 214, 160, 100 ) );// yellow
+        store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEMODIFY
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_STYLE_SUFFIX, SWT.BOLD );
+        PreferenceConverter.setDefault( store, LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEDELETE
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, new RGB( 242, 70, 86 ) );// red
+        store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEDELETE
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_STYLE_SUFFIX, SWT.BOLD );
+        PreferenceConverter.setDefault( store, LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEMODDN
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_RGB_SUFFIX, new RGB( 127, 159, 191 ) );// bright
+        // blue
+        store.setDefault( LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_CHANGETYPEMODDN
+            + LdifEditorConstants.PREFERENCE_LDIFEDITOR_SYNTAX_STYLE_SUFFIX, SWT.BOLD );
+    }
+
+}

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/dialogs/LdifEntryEditorDialog.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/dialogs/LdifEntryEditorDialog.java?view=auto&rev=526698
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/dialogs/LdifEntryEditorDialog.java (added)
+++ directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/dialogs/LdifEntryEditorDialog.java Mon Apr  9 02:59:19 2007
@@ -0,0 +1,229 @@
+/*
+ *  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.ldapstudio.ldifeditor.dialogs;
+
+
+import org.apache.directory.ldapstudio.browser.common.widgets.entryeditor.EntryEditorWidget;
+import org.apache.directory.ldapstudio.browser.common.widgets.entryeditor.EntryEditorWidgetActionGroup;
+import org.apache.directory.ldapstudio.browser.common.widgets.entryeditor.EntryEditorWidgetActionGroupWithAttribute;
+import org.apache.directory.ldapstudio.browser.common.widgets.entryeditor.EntryEditorWidgetConfiguration;
+import org.apache.directory.ldapstudio.browser.common.widgets.entryeditor.EntryEditorWidgetUniversalListener;
+import org.apache.directory.ldapstudio.browser.core.internal.model.DummyConnection;
+import org.apache.directory.ldapstudio.browser.core.model.IConnection;
+import org.apache.directory.ldapstudio.browser.core.model.IEntry;
+import org.apache.directory.ldapstudio.browser.core.model.ModelModificationException;
+import org.apache.directory.ldapstudio.browser.core.model.NameException;
+import org.apache.directory.ldapstudio.browser.core.model.ldif.container.LdifChangeAddRecord;
+import org.apache.directory.ldapstudio.browser.core.model.ldif.container.LdifContentRecord;
+import org.apache.directory.ldapstudio.browser.core.model.ldif.container.LdifRecord;
+import org.apache.directory.ldapstudio.browser.core.model.schema.Schema;
+import org.apache.directory.ldapstudio.browser.core.utils.ModelConverter;
+import org.apache.directory.ldapstudio.ldifeditor.LdifEditorActivator;
+import org.apache.directory.ldapstudio.ldifeditor.LdifEditorConstants;
+import org.eclipse.jface.dialogs.Dialog;
+import org.eclipse.jface.dialogs.IDialogConstants;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Shell;
+
+
+public class LdifEntryEditorDialog extends Dialog
+{
+
+    public static final String DIALOG_TITLE = "LDIF Record Editor";
+
+    public static final int MAX_WIDTH = 450;
+
+    public static final int MAX_HEIGHT = 250;
+
+    private IConnection connection;
+
+    private LdifRecord ldifRecord;
+
+    private IEntry entry;
+
+    private EntryEditorWidgetConfiguration configuration;
+
+    private EntryEditorWidgetActionGroup actionGroup;
+
+    private EntryEditorWidget mainWidget;
+
+    private EntryEditorWidgetUniversalListener universalListener;
+
+
+    public LdifEntryEditorDialog( Shell parentShell, IConnection connection, LdifContentRecord ldifRecord )
+    {
+        this( parentShell, connection, ldifRecord, null );
+    }
+
+
+    public LdifEntryEditorDialog( Shell parentShell, IConnection connection, LdifChangeAddRecord ldifRecord )
+    {
+        this( parentShell, connection, ldifRecord, null );
+    }
+
+
+    private LdifEntryEditorDialog( Shell parentShell, IConnection connection, LdifRecord ldifRecord, String s )
+    {
+        super( parentShell );
+        setShellStyle( getShellStyle() | SWT.RESIZE );
+        this.ldifRecord = ldifRecord;
+
+        this.connection = new DummyConnection( ( connection != null && connection.getSchema() != null ) ? connection
+            .getSchema() : Schema.DEFAULT_SCHEMA );
+    }
+
+
+    protected void configureShell( Shell shell )
+    {
+        super.configureShell( shell );
+        shell.setText( DIALOG_TITLE );
+        shell.setImage( LdifEditorActivator.getDefault().getImage( LdifEditorConstants.IMG_BROWSER_LDIFEDITOR ) );
+    }
+
+
+    protected void createButtonsForButtonBar( Composite parent )
+    {
+        createButton( parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false );
+        createButton( parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false );
+
+        getShell().update();
+        getShell().layout( true, true );
+    }
+
+
+    protected void buttonPressed( int buttonId )
+    {
+
+        if ( IDialogConstants.OK_ID == buttonId )
+        {
+            if ( this.ldifRecord instanceof LdifContentRecord )
+            {
+                this.ldifRecord = ModelConverter.entryToLdifContentRecord( entry );
+            }
+            else if ( this.ldifRecord instanceof LdifChangeAddRecord )
+            {
+                this.ldifRecord = ModelConverter.entryToLdifChangeAddRecord( entry );
+            }
+        }
+
+        super.buttonPressed( buttonId );
+    }
+
+
+    public void create()
+    {
+        super.create();
+        // this.actionGroup.activateGlobalActionHandlers();
+    }
+
+
+    public boolean close()
+    {
+        boolean returnValue = super.close();
+        if ( returnValue )
+        {
+            this.dispose();
+        }
+        return returnValue;
+    }
+
+
+    public void dispose()
+    {
+        if ( this.configuration != null )
+        {
+            this.universalListener.dispose();
+            this.universalListener = null;
+            this.mainWidget.dispose();
+            this.mainWidget = null;
+            this.actionGroup.deactivateGlobalActionHandlers();
+            this.actionGroup.dispose();
+            this.actionGroup = null;
+            this.configuration.dispose();
+            this.configuration = null;
+        }
+    }
+
+
+    protected Control createDialogArea( Composite parent )
+    {
+
+        Composite composite = ( Composite ) super.createDialogArea( parent );
+
+        // create configuration
+        this.configuration = new EntryEditorWidgetConfiguration();
+
+        // create main widget
+        this.mainWidget = new EntryEditorWidget( this.configuration );
+        this.mainWidget.createWidget( composite );
+        this.mainWidget.getViewer().getTree().setFocus();
+
+        // create actions
+        this.actionGroup = new EntryEditorWidgetActionGroupWithAttribute( this.mainWidget, this.configuration );
+        this.actionGroup.fillToolBar( this.mainWidget.getToolBarManager() );
+        this.actionGroup.fillMenu( this.mainWidget.getMenuManager() );
+        this.actionGroup.fillContextMenu( this.mainWidget.getContextMenuManager() );
+        this.actionGroup.activateGlobalActionHandlers();
+
+        // create the listener
+        this.universalListener = new EntryEditorWidgetUniversalListener( this.mainWidget.getViewer(), this.actionGroup
+            .getOpenDefaultEditorAction() );
+
+        try
+        {
+
+            if ( ldifRecord instanceof LdifContentRecord )
+            {
+                entry = ModelConverter.ldifContentRecordToEntry( ( LdifContentRecord ) ldifRecord, connection );
+            }
+            else if ( ldifRecord instanceof LdifChangeAddRecord )
+            {
+                entry = ModelConverter.ldifChangeAddRecordToEntry( ( LdifChangeAddRecord ) ldifRecord, connection );
+            }
+
+            if ( entry != null )
+            {
+                this.mainWidget.getViewer().setInput( entry );
+            }
+
+        }
+        catch ( ModelModificationException e )
+        {
+            e.printStackTrace();
+        }
+        catch ( NameException e )
+        {
+            e.printStackTrace();
+        }
+
+        applyDialogFont( composite );
+        return composite;
+    }
+
+
+    public LdifRecord getLdifRecord()
+    {
+        return ldifRecord;
+    }
+
+}

Added: directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/dialogs/preferences/LdifEditorContentAssistPreferencePage.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/dialogs/preferences/LdifEditorContentAssistPreferencePage.java?view=auto&rev=526698
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/dialogs/preferences/LdifEditorContentAssistPreferencePage.java (added)
+++ directory/ldapstudio/trunk/ldapstudio-ldifeditor/src/main/java/org/apache/directory/ldapstudio/ldifeditor/dialogs/preferences/LdifEditorContentAssistPreferencePage.java Mon Apr  9 02:59:19 2007
@@ -0,0 +1,190 @@
+/*
+ *  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.ldapstudio.ldifeditor.dialogs.preferences;
+
+
+import org.apache.directory.ldapstudio.browser.common.widgets.BaseWidgetUtils;
+import org.apache.directory.ldapstudio.browser.core.BrowserCorePlugin;
+import org.apache.directory.ldapstudio.ldifeditor.LdifEditorActivator;
+import org.apache.directory.ldapstudio.ldifeditor.LdifEditorConstants;
+import org.eclipse.jface.preference.PreferencePage;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.events.VerifyListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+
+
+public class LdifEditorContentAssistPreferencePage extends PreferencePage implements IWorkbenchPreferencePage
+{
+
+    private Button insertSingleProposalAutoButton;
+
+    private Button enableAutoActivationButton;
+
+    private Label autoActivationDelayLabel;
+
+    private Text autoActivationDelayText;
+
+    private Label autoActivationDelayMs;
+
+    private Button smartInsertAttributeInModspecButton;
+
+
+    public LdifEditorContentAssistPreferencePage()
+    {
+        super( "Content Assist" );
+        super.setPreferenceStore( LdifEditorActivator.getDefault().getPreferenceStore() );
+    }
+
+
+    public void init( IWorkbench workbench )
+    {
+    }
+
+
+    protected Control createContents( Composite parent )
+    {
+
+        Composite composite = new Composite( parent, SWT.NONE );
+        GridLayout layout = new GridLayout( 1, false );
+        layout.marginWidth = 0;
+        layout.marginHeight = 0;
+        layout.marginLeft = 0;
+        layout.marginRight = 0;
+        layout.marginTop = 0;
+        layout.marginBottom = 0;
+        composite.setLayout( layout );
+        GridData gd = new GridData( GridData.FILL_HORIZONTAL );
+        composite.setLayoutData( gd );
+
+        BaseWidgetUtils.createSpacer( composite, 1 );
+        BaseWidgetUtils.createSpacer( composite, 1 );
+
+        Group caGroup = BaseWidgetUtils.createGroup( BaseWidgetUtils.createColumnContainer( composite, 1, 1 ),
+            "Content Assist", 1 );
+
+        insertSingleProposalAutoButton = BaseWidgetUtils.createCheckbox( caGroup,
+            "Insert single proposal automatically", 1 );
+        insertSingleProposalAutoButton.setSelection( getPreferenceStore().getBoolean(
+            LdifEditorConstants.PREFERENCE_LDIFEDITOR_CONTENTASSIST_INSERTSINGLEPROPOSALAUTO ) );
+
+        enableAutoActivationButton = BaseWidgetUtils.createCheckbox( caGroup, "Enable auto activation", 1 );
+        enableAutoActivationButton.setSelection( getPreferenceStore().getBoolean(
+            LdifEditorConstants.PREFERENCE_LDIFEDITOR_CONTENTASSIST_ENABLEAUTOACTIVATION ) );
+        enableAutoActivationButton.addSelectionListener( new SelectionAdapter()
+        {
+            public void widgetSelected( SelectionEvent e )
+            {
+                checkEnabled();
+            }
+        } );
+
+        Composite autoActivationDelayComposite = BaseWidgetUtils.createColumnContainer( caGroup, 4, 1 );
+        BaseWidgetUtils.createRadioIndent( autoActivationDelayComposite, 1 );
+        autoActivationDelayLabel = BaseWidgetUtils.createLabel( autoActivationDelayComposite, "Auto activation delay:",
+            1 );
+        autoActivationDelayText = BaseWidgetUtils.createText( autoActivationDelayComposite, "", 4, 1 );
+        autoActivationDelayText.setText( getPreferenceStore().getString(
+            LdifEditorConstants.PREFERENCE_LDIFEDITOR_CONTENTASSIST_AUTOACTIVATIONDELAY ) );
+        autoActivationDelayText.addVerifyListener( new VerifyListener()
+        {
+            public void verifyText( VerifyEvent e )
+            {
+                if ( !e.text.matches( "[0-9]*" ) )
+                {
+                    e.doit = false;
+                }
+                if ( "".equals( autoActivationDelayText.getText() ) && e.text.matches( "[0]" ) )
+                {
+                    e.doit = false;
+                }
+            }
+        } );
+        autoActivationDelayMs = BaseWidgetUtils.createLabel( autoActivationDelayComposite, "ms", 1 );
+
+        smartInsertAttributeInModspecButton = BaseWidgetUtils.createCheckbox( caGroup,
+            "Smart insert attribute name in modification items", 1 );
+        smartInsertAttributeInModspecButton.setSelection( getPreferenceStore().getBoolean(
+            LdifEditorConstants.PREFERENCE_LDIFEDITOR_CONTENTASSIST_SMARTINSERTATTRIBUTEINMODSPEC ) );
+        BaseWidgetUtils.createLabel( caGroup, "TODO: Smart insert must attributes", 1 );
+
+        checkEnabled();
+
+        return composite;
+    }
+
+
+    private void checkEnabled()
+    {
+        autoActivationDelayLabel.setEnabled( enableAutoActivationButton.getSelection() );
+        autoActivationDelayText.setEnabled( enableAutoActivationButton.getSelection() );
+        autoActivationDelayMs.setEnabled( enableAutoActivationButton.getSelection() );
+    }
+
+
+    public boolean performOk()
+    {
+
+        getPreferenceStore().setValue( LdifEditorConstants.PREFERENCE_LDIFEDITOR_CONTENTASSIST_INSERTSINGLEPROPOSALAUTO,
+            this.insertSingleProposalAutoButton.getSelection() );
+        getPreferenceStore().setValue( LdifEditorConstants.PREFERENCE_LDIFEDITOR_CONTENTASSIST_ENABLEAUTOACTIVATION,
+            this.enableAutoActivationButton.getSelection() );
+        getPreferenceStore().setValue( LdifEditorConstants.PREFERENCE_LDIFEDITOR_CONTENTASSIST_AUTOACTIVATIONDELAY,
+            this.autoActivationDelayText.getText() );
+        getPreferenceStore().setValue(
+            LdifEditorConstants.PREFERENCE_LDIFEDITOR_CONTENTASSIST_SMARTINSERTATTRIBUTEINMODSPEC,
+            this.smartInsertAttributeInModspecButton.getSelection() );
+
+        BrowserCorePlugin.getDefault().savePluginPreferences();
+
+        return true;
+    }
+
+
+    protected void performDefaults()
+    {
+
+        insertSingleProposalAutoButton.setSelection( getPreferenceStore().getDefaultBoolean(
+            LdifEditorConstants.PREFERENCE_LDIFEDITOR_CONTENTASSIST_INSERTSINGLEPROPOSALAUTO ) );
+        enableAutoActivationButton.setSelection( getPreferenceStore().getDefaultBoolean(
+            LdifEditorConstants.PREFERENCE_LDIFEDITOR_CONTENTASSIST_ENABLEAUTOACTIVATION ) );
+        autoActivationDelayText.setText( getPreferenceStore().getDefaultString(
+            LdifEditorConstants.PREFERENCE_LDIFEDITOR_CONTENTASSIST_AUTOACTIVATIONDELAY ) );
+        smartInsertAttributeInModspecButton.setSelection( getPreferenceStore().getDefaultBoolean(
+            LdifEditorConstants.PREFERENCE_LDIFEDITOR_CONTENTASSIST_SMARTINSERTATTRIBUTEINMODSPEC ) );
+
+        super.performDefaults();
+
+        checkEnabled();
+    }
+
+}



Mime
View raw message