You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by fe...@apache.org on 2007/11/05 18:04:59 UTC
svn commit: r592089 [1/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/...
Author: felixk
Date: Mon Nov 5 09:04:52 2007
New Revision: 592089
URL: http://svn.apache.org/viewvc?rev=592089&view=rev
Log:
Initial studio maven-build
Added:
directory/sandbox/felixk/studio-ldifeditor/ (with props)
directory/sandbox/felixk/studio-ldifeditor/META-INF/
directory/sandbox/felixk/studio-ldifeditor/META-INF/MANIFEST.MF (with props)
directory/sandbox/felixk/studio-ldifeditor/about.ini
directory/sandbox/felixk/studio-ldifeditor/plugin.properties (with props)
directory/sandbox/felixk/studio-ldifeditor/plugin.xml (with props)
directory/sandbox/felixk/studio-ldifeditor/pom.xml (with props)
directory/sandbox/felixk/studio-ldifeditor/src/
directory/sandbox/felixk/studio-ldifeditor/src/main/
directory/sandbox/felixk/studio-ldifeditor/src/main/java/
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorActivator.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorConstants.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorPreferencesInitializer.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/LdifEntryEditorDialog.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/preferences/
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/preferences/LdifEditorContentAssistPreferencePage.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/preferences/LdifEditorPreferencePage.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/preferences/LdifEditorSyntaxColoringPreferencePage.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/preferences/LdifEditorTemplatesPreferencePage.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/ExecuteLdifAction.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/ILdifEditor.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifDocumentProvider.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifDocumentSetupParticipant.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditor.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifEditorContributor.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifOutlinePage.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/LdifSourceViewerConfiguration.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/NonExistingLdifEditorInput.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/PathEditorInput.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/AbstractLdifAction.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/AbstractOpenValueEditorAction.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/EditLdifAttributeAction.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/EditLdifRecordAction.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/FormatLdifDocumentAction.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/FormatLdifRecordAction.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/OpenBestValueEditorAction.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/OpenDefaultValueEditorAction.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/actions/OpenValueEditorAction.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/reconciler/
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/reconciler/LdifAnnotationUpdater.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/reconciler/LdifFoldingRegionUpdater.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/reconciler/LdifReconcilingStrategy.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifAnnotationHover.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifAutoEditStrategy.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifCompletionProcessor.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifDamagerRepairer.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifDoubleClickStrategy.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifExternalAnnotationModel.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifPartitionScanner.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifRecordRule.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifTextHover.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/editor/text/LdifValueRule.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/widgets/
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/widgets/LdifEditorWidget.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/wizards/
directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/wizards/NewLdifFileWizard.java (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/org/
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/org/apache/
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/org/apache/directory/
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/org/apache/directory/studio/
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/org/apache/directory/studio/ldifeditor/
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/org/apache/directory/studio/ldifeditor/messages.properties (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/entry.gif (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/execute.gif (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_add.gif (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_attribute.gif (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_comment.gif (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_delete.gif (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_dn.gif (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_mod_add.gif (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_mod_delete.gif (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_mod_replace.gif (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_modify.gif (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_rename.gif (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldif_value.gif (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldifeditor.gif (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/ldifeditor_new.gif (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/icons/template.gif (with props)
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/templates/
directory/sandbox/felixk/studio-ldifeditor/src/main/resources/resources/templates/templates.xml (with props)
directory/sandbox/felixk/studio-ldifeditor/studio.png (with props)
Propchange: directory/sandbox/felixk/studio-ldifeditor/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Nov 5 09:04:52 2007
@@ -0,0 +1,2 @@
+.settings
+target
Added: directory/sandbox/felixk/studio-ldifeditor/META-INF/MANIFEST.MF
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/META-INF/MANIFEST.MF?rev=592089&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldifeditor/META-INF/MANIFEST.MF (added)
+++ directory/sandbox/felixk/studio-ldifeditor/META-INF/MANIFEST.MF Mon Nov 5 09:04:52 2007
@@ -0,0 +1,31 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Apache Directory Studio LDIF Editor
+Bundle-SymbolicName: org.apache.directory.studio.ldifeditor;singleton:=true
+Bundle-Version: 1.0.1
+Bundle-Activator: org.apache.directory.studio.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.studio.jars,
+ org.apache.directory.studio.connection.core,
+ org.apache.directory.studio.connection.ui,
+ org.apache.directory.studio.ldapbrowser.core,
+ org.apache.directory.studio.ldapbrowser.common
+Eclipse-LazyStart: true
+Export-Package: org.apache.directory.studio.ldifeditor,
+ org.apache.directory.studio.ldifeditor.dialogs,
+ org.apache.directory.studio.ldifeditor.editor,
+ org.apache.directory.studio.ldifeditor.editor.actions,
+ org.apache.directory.studio.ldifeditor.editor.reconciler,
+ org.apache.directory.studio.ldifeditor.editor.text,
+ org.apache.directory.studio.ldifeditor.widgets,
+ org.apache.directory.studio.ldifeditor.wizards
Propchange: directory/sandbox/felixk/studio-ldifeditor/META-INF/MANIFEST.MF
------------------------------------------------------------------------------
svn:eol-style = native
Added: directory/sandbox/felixk/studio-ldifeditor/about.ini
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/about.ini?rev=592089&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldifeditor/about.ini (added)
+++ directory/sandbox/felixk/studio-ldifeditor/about.ini Mon Nov 5 09:04:52 2007
@@ -0,0 +1 @@
+featureImage=studio.png
\ No newline at end of file
Added: directory/sandbox/felixk/studio-ldifeditor/plugin.properties
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/plugin.properties?rev=592089&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldifeditor/plugin.properties (added)
+++ directory/sandbox/felixk/studio-ldifeditor/plugin.properties Mon Nov 5 09:04:52 2007
@@ -0,0 +1,19 @@
+# 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.name=Apache Directory Studio LDIF Editor
+project.version=1.0.1
+project.id=org.apache.directory.studio.ldifeditor
Propchange: directory/sandbox/felixk/studio-ldifeditor/plugin.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: directory/sandbox/felixk/studio-ldifeditor/plugin.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/plugin.xml?rev=592089&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldifeditor/plugin.xml (added)
+++ directory/sandbox/felixk/studio-ldifeditor/plugin.xml Mon Nov 5 09:04:52 2007
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.2"?>
+<plugin>
+ <extension
+ point="org.eclipse.ui.editors">
+ <editor
+ class="org.apache.directory.studio.ldifeditor.editor.LdifEditor"
+ contributorClass="org.apache.directory.studio.ldifeditor.editor.LdifEditorContributor"
+ default="true"
+ extensions="ldif, ldiflog"
+ icon="resources/icons/ldifeditor.gif"
+ id="org.apache.directory.studio.ldifeditor.editor.LdifEditor"
+ name="LDIF Editor"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.newWizards">
+ <wizard
+ canFinishEarly="true"
+ category="org.apache.directory.studio.ldapbrowser.newWizards"
+ class="org.apache.directory.studio.ldifeditor.wizards.NewLdifFileWizard"
+ hasPages="false"
+ icon="resources/icons/ldifeditor_new.gif"
+ id="org.apache.directory.studio.ldifeditor.wizards.NewLdifFileWizard"
+ name="LDIF File"
+ project="false"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.core.runtime.preferences">
+ <initializer class="org.apache.directory.studio.ldifeditor.LdifEditorPreferencesInitializer"/>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.preferencePages">
+ <page
+ class="org.apache.directory.studio.ldifeditor.dialogs.preferences.LdifEditorPreferencePage"
+ id="org.apache.directory.studio.ldifeditor.dialogs.preferences.LdifEditorPreferencePage"
+ name="LDIF Editor">
+ <keywordReference id="org.apache.directory.studio.ldapbrowser.keyword.ldap"/>
+ <keywordReference id="org.apache.directory.studio.ldapbrowser.keyword.ldif"/>
+ </page>
+ <page
+ category="org.apache.directory.studio.ldifeditor.dialogs.preferences.LdifEditorPreferencePage"
+ class="org.apache.directory.studio.ldifeditor.dialogs.preferences.LdifEditorContentAssistPreferencePage"
+ id="org.apache.directory.studio.ldifeditor.dialogs.preferences.LdifEditorContentAssistPreferencePage"
+ name="Content Assist">
+ <keywordReference id="org.apache.directory.studio.ldapbrowser.keyword.ldap"/>
+ <keywordReference id="org.apache.directory.studio.ldapbrowser.keyword.ldif"/>
+ </page>
+ <page
+ category="org.apache.directory.studio.ldifeditor.dialogs.preferences.LdifEditorPreferencePage"
+ class="org.apache.directory.studio.ldifeditor.dialogs.preferences.LdifEditorSyntaxColoringPreferencePage"
+ id="org.apache.directory.studio.ldifeditor.dialogs.preferences.LdifEditorSyntaxColoringPreferencePage"
+ name="Syntax Coloring">
+ <keywordReference id="org.apache.directory.studio.ldapbrowser.keyword.ldap"/>
+ <keywordReference id="org.apache.directory.studio.ldapbrowser.keyword.ldif"/>
+ <keywordReference id="org.apache.directory.studio.ldapbrowser.keyword.colors"/>
+ </page>
+ <page
+ category="org.apache.directory.studio.ldifeditor.dialogs.preferences.LdifEditorPreferencePage"
+ class="org.apache.directory.studio.ldifeditor.dialogs.preferences.LdifEditorTemplatesPreferencePage"
+ id="org.apache.directory.studio.ldifeditor.dialogs.preferences.LdifEditorTemplatesPreferencePage"
+ name="Templates">
+ <keywordReference id="org.apache.directory.studio.ldapbrowser.keyword.ldap"/>
+ <keywordReference id="org.apache.directory.studio.ldapbrowser.keyword.ldif"/>
+ </page>
+ </extension>
+
+ <extension
+ point="org.eclipse.ui.editors.templates">
+ <contextType
+ class="org.eclipse.jface.text.templates.TemplateContextType"
+ id="org.apache.directory.studio.ldifeditor.templates.ldifFile"
+ name="LDIF File"/>
+ <contextType
+ class="org.eclipse.jface.text.templates.TemplateContextType"
+ id="org.apache.directory.studio.ldifeditor.templates.ldifAttrValRecord"
+ name="LDIF Attribute Value Record"/>
+ <contextType
+ class="org.eclipse.jface.text.templates.TemplateContextType"
+ id="org.apache.directory.studio.ldifeditor.templates.ldifModificationRecord"
+ name="LDIF Modification Record"/>
+ <contextType
+ class="org.eclipse.jface.text.templates.TemplateContextType"
+ id="org.apache.directory.studio.ldifeditor.templates.ldifModificationItem"
+ name="LDIF Modification Item"/>
+ <contextType
+ class="org.eclipse.jface.text.templates.TemplateContextType"
+ id="org.apache.directory.studio.ldifeditor.templates.ldifModdnRecord"
+ name="LDIF Moddn Record"/>
+ <include file="resources/templates/templates.xml"/>
+ </extension>
+
+</plugin>
Propchange: directory/sandbox/felixk/studio-ldifeditor/plugin.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: directory/sandbox/felixk/studio-ldifeditor/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/pom.xml?rev=592089&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldifeditor/pom.xml (added)
+++ directory/sandbox/felixk/studio-ldifeditor/pom.xml Mon Nov 5 09:04:52 2007
@@ -0,0 +1,96 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+ 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.
+-->
+<!--
+ @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ @version $Id: pom.xml 353 2007-10-28 14:59:35Z felix $
+-->
+
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <groupId>org.apache.directory.studio</groupId>
+ <artifactId>parent</artifactId>
+ <version>1.0.2-SNAPSHOT</version>
+ </parent>
+ <artifactId>${groupId}.ldifeditor</artifactId>
+ <name>Apache Directory Studio LDIF Editor</name>
+ <packaging>jar</packaging>
+
+ <description></description>
+
+ <!-- Set path for local repository -->
+ <properties>
+ <local-repo>${project.basedir}/../local-repository</local-repo>
+ </properties>
+
+ <build>
+ <resources>
+ <resource>
+ <directory>.</directory>
+ <includes>
+ <include>plugin.properties</include>
+ <include>plugin.xml</include>
+ <include>about.ini</include>
+ <include>studio.png</include>
+ </includes>
+ </resource>
+ <resource>
+ <directory>src/main/resources</directory>
+ </resource>
+ </resources>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jar-plugin</artifactId>
+ <configuration>
+ <archive>
+ <manifestFile>META-INF/MANIFEST.MF</manifestFile>
+ <addMavenDescriptor>false</addMavenDescriptor>
+ </archive>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.directory.studio</groupId>
+ <artifactId>${pom.groupId}.ldapbrowser.common</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.studio</groupId>
+ <artifactId>${pom.groupId}.valueeditors</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse</groupId>
+ <artifactId>org.eclipse.jface</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse</groupId>
+ <artifactId>org.eclipse.core.filebuffers</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse</groupId>
+ <artifactId>org.eclipse.ui.views</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.eclipse</groupId>
+ <artifactId>org.eclipse.core.runtime</artifactId>
+ </dependency>
+ </dependencies>
+</project>
Propchange: directory/sandbox/felixk/studio-ldifeditor/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Added: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorActivator.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorActivator.java?rev=592089&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorActivator.java (added)
+++ directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorActivator.java Mon Nov 5 09:04:52 2007
@@ -0,0 +1,286 @@
+/*
+ * 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;
+
+
+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.studio.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.studio.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;
+ }
+
+}
Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorActivator.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorConstants.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorConstants.java?rev=592089&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorConstants.java (added)
+++ directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorConstants.java Mon Nov 5 09:04:52 2007
@@ -0,0 +1,123 @@
+/*
+ * 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;
+
+public interface LdifEditorConstants
+{
+
+ public static final String ACTION_ID_EDIT_RECORD = "org.apache.directory.studio.ldapbrowser.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.studio.ldifeditor.dialogs.preferences.LdifEditorPreferencePage";
+
+ public static final String PREFERENCEPAGEID_LDIFEDITOR_CONTENTASSIST = "org.apache.directory.studio.ldifeditor.dialogs.preferences.LdifEditorContentAssistPreferencePage";
+
+ public static final String PREFERENCEPAGEID_LDIFEDITOR_SYNTAXCOLORING = "org.apache.directory.studio.ldifeditor.dialogs.preferences.LdifEditorSyntaxColoringPreferencePage";
+
+ public static final String PREFERENCEPAGEID_LDIFEDITOR_TEMPLATES = "org.apache.directory.studio.ldifeditor.dialogs.preferences.TemplatesPreferencePage";
+
+ public static final String LDIF_FILE_TEMPLATE_ID = "org.apache.directory.studio.ldifeditor.templates.ldifFile";
+
+ public static final String LDIF_ATTR_VAL_RECORD_TEMPLATE_ID = "org.apache.directory.studio.ldifeditor.templates.ldifAttrValRecord";
+
+ public static final String LDIF_MODIFICATION_RECORD_TEMPLATE_ID = "org.apache.directory.studio.ldifeditor.templates.ldifModificationRecord";
+
+ public static final String LDIF_MODIFICATION_ITEM_TEMPLATE_ID = "org.apache.directory.studio.ldifeditor.templates.ldifModificationItem";
+
+ public static final String LDIF_MODDN_RECORD_TEMPLATE_ID = "org.apache.directory.studio.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";
+
+
+
+}
Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorConstants.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorPreferencesInitializer.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorPreferencesInitializer.java?rev=592089&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorPreferencesInitializer.java (added)
+++ directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorPreferencesInitializer.java Mon Nov 5 09:04:52 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.studio.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 );
+ }
+
+}
Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/LdifEditorPreferencesInitializer.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/LdifEntryEditorDialog.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/LdifEntryEditorDialog.java?rev=592089&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/LdifEntryEditorDialog.java (added)
+++ directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/LdifEntryEditorDialog.java Mon Nov 5 09:04:52 2007
@@ -0,0 +1,243 @@
+/*
+ * 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.dialogs;
+
+
+import javax.naming.InvalidNameException;
+
+import org.apache.directory.studio.ldapbrowser.common.BrowserCommonConstants;
+import org.apache.directory.studio.ldapbrowser.common.widgets.entryeditor.EntryEditorWidget;
+import org.apache.directory.studio.ldapbrowser.common.widgets.entryeditor.EntryEditorWidgetActionGroup;
+import org.apache.directory.studio.ldapbrowser.common.widgets.entryeditor.EntryEditorWidgetActionGroupWithAttribute;
+import org.apache.directory.studio.ldapbrowser.common.widgets.entryeditor.EntryEditorWidgetConfiguration;
+import org.apache.directory.studio.ldapbrowser.common.widgets.entryeditor.EntryEditorWidgetUniversalListener;
+import org.apache.directory.studio.ldapbrowser.core.model.IBrowserConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.IEntry;
+import org.apache.directory.studio.ldapbrowser.core.model.impl.DummyConnection;
+import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifChangeAddRecord;
+import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifContentRecord;
+import org.apache.directory.studio.ldapbrowser.core.model.ldif.container.LdifRecord;
+import org.apache.directory.studio.ldapbrowser.core.model.schema.Schema;
+import org.apache.directory.studio.ldapbrowser.core.utils.ModelConverter;
+import org.apache.directory.studio.ldifeditor.LdifEditorActivator;
+import org.apache.directory.studio.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;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.contexts.IContextActivation;
+import org.eclipse.ui.contexts.IContextService;
+
+
+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 IBrowserConnection connection;
+
+ private LdifRecord ldifRecord;
+
+ private IEntry entry;
+
+ private EntryEditorWidgetConfiguration configuration;
+
+ private EntryEditorWidgetActionGroup actionGroup;
+
+ private EntryEditorWidget mainWidget;
+
+ private EntryEditorWidgetUniversalListener universalListener;
+
+ /** Token used to activate and deactivate shortcuts in the editor */
+ private IContextActivation contextActivation;
+
+
+ public LdifEntryEditorDialog( Shell parentShell, IBrowserConnection connection, LdifContentRecord ldifRecord )
+ {
+ this( parentShell, connection, ldifRecord, null );
+ }
+
+
+ public LdifEntryEditorDialog( Shell parentShell, IBrowserConnection connection, LdifChangeAddRecord ldifRecord )
+ {
+ this( parentShell, connection, ldifRecord, null );
+ }
+
+
+ private LdifEntryEditorDialog( Shell parentShell, IBrowserConnection 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;
+
+ if ( contextActivation != null )
+ {
+ IContextService contextService = ( IContextService ) PlatformUI.getWorkbench().getAdapter(
+ IContextService.class );
+ contextService.deactivateContext( contextActivation );
+ contextActivation = 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() );
+ IContextService contextService = ( IContextService ) PlatformUI.getWorkbench().getAdapter(
+ IContextService.class );
+ contextActivation = contextService.activateContext( BrowserCommonConstants.CONTEXT_DIALOGS );
+ 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 ( InvalidNameException e )
+ {
+ e.printStackTrace();
+ }
+
+ applyDialogFont( composite );
+ return composite;
+ }
+
+
+ public LdifRecord getLdifRecord()
+ {
+ return ldifRecord;
+ }
+
+}
Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/LdifEntryEditorDialog.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/preferences/LdifEditorContentAssistPreferencePage.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/preferences/LdifEditorContentAssistPreferencePage.java?rev=592089&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/preferences/LdifEditorContentAssistPreferencePage.java (added)
+++ directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/preferences/LdifEditorContentAssistPreferencePage.java Mon Nov 5 09:04:52 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.studio.ldifeditor.dialogs.preferences;
+
+
+import org.apache.directory.studio.ldapbrowser.common.widgets.BaseWidgetUtils;
+import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
+import org.apache.directory.studio.ldifeditor.LdifEditorActivator;
+import org.apache.directory.studio.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();
+ }
+
+}
Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/preferences/LdifEditorContentAssistPreferencePage.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/preferences/LdifEditorPreferencePage.java
URL: http://svn.apache.org/viewvc/directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/preferences/LdifEditorPreferencePage.java?rev=592089&view=auto
==============================================================================
--- directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/preferences/LdifEditorPreferencePage.java (added)
+++ directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/preferences/LdifEditorPreferencePage.java Mon Nov 5 09:04:52 2007
@@ -0,0 +1,202 @@
+/*
+ * 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.dialogs.preferences;
+
+
+import org.apache.directory.studio.ldapbrowser.common.dialogs.preferences.TextFormatsPreferencePage;
+import org.apache.directory.studio.ldapbrowser.common.widgets.BaseWidgetUtils;
+import org.apache.directory.studio.ldapbrowser.core.BrowserCorePlugin;
+import org.apache.directory.studio.ldifeditor.LdifEditorActivator;
+import org.apache.directory.studio.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.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.Link;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchPreferencePage;
+import org.eclipse.ui.dialogs.PreferencesUtil;
+
+
+public class LdifEditorPreferencePage extends PreferencePage implements IWorkbenchPreferencePage
+{
+
+ // private Button autoWrapButton;
+
+ private Button enableFoldingButton;
+
+ private Label initiallyFoldLabel;
+
+ private Button initiallyFoldCommentsButton;
+
+ private Button initiallyFoldRecordsButton;
+
+ private Button initiallyFoldWrappedLinesButton;
+
+ private Button useLdifDoubleClickButton;
+
+
+ public LdifEditorPreferencePage()
+ {
+ super( "LDIF Editor" );
+ 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 );
+ composite.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+
+ String text = "See <a>Text Editors</a> for the general text editor preferences.";
+ Link link = BaseWidgetUtils.createLink( composite, text, 1 );
+ link.addSelectionListener( new SelectionAdapter()
+ {
+ public void widgetSelected( SelectionEvent e )
+ {
+ PreferencesUtil.createPreferenceDialogOn( getShell(),
+ "org.eclipse.ui.preferencePages.GeneralTextEditor", null, null ); //$NON-NLS-1$
+ }
+ } );
+ String text2 = "See <a>Text Formats</a> for LDIF format preferences.";
+ Link link2 = BaseWidgetUtils.createLink( composite, text2, 1 );
+ link2.addSelectionListener( new SelectionAdapter()
+ {
+ public void widgetSelected( SelectionEvent e )
+ {
+ PreferencesUtil.createPreferenceDialogOn( getShell(), TextFormatsPreferencePage.class.getName(), null,
+ null ); //$NON-NLS-1$
+ }
+ } );
+
+ BaseWidgetUtils.createSpacer( composite, 1 );
+ BaseWidgetUtils.createSpacer( composite, 1 );
+
+ Group foldGroup = BaseWidgetUtils.createGroup( BaseWidgetUtils.createColumnContainer( composite, 1, 1 ),
+ "Folding", 1 );
+
+ enableFoldingButton = BaseWidgetUtils.createCheckbox( foldGroup, "Enable Folding", 1 );
+ enableFoldingButton.setSelection( getPreferenceStore().getBoolean(
+ LdifEditorConstants.PREFERENCE_LDIFEDITOR_FOLDING_ENABLE ) );
+ enableFoldingButton.addSelectionListener( new SelectionAdapter()
+ {
+ public void widgetSelected( SelectionEvent e )
+ {
+ checkEnabled();
+ }
+ } );
+
+ Composite initiallyFoldComposiste = BaseWidgetUtils.createColumnContainer( foldGroup, 4, 1 );
+ initiallyFoldLabel = BaseWidgetUtils.createLabel( initiallyFoldComposiste, "Initially fold:", 1 );
+ initiallyFoldCommentsButton = BaseWidgetUtils.createCheckbox( initiallyFoldComposiste, "Comments", 1 );
+ initiallyFoldCommentsButton.setSelection( getPreferenceStore().getBoolean(
+ LdifEditorConstants.PREFERENCE_LDIFEDITOR_FOLDING_INITIALLYFOLDCOMMENTS ) );
+ initiallyFoldRecordsButton = BaseWidgetUtils.createCheckbox( initiallyFoldComposiste, "Records", 1 );
+ initiallyFoldRecordsButton.setSelection( getPreferenceStore().getBoolean(
+ LdifEditorConstants.PREFERENCE_LDIFEDITOR_FOLDING_INITIALLYFOLDRECORDS ) );
+ initiallyFoldWrappedLinesButton = BaseWidgetUtils.createCheckbox( initiallyFoldComposiste, "Wrapped lines", 1 );
+ initiallyFoldWrappedLinesButton.setSelection( getPreferenceStore().getBoolean(
+ LdifEditorConstants.PREFERENCE_LDIFEDITOR_FOLDING_INITIALLYFOLDWRAPPEDLINES ) );
+
+ BaseWidgetUtils.createSpacer( composite, 1 );
+
+ Group doubleClickGroup = BaseWidgetUtils.createGroup( BaseWidgetUtils.createColumnContainer( composite, 1, 1 ),
+ "Double Click Behaviour", 1 );
+ useLdifDoubleClickButton = BaseWidgetUtils.createCheckbox( doubleClickGroup,
+ "Select whole attribute or value on double click", 1 );
+ useLdifDoubleClickButton.setSelection( getPreferenceStore().getBoolean(
+ LdifEditorConstants.PREFERENCE_LDIFEDITOR_DOUBLECLICK_USELDIFDOUBLECLICK ) );
+
+ checkEnabled();
+
+ return composite;
+ }
+
+
+ private void checkEnabled()
+ {
+ initiallyFoldLabel.setEnabled( enableFoldingButton.getSelection() );
+ initiallyFoldCommentsButton.setEnabled( enableFoldingButton.getSelection() );
+ initiallyFoldRecordsButton.setEnabled( enableFoldingButton.getSelection() );
+ initiallyFoldWrappedLinesButton.setEnabled( enableFoldingButton.getSelection() );
+ }
+
+
+ public boolean performOk()
+ {
+ getPreferenceStore().setValue( LdifEditorConstants.PREFERENCE_LDIFEDITOR_FOLDING_ENABLE,
+ this.enableFoldingButton.getSelection() );
+ getPreferenceStore().setValue( LdifEditorConstants.PREFERENCE_LDIFEDITOR_FOLDING_INITIALLYFOLDCOMMENTS,
+ this.initiallyFoldCommentsButton.getSelection() );
+ getPreferenceStore().setValue( LdifEditorConstants.PREFERENCE_LDIFEDITOR_FOLDING_INITIALLYFOLDRECORDS,
+ this.initiallyFoldRecordsButton.getSelection() );
+ getPreferenceStore().setValue( LdifEditorConstants.PREFERENCE_LDIFEDITOR_FOLDING_INITIALLYFOLDWRAPPEDLINES,
+ this.initiallyFoldWrappedLinesButton.getSelection() );
+
+ getPreferenceStore().setValue( LdifEditorConstants.PREFERENCE_LDIFEDITOR_DOUBLECLICK_USELDIFDOUBLECLICK,
+ this.useLdifDoubleClickButton.getSelection() );
+
+ BrowserCorePlugin.getDefault().savePluginPreferences();
+
+ return true;
+ }
+
+
+ protected void performDefaults()
+ {
+ enableFoldingButton.setSelection( getPreferenceStore().getDefaultBoolean(
+ LdifEditorConstants.PREFERENCE_LDIFEDITOR_FOLDING_ENABLE ) );
+ initiallyFoldCommentsButton.setSelection( getPreferenceStore().getDefaultBoolean(
+ LdifEditorConstants.PREFERENCE_LDIFEDITOR_FOLDING_INITIALLYFOLDCOMMENTS ) );
+ initiallyFoldRecordsButton.setSelection( getPreferenceStore().getDefaultBoolean(
+ LdifEditorConstants.PREFERENCE_LDIFEDITOR_FOLDING_INITIALLYFOLDRECORDS ) );
+ initiallyFoldWrappedLinesButton.setSelection( getPreferenceStore().getDefaultBoolean(
+ LdifEditorConstants.PREFERENCE_LDIFEDITOR_FOLDING_INITIALLYFOLDWRAPPEDLINES ) );
+
+ useLdifDoubleClickButton.setSelection( getPreferenceStore().getDefaultBoolean(
+ LdifEditorConstants.PREFERENCE_LDIFEDITOR_DOUBLECLICK_USELDIFDOUBLECLICK ) );
+
+ super.performDefaults();
+
+ checkEnabled();
+ }
+
+}
Propchange: directory/sandbox/felixk/studio-ldifeditor/src/main/java/org/apache/directory/studio/ldifeditor/dialogs/preferences/LdifEditorPreferencePage.java
------------------------------------------------------------------------------
svn:eol-style = native