directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r491621 - in /directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors: ./ internal/
Date Mon, 01 Jan 2007 20:17:45 GMT
Author: seelmann
Date: Mon Jan  1 12:17:44 2007
New Revision: 491621

URL: http://svn.apache.org/viewvc?view=rev&rev=491621
Log:
Javadoc, formatting, some minor modificatons

Modified:
    directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/AbstractDialogBinaryValueEditor.java
    directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/AbstractDialogStringValueEditor.java
    directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/AbstractDialogValueEditor.java
    directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/AbstractInPlaceStringValueEditor.java
    directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/IValueEditor.java
    directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/AddressValueEditor.java
    directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/DnValueEditor.java
    directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/HexValueEditor.java
    directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ImageValueEditor.java
    directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/InPlaceGeneralizedTimeValueEditor.java
    directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/InPlaceTextValueEditor.java
    directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/MultivaluedValueEditor.java
    directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ObjectClassValueEditor.java
    directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/PasswordValueEditor.java
    directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/TextValueEditor.java
    directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ValueEditorManager.java

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/AbstractDialogBinaryValueEditor.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/AbstractDialogBinaryValueEditor.java?view=diff&rev=491621&r1=491620&r2=491621
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/AbstractDialogBinaryValueEditor.java
(original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/AbstractDialogBinaryValueEditor.java
Mon Jan  1 12:17:44 2007
@@ -205,7 +205,7 @@
         }
     }
 
-    
+
     /**
      * {@inheritDoc}
      */

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/AbstractDialogStringValueEditor.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/AbstractDialogStringValueEditor.java?view=diff&rev=491621&r1=491620&r2=491621
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/AbstractDialogStringValueEditor.java
(original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/AbstractDialogStringValueEditor.java
Mon Jan  1 12:17:44 2007
@@ -107,8 +107,8 @@
 
     /**
      * This implementation returns the value itself if it is
-     * of type byte[] or a byte[] with the UTF-8 encoded string
-     * value if it is of type String.  
+     * of type String. If the value is of type byte[] then the binary
+     * data is converted to a String using UTF-8 encoding.  
      */
     public Object getRawValue( IConnection connection, Object value )
     {

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/AbstractDialogValueEditor.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/AbstractDialogValueEditor.java?view=diff&rev=491621&r1=491620&r2=491621
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/AbstractDialogValueEditor.java
(original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/AbstractDialogValueEditor.java
Mon Jan  1 12:17:44 2007
@@ -248,6 +248,7 @@
         this.name = name;
     }
 
+
     /**
      * {@inheritDoc}
      */
@@ -256,6 +257,7 @@
         return name;
     }
 
+
     /**
      * {@inheritDoc}
      */
@@ -263,6 +265,7 @@
     {
         this.imageDescriptor = imageDescriptor;
     }
+
 
     /**
      * {@inheritDoc}

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/AbstractInPlaceStringValueEditor.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/AbstractInPlaceStringValueEditor.java?view=diff&rev=491621&r1=491620&r2=491621
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/AbstractInPlaceStringValueEditor.java
(original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/AbstractInPlaceStringValueEditor.java
Mon Jan  1 12:17:44 2007
@@ -58,13 +58,14 @@
      *             createValue(), deleteValue() and modifyValue().
      */
     private TextValueEditor delegate;
-    
+
     /** The name of this value editor */
     private String name;
 
     /** The image of this value editor */
     private ImageDescriptor imageDescriptor;
 
+
     protected AbstractInPlaceStringValueEditor()
     {
         super();
@@ -182,8 +183,8 @@
             return null;
         }
     }
-    
-    
+
+
     /**
      * Small helper.
      */
@@ -239,7 +240,7 @@
         }
     }
 
-    
+
     /**
      * This implementation always return the string value
      * as String.
@@ -260,6 +261,7 @@
         }
     }
 
+
     public CellEditor getCellEditor()
     {
         return this;
@@ -290,6 +292,7 @@
         this.name = name;
     }
 
+
     /**
      * {@inheritDoc}
      */
@@ -298,6 +301,7 @@
         return name;
     }
 
+
     /**
      * {@inheritDoc}
      */
@@ -306,6 +310,7 @@
         this.imageDescriptor = imageDescriptor;
     }
 
+
     /**
      * {@inheritDoc}
      */
@@ -342,6 +347,7 @@
         delegate.deleteValue( oldValue );
     }
 
+
     /**
      * {@inheritDoc}
      */
@@ -349,5 +355,5 @@
     {
         delegate.modifyValue( oldValue, newRawValue );
     }
-    
+
 }

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/IValueEditor.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/IValueEditor.java?view=diff&rev=491621&r1=491620&r2=491621
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/IValueEditor.java
(original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/IValueEditor.java
Mon Jan  1 12:17:44 2007
@@ -124,10 +124,10 @@
      */
     public abstract Object getRawValue( IConnection connecton, Object stringOrBinaryValue
);
 
-    
+
     /**
      * Returns the String or binary byte[] value of the given raw value. 
-     * The return value is used to create or modify the value
+     * The return value is used to create,  modify or delete the value
      * in directory.
      * <p>
      * This method is called after editing has been finished. The 
@@ -146,8 +146,8 @@
      * @return the editors name
      */
     public abstract String getValueEditorName();
-    
-    
+
+
     /**
      * Sets the editors name. 
      * 
@@ -167,8 +167,8 @@
      * @return the editors image
      */
     public abstract ImageDescriptor getValueEditorImageDescriptor();
-    
-    
+
+
     /**
      * Sets the editors image.
      * 
@@ -180,7 +180,7 @@
      */
     public abstract void setValueEditorImageDescriptor( ImageDescriptor imageDescriptor );
 
-    
+
     /**
      * Creates the attribute with the given value at the entry.
      * 
@@ -193,7 +193,8 @@
      * @throws ModelModificationException
      * @deprecated This functionality will be removed from IValueEditor soon.
      */
-    public abstract void createValue( IEntry entry, String attributeDescription, Object newRawValue
) throws ModelModificationException;
+    public abstract void createValue( IEntry entry, String attributeDescription, Object newRawValue
)
+        throws ModelModificationException;
 
 
     /**
@@ -242,8 +243,8 @@
      * @param parent the parent control
      */
     public abstract void create( Composite parent );
-    
-    
+
+
     /**
      * Disposes of this value editor and frees any associated SWT resources.
      */

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/AddressValueEditor.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/AddressValueEditor.java?view=diff&rev=491621&r1=491620&r2=491621
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/AddressValueEditor.java
(original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/AddressValueEditor.java
Mon Jan  1 12:17:44 2007
@@ -28,15 +28,21 @@
 import org.eclipse.swt.widgets.Shell;
 
 
+/**
+ * Implementation of IValueEditor for syntax 1.3.6.1.4.1.1466.115.121.1.41 
+ * (Postal Address). In the displayed value the $ separators are replaced
+ * by commas. In the opened AddressDialog the $ separators are recplaced by 
+ * line breaks.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class AddressValueEditor extends AbstractDialogStringValueEditor
 {
 
-    public AddressValueEditor()
-    {
-        super();
-    }
-
-
+    /**
+     * This implementation opens the AddressDialog.
+     */
     protected boolean openDialog( Shell shell )
     {
         Object value = getValue();
@@ -53,6 +59,9 @@
     }
 
 
+    /**
+     * This implementatiosn replaces the $ separators by commas.
+     */
     public String getDisplayValue( IValue value )
     {
         String displayValue = super.getDisplayValue( value );

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/DnValueEditor.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/DnValueEditor.java?view=diff&rev=491621&r1=491620&r2=491621
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/DnValueEditor.java
(original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/DnValueEditor.java
Mon Jan  1 12:17:44 2007
@@ -32,15 +32,19 @@
 import org.eclipse.swt.widgets.Shell;
 
 
+/**
+ * Implementation of IValueEditor for syntax 1.3.6.1.4.1.1466.115.121.1.12 
+ * (Distinguished Name). 
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class DnValueEditor extends AbstractDialogStringValueEditor
 {
 
-    public DnValueEditor()
-    {
-        super();
-    }
-
-
+    /**
+     * This implementation opens the DnDialog.
+     */
     protected boolean openDialog( Shell shell )
     {
         Object value = getValue();
@@ -58,30 +62,39 @@
     }
 
 
-    public Object getRawValue( AttributeHierarchy ah )
+    /**
+     * Returns a DnValueEditorRawValueWrapper with the connection of 
+     * the attribute hierarchy and a null DN if there are no values
+     * in attributeHierarchy.
+     * 
+     * Returns a DnValueEditorRawValueWrapper with the connection of 
+     * the attribute hierarchy and a DN if there is one value
+     * in attributeHierarchy.
+     */
+    public Object getRawValue( AttributeHierarchy attributeHierarchy )
     {
-        if ( ah == null )
+        if ( attributeHierarchy == null )
         {
             return null;
         }
-        else if ( ah.size() == 1 && ah.getAttribute().getValueSize() == 0 )
+        else if ( attributeHierarchy.size() == 1 && attributeHierarchy.getAttribute().getValueSize()
== 0 )
         {
-            IConnection connection = ah.getAttribute().getEntry().getConnection();
+            IConnection connection = attributeHierarchy.getAttribute().getEntry().getConnection();
             DN dn = null;
             return new DnValueEditorRawValueWrapper( connection, dn );
         }
-        else if ( ah.size() == 1 && ah.getAttribute().getValueSize() == 1 )
+        else if ( attributeHierarchy.size() == 1 && attributeHierarchy.getAttribute().getValueSize()
== 1 )
         {
-            IConnection connection = ah.getAttribute().getEntry().getConnection();
-            DN dn = null;
+            IConnection connection = attributeHierarchy.getAttribute().getEntry().getConnection();
             try
             {
-                dn = new DN( getDisplayValue( ah ) );
+                DN dn = new DN( getDisplayValue( attributeHierarchy ) );
+                return new DnValueEditorRawValueWrapper( connection, dn );
             }
             catch ( NameException e )
             {
+                return new DnValueEditorRawValueWrapper( connection, null );
             }
-            return new DnValueEditorRawValueWrapper( connection, dn );
         }
         else
         {
@@ -90,30 +103,41 @@
     }
 
 
+    /**
+     * Returns a DnValueEditorRawValueWrapper with the connection of 
+     * the value and a DN build from the given value. 
+     * 
+     * If the value doesn't contain a valid DN a DnValueEditorRawValueWrapper
+     * with a null DN is returned.
+     */
     public Object getRawValue( IValue value )
     {
-        IConnection connection = value.getAttribute().getEntry().getConnection();
-
-        DN dn = null;
-        if ( value.isEmpty() )
-        {
-            dn = null;
-        }
-        else
+        Object o = super.getRawValue( value );
+        if ( o != null && o instanceof String )
         {
+            IConnection connection = value.getAttribute().getEntry().getConnection();
             try
             {
-                dn = new DN( getDisplayValue( value ) );
+                DN dn = new DN( ( String ) o );
+                return new DnValueEditorRawValueWrapper( connection, dn );
             }
             catch ( NameException e )
             {
+                return new DnValueEditorRawValueWrapper( connection, null );
             }
         }
 
-        return new DnValueEditorRawValueWrapper( connection, dn );
+        return null;
     }
 
 
+    /**
+     * Returns a DnValueEditorRawValueWrapper with the given 
+     * connection and a DN build from the given value.
+     * 
+     * If the value doesn't contain a valid DN a DnValueEditorRawValueWrapper
+     * with a null DN is returned.
+     */
     public Object getRawValue( IConnection connection, Object value )
     {
         Object o = super.getRawValue( connection, value );
@@ -126,6 +150,7 @@
             }
             catch ( NameException e )
             {
+                return new DnValueEditorRawValueWrapper( connection, null );
             }
         }
 
@@ -133,6 +158,12 @@
     }
 
 
+    /**
+     * Returns always the string value.
+     * 
+     * Reimplementation, because getRawValue() returns a 
+     * DnValueEditorRawValueWrapper.
+     */
     public String getDisplayValue( IValue value )
     {
         if ( value == null )
@@ -144,14 +175,29 @@
         return displayValue;
     }
 
-    class DnValueEditorRawValueWrapper
-    {
-        IConnection connection;
-
-        DN dn;
-
-
-        public DnValueEditorRawValueWrapper( IConnection connection, DN dn )
+    /**
+     * The DnValueEditorRawValueWrapper is used to pass contextual 
+     * information to the opened DnDialog.
+     *
+     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+     * @version $Rev$, $Date$
+     */
+    private class DnValueEditorRawValueWrapper
+    {
+        /** The connection, used in DnDialog to browse for an entry */
+        private IConnection connection;
+
+        /** The DN, used as initial value in DnDialog */
+        private DN dn;
+
+
+        /**
+         * Creates a new instance of DnValueEditorRawValueWrapper.
+         *
+         * @param connection the connection
+         * @param dn the DN
+         */
+        private DnValueEditorRawValueWrapper( IConnection connection, DN dn )
         {
             this.connection = connection;
             this.dn = dn;

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/HexValueEditor.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/HexValueEditor.java?view=diff&rev=491621&r1=491620&r2=491621
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/HexValueEditor.java
(original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/HexValueEditor.java
Mon Jan  1 12:17:44 2007
@@ -8,6 +8,10 @@
 
 /**
  * The default editor for binary values. Uses the HexDialog.
+ * 
+ * The HexDialog is currently only able to save and load binary data
+ * to and from file. It is not possible to edit the data in the dialog
+ * directly.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
@@ -15,12 +19,9 @@
 public class HexValueEditor extends AbstractDialogBinaryValueEditor
 {
 
-    public HexValueEditor()
-    {
-        super();
-    }
-
-
+    /**
+     * This implementation opens the HexDialog.
+     */
     protected boolean openDialog( Shell shell )
     {
         Object value = getValue();

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ImageValueEditor.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ImageValueEditor.java?view=diff&rev=491621&r1=491620&r2=491621
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ImageValueEditor.java
(original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ImageValueEditor.java
Mon Jan  1 12:17:44 2007
@@ -29,15 +29,19 @@
 import org.eclipse.swt.widgets.Shell;
 
 
+/**
+ * Implementation of IValueEditor for syntax 1.3.6.1.4.1.1466.115.121.1.28 
+ * (JPEG). 
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class ImageValueEditor extends AbstractDialogBinaryValueEditor
 {
 
-    public ImageValueEditor()
-    {
-        super();
-    }
-
-
+    /**
+     * This implementation opens the ImageDialog.
+     */
     protected boolean openDialog( Shell shell )
     {
         Object value = getValue();
@@ -57,6 +61,10 @@
     }
 
 
+    /**
+     * Returns the image info text created by 
+     * ImageDialog.getImageInfo().
+     */
     public String getDisplayValue( IValue value )
     {
         if ( showRawValues() )
@@ -69,7 +77,7 @@
             {
                 return "NULL";
             }
-            if ( value.isBinary() )
+            else if ( value.isBinary() )
             {
                 byte[] data = value.getBinaryValue();
                 String text = ImageDialog.getImageInfo( data );

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/InPlaceGeneralizedTimeValueEditor.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/InPlaceGeneralizedTimeValueEditor.java?view=diff&rev=491621&r1=491620&r2=491621
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/InPlaceGeneralizedTimeValueEditor.java
(original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/InPlaceGeneralizedTimeValueEditor.java
Mon Jan  1 12:17:44 2007
@@ -26,37 +26,33 @@
 import java.text.SimpleDateFormat;
 import java.util.Date;
 
-import org.apache.directory.ldapstudio.browser.core.model.AttributeHierarchy;
 import org.apache.directory.ldapstudio.browser.core.model.IValue;
 import org.apache.directory.ldapstudio.browser.ui.valueeditors.AbstractInPlaceStringValueEditor;
 
 
+/**
+ * Implementation of IValueEditor for syntax 1.3.6.1.4.1.1466.115.121.1.24 
+ * (Generalized Time). 
+ * 
+ * Currently only the getDisplayXXX() methods are implemented.
+ * For modification the raw string must be edited.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class InPlaceGeneralizedTimeValueEditor extends AbstractInPlaceStringValueEditor
 {
 
-    public InPlaceGeneralizedTimeValueEditor()
-    {
-        super();
-    }
-
-
-    public String getDisplayValue( AttributeHierarchy ah )
-    {
-        if ( ah == null )
-        {
-            return "NULL";
-        }
-        else if ( ah.size() == 1 && ah.getAttribute().getValueSize() == 1 )
-        {
-            return getDisplayValue( ah.getAttribute().getValues()[0] );
-        }
-        else
-        {
-            return "not displayable";
-        }
-    }
-
-
+    /**
+     * Returns the proper formatted date and time, Timezone is 
+     * convertet to the default locale. 
+     * 
+     * Can handle 
+     * <ul>
+     * <li>default LDAP format: yyyyMMddHHmmssZ
+     * <li>Active Directory format: yyyyMMddHHmmss.SSSZ
+     * </ul>  
+     */
     public String getDisplayValue( IValue value )
     {
         String displayValue = super.getDisplayValue( value );

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/InPlaceTextValueEditor.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/InPlaceTextValueEditor.java?view=diff&rev=491621&r1=491620&r2=491621
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/InPlaceTextValueEditor.java
(original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/InPlaceTextValueEditor.java
Mon Jan  1 12:17:44 2007
@@ -24,12 +24,13 @@
 import org.apache.directory.ldapstudio.browser.ui.valueeditors.AbstractInPlaceStringValueEditor;
 
 
+/**
+ * The default editor for string values.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class InPlaceTextValueEditor extends AbstractInPlaceStringValueEditor
 {
-
-    public InPlaceTextValueEditor()
-    {
-        super();
-    }
 
 }

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/MultivaluedValueEditor.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/MultivaluedValueEditor.java?view=diff&rev=491621&r1=491620&r2=491621
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/MultivaluedValueEditor.java
(original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/MultivaluedValueEditor.java
Mon Jan  1 12:17:44 2007
@@ -41,6 +41,12 @@
 import org.eclipse.swt.widgets.Control;
 
 
+/**
+ * Special ValueEditor to handle attributes with multiple values in a dialog.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class MultivaluedValueEditor extends CellEditor implements IValueEditor, ModelModifier
 {
 
@@ -56,10 +62,17 @@
     /** The image of this value editor */
     private ImageDescriptor imageDescriptor;
 
-    /** The value editor manager, used to get proper value editor */
+    /** The value editor manager, used to get proper value editors */
     protected ValueEditorManager valueEditorManager;
 
 
+    /**
+     * Creates a new instance of MultivaluedValueEditor.
+     *
+     * @param parent the parent composite
+     * @param valueEditorManager the value editor manager, used to get
+     *                           proper value editors
+     */
     public MultivaluedValueEditor( Composite parent, ValueEditorManager valueEditorManager
)
     {
         super( parent );
@@ -68,29 +81,45 @@
     }
 
 
+    /**
+     * This is a dialog editor, it doesn't create a control. 
+     */
     protected Control createControl( Composite parent )
     {
         return null;
     }
 
 
-    protected Object doGetValue()
+    /**
+     * Returns the value object stored in a member.
+     */
+    protected final Object doGetValue()
     {
         return this.value;
     }
 
 
+    /**
+     * This is a dialog editor, doesn't set focus. 
+     */
     protected void doSetFocus()
     {
     }
 
 
+    /**
+     * Stores the value object in a member.
+     */
     protected void doSetValue( Object value )
     {
         this.value = value;
     }
 
 
+    /**
+     * Opens the MulitvaluedDialog. Expects that an AttributeHierarchy
+     * object is in value member. 
+     */
     public void activate()
     {
         if ( this.getValue() != null && this.getValue() instanceof AttributeHierarchy
)
@@ -107,17 +136,24 @@
     }
 
 
+    /**
+     * Returns this.
+     */
     public CellEditor getCellEditor()
     {
         return this;
     }
 
 
-    public String getDisplayValue( AttributeHierarchy ah )
+    /**
+     * This implementation of getDisplayValue() returns a 
+     * comma-separated list of all values. 
+     */
+    public String getDisplayValue( AttributeHierarchy attributeHierarchy )
     {
 
         List<IValue> valueList = new ArrayList<IValue>();
-        for ( Iterator it = ah.iterator(); it.hasNext(); )
+        for ( Iterator it = attributeHierarchy.iterator(); it.hasNext(); )
         {
             IAttribute attribute = ( IAttribute ) it.next();
             valueList.addAll( Arrays.asList( attribute.getValues() ) );
@@ -138,74 +174,117 @@
     }
 
 
+    /**
+     * It doesn't make sense to use the MultivaluedValueEditor with a single value.
+     * Returns an empty string.
+     */
     public String getDisplayValue( IValue value )
     {
         return "";
     }
 
 
-    public Object getRawValue( AttributeHierarchy ah )
+    /**
+     * Returns the attributeHierarchy.
+     */
+    public Object getRawValue( AttributeHierarchy attributeHierarchy )
     {
-        return ah;
+        return attributeHierarchy;
     }
 
 
+    /**
+     * It doesn't make sense to use the MultivaluedValueEditor with a single value.
+     * Returns null.
+     */
     public Object getRawValue( IValue value )
     {
         return null;
     }
 
 
+    /**
+     * It doesn't make sense to use the MultivaluedValueEditor with a single value.
+     * Returns null.
+     */
     public Object getRawValue( IConnection connection, Object value )
     {
         return null;
     }
 
 
+    /**
+     * Modification is performed in the concrete single-ValueEditors.
+     */
     public void modifyValue( IValue oldValue, Object newRawValue ) throws ModelModificationException
     {
     }
 
 
+    /**
+     * Creationg is performed in the concrete single-ValueEditors.
+     */
     public void createValue( IEntry entry, String attributeName, Object newRawValue ) throws
ModelModificationException
     {
     }
 
 
+    /**
+     * Deletion is performed in the concrete single-ValueEditors.
+     */
     public void deleteAttribute( AttributeHierarchy ah ) throws ModelModificationException
     {
     }
 
 
+    /**
+     * Deletion is performed in the concrete single-ValueEditors.
+     */
     public void deleteValue( IValue oldValue ) throws ModelModificationException
     {
     }
 
 
+    /**
+     * Modification is performed in the concrete single-ValueEditors. No need 
+     * to return a value.
+     */
     public Object getStringOrBinaryValue( Object rawValue )
     {
         return null;
     }
 
 
+    /*
+     * @see org.apache.directory.ldapstudio.browser.ui.valueeditors.IValueEditor#setValueEditorName(java.lang.String)
+     */
     public void setValueEditorName( String name )
     {
         this.name = name;
     }
 
 
+    /*
+     * @see org.apache.directory.ldapstudio.browser.ui.valueeditors.IValueEditor#getValueEditorName()
+     */
     public String getValueEditorName()
     {
         return name;
     }
 
 
+    /*
+     * @see org.apache.directory.ldapstudio.browser.ui.valueeditors.IValueEditor#setValueEditorImageDescriptor(org.eclipse.jface.resource.ImageDescriptor)
+     */
     public void setValueEditorImageDescriptor( ImageDescriptor imageDescriptor )
     {
         this.imageDescriptor = imageDescriptor;
     }
 
 
+    /*
+     * @see org.apache.directory.ldapstudio.browser.ui.valueeditors.IValueEditor#getValueEditorImageDescriptor()
+     */
     public ImageDescriptor getValueEditorImageDescriptor()
     {
         return imageDescriptor;

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ObjectClassValueEditor.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ObjectClassValueEditor.java?view=diff&rev=491621&r1=491620&r2=491621
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ObjectClassValueEditor.java
(original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ObjectClassValueEditor.java
Mon Jan  1 12:17:44 2007
@@ -32,23 +32,25 @@
 import org.eclipse.swt.widgets.Shell;
 
 
-public class ObjectClassValueEditor extends AbstractDialogStringValueEditor 
+/**
+ * Implementation of IValueEditor for attribute objectClass.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
+public class ObjectClassValueEditor extends AbstractDialogStringValueEditor
 {
 
-    public ObjectClassValueEditor()
-    {
-        super();
-    }
-
-
+    /**
+     * This implementation opens the ObjectClassDialog.
+     */
     public boolean openDialog( Shell shell )
     {
         Object value = getValue();
         if ( value != null && value instanceof ObjectClassValueEditorRawValueWrapper
)
         {
             ObjectClassValueEditorRawValueWrapper wrapper = ( ObjectClassValueEditorRawValueWrapper
) value;
-            ObjectClassDialog dialog = new ObjectClassDialog( shell, wrapper.schema,
-                wrapper.value );
+            ObjectClassDialog dialog = new ObjectClassDialog( shell, wrapper.schema, wrapper.objectClass
);
             if ( dialog.open() == TextDialog.OK && !"".equals( dialog.getObjectClass()
) )
             {
                 setValue( dialog.getObjectClass() );
@@ -59,16 +61,23 @@
     }
 
 
+    /**
+     * This implementation appends the kind of object class,
+     * on of structural, abstract, auxiliary or obsolete. 
+     * 
+     * Reimplementation, because getRawValue() returns a 
+     * ObjectClassValueEditorRawValueWrapper.
+     */
     public String getDisplayValue( IValue value )
     {
-        if(getRawValue( value ) == null)
+        if ( getRawValue( value ) == null )
         {
             return "NULL";
         }
-        
+
         String displayValue = value.getStringValue();
-        
-        if(!showRawValues())
+
+        if ( !showRawValues() )
         {
             Schema schema = value.getAttribute().getEntry().getConnection().getSchema();
             ObjectClassDescription ocd = schema.getObjectClassDescription( displayValue );
@@ -89,17 +98,24 @@
                 displayValue = displayValue + " (obsolete)";
             }
         }
-        
+
         return displayValue;
     }
 
 
-    public Object getRawValue( AttributeHierarchy ah )
+    /**
+     * Returns null.
+     * Modification in search result editor not supported.
+     */
+    public Object getRawValue( AttributeHierarchy attributeHierarchy )
     {
         return null;
     }
 
 
+    /**
+     * Returns a ObjectClassValueEditorRawValueWrapper.
+     */
     public Object getRawValue( IValue value )
     {
         if ( value == null || !value.isString() || !value.getAttribute().isObjectClassAttribute()
)
@@ -113,6 +129,9 @@
     }
 
 
+    /**
+     * Returns a ObjectClassValueEditorRawValueWrapper.
+     */
     public Object getRawValue( IConnection connection, Object value )
     {
         Schema schema = null;
@@ -130,19 +149,36 @@
         return wrapper;
     }
 
-
-    class ObjectClassValueEditorRawValueWrapper
-    {
-        Schema schema;
-
-        String value;
-
-
-        public ObjectClassValueEditorRawValueWrapper( Schema schema, String value )
+    /**
+     * The ObjectClassValueEditorRawValueWrapper is used to pass contextual 
+     * information to the opened ObjectClassDialog.
+     *
+     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+     * @version $Rev$, $Date$
+     */
+    private class ObjectClassValueEditorRawValueWrapper
+    {
+        /** 
+         * The schema, used in ObjectClassDialog to build the list
+         * with possible object classes.
+         */
+        private Schema schema;
+
+        /** The object class, used as initial value in ObjectClassDialog. */
+        private String objectClass;
+
+
+        /**
+         * Creates a new instance of ObjectClassValueEditorRawValueWrapper.
+         *
+         * @param schema the schema
+         * @param objectClass the object class
+         */
+        private ObjectClassValueEditorRawValueWrapper( Schema schema, String objectClass
)
         {
             super();
             this.schema = schema;
-            this.value = value;
+            this.objectClass = objectClass;
         }
     }
 

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/PasswordValueEditor.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/PasswordValueEditor.java?view=diff&rev=491621&r1=491620&r2=491621
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/PasswordValueEditor.java
(original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/PasswordValueEditor.java
Mon Jan  1 12:17:44 2007
@@ -21,7 +21,6 @@
 package org.apache.directory.ldapstudio.browser.ui.valueeditors.internal;
 
 
-import org.apache.directory.ldapstudio.browser.core.model.AttributeHierarchy;
 import org.apache.directory.ldapstudio.browser.core.model.IAttribute;
 import org.apache.directory.ldapstudio.browser.core.model.IConnection;
 import org.apache.directory.ldapstudio.browser.core.model.IEntry;
@@ -32,15 +31,18 @@
 import org.eclipse.swt.widgets.Shell;
 
 
+/**
+ * Implementation of IValueEditor for attribute userPassword.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class PasswordValueEditor extends AbstractDialogBinaryValueEditor
 {
 
-    public PasswordValueEditor()
-    {
-        super();
-    }
-
-
+    /**
+     * This implementation opens the PasswordDialog.
+     */
     protected boolean openDialog( Shell shell )
     {
         Object value = getValue();
@@ -62,6 +64,12 @@
     }
 
 
+    /**
+     * This implementation returns information about the 
+     * used hash algorithm. The value stored in directory
+     * is only display when the showRawValues option is 
+     * active.
+     */
     public String getDisplayValue( IValue value )
     {
         if ( showRawValues() )
@@ -100,21 +108,21 @@
             }
         }
     }
- 
-    
-    protected Object getEmptyRawValue( IAttribute attribute )
-    {
-        return new PasswordValueEditorRawValueWrapper( new byte[0], attribute.getEntry()
);
-    }
 
 
-    public Object getRawValue( AttributeHierarchy ah )
+    /**
+     * Returns a PasswordValueEditorRawValueWrapper with empty 
+     * password.
+     */
+    protected Object getEmptyRawValue( IAttribute attribute )
     {
-        Object wrapper = super.getRawValue( ah );
-        return wrapper;
+        return new PasswordValueEditorRawValueWrapper( new byte[0], attribute.getEntry()
);
     }
 
 
+    /**
+     * Returns a PasswordValueEditorRawValueWrapper.
+     */
     public Object getRawValue( IValue value )
     {
         Object password = super.getRawValue( value );
@@ -122,19 +130,39 @@
     }
 
 
+    /**
+     * Returns a PasswordValueEditorRawValueWrapper with 
+     * null entry.
+     */
     public Object getRawValue( IConnection connection, Object value )
     {
         Object password = super.getRawValue( connection, value );
         return new PasswordValueEditorRawValueWrapper( password, null );
     }
 
-    class PasswordValueEditorRawValueWrapper
-    {
-        Object password;
-        IEntry entry;
-
-
-        public PasswordValueEditorRawValueWrapper( Object password, IEntry entry )
+    /**
+     * The PasswordValueEditorRawValueWrapper is used to pass contextual 
+     * information to the opened PasswordDialog.
+     *
+     * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+     * @version $Rev$, $Date$
+     */
+    private class PasswordValueEditorRawValueWrapper
+    {
+        /** The password, used as initial value in PasswordDialog */
+        private Object password;
+
+        /** The entry, used for the bind operation in PasswordDialog */
+        private IEntry entry;
+
+
+        /**
+         * Creates a new instance of PasswordValueEditorRawValueWrapper.
+         *
+         * @param password the password
+         * @param entry the entry
+         */
+        private PasswordValueEditorRawValueWrapper( Object password, IEntry entry )
         {
             this.password = password;
             this.entry = entry;

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/TextValueEditor.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/TextValueEditor.java?view=diff&rev=491621&r1=491620&r2=491621
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/TextValueEditor.java
(original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/TextValueEditor.java
Mon Jan  1 12:17:44 2007
@@ -26,15 +26,18 @@
 import org.eclipse.swt.widgets.Shell;
 
 
+/**
+ * The default editor for string values.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class TextValueEditor extends AbstractDialogStringValueEditor
 {
 
-    public TextValueEditor()
-    {
-        super();
-    }
-
-
+    /**
+     * This implementation opens the TextDialog.
+     */
     public boolean openDialog( Shell shell )
     {
         Object value = getValue();

Modified: directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ValueEditorManager.java
URL: http://svn.apache.org/viewvc/directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ValueEditorManager.java?view=diff&rev=491621&r1=491620&r2=491621
==============================================================================
--- directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ValueEditorManager.java
(original)
+++ directory/trunks/ldapstudio/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/valueeditors/internal/ValueEditorManager.java
Mon Jan  1 12:17:44 2007
@@ -397,7 +397,7 @@
      * Returns alternative value editors for the given value. For now these
      * are the three default editors.
      *
-     * @param value the value
+     * @param objectClass the value
      * @return lternative value editors
      */
     public IValueEditor[] getAlternativeValueEditors( AttributeHierarchy ah )



Mime
View raw message