directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r517413 - /directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/
Date Mon, 12 Mar 2007 21:46:35 GMT
Author: seelmann
Date: Mon Mar 12 14:46:34 2007
New Revision: 517413

URL: http://svn.apache.org/viewvc?view=rev&rev=517413
Log:
Code cleaning and Javadocs.

Removed:
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/AbstractEntryEditorListenerAction.java
Modified:
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidget.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetCellModifier.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetConfiguration.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetContentProvider.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetFilter.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetLabelProvider.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetPreferences.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetQuickFilterWidget.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetSorter.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetSorterDialog.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetTableMetadata.java

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidget.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidget.java?view=diff&rev=517413&r1=517412&r2=517413
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidget.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidget.java Mon Mar 12 14:46:34 2007
@@ -21,7 +21,11 @@
 package org.apache.directory.ldapstudio.browser.ui.widgets.entryeditor;
 
 
+import org.apache.directory.ldapstudio.browser.ui.dialogs.LdifEntryEditorDialog;
+import org.apache.directory.ldapstudio.browser.ui.dialogs.MultivaluedDialog;
+import org.apache.directory.ldapstudio.browser.ui.editors.entry.EntryEditor;
 import org.apache.directory.ldapstudio.browser.ui.widgets.ViewFormWidget;
+import org.apache.directory.ldapstudio.browser.ui.wizards.NewEntryAttributesWizardPage;
 import org.eclipse.jface.viewers.CellEditor;
 import org.eclipse.jface.viewers.TreeViewer;
 import org.eclipse.swt.SWT;
@@ -34,53 +38,76 @@
 import org.eclipse.swt.widgets.TreeColumn;
 
 
+/**
+ * The EntryEditorWidget is a reusable widget to display and edit the attributes of an entry.
+ * It is used by {@link EntryEditor}, {@link MultivaluedDialog}, 
+ * {@link LdifEntryEditorDialog} and {@link NewEntryAttributesWizardPage}. 
+ * 
+ * It provides a context menu and a local toolbar with actions to
+ * manage attributes. Further there is an instant search feature to filter 
+ * the visible attributes.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class EntryEditorWidget extends ViewFormWidget
 {
 
+    /** The configuration. */
     private EntryEditorWidgetConfiguration configuration;
 
+    /** The quick filter widget. */
     private EntryEditorWidgetQuickFilterWidget quickFilterWidget;
 
+    /** The tree. */
     private Tree tree;
 
+    /** The viewer. */
     private TreeViewer viewer;
 
 
+    /**
+     * Creates a new instance of EntryEditorWidget.
+     * 
+     * @param configuration the configuration
+     */
     public EntryEditorWidget( EntryEditorWidgetConfiguration configuration )
     {
         this.configuration = configuration;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     protected Control createContent( Composite parent )
     {
-
-        this.quickFilterWidget = new EntryEditorWidgetQuickFilterWidget( this.configuration.getFilter(), this );
-        this.quickFilterWidget.createComposite( parent );
+        quickFilterWidget = new EntryEditorWidgetQuickFilterWidget( configuration.getFilter(), this );
+        quickFilterWidget.createComposite( parent );
 
         // create tree widget and viewer
-        this.tree = new Tree( parent, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION
+        tree = new Tree( parent, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.FULL_SELECTION
             | SWT.HIDE_SELECTION );
         GridData data = new GridData( GridData.FILL_BOTH );
         data.widthHint = 450;
         data.heightHint = 250;
-        this.tree.setLayoutData( data );
-        this.tree.setHeaderVisible( true );
-        this.tree.setLinesVisible( true );
-        this.viewer = new TreeViewer( this.tree );
-        this.viewer.setUseHashlookup( true );
+        tree.setLayoutData( data );
+        tree.setHeaderVisible( true );
+        tree.setLinesVisible( true );
+        viewer = new TreeViewer( tree );
+        viewer.setUseHashlookup( true );
 
         // set tree columns
         for ( int i = 0; i < EntryEditorWidgetTableMetadata.COLUM_NAMES.length; i++ )
         {
-            TreeColumn column = new TreeColumn( this.tree, SWT.LEFT, i );
+            TreeColumn column = new TreeColumn( tree, SWT.LEFT, i );
             column.setText( EntryEditorWidgetTableMetadata.COLUM_NAMES[i] );
             column.setWidth( 200 );
             column.setResizable( true );
 
         }
-        this.viewer.setColumnProperties( EntryEditorWidgetTableMetadata.COLUM_NAMES );
-        this.tree.addControlListener( new ControlAdapter()
+        viewer.setColumnProperties( EntryEditorWidgetTableMetadata.COLUM_NAMES );
+        tree.addControlListener( new ControlAdapter()
         {
             public void controlResized( ControlEvent e )
             {
@@ -98,67 +125,88 @@
         } );
 
         // setup sorter, filter and layout
-        this.configuration.getSorter().connect( this.viewer );
-        this.configuration.getFilter().connect( this.viewer );
-        this.configuration.getPreferences().connect( this.viewer );
+        configuration.getSorter().connect( viewer );
+        configuration.getFilter().connect( viewer );
+        configuration.getPreferences().connect( viewer );
 
         // setup providers
-        this.viewer.setContentProvider( configuration.getContentProvider( this ) );
-        this.viewer.setLabelProvider( configuration.getLabelProvider( this.viewer ) );
+        viewer.setContentProvider( configuration.getContentProvider( this ) );
+        viewer.setLabelProvider( configuration.getLabelProvider( viewer ) );
 
         // set table cell editors
-        this.viewer.setCellModifier( configuration.getCellModifier( this.viewer ) );
+        viewer.setCellModifier( configuration.getCellModifier( viewer ) );
         CellEditor[] editors = new CellEditor[EntryEditorWidgetTableMetadata.COLUM_NAMES.length];
-        this.viewer.setCellEditors( editors );
+        viewer.setCellEditors( editors );
 
-        return this.tree;
+        return tree;
 
     }
 
 
+    /**
+     * Sets the focus to the tree viewer.
+     */
     public void setFocus()
     {
-        this.viewer.getTree().setFocus();
+        viewer.getTree().setFocus();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void dispose()
     {
-        if ( this.viewer != null )
+        if ( viewer != null )
         {
-            this.configuration.dispose();
-            this.configuration = null;
+            configuration.dispose();
+            configuration = null;
 
-            if ( this.quickFilterWidget != null )
+            if ( quickFilterWidget != null )
             {
-                this.quickFilterWidget.dispose();
-                this.quickFilterWidget = null;
+                quickFilterWidget.dispose();
+                quickFilterWidget = null;
             }
 
-            this.tree.dispose();
-            this.tree = null;
-            this.viewer = null;
+            tree.dispose();
+            tree = null;
+            viewer = null;
         }
 
         super.dispose();
     }
 
 
+    /**
+     * Gets the viewer.
+     * 
+     * @return the viewer
+     */
     public TreeViewer getViewer()
     {
         return viewer;
     }
 
 
+    /**
+     * Gets the quick filter widget.
+     * 
+     * @return the quick filter widget
+     */
     public EntryEditorWidgetQuickFilterWidget getQuickFilterWidget()
     {
         return quickFilterWidget;
     }
 
 
+    /**
+     * Enables or disables this widget.
+     *
+     * @param enabled true to enable this widget, false to disable this widget
+     */
     public void setEnabled( boolean enabled )
     {
-        this.tree.setEnabled( enabled );
+        tree.setEnabled( enabled );
     }
 
 }

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetCellModifier.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetCellModifier.java?view=diff&rev=517413&r1=517412&r2=517413
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetCellModifier.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetCellModifier.java Mon Mar 12 14:46:34 2007
@@ -25,31 +25,49 @@
 import org.apache.directory.ldapstudio.browser.core.model.ModelModificationException;
 import org.apache.directory.ldapstudio.browser.core.model.schema.SchemaUtils;
 import org.apache.directory.ldapstudio.browser.ui.valueeditors.internal.ValueEditorManager;
-
 import org.eclipse.jface.dialogs.MessageDialog;
 import org.eclipse.jface.viewers.ICellModifier;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.swt.widgets.Item;
 
 
+/**
+ * The EntryEditorWidgetCellModifier implements the {@link ICellModifier} interface
+ * for the entry editor widget.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class EntryEditorWidgetCellModifier implements ICellModifier
 {
 
+    /** The value editor manager. */
     private ValueEditorManager valueEditorManager;
 
 
+    /**
+     * Creates a new instance of EntryEditorWidgetCellModifier.
+     *
+     * @param valueEditorManager
+     */
     public EntryEditorWidgetCellModifier( ValueEditorManager valueEditorManager )
     {
         this.valueEditorManager = valueEditorManager;
     }
 
 
+    /**
+     * Disposes this object.
+     */
     public void dispose()
     {
-        this.valueEditorManager = null;
+        valueEditorManager = null;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean canModify( Object element, String property )
     {
         if ( element != null && element instanceof IValue )
@@ -78,6 +96,9 @@
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public Object getValue( Object element, String property )
     {
         if ( element != null && element instanceof IValue )
@@ -106,9 +127,13 @@
     }
 
 
+    /**
+     * {@inheritDoc}
+     * 
+     * TODO: Remove value modification from value editors 
+     */
     public void modify( Object element, String property, Object newRawValue )
     {
-
         if ( element != null && element instanceof Item )
         {
             element = ( ( Item ) element ).getData();
@@ -118,11 +143,7 @@
         {
             IValue attributeValue = ( IValue ) element;
 
-            if ( EntryEditorWidgetTableMetadata.KEY_COLUMN_NAME.equals( property ) )
-            {
-                // no modification
-            }
-            else if ( EntryEditorWidgetTableMetadata.VALUE_COLUMN_NAME.equals( property ) )
+            if ( EntryEditorWidgetTableMetadata.VALUE_COLUMN_NAME.equals( property ) )
             {
                 try
                 {
@@ -135,14 +156,6 @@
                         .getMessage() );
                 }
             }
-            else
-            {
-                // no modification
-            }
-        }
-        else
-        {
-            ;
         }
     }
 

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetConfiguration.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetConfiguration.java?view=diff&rev=517413&r1=517412&r2=517413
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetConfiguration.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetConfiguration.java Mon Mar 12 14:46:34 2007
@@ -25,127 +25,219 @@
 import org.eclipse.jface.viewers.TreeViewer;
 
 
+/**
+ * The BrowserConfiguration contains the content provider, 
+ * label provider, sorter, filter the context menu manager and the
+ * preferences for the browser widget. 
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class EntryEditorWidgetConfiguration
 {
 
+    /** The disposed flag */
     private boolean disposed = false;
 
+    /** The sorter. */
     protected EntryEditorWidgetSorter sorter;
 
+    /** The filter. */
     protected EntryEditorWidgetFilter filter;
 
+    /** The preferences. */
     protected EntryEditorWidgetPreferences preferences;
 
+    /** The content provider. */
     protected EntryEditorWidgetContentProvider contentProvider;
 
+    /** The label provider. */
     protected EntryEditorWidgetLabelProvider labelProvider;
 
+    /** The cell modifier. */
     protected EntryEditorWidgetCellModifier cellModifier;
 
+    /** The value editor manager. */
     protected ValueEditorManager valueEditorManager;
 
 
+    /**
+     * Creates a new instance of EntryEditorWidgetConfiguration.
+     */
     public EntryEditorWidgetConfiguration()
     {
     }
 
 
+    /**
+     * Disposes this configuration.
+     */
     public void dispose()
     {
-        if ( !this.disposed )
+        if ( !disposed )
         {
+            if ( sorter != null )
+            {
+                sorter.dispose();
+                sorter = null;
+            }
+
+            if ( filter != null )
+            {
+                filter.dispose();
+                filter = null;
+            }
+
+            if ( preferences != null )
+            {
+                preferences.dispose();
+                preferences = null;
+            }
+
+            if ( contentProvider != null )
+            {
+                contentProvider.dispose();
+                contentProvider = null;
+            }
+
+            if ( labelProvider != null )
+            {
+                labelProvider.dispose();
+                labelProvider = null;
+            }
+
+            if ( cellModifier != null )
+            {
+                cellModifier.dispose();
+                cellModifier = null;
+            }
+
+            if ( valueEditorManager != null )
+            {
+                valueEditorManager.dispose();
+                valueEditorManager = null;
+            }
 
-            if ( this.sorter != null )
-                this.sorter.dispose();
-            this.sorter = null;
-
-            if ( this.filter != null )
-                this.filter.dispose();
-            this.filter = null;
-
-            if ( this.preferences != null )
-                this.preferences.dispose();
-            this.preferences = null;
-
-            if ( this.contentProvider != null )
-                this.contentProvider.dispose();
-            this.contentProvider = null;
-
-            if ( this.labelProvider != null )
-                this.labelProvider.dispose();
-            this.labelProvider = null;
-
-            if ( this.cellModifier != null )
-                this.cellModifier.dispose();
-            this.cellModifier = null;
-
-            if ( this.valueEditorManager != null )
-                this.valueEditorManager.dispose();
-            this.valueEditorManager = null;
-
-            this.disposed = true;
+            disposed = true;
         }
     }
 
 
+    /**
+     * Gets the content provider.
+     * 
+     * @param mainWidget the main widget
+     * 
+     * @return the content provider
+     */
     public EntryEditorWidgetContentProvider getContentProvider( EntryEditorWidget mainWidget )
     {
-        if ( this.contentProvider == null )
-            this.contentProvider = new EntryEditorWidgetContentProvider( this.getPreferences(), mainWidget );
+        if ( contentProvider == null )
+        {
+            contentProvider = new EntryEditorWidgetContentProvider( getPreferences(), mainWidget );
+        }
 
         return contentProvider;
     }
 
 
+    /**
+     * Gets the label provider.
+     * 
+     * @param viewer the viewer
+     * 
+     * @return the label provider
+     */
     public EntryEditorWidgetLabelProvider getLabelProvider( TreeViewer viewer )
     {
-        if ( this.labelProvider == null )
-            this.labelProvider = new EntryEditorWidgetLabelProvider( this.getValueEditorManager( viewer ) );
+        if ( labelProvider == null )
+        {
+            labelProvider = new EntryEditorWidgetLabelProvider( getValueEditorManager( viewer ) );
+        }
 
         return labelProvider;
     }
 
 
+    /**
+     * Gets the cell modifier.
+     * 
+     * @param viewer the viewer
+     * 
+     * @return the cell modifier
+     */
     public EntryEditorWidgetCellModifier getCellModifier( TreeViewer viewer )
     {
-        if ( this.cellModifier == null )
-            this.cellModifier = new EntryEditorWidgetCellModifier( this.getValueEditorManager( viewer ) );
+        if ( cellModifier == null )
+        {
+            cellModifier = new EntryEditorWidgetCellModifier( getValueEditorManager( viewer ) );
+        }
 
         return cellModifier;
     }
 
 
+    /**
+     * Gets the value editor manager.
+     * 
+     * @param viewer the viewer
+     * 
+     * @return the value editor manager
+     */
     public ValueEditorManager getValueEditorManager( TreeViewer viewer )
     {
-        if ( this.valueEditorManager == null )
-            this.valueEditorManager = new ValueEditorManager( viewer.getTree() );
+        if ( valueEditorManager == null )
+        {
+            valueEditorManager = new ValueEditorManager( viewer.getTree() );
+        }
 
         return valueEditorManager;
     }
 
 
+    /**
+     * Gets the sorter.
+     * 
+     * @return the sorter
+     */
     public EntryEditorWidgetSorter getSorter()
     {
-        if ( this.sorter == null )
-            this.sorter = new EntryEditorWidgetSorter( getPreferences() );
+        if ( sorter == null )
+        {
+            sorter = new EntryEditorWidgetSorter( getPreferences() );
+        }
 
         return sorter;
     }
 
 
+    /**
+     * Gets the filter.
+     * 
+     * @return the filter
+     */
     public EntryEditorWidgetFilter getFilter()
     {
-        if ( this.filter == null )
-            this.filter = new EntryEditorWidgetFilter();
+        if ( filter == null )
+        {
+            filter = new EntryEditorWidgetFilter();
+        }
 
         return filter;
     }
 
 
+    /**
+     * Gets the preferences.
+     * 
+     * @return the preferences
+     */
     public EntryEditorWidgetPreferences getPreferences()
     {
-        if ( this.preferences == null )
-            this.preferences = new EntryEditorWidgetPreferences();
+        if ( preferences == null )
+        {
+            preferences = new EntryEditorWidgetPreferences();
+        }
 
         return preferences;
     }

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetContentProvider.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetContentProvider.java?view=diff&rev=517413&r1=517412&r2=517413
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetContentProvider.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetContentProvider.java Mon Mar 12 14:46:34 2007
@@ -31,19 +31,34 @@
 import org.apache.directory.ldapstudio.browser.core.model.IValue;
 import org.apache.directory.ldapstudio.browser.ui.BrowserUIConstants;
 import org.apache.directory.ldapstudio.browser.ui.BrowserUIPlugin;
-
 import org.eclipse.jface.viewers.ITreeContentProvider;
 import org.eclipse.jface.viewers.Viewer;
 
 
+/**
+ * The EntryEditorWidgetContentProvider implements the content provider for
+ * the entry editor widget. It accepts an {@link IEntry} or an 
+ * {@link AttributeHierarchy} as input.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class EntryEditorWidgetContentProvider implements ITreeContentProvider
 {
 
+    /** The preferences. */
     protected EntryEditorWidgetPreferences preferences;
 
+    /** The main widget. */
     protected EntryEditorWidget mainWidget;
 
 
+    /**
+     * Creates a new instance of EntryEditorWidgetContentProvider.
+     * 
+     * @param preferences the preferences
+     * @param mainWidget the main widget
+     */
     public EntryEditorWidgetContentProvider( EntryEditorWidgetPreferences preferences, EntryEditorWidget mainWidget )
     {
         this.preferences = preferences;
@@ -51,6 +66,11 @@
     }
 
 
+    /**
+     * {@inheritDoc}
+     * 
+     * This implementations updates the enabled state and the info text.
+     */
     public void inputChanged( Viewer viewer, Object oldInput, Object newInput )
     {
 
@@ -73,26 +93,34 @@
             enabled = false;
         }
 
-        if ( this.mainWidget.getInfoText() != null && !this.mainWidget.getInfoText().isDisposed() )
+        if ( mainWidget.getInfoText() != null && !mainWidget.getInfoText().isDisposed() )
         {
-            this.mainWidget.getInfoText().setText( dn );
+            mainWidget.getInfoText().setText( dn );
         }
-        if ( this.mainWidget.getQuickFilterWidget() != null )
+        if ( mainWidget.getQuickFilterWidget() != null )
         {
-            this.mainWidget.getQuickFilterWidget().setEnabled( enabled );
+            mainWidget.getQuickFilterWidget().setEnabled( enabled );
         }
-        if ( this.mainWidget.getViewer() != null && !this.mainWidget.getViewer().getTree().isDisposed() )
+        if ( mainWidget.getViewer() != null && !mainWidget.getViewer().getTree().isDisposed() )
         {
-            this.mainWidget.getViewer().getTree().setEnabled( enabled );
+            mainWidget.getViewer().getTree().setEnabled( enabled );
         }
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void dispose()
     {
+        preferences = null;
+        mainWidget = null;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public Object[] getElements( Object inputElement )
     {
 
@@ -107,8 +135,7 @@
                 InitializeAttributesJob job = new InitializeAttributesJob( new IEntry[]
                     { entry }, soa );
                 job.execute();
-                return new Object[]
-                    {};
+                return new Object[0];
             }
             else
             {
@@ -126,15 +153,21 @@
         }
         else
         {
-            return new Object[]
-                {};
+            return new Object[0];
         }
     }
 
 
+    /**
+     * Gets the values of the given attributes.
+     * 
+     * @param attributes the attributes
+     * 
+     * @return the values
+     */
     private Object[] getValues( IAttribute[] attributes )
     {
-        List valueList = new ArrayList();
+        List<Object> valueList = new ArrayList<Object>();
         for ( int i = 0; attributes != null && i < attributes.length; i++ )
         {
             IValue[] values = attributes[i].getValues();
@@ -148,6 +181,7 @@
             }
             else
             {
+                // if folding threshold is exceeded then return the attribute itself
                 valueList.add( attributes[i] );
             }
         }
@@ -155,6 +189,9 @@
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public Object[] getChildren( Object parentElement )
     {
         if ( parentElement instanceof IAttribute )
@@ -167,6 +204,9 @@
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public Object getParent( Object element )
     {
         if ( element instanceof IValue )
@@ -177,6 +217,9 @@
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean hasChildren( Object element )
     {
         return ( element instanceof IAttribute );

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetFilter.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetFilter.java?view=diff&rev=517413&r1=517412&r2=517413
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetFilter.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetFilter.java Mon Mar 12 14:46:34 2007
@@ -21,26 +21,36 @@
 package org.apache.directory.ldapstudio.browser.ui.widgets.entryeditor;
 
 
-import java.util.ArrayList;
-
 import org.apache.directory.ldapstudio.browser.core.model.IAttribute;
 import org.apache.directory.ldapstudio.browser.core.model.IValue;
-
 import org.eclipse.jface.viewers.TreeViewer;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerFilter;
 
 
+/**
+ * The EntryEditorWidgetFilter implements the filter for
+ * the entry editor widget.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class EntryEditorWidgetFilter extends ViewerFilter
 {
 
+    /** The viewer to filter. */
     protected TreeViewer viewer;
 
+    /** The quick filter attribute. */
     protected String quickFilterAttribute;
 
+    /** The quick filter value. */
     protected String quickFilterValue;
 
 
+    /**
+     * Creates a new instance of EntryEditorWidgetFilter.
+     */
     public EntryEditorWidgetFilter()
     {
         this.quickFilterAttribute = "";
@@ -48,32 +58,23 @@
     }
 
 
+    /**
+     * Connects this filter with the given viewer.
+     * 
+     * @param viewer the viewer
+     */
     public void connect( TreeViewer viewer )
     {
         this.viewer = viewer;
-        this.viewer.addFilter( this );
-    }
-
-
-    public Object[] filter( Viewer viewer, Object parent, Object[] elements )
-    {
-
-        int size = elements.length;
-        ArrayList out = new ArrayList( size );
-        for ( int i = 0; i < size; ++i )
-        {
-            Object element = elements[i];
-            if ( select( viewer, parent, element ) )
-                out.add( element );
-        }
-
-        return out.toArray();
+        viewer.addFilter( this );
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public boolean select( Viewer viewer, Object parentElement, Object element )
     {
-
         if ( element instanceof IAttribute )
         {
             IAttribute attribute = ( IAttribute ) element;
@@ -83,7 +84,7 @@
             IValue[] values = attribute.getValues();
             for ( int i = 0; i < values.length; i++ )
             {
-                if ( this.goesThroughQuickFilter( values[i] ) )
+                if ( goesThroughQuickFilter( values[i] ) )
                 {
                     oneGoesThrough = true;
                     break;
@@ -101,22 +102,32 @@
             IValue value = ( IValue ) element;
 
             // check quick filter
-            if ( !this.goesThroughQuickFilter( value ) )
+            if ( !goesThroughQuickFilter( value ) )
             {
                 return false;
             }
 
             // filter attribute types
             if ( value.getAttribute().isObjectClassAttribute() )
-                return this.isShowObjectClassAttribute();
+            {
+                return isShowObjectClassAttribute();
+            }
             else if ( value.getAttribute().isMustAttribute() )
-                return this.isShowMustAttributes();
+            {
+                return isShowMustAttributes();
+            }
             else if ( value.getAttribute().isMayAttribute() )
-                return this.isShowMayAttributes();
+            {
+                return isShowMayAttributes();
+            }
             else if ( value.getAttribute().isOperationalAttribute() )
-                return this.isShowOperationalAttributes();
+            {
+                return isShowOperationalAttributes();
+            }
             else
+            {
                 return true;
+            }
         }
         else
         {
@@ -125,22 +136,29 @@
     }
 
 
+    /**
+     * Checks if the given value goes through quick filter.
+     * 
+     * @param value the value
+     * 
+     * @return true, if goes through quick filter
+     */
     private boolean goesThroughQuickFilter( IValue value )
     {
         // filter attribute description
-        if ( this.quickFilterAttribute != null && !"".equals( this.quickFilterAttribute ) )
+        if ( quickFilterAttribute != null && !"".equals( quickFilterAttribute ) )
         {
-            if ( value.getAttribute().getDescription().toUpperCase().indexOf( this.quickFilterAttribute.toUpperCase() ) == -1 )
+            if ( value.getAttribute().getDescription().toUpperCase().indexOf( quickFilterAttribute.toUpperCase() ) == -1 )
             {
                 return false;
             }
         }
 
         // fitler value
-        if ( this.quickFilterValue != null && !"".equals( this.quickFilterValue ) )
+        if ( quickFilterValue != null && !"".equals( quickFilterValue ) )
         {
             if ( value.isString()
-                && value.getStringValue().toUpperCase().indexOf( this.quickFilterValue.toUpperCase() ) == -1 )
+                && value.getStringValue().toUpperCase().indexOf( quickFilterValue.toUpperCase() ) == -1 )
             {
                 return false;
             }
@@ -154,64 +172,111 @@
     }
 
 
+    /**
+     * Disposes this filter.
+     */
     public void dispose()
     {
-        this.viewer = null;
+        viewer = null;
     }
 
 
+    /**
+     * Gets the quick filter attribute.
+     * 
+     * @return the quick filter attribute
+     */
     public String getQuickFilterAttribute()
     {
         return quickFilterAttribute;
     }
 
 
+    /**
+     * Sets the quick filter attribute.
+     * 
+     * @param quickFilterAttribute the quick filter attribute
+     */
     public void setQuickFilterAttribute( String quickFilterAttribute )
     {
         if ( !this.quickFilterAttribute.equals( quickFilterAttribute ) )
         {
             this.quickFilterAttribute = quickFilterAttribute;
-            if ( this.viewer != null )
-                this.viewer.refresh();
+            if ( viewer != null )
+            {
+                viewer.refresh();
+            }
         }
     }
 
 
+    /**
+     * Gets the quick filter value.
+     * 
+     * @return the quick filter value
+     */
     public String getQuickFilterValue()
     {
         return quickFilterValue;
     }
 
 
+    /**
+     * Sets the quick filter value.
+     * 
+     * @param quickFilterValue the quick filter value
+     */
     public void setQuickFilterValue( String quickFilterValue )
     {
         if ( !this.quickFilterValue.equals( quickFilterValue ) )
         {
             this.quickFilterValue = quickFilterValue;
-            if ( this.viewer != null )
-                this.viewer.refresh();
+            if ( viewer != null )
+            {
+                viewer.refresh();
+            }
         }
     }
 
 
+    /**
+     * Checks if may attributes should be shown.
+     * 
+     * @return true, if may attributes should be shown
+     */
     public boolean isShowMayAttributes()
     {
         return true;
     }
 
 
+    /**
+     * Checks if must attributes should be shown.
+     * 
+     * @return true, if must attributes should be shown
+     */
     public boolean isShowMustAttributes()
     {
         return true;
     }
 
 
+    /**
+     * Checks if the objectClass attribute should be shown.
+     * 
+     * @return true, if the objectClass attribute should be shown
+     */
     public boolean isShowObjectClassAttribute()
     {
         return true;
     }
 
 
+    /**
+     * Checks if operational attributes should be shown.
+     * 
+     * @return true, if operational attributes should be shown
+     */
     public boolean isShowOperationalAttributes()
     {
         return true;

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetLabelProvider.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetLabelProvider.java?view=diff&rev=517413&r1=517412&r2=517413
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetLabelProvider.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetLabelProvider.java Mon Mar 12 14:46:34 2007
@@ -27,7 +27,6 @@
 import org.apache.directory.ldapstudio.browser.ui.BrowserUIPlugin;
 import org.apache.directory.ldapstudio.browser.ui.valueeditors.IValueEditor;
 import org.apache.directory.ldapstudio.browser.ui.valueeditors.internal.ValueEditorManager;
-
 import org.eclipse.jface.preference.PreferenceConverter;
 import org.eclipse.jface.viewers.IColorProvider;
 import org.eclipse.jface.viewers.IFontProvider;
@@ -40,29 +39,52 @@
 import org.eclipse.swt.graphics.RGB;
 
 
+/**
+ * The EntryEditorWidgetLabelProvider implements the label provider for
+ * the entry editor widget.
+ * 
+ * It provides the type value pairs for {@link IValue} objects and type plus 
+ * the number of values for {@link IAttribute} objects. It also implements 
+ * {@link IFontProvider} and {@link IColorProvider} to set the font and color
+ * depending on whether the attribte is a must, may or operational attribute.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class EntryEditorWidgetLabelProvider extends LabelProvider implements ITableLabelProvider, IFontProvider,
     IColorProvider
 {
 
+    /** The value editor manager. */
     private ValueEditorManager valueEditorManager;
 
 
+    /**
+     * Creates a new instance of EntryEditorWidgetLabelProvider.
+     * 
+     * @param valueEditorManager the value editor manager
+     */
     public EntryEditorWidgetLabelProvider( ValueEditorManager valueEditorManager )
     {
         this.valueEditorManager = valueEditorManager;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void dispose()
     {
         super.dispose();
-        this.valueEditorManager = null;
+        valueEditorManager = null;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public final String getColumnText( Object obj, int index )
     {
-
         if ( obj != null && obj instanceof IValue )
         {
             IValue value = ( IValue ) obj;
@@ -97,15 +119,20 @@
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public final Image getColumnImage( Object element, int index )
     {
         return null;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public Font getFont( Object element )
     {
-
         IAttribute attribute = null;
         IValue value = null;
         if ( element instanceof IAttribute )
@@ -173,9 +200,11 @@
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public Color getForeground( Object element )
     {
-
         IAttribute attribute = null;
         IValue value = null;
         if ( element instanceof IAttribute )
@@ -243,6 +272,9 @@
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public Color getBackground( Object element )
     {
         return null;

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetPreferences.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetPreferences.java?view=diff&rev=517413&r1=517412&r2=517413
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetPreferences.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetPreferences.java Mon Mar 12 14:46:34 2007
@@ -21,6 +21,7 @@
 package org.apache.directory.ldapstudio.browser.ui.widgets.entryeditor;
 
 
+import org.apache.directory.ldapstudio.browser.core.BrowserCoreConstants;
 import org.apache.directory.ldapstudio.browser.ui.BrowserUIConstants;
 import org.apache.directory.ldapstudio.browser.ui.BrowserUIPlugin;
 import org.eclipse.jface.util.IPropertyChangeListener;
@@ -29,31 +30,54 @@
 import org.eclipse.jface.viewers.Viewer;
 
 
+/**
+ * This class is a wrapper for the preferences of the entry editor widget.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class EntryEditorWidgetPreferences implements IPropertyChangeListener
 {
 
+    /** The viewer. */
     protected Viewer viewer;
 
 
+    /**
+     * Creates a new instance of EntryEditorWidgetPreferences.
+     */
     public EntryEditorWidgetPreferences()
     {
         BrowserUIPlugin.getDefault().getPreferenceStore().addPropertyChangeListener( this );
     }
 
 
+    /**
+     * Connects this preferences with the given viewer.
+     * 
+     * @param viewer the viewer
+     */
     public void connect( TreeViewer viewer )
     {
         this.viewer = viewer;
     }
 
 
+    /**
+     * Disposes this preferences.
+     */
     public void dispose()
     {
         BrowserUIPlugin.getDefault().getPreferenceStore().removePropertyChangeListener( this );
-        this.viewer = null;
+        viewer = null;
     }
 
 
+    /**
+     * Checks if folding is enabled.
+     * 
+     * @return true, if folding is enabled
+     */
     public boolean isUseFolding()
     {
         return BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
@@ -61,6 +85,11 @@
     }
 
 
+    /**
+     * Gets the folding threshold.
+     * 
+     * @return the folding threshold
+     */
     public int getFoldingThreshold()
     {
         return BrowserUIPlugin.getDefault().getPreferenceStore().getInt(
@@ -68,6 +97,11 @@
     }
 
 
+    /**
+     * Checks if may attributes should be shown.
+     * 
+     * @return true, if may attributes should be shown
+     */
     public boolean isShowMayAttributes()
     {
         return BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
@@ -75,6 +109,11 @@
     }
 
 
+    /**
+     * Checks if must attributes should be shown.
+     * 
+     * @return true, if must attributes should be shown
+     */
     public boolean isShowMustAttributes()
     {
         return BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
@@ -82,6 +121,11 @@
     }
 
 
+    /**
+     * Checks if object class attribute should be shown.
+     * 
+     * @return true, if object class attribute should be shown
+     */
     public boolean isShowObjectClassAttribute()
     {
         return BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
@@ -89,6 +133,11 @@
     }
 
 
+    /**
+     * Checks if operational attributes should be shown.
+     * 
+     * @return true, if operational attributes should be shown
+     */
     public boolean isShowOperationalAttributes()
     {
         return BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
@@ -96,6 +145,12 @@
     }
 
 
+    /**
+     * Checks if object class and must attributes should be 
+     * grouped before may attributes.
+     * 
+     * @return true, if object class and must attributes first
+     */
     public boolean isObjectClassAndMustAttributesFirst()
     {
         return BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
@@ -103,6 +158,11 @@
     }
 
 
+    /**
+     * Checks if operational attributes should be grouped after may attributes.
+     * 
+     * @return true, if operational attributes last
+     */
     public boolean isOperationalAttributesLast()
     {
         return BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
@@ -110,6 +170,13 @@
     }
 
 
+    /**
+     * Gets the default sort property, one of 
+     * {@link BrowserCoreConstants#SORT_BY_ATTRIBUTE_DESCRIPTION} or
+     * {@link BrowserCoreConstants#SORT_BY_VALUE}.
+     * 
+     * @return the default sort property
+     */
     public int getDefaultSortBy()
     {
         return BrowserUIPlugin.getDefault().getPreferenceStore().getInt(
@@ -117,6 +184,14 @@
     }
 
 
+    /**
+     * Gets the default sort property, one of 
+     * {@link BrowserCoreConstants#SORT_ORDER_NONE},
+     * {@link BrowserCoreConstants#SORT_ORDER_ASCENDING} or
+     * {@link BrowserCoreConstants#SORT_ORDER_DESCENDING}.
+     * 
+     * @return the default sort property
+     */
     public int getDefaultSortOrder()
     {
         return BrowserUIPlugin.getDefault().getPreferenceStore().getInt(
@@ -124,6 +199,9 @@
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void propertyChange( PropertyChangeEvent event )
     {
         if ( this.viewer != null )

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetQuickFilterWidget.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetQuickFilterWidget.java?view=diff&rev=517413&r1=517412&r2=517413
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetQuickFilterWidget.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetQuickFilterWidget.java Mon Mar 12 14:46:34 2007
@@ -41,26 +41,48 @@
 import org.eclipse.swt.widgets.Text;
 
 
+/**
+ * The EntryEditorWidgetQuickFilterWidget implements an instant search 
+ * for the entry editor widget. It contains separate search fields for
+ * attribute type and/or value.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class EntryEditorWidgetQuickFilterWidget
 {
 
+    /** The filter to propagate the entered filter phrases. */
     private EntryEditorWidgetFilter filter;
 
+    /** The entry editor widget. */
     private EntryEditorWidget entryEditorWidget;
 
+    /** The parent, used to create the composite. */
     private Composite parent;
 
+    /** The outer composite. */
     private Composite composite;
 
+    /** The inner composite, it is created/destroyed when showing/hiding the quick filter. */
     private Composite innerComposite;
 
+    /** The quick filter attribute text. */
     private Text quickFilterAttributeText;
 
+    /** The quick filter value text. */
     private Text quickFilterValueText;
 
+    /** The clear quick filter button. */
     private Button clearQuickFilterButton;
 
 
+    /**
+     * Creates a new instance of EntryEditorWidgetQuickFilterWidget.
+     * 
+     * @param filter the filter
+     * @param entryEditorWidget the entry editor widget
+     */
     public EntryEditorWidgetQuickFilterWidget( EntryEditorWidgetFilter filter, EntryEditorWidget entryEditorWidget )
     {
         this.filter = filter;
@@ -68,27 +90,35 @@
     }
 
 
+    /**
+     * Creates the outer composite.
+     * 
+     * @param parent the parent
+     */
     public void createComposite( Composite parent )
     {
         this.parent = parent;
 
-        this.composite = BaseWidgetUtils.createColumnContainer( parent, 1, 1 );
+        composite = BaseWidgetUtils.createColumnContainer( parent, 1, 1 );
         GridLayout gl = new GridLayout();
         gl.marginHeight = 2;
         gl.marginWidth = 2;
         composite.setLayout( gl );
 
-        this.innerComposite = null;
+        innerComposite = null;
     }
 
 
+    /**
+     * Creates the inner composite with its input fields.
+     */
     private void create()
     {
-        innerComposite = BaseWidgetUtils.createColumnContainer( this.composite, 3, 1 );
+        innerComposite = BaseWidgetUtils.createColumnContainer( composite, 3, 1 );
 
-        this.quickFilterAttributeText = new Text( innerComposite, SWT.BORDER );
-        this.quickFilterAttributeText.setLayoutData( new GridData( 200 - 14, SWT.DEFAULT ) );
-        this.quickFilterAttributeText.addModifyListener( new ModifyListener()
+        quickFilterAttributeText = new Text( innerComposite, SWT.BORDER );
+        quickFilterAttributeText.setLayoutData( new GridData( 200 - 14, SWT.DEFAULT ) );
+        quickFilterAttributeText.addModifyListener( new ModifyListener()
         {
             public void modifyText( ModifyEvent e )
             {
@@ -117,9 +147,9 @@
             }
         } );
 
-        this.quickFilterValueText = new Text( innerComposite, SWT.BORDER );
-        this.quickFilterValueText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
-        this.quickFilterValueText.addModifyListener( new ModifyListener()
+        quickFilterValueText = new Text( innerComposite, SWT.BORDER );
+        quickFilterValueText.setLayoutData( new GridData( GridData.FILL_HORIZONTAL ) );
+        quickFilterValueText.addModifyListener( new ModifyListener()
         {
             public void modifyText( ModifyEvent e )
             {
@@ -148,18 +178,22 @@
             }
         } );
 
-        this.clearQuickFilterButton = new Button( innerComposite, SWT.PUSH );
-        this.clearQuickFilterButton.setToolTipText( "Clear Quick Filter" );
-        this.clearQuickFilterButton.setImage( BrowserUIPlugin.getDefault().getImage( BrowserUIConstants.IMG_CLEAR ) );
-        this.clearQuickFilterButton.setEnabled( false );
-        this.clearQuickFilterButton.addSelectionListener( new SelectionAdapter()
+        clearQuickFilterButton = new Button( innerComposite, SWT.PUSH );
+        clearQuickFilterButton.setToolTipText( "Clear Quick Filter" );
+        clearQuickFilterButton.setImage( BrowserUIPlugin.getDefault().getImage( BrowserUIConstants.IMG_CLEAR ) );
+        clearQuickFilterButton.setEnabled( false );
+        clearQuickFilterButton.addSelectionListener( new SelectionAdapter()
         {
             public void widgetSelected( SelectionEvent e )
             {
                 if ( !"".equals( quickFilterAttributeText.getText() ) )
+                {
                     quickFilterAttributeText.setText( "" );
+                }
                 if ( !"".equals( quickFilterValueText.getText() ) )
+                {
                     quickFilterValueText.setText( "" );
+                }
             }
         } );
 
@@ -170,12 +204,19 @@
     }
 
 
+    /**
+     * Destroys the inner widget.
+     */
     private void destroy()
     {
         if ( !"".equals( quickFilterAttributeText.getText() ) )
+        {
             quickFilterAttributeText.setText( "" );
+        }
         if ( !"".equals( quickFilterValueText.getText() ) )
+        {
             quickFilterValueText.setText( "" );
+        }
         innerComposite.dispose();
         innerComposite = null;
 
@@ -184,49 +225,62 @@
     }
 
 
+    /**
+     * Disposes this widget.
+     */
     public void dispose()
     {
-        if ( this.filter != null )
+        if ( filter != null )
         {
-            this.quickFilterAttributeText = null;
-            this.quickFilterValueText = null;
-            this.clearQuickFilterButton = null;
-            this.innerComposite = null;
-            this.composite.dispose();
-            this.composite = null;
-            this.parent = null;
-            this.filter = null;
+            quickFilterAttributeText = null;
+            quickFilterValueText = null;
+            clearQuickFilterButton = null;
+            innerComposite = null;
+            composite.dispose();
+            composite = null;
+            parent = null;
+            filter = null;
         }
     }
 
 
+    /**
+     * Enables or disables this quick filter widget.
+     * 
+     * @param enabled true to enable this quick filter widget, false to disable it
+     */
     public void setEnabled( boolean enabled )
     {
-        if ( this.composite != null && !this.composite.isDisposed() )
+        if ( composite != null && !composite.isDisposed() )
         {
-            this.composite.setEnabled( enabled );
+            composite.setEnabled( enabled );
         }
-        if ( this.innerComposite != null && !this.innerComposite.isDisposed() )
+        if ( innerComposite != null && !innerComposite.isDisposed() )
         {
-            this.innerComposite.setEnabled( enabled );
-            this.quickFilterAttributeText.setEnabled( enabled );
-            this.quickFilterValueText.setEnabled( enabled );
-            this.clearQuickFilterButton.setEnabled( enabled );
+            innerComposite.setEnabled( enabled );
+            quickFilterAttributeText.setEnabled( enabled );
+            quickFilterValueText.setEnabled( enabled );
+            clearQuickFilterButton.setEnabled( enabled );
         }
     }
 
 
+    /**
+     * Activates or deactivates this quick filter widget.
+     *
+     * @param visible true to crate this quick filter widget, false to destroy it
+     */
     public void setActive( boolean visible )
     {
-        if ( visible && this.innerComposite == null && composite != null )
+        if ( visible && innerComposite == null && composite != null )
         {
             create();
-            this.quickFilterAttributeText.setFocus();
+            quickFilterAttributeText.setFocus();
         }
-        else if ( !visible && this.innerComposite != null && composite != null )
+        else if ( !visible && innerComposite != null && composite != null )
         {
             destroy();
-            this.entryEditorWidget.getViewer().getTree().setFocus();
+            entryEditorWidget.getViewer().getTree().setFocus();
         }
     }
 

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetSorter.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetSorter.java?view=diff&rev=517413&r1=517412&r2=517413
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetSorter.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetSorter.java Mon Mar 12 14:46:34 2007
@@ -29,7 +29,6 @@
 import org.apache.directory.ldapstudio.browser.core.model.IValue;
 import org.apache.directory.ldapstudio.browser.ui.BrowserUIConstants;
 import org.apache.directory.ldapstudio.browser.ui.BrowserUIPlugin;
-
 import org.eclipse.jface.viewers.TreeViewer;
 import org.eclipse.jface.viewers.Viewer;
 import org.eclipse.jface.viewers.ViewerSorter;
@@ -38,18 +37,33 @@
 import org.eclipse.swt.widgets.TreeColumn;
 
 
+/**
+ * The EntryEditorWidgetSorter implements the Sorter for the entry editor widget.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class EntryEditorWidgetSorter extends ViewerSorter implements SelectionListener
 {
 
+    /** The tree viewer. */
     private TreeViewer viewer;
 
+    /** The sort property. */
     private int sortBy;
 
+    /** The sort order. */
     private int sortOrder;
 
+    /** The preferences. */
     private EntryEditorWidgetPreferences preferences;
 
 
+    /**
+     * Creates a new instance of EntryEditorWidgetSorter.
+     * 
+     * @param preferences the preferences
+     */
     public EntryEditorWidgetSorter( EntryEditorWidgetPreferences preferences )
     {
         this.sortBy = BrowserCoreConstants.SORT_BY_NONE;
@@ -58,10 +72,15 @@
     }
 
 
+    /**
+     * Connects this sorter to the given tree viewer.
+     * 
+     * @param viewer the viewer
+     */
     public void connect( TreeViewer viewer )
     {
         this.viewer = viewer;
-        this.viewer.setSorter( this );
+        viewer.setSorter( this );
 
         TreeColumn[] columns = ( ( TreeViewer ) viewer ).getTree().getColumns();
         for ( int i = 0; i < columns.length; i++ )
@@ -71,94 +90,102 @@
     }
 
 
+    /**
+     * Disposes this sorter.
+     */
     public void dispose()
     {
-        /*
-         * TableColumn[] columns = this.viewer.getTable().getColumns(); for(int
-         * i=0; i <columns.length; i++) {
-         * columns[i].removeSelectionListener(this); }
-         */
-        this.viewer = null;
+        viewer = null;
+        preferences = null;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void widgetDefaultSelected( SelectionEvent e )
     {
     }
 
 
+    /**
+     * {@inheritDoc}
+     * 
+     * Switches the sort property and sort order when clicking the table headers.
+     */
     public void widgetSelected( SelectionEvent e )
     {
-        if ( e.widget instanceof TreeColumn && this.viewer != null )
+        if ( e.widget instanceof TreeColumn && viewer != null )
         {
-
-            int index = this.viewer.getTree().indexOf( ( ( TreeColumn ) e.widget ) );
+            int index = viewer.getTree().indexOf( ( ( TreeColumn ) e.widget ) );
             switch ( index )
             {
                 case EntryEditorWidgetTableMetadata.KEY_COLUMN_INDEX:
-                    if ( this.sortBy == BrowserCoreConstants.SORT_BY_ATTRIBUTE_DESCRIPTION )
+                    if ( sortBy == BrowserCoreConstants.SORT_BY_ATTRIBUTE_DESCRIPTION )
                     {
                         // toggle sort order
-                        this.sortOrder = this.sortOrder == BrowserCoreConstants.SORT_ORDER_NONE ? BrowserCoreConstants.SORT_ORDER_ASCENDING
-                            : this.sortOrder == BrowserCoreConstants.SORT_ORDER_ASCENDING ? BrowserCoreConstants.SORT_ORDER_DESCENDING
+                        sortOrder = sortOrder == BrowserCoreConstants.SORT_ORDER_NONE ? BrowserCoreConstants.SORT_ORDER_ASCENDING
+                            : sortOrder == BrowserCoreConstants.SORT_ORDER_ASCENDING ? BrowserCoreConstants.SORT_ORDER_DESCENDING
                                 : BrowserCoreConstants.SORT_ORDER_NONE;
                     }
                     else
                     {
                         // set new sort by
-                        this.sortBy = BrowserCoreConstants.SORT_BY_ATTRIBUTE_DESCRIPTION;
-                        this.sortOrder = BrowserCoreConstants.SORT_ORDER_ASCENDING;
+                        sortBy = BrowserCoreConstants.SORT_BY_ATTRIBUTE_DESCRIPTION;
+                        sortOrder = BrowserCoreConstants.SORT_ORDER_ASCENDING;
                     }
                     break;
                 case EntryEditorWidgetTableMetadata.VALUE_COLUMN_INDEX:
-                    if ( this.sortBy == BrowserCoreConstants.SORT_BY_VALUE )
+                    if ( sortBy == BrowserCoreConstants.SORT_BY_VALUE )
                     {
                         // toggle sort order
-                        this.sortOrder = this.sortOrder == BrowserCoreConstants.SORT_ORDER_NONE ? BrowserCoreConstants.SORT_ORDER_ASCENDING
-                            : this.sortOrder == BrowserCoreConstants.SORT_ORDER_ASCENDING ? BrowserCoreConstants.SORT_ORDER_DESCENDING
+                        sortOrder = sortOrder == BrowserCoreConstants.SORT_ORDER_NONE ? BrowserCoreConstants.SORT_ORDER_ASCENDING
+                            : sortOrder == BrowserCoreConstants.SORT_ORDER_ASCENDING ? BrowserCoreConstants.SORT_ORDER_DESCENDING
                                 : BrowserCoreConstants.SORT_ORDER_NONE;
                     }
                     else
                     {
                         // set new sort by
-                        this.sortBy = BrowserCoreConstants.SORT_BY_VALUE;
-                        this.sortOrder = BrowserCoreConstants.SORT_ORDER_ASCENDING;
+                        sortBy = BrowserCoreConstants.SORT_BY_VALUE;
+                        sortOrder = BrowserCoreConstants.SORT_ORDER_ASCENDING;
                     }
                     break;
                 default:
                     ;
             }
-            if ( this.sortOrder == BrowserCoreConstants.SORT_ORDER_NONE )
+            if ( sortOrder == BrowserCoreConstants.SORT_ORDER_NONE )
             {
-                this.sortBy = BrowserCoreConstants.SORT_BY_NONE;
+                sortBy = BrowserCoreConstants.SORT_BY_NONE;
             }
 
-            TreeColumn[] columns = this.viewer.getTree().getColumns();
+            TreeColumn[] columns = viewer.getTree().getColumns();
             for ( int i = 0; i < columns.length; i++ )
             {
                 columns[i].setImage( null );
             }
 
-            if ( this.sortOrder == BrowserCoreConstants.SORT_ORDER_ASCENDING )
+            if ( sortOrder == BrowserCoreConstants.SORT_ORDER_ASCENDING )
             {
                 ( ( TreeColumn ) e.widget ).setImage( BrowserUIPlugin.getDefault().getImage(
                     BrowserUIConstants.IMG_SORT_ASCENDING ) );
             }
-            else if ( this.sortOrder == BrowserCoreConstants.SORT_ORDER_DESCENDING )
+            else if ( sortOrder == BrowserCoreConstants.SORT_ORDER_DESCENDING )
             {
                 ( ( TreeColumn ) e.widget ).setImage( BrowserUIPlugin.getDefault().getImage(
                     BrowserUIConstants.IMG_SORT_DESCENDING ) );
             }
 
-            this.viewer.refresh();
+            viewer.refresh();
         }
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void sort( final Viewer viewer, Object[] elements )
     {
-
-        Arrays.sort( elements, new Comparator()
+        Arrays.sort( elements, new Comparator<Object>()
         {
             public int compare( Object a, Object b )
             {
@@ -169,21 +196,12 @@
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public int compare( Viewer viewer, Object o1, Object o2 )
     {
-
-        // System.out.println("compare() " + o1 + " - " + o2);
-
-        // if (o1 == null && o2 == null) {
-        // return this.equal();
-        // }
-        // else if (o1 == null && o2 != null) {
-        // return this.lessThan();
-        // }
-        // else if (o1 != null && o2 == null) {
-        // return this.greaterThan();
-        // }
-        // else {
+        // check o1
         IAttribute attribute1 = null;
         IValue value1 = null;
         if ( o1 instanceof IAttribute )
@@ -196,6 +214,7 @@
             attribute1 = value1.getAttribute();
         }
 
+        // check o2
         IAttribute attribute2 = null;
         IValue value2 = null;
         if ( o2 instanceof IAttribute )
@@ -208,42 +227,49 @@
             attribute2 = value2.getAttribute();
         }
 
+        // compare
         if ( value1 != null && value2 != null )
         {
-            if ( this.getSortByOrDefault() == BrowserCoreConstants.SORT_BY_ATTRIBUTE_DESCRIPTION )
+            if ( getSortByOrDefault() == BrowserCoreConstants.SORT_BY_ATTRIBUTE_DESCRIPTION )
             {
                 if ( value1.getAttribute() != value2.getAttribute() )
                 {
-                    return this.compareAttributeNames( value1.getAttribute(), value2.getAttribute() );
+                    return compareAttributes( value1.getAttribute(), value2.getAttribute() );
                 }
                 else
                 {
-                    return this.compareValues( value1, value2 );
+                    return compareValues( value1, value2 );
                 }
             }
-            else if ( this.getSortByOrDefault() == BrowserCoreConstants.SORT_BY_VALUE )
+            else if ( getSortByOrDefault() == BrowserCoreConstants.SORT_BY_VALUE )
             {
-                return this.compareValues( value1, value2 );
+                return compareValues( value1, value2 );
             }
             else
             {
-                return this.equal();
+                return equal();
             }
         }
         else if ( attribute1 != null && attribute2 != null )
         {
-            return this.compareAttributeNames( attribute1, attribute2 );
+            return compareAttributes( attribute1, attribute2 );
         }
         else
         {
-            return this.equal();
+            return equal();
         }
-
-        // }
     }
 
 
-    private int compareAttributeNames( IAttribute attribute1, IAttribute attribute2 )
+    /**
+     * Compares attribute kind or description.
+     * 
+     * @param attribute1 the attribute1
+     * @param attribute2 the attribute2
+     * 
+     * @return the compare result
+     */
+    private int compareAttributes( IAttribute attribute1, IAttribute attribute2 )
     {
         if ( this.sortOrder == BrowserCoreConstants.SORT_ORDER_NONE )
         {
@@ -284,6 +310,14 @@
     }
 
 
+    /**
+     * Compares values.
+     * 
+     * @param value1 the value1
+     * @param value2 the value2
+     * 
+     * @return the compare result
+     */
     private int compareValues( IValue value1, IValue value2 )
     {
         if ( value1.isEmpty() && value2.isEmpty() )
@@ -298,18 +332,6 @@
         {
             return lessThan();
         }
-        // else if ((value1.isString()) && !(value2.isString())) {
-        // return lessThan();
-        // }
-        // else if ((value2.isString()) && !(value1.isString())) {
-        // return greaterThan();
-        // }
-        // else if ((value1.isString()) && (value2.isString())) {
-        // return compare(value1.getStringValue(), value2.getStringValue());
-        // }
-        // else {
-        // return equal();
-        // }
         else
         {
             return compare( value1.getStringValue(), value2.getStringValue() );
@@ -317,58 +339,92 @@
     }
 
 
+    /**
+     * Gets the current sort order or the default sort order from the preferences .
+     * 
+     * @return the current sort order or default sort order
+     */
     private int getSortOrderOrDefault()
     {
         if ( preferences == null )
         {
             return BrowserCoreConstants.SORT_ORDER_ASCENDING;
         }
-        else if ( this.sortOrder == BrowserCoreConstants.SORT_ORDER_NONE )
+        else if ( sortOrder == BrowserCoreConstants.SORT_ORDER_NONE )
         {
             return preferences.getDefaultSortOrder();
         }
         else
         {
-            return this.sortOrder;
+            return sortOrder;
         }
     }
 
 
+    /**
+     * Gets the current sort property or the default sort property from the preferences .
+     * 
+     * @return the current sort property or default sort property
+     */
     private int getSortByOrDefault()
     {
         if ( preferences == null )
         {
             return BrowserCoreConstants.SORT_BY_ATTRIBUTE_DESCRIPTION;
         }
-        else if ( this.sortBy == BrowserCoreConstants.SORT_BY_NONE )
+        else if ( sortBy == BrowserCoreConstants.SORT_BY_NONE )
         {
             return preferences.getDefaultSortBy();
         }
         else
         {
-            return this.sortBy;
+            return sortBy;
         }
     }
 
 
+    /**
+     * Returns +1 or -1, depending on the sort order.
+     *
+     * @return +1 or -1, depending on the sort order
+     */
     private int lessThan()
     {
         return this.getSortOrderOrDefault() == BrowserCoreConstants.SORT_ORDER_ASCENDING ? -1 : 1;
     }
 
 
+    /**
+     * Returns 0.
+     *
+     * @return 0
+     */
     private int equal()
     {
         return 0;
     }
 
 
+    /**
+     * Returns +1 or -1, depending on the sort order.
+     *
+     * @return +1 or -1, depending on the sort order
+     */
     private int greaterThan()
     {
         return this.getSortOrderOrDefault() == BrowserCoreConstants.SORT_ORDER_ASCENDING ? 1 : -1;
     }
 
 
+    /**
+     * Compares the two strings using the Strings's compareToIgnoreCase method, 
+     * pays attention for the sort order.
+     *
+     * @param s1 the first string to compare
+     * @param s2 the second string to compare
+     * @return a negative integer, zero, or a positive integer
+     * @see java.lang.String#compareToIgnoreCase(String)
+     */
     private int compare( String s1, String s2 )
     {
         return this.getSortOrderOrDefault() == BrowserCoreConstants.SORT_ORDER_ASCENDING ? s1.compareToIgnoreCase( s2 )

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetSorterDialog.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetSorterDialog.java?view=diff&rev=517413&r1=517412&r2=517413
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetSorterDialog.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetSorterDialog.java Mon Mar 12 14:46:34 2007
@@ -25,7 +25,6 @@
 import org.apache.directory.ldapstudio.browser.ui.BrowserUIConstants;
 import org.apache.directory.ldapstudio.browser.ui.BrowserUIPlugin;
 import org.apache.directory.ldapstudio.browser.ui.widgets.BaseWidgetUtils;
-
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
 import org.eclipse.jface.preference.IPreferenceStore;
@@ -40,30 +39,52 @@
 import org.eclipse.swt.widgets.Shell;
 
 
+/**
+ * This class represents the dialog used to change the entry editors's  default sort preferences.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class EntryEditorWidgetSorterDialog extends Dialog
 {
 
+    /** The Constant DIALOG_TITLE. */
     public static final String DIALOG_TITLE = "Entry Editor Sorting";
 
+    /** The Constant SORT_BY_NONE. */
     public static final String SORT_BY_NONE = "No Default Sorting";
 
+    /** The Constant SORT_BY_ATTRIBUTE. */
     public static final String SORT_BY_ATTRIBUTE = "Attribute Description";
 
+    /** The Constant SORT_BY_VALUE. */
     public static final String SORT_BY_VALUE = "Value";
 
+    /** The preferences. */
     private EntryEditorWidgetPreferences preferences;
 
+    /** The object class and must attributes first button. */
     private Button objectClassAndMustAttributesFirstButton;
 
+    /** The operational attributes last button. */
     private Button operationalAttributesLastButton;
 
+    /** The sort by combo. */
     private Combo sortByCombo;
 
+    /** The sort acending button. */
     private Button sortAcendingButton;
 
+    /** The sort descending button. */
     private Button sortDescendingButton;
 
 
+    /**
+     * Creates a new instance of EntryEditorWidgetSorterDialog.
+     * 
+     * @param parentShell the parent shell
+     * @param preferences the preferences
+     */
     public EntryEditorWidgetSorterDialog( Shell parentShell, EntryEditorWidgetPreferences preferences )
     {
         super( parentShell );
@@ -71,6 +92,11 @@
     }
 
 
+    /**
+     * {@inheritDoc}
+     * 
+     * This implementation calls its super implementation and sets the dialog's title.
+     */
     protected void configureShell( Shell newShell )
     {
         super.configureShell( newShell );
@@ -78,32 +104,36 @@
     }
 
 
+    /**
+     * {@inheritDoc}
+     * 
+     * This implementation saves the changed settings when OK is pressed.
+     */
     protected void buttonPressed( int buttonId )
     {
         if ( buttonId == IDialogConstants.OK_ID )
         {
             IPreferenceStore store = BrowserUIPlugin.getDefault().getPreferenceStore();
             store.setValue( BrowserUIConstants.PREFERENCE_ENTRYEDITOR_OBJECTCLASS_AND_MUST_ATTRIBUTES_FIRST,
-                this.objectClassAndMustAttributesFirstButton.getSelection() );
+                objectClassAndMustAttributesFirstButton.getSelection() );
             store.setValue( BrowserUIConstants.PREFERENCE_ENTRYEDITOR_OPERATIONAL_ATTRIBUTES_LAST,
-                this.operationalAttributesLastButton.getSelection() );
-            store.setValue( BrowserUIConstants.PREFERENCE_ENTRYEDITOR_DEFAULT_SORT_ORDER, this.sortDescendingButton
+                operationalAttributesLastButton.getSelection() );
+            store.setValue( BrowserUIConstants.PREFERENCE_ENTRYEDITOR_DEFAULT_SORT_ORDER, sortDescendingButton
                 .getSelection() ? BrowserCoreConstants.SORT_ORDER_DESCENDING
                 : BrowserCoreConstants.SORT_ORDER_ASCENDING );
-            store.setValue( BrowserUIConstants.PREFERENCE_ENTRYEDITOR_DEFAULT_SORT_BY, this.sortByCombo
-                .getSelectionIndex() == 2 ? BrowserCoreConstants.SORT_BY_VALUE
-                : this.sortByCombo.getSelectionIndex() == 1 ? BrowserCoreConstants.SORT_BY_ATTRIBUTE_DESCRIPTION
+            store.setValue( BrowserUIConstants.PREFERENCE_ENTRYEDITOR_DEFAULT_SORT_BY,
+                sortByCombo.getSelectionIndex() == 2 ? BrowserCoreConstants.SORT_BY_VALUE : sortByCombo
+                    .getSelectionIndex() == 1 ? BrowserCoreConstants.SORT_BY_ATTRIBUTE_DESCRIPTION
                     : BrowserCoreConstants.SORT_BY_NONE );
         }
-        else
-        {
-            // no changes
-        }
 
         super.buttonPressed( buttonId );
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     protected Control createDialogArea( Composite parent )
     {
         Composite composite = ( Composite ) super.createDialogArea( parent );
@@ -115,10 +145,10 @@
 
         objectClassAndMustAttributesFirstButton = BaseWidgetUtils.createCheckbox( group,
             "ObjectClass and must attributes first", 1 );
-        objectClassAndMustAttributesFirstButton.setSelection( this.preferences.isObjectClassAndMustAttributesFirst() );
+        objectClassAndMustAttributesFirstButton.setSelection( preferences.isObjectClassAndMustAttributesFirst() );
 
         operationalAttributesLastButton = BaseWidgetUtils.createCheckbox( group, "Operational attributes last", 1 );
-        operationalAttributesLastButton.setSelection( this.preferences.isOperationalAttributesLast() );
+        operationalAttributesLastButton.setSelection( preferences.isOperationalAttributesLast() );
 
         Group sortingGroup = BaseWidgetUtils.createGroup( composite, "Sort attributes", 1 );
 
@@ -126,8 +156,8 @@
         BaseWidgetUtils.createLabel( sortByComposite, "Sort by", 1 );
         sortByCombo = BaseWidgetUtils.createReadonlyCombo( sortByComposite, new String[]
             { SORT_BY_NONE, SORT_BY_ATTRIBUTE, SORT_BY_VALUE }, 0, 1 );
-        sortByCombo.select( this.preferences.getDefaultSortBy() == BrowserCoreConstants.SORT_BY_VALUE ? 2
-            : this.preferences.getDefaultSortBy() == BrowserCoreConstants.SORT_BY_ATTRIBUTE_DESCRIPTION ? 1 : 0 );
+        sortByCombo.select( preferences.getDefaultSortBy() == BrowserCoreConstants.SORT_BY_VALUE ? 2 : preferences
+            .getDefaultSortBy() == BrowserCoreConstants.SORT_BY_ATTRIBUTE_DESCRIPTION ? 1 : 0 );
         sortByCombo.addSelectionListener( new SelectionAdapter()
         {
             public void widgetSelected( SelectionEvent e )
@@ -139,12 +169,12 @@
 
         sortAcendingButton = BaseWidgetUtils.createRadiobutton( sortByComposite, "Ascending", 1 );
         sortAcendingButton
-            .setSelection( this.preferences.getDefaultSortOrder() == BrowserCoreConstants.SORT_ORDER_ASCENDING );
+            .setSelection( preferences.getDefaultSortOrder() == BrowserCoreConstants.SORT_ORDER_ASCENDING );
         sortAcendingButton.setEnabled( sortByCombo.getSelectionIndex() != 0 );
 
         sortDescendingButton = BaseWidgetUtils.createRadiobutton( sortByComposite, "Descending", 1 );
         sortDescendingButton
-            .setSelection( this.preferences.getDefaultSortOrder() == BrowserCoreConstants.SORT_ORDER_DESCENDING );
+            .setSelection( preferences.getDefaultSortOrder() == BrowserCoreConstants.SORT_ORDER_DESCENDING );
         sortDescendingButton.setEnabled( sortByCombo.getSelectionIndex() != 0 );
 
         BaseWidgetUtils.createSpacer( composite, 2 );

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetTableMetadata.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetTableMetadata.java?view=diff&rev=517413&r1=517412&r2=517413
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetTableMetadata.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/entryeditor/EntryEditorWidgetTableMetadata.java Mon Mar 12 14:46:34 2007
@@ -21,17 +21,29 @@
 package org.apache.directory.ldapstudio.browser.ui.widgets.entryeditor;
 
 
+/**
+ * The EntryEditorWidgetTableMetadata interface contains some constants used
+ * by the entry editor widget.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public interface EntryEditorWidgetTableMetadata
 {
 
+    /** The Constant KEY_COLUMN_INDEX. */
     public static final int KEY_COLUMN_INDEX = 0;
 
+    /** The Constant VALUE_COLUMN_INDEX. */
     public static final int VALUE_COLUMN_INDEX = 1;
 
+    /** The Constant KEY_COLUMN_NAME. */
     public static final String KEY_COLUMN_NAME = "Attribute Description";
 
+    /** The Constant VALUE_COLUMN_NAME. */
     public static final String VALUE_COLUMN_NAME = "Value";
 
+    /** The Constant COLUM_NAMES. */
     public static final String[] COLUM_NAMES =
         { KEY_COLUMN_NAME, VALUE_COLUMN_NAME };
 



Mime
View raw message