directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1459333 - in /directory/studio/trunk/plugins/valueeditors: ./ resources/icons/ src/main/java/org/apache/directory/studio/valueeditors/bool/
Date Thu, 21 Mar 2013 14:32:21 GMT
Author: pamarcelot
Date: Thu Mar 21 14:32:21 2013
New Revision: 1459333

URL: http://svn.apache.org/r1459333
Log:
Fix for DIRSTUDIO-888 (Improve editing of boolean values to allow lowercased values and shortcuts).

Added:
    directory/studio/trunk/plugins/valueeditors/resources/icons/booleaneditor.gif   (with
props)
    directory/studio/trunk/plugins/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/bool/
    directory/studio/trunk/plugins/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/bool/InPlaceBooleanValueEditor.java
Modified:
    directory/studio/trunk/plugins/valueeditors/plugin.properties
    directory/studio/trunk/plugins/valueeditors/plugin.xml
    directory/studio/trunk/plugins/valueeditors/plugin_de.properties
    directory/studio/trunk/plugins/valueeditors/plugin_fr.properties

Modified: directory/studio/trunk/plugins/valueeditors/plugin.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/valueeditors/plugin.properties?rev=1459333&r1=1459332&r2=1459333&view=diff
==============================================================================
--- directory/studio/trunk/plugins/valueeditors/plugin.properties (original)
+++ directory/studio/trunk/plugins/valueeditors/plugin.properties Thu Mar 21 14:32:21 2013
@@ -43,4 +43,6 @@ ValueEditor_InPlaceMsAdObjectGuidValueEd
 
 ValueEditor_InPlaceMsAdObjectSidValueEditor_name=MS AD SID Editor
 
-ValueEditor_CertificateValueEditor_name=Certificate Editor
\ No newline at end of file
+ValueEditor_CertificateValueEditor_name=Certificate Editor
+
+ValueEditor_InPlaceBooleanValueEditor_name=Boolean Editor
\ No newline at end of file

Modified: directory/studio/trunk/plugins/valueeditors/plugin.xml
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/valueeditors/plugin.xml?rev=1459333&r1=1459332&r2=1459333&view=diff
==============================================================================
--- directory/studio/trunk/plugins/valueeditors/plugin.xml (original)
+++ directory/studio/trunk/plugins/valueeditors/plugin.xml Thu Mar 21 14:32:21 2013
@@ -124,6 +124,12 @@
        <attribute attributeType="cACertificate"/>
        <attribute attributeType="ndsCrossCertificatePair"/>
     </valueEditor>
+    <valueEditor
+          class="org.apache.directory.studio.valueeditors.bool.InPlaceBooleanValueEditor"
+          icon="resources/icons/booleaneditor.gif"
+          name="%ValueEditor_InPlaceBooleanValueEditor_name">
+       <syntax syntaxOID="1.3.6.1.4.1.1466.115.121.1.7"/>
+    </valueEditor>
    </extension>
 
 </plugin>

Modified: directory/studio/trunk/plugins/valueeditors/plugin_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/valueeditors/plugin_de.properties?rev=1459333&r1=1459332&r2=1459333&view=diff
==============================================================================
--- directory/studio/trunk/plugins/valueeditors/plugin_de.properties (original)
+++ directory/studio/trunk/plugins/valueeditors/plugin_de.properties Thu Mar 21 14:32:21 2013
@@ -35,4 +35,6 @@ ValueEditor_InPlaceMsAdObjectGuidValueEd
 
 ValueEditor_InPlaceMsAdObjectSidValueEditor_name=MS AD SID Editor
 
-ValueEditor_CertificateValueEditor_name=Zertifikats-Editor
\ No newline at end of file
+ValueEditor_CertificateValueEditor_name=Zertifikats-Editor
+
+ValueEditor_InPlaceBooleanValueEditor_name=Boolean Editor
\ No newline at end of file

Modified: directory/studio/trunk/plugins/valueeditors/plugin_fr.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/valueeditors/plugin_fr.properties?rev=1459333&r1=1459332&r2=1459333&view=diff
==============================================================================
--- directory/studio/trunk/plugins/valueeditors/plugin_fr.properties (original)
+++ directory/studio/trunk/plugins/valueeditors/plugin_fr.properties Thu Mar 21 14:32:21 2013
@@ -16,16 +16,31 @@
 # under the License.
 
 ValueEditor_PasswordValueEditor_name=Editeur de mot de passe
+
 ValueEditor_ImageValueEditor_name=Editeur d'image
+
 ValueEditor_GeneralizedTimeValueEditor_name=Editeur de date et heure
+
 ValueEditor_ActiveDirectoryTimeValueEditor_name=Editeur de date et heure MS AD
+
 ValueEditor_ObjectClassValueEditor_name=Editeur d'object class
+
 ValueEditor_DnValueEditor_name=Editeur de DN
+
 ValueEditor_AddressValueEditor_name=Editeur d'addresse
+
 ValueEditor_IntegerValueEditor_name=Editeur de nombre entier
+
 ValueEditor_AdministrativeRoleValueEditor_name=Editeur de r\u00F4le d'administration
+
 ValueEditor_InPlaceOidValueEditor_name=Editeur d'OID
+
 ValueEditor_InPlaceEntryUUIDValueEditor_name=Editeur d'EntryUUID
+
 ValueEditor_InPlaceMsAdObjectGuidValueEditor_name=Editeur MS AD GUID
+
 ValueEditor_InPlaceMsAdObjectSidValueEditor_name=Editeur MS AD SID
-ValueEditor_CertificateValueEditor_name=Editeur de certificat
\ No newline at end of file
+
+ValueEditor_CertificateValueEditor_name=Editeur de certificat
+
+ValueEditor_InPlaceBooleanValueEditor_name=Editeur de booléen
\ No newline at end of file

Added: directory/studio/trunk/plugins/valueeditors/resources/icons/booleaneditor.gif
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/valueeditors/resources/icons/booleaneditor.gif?rev=1459333&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/studio/trunk/plugins/valueeditors/resources/icons/booleaneditor.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/studio/trunk/plugins/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/bool/InPlaceBooleanValueEditor.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/bool/InPlaceBooleanValueEditor.java?rev=1459333&view=auto
==============================================================================
--- directory/studio/trunk/plugins/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/bool/InPlaceBooleanValueEditor.java
(added)
+++ directory/studio/trunk/plugins/valueeditors/src/main/java/org/apache/directory/studio/valueeditors/bool/InPlaceBooleanValueEditor.java
Thu Mar 21 14:32:21 2013
@@ -0,0 +1,77 @@
+/*
+ *  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.valueeditors.bool;
+
+
+import org.apache.directory.studio.valueeditors.AbstractInPlaceStringValueEditor;
+
+
+/**
+ * Implementation of IValueEditor for syntax 1.3.6.1.4.1.1466.115.121.1.7 
+ * (Boolean syntax).
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class InPlaceBooleanValueEditor extends AbstractInPlaceStringValueEditor
+{
+    /** The 'TRUE' value */
+    private static final String TRUE = "TRUE";
+
+    /** The 'FALSE' value */
+    private static final String FALSE = "FALSE";
+
+
+    /**
+     * {@inheritDoc}
+     */
+    protected Object doGetValue()
+    {
+        Object value = super.doGetValue();
+
+        if ( value instanceof String )
+        {
+            String stringValue = ( String ) value;
+
+            if ( "".equals( stringValue ) )
+            {
+                return null;
+            }
+            else if ( "TRUE".equalsIgnoreCase( stringValue )
+                || "T".equalsIgnoreCase( stringValue )
+                || "YES".equalsIgnoreCase( stringValue )
+                || "Y".equalsIgnoreCase( stringValue )
+                || "1".equalsIgnoreCase( stringValue ) )
+            {
+                return TRUE;
+            }
+            else if ( "FALSE".equalsIgnoreCase( stringValue )
+                || "F".equalsIgnoreCase( stringValue )
+                || "NO".equalsIgnoreCase( stringValue )
+                || "N".equalsIgnoreCase( stringValue )
+                || "0".equalsIgnoreCase( stringValue ) )
+            {
+                return FALSE;
+            }
+        }
+
+        return value;
+    }
+}



Mime
View raw message