directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r514464 [1/2] - in /directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui: widgets/ldifeditor/ widgets/search/ wizards/
Date Sun, 04 Mar 2007 20:15:09 GMT
Author: seelmann
Date: Sun Mar  4 12:15:08 2007
New Revision: 514464

URL: http://svn.apache.org/viewvc?view=rev&rev=514464
Log:
Code cleaning, Javadocs, small refactorings, added content assist to attribute wizard

Modified:
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/ldifeditor/LdifEditorWidget.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/AliasesDereferencingWidget.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ConnectionWidget.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/EntryWidget.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/FilterWidget.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/LimitWidget.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ReferralsHandlingWidget.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ReturningAttributesContentAssistProcessor.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ReturningAttributesWidget.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ScopeWidget.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/SearchPageWrapper.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/wizards/AttributeOptionsWizardPage.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/wizards/AttributeTypeWizardPage.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/wizards/AttributeWizard.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/wizards/ExportCsvFromWizardPage.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/wizards/ExportDsmlFromWizardPage.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/wizards/ExportExcelFromWizardPage.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/wizards/ExportLdifFromWizardPage.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/wizards/NewLdifFileWizard.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/wizards/NewSearchWizard.java

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/ldifeditor/LdifEditorWidget.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/ldifeditor/LdifEditorWidget.java?view=diff&rev=514464&r1=514463&r2=514464
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/ldifeditor/LdifEditorWidget.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/ldifeditor/LdifEditorWidget.java Sun Mar  4 12:15:08 2007
@@ -28,7 +28,6 @@
 import org.apache.directory.ldapstudio.browser.ui.editors.ldif.LdifSourceViewerConfiguration;
 import org.apache.directory.ldapstudio.browser.ui.editors.ldif.NonExistingLdifEditorInput;
 import org.apache.directory.ldapstudio.browser.ui.widgets.BrowserWidget;
-
 import org.eclipse.core.runtime.CoreException;
 import org.eclipse.jface.resource.JFaceResources;
 import org.eclipse.jface.text.IDocument;
@@ -42,32 +41,56 @@
 import org.eclipse.swt.widgets.Composite;
 
 
+/**
+ * The LdifEditorWidget provides basic LDIF editor functionality like 
+ * syntax highlighting and content assistent.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class LdifEditorWidget extends BrowserWidget implements ILdifEditor, ITextListener
 {
 
+    /** The connection. */
     private IConnection connection;
 
+    /** The initial LDIF. */
     private String initialLdif;
 
+    /** The content assist enabled. */
     private boolean contentAssistEnabled;
 
+    /** The editor input. */
     private NonExistingLdifEditorInput editorInput;
 
+    /** The document provider. */
     private LdifDocumentProvider documentProvider;
 
+    /** The source viewer. */
     private SourceViewer sourceViewer;
 
+    /** The source viewer configuration. */
     private LdifSourceViewerConfiguration sourceViewerConfiguration;
 
 
-    public LdifEditorWidget( IConnection connection, String ldif, boolean contentAssistEnabled )
+    /**
+     * Creates a new instance of LdifEditorWidget.
+     * 
+     * @param contentAssistEnabled the content assist enabled
+     * @param initialLdif the initial ldif
+     * @param connection the connection
+     */
+    public LdifEditorWidget( IConnection connection, String initialLdif, boolean contentAssistEnabled )
     {
         this.connection = connection;
-        this.initialLdif = ldif;
+        this.initialLdif = initialLdif;
         this.contentAssistEnabled = contentAssistEnabled;
     }
 
 
+    /**
+     * Disposes this widget.
+     */
     public void dispose()
     {
         if ( editorInput != null )
@@ -80,9 +103,13 @@
     }
 
 
+    /**
+     * Creates the widget.
+     * 
+     * @param parent the parent
+     */
     public void createWidget( Composite parent )
     {
-
         Composite composite = new Composite( parent, SWT.NONE );
         composite.setLayoutData( new GridData( GridData.FILL_BOTH ) );
         GridLayout layout = new GridLayout( 1, false );
@@ -125,40 +152,61 @@
 
         // focus
         sourceViewer.getControl().setFocus();
-
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public IConnection getConnection()
     {
         return connection;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public LdifFile getLdifModel()
     {
         return documentProvider.getLdifModel();
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public Object getAdapter( Class adapter )
     {
         return null;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void textChanged( TextEvent event )
     {
         super.notifyListeners();
     }
 
 
+    /**
+     * Gets the source viewer.
+     * 
+     * @return the source viewer
+     */
     public SourceViewer getSourceViewer()
     {
         return sourceViewer;
     }
 
 
+    /**
+     * Gets the source viewer configuration.
+     * 
+     * @return the source viewer configuration
+     */
     public LdifSourceViewerConfiguration getSourceViewerConfiguration()
     {
         return sourceViewerConfiguration;

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/AliasesDereferencingWidget.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/AliasesDereferencingWidget.java?view=diff&rev=514464&r1=514463&r2=514464
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/AliasesDereferencingWidget.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/AliasesDereferencingWidget.java Sun Mar  4 12:15:08 2007
@@ -24,7 +24,6 @@
 import org.apache.directory.ldapstudio.browser.core.model.IConnection;
 import org.apache.directory.ldapstudio.browser.ui.widgets.BaseWidgetUtils;
 import org.apache.directory.ldapstudio.browser.ui.widgets.BrowserWidget;
-
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.widgets.Button;
@@ -32,30 +31,59 @@
 import org.eclipse.swt.widgets.Group;
 
 
+/**
+ * The AliasesDereferencingWidget could be used to select the
+ * alias dereferencing method. It is composed of a group with 
+ * two check boxes.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class AliasesDereferencingWidget extends BrowserWidget
 {
 
+    /** The initial aliases dereferencing method */
     private int initialAliasesDereferencingMethod;
 
+    /** The group. */
     private Group group;
 
+    /** The finding button. */
     private Button findingButton;
 
+    /** The search button. */
     private Button searchButton;
 
 
+    /**
+     * Creates a new instance of AliasesDereferencingWidget with the given
+     * derefenencing method. This must be one of {@link IConnection#DEREFERENCE_ALIASES_NEVER},
+     * {@link IConnection#DEREFERENCE_ALIASES_SEARCH}, {@link IConnection#DEREFERENCE_ALIASES_FINDING}
+     * or {@link IConnection#DEREFERENCE_ALIASES_ALWAYS}.
+     * 
+     * @param initialAliasesDereferencingMethod the initial aliases dereferencing method
+     */
     public AliasesDereferencingWidget( int initialAliasesDereferencingMethod )
     {
         this.initialAliasesDereferencingMethod = initialAliasesDereferencingMethod;
     }
 
 
+    /**
+     * Creates a new instance of AliasesDereferencingWidget. The initial 
+     * dereferncing method is set to {@link IConnection#DEREFERENCE_ALIASES_NEVER}.
+     */
     public AliasesDereferencingWidget()
     {
         this.initialAliasesDereferencingMethod = IConnection.DEREFERENCE_ALIASES_NEVER;
     }
 
 
+    /**
+     * Creates the widget.
+     * 
+     * @param parent the parent
+     */
     public void createWidget( Composite parent )
     {
 
@@ -80,13 +108,20 @@
             }
         } );
 
-        this.setAliasesDereferencingMethod( this.initialAliasesDereferencingMethod );
+        setAliasesDereferencingMethod( initialAliasesDereferencingMethod );
     }
 
 
+    /**
+     * Sets the aliases dereferencing method, must be one of {@link IConnection#DEREFERENCE_ALIASES_NEVER},
+     * {@link IConnection#DEREFERENCE_ALIASES_SEARCH}, {@link IConnection#DEREFERENCE_ALIASES_FINDING}
+     * or {@link IConnection#DEREFERENCE_ALIASES_ALWAYS}.
+     * 
+     * @param aliasesDereferencingMethod the aliases dereferencing method
+     */
     public void setAliasesDereferencingMethod( int aliasesDereferencingMethod )
     {
-        this.initialAliasesDereferencingMethod = aliasesDereferencingMethod;
+        initialAliasesDereferencingMethod = aliasesDereferencingMethod;
         findingButton.setSelection( initialAliasesDereferencingMethod == IConnection.DEREFERENCE_ALIASES_FINDING
             || initialAliasesDereferencingMethod == IConnection.DEREFERENCE_ALIASES_ALWAYS );
         searchButton.setSelection( initialAliasesDereferencingMethod == IConnection.DEREFERENCE_ALIASES_SEARCH
@@ -94,17 +129,24 @@
     }
 
 
+    /**
+     * Gets the aliases dereferencing method, one of {@link IConnection#DEREFERENCE_ALIASES_NEVER},
+     * {@link IConnection#DEREFERENCE_ALIASES_SEARCH}, {@link IConnection#DEREFERENCE_ALIASES_FINDING}
+     * or {@link IConnection#DEREFERENCE_ALIASES_ALWAYS}.
+     * 
+     * @return the aliases dereferencing method
+     */
     public int getAliasesDereferencingMethod()
     {
-        if ( this.findingButton.getSelection() && this.searchButton.getSelection() )
+        if ( findingButton.getSelection() && searchButton.getSelection() )
         {
             return IConnection.DEREFERENCE_ALIASES_ALWAYS;
         }
-        else if ( this.findingButton.getSelection() )
+        else if ( findingButton.getSelection() )
         {
             return IConnection.DEREFERENCE_ALIASES_FINDING;
         }
-        else if ( this.searchButton.getSelection() )
+        else if ( searchButton.getSelection() )
         {
             return IConnection.DEREFERENCE_ALIASES_SEARCH;
         }
@@ -115,11 +157,16 @@
     }
 
 
+    /**
+     * Sets the enabled state of the widget.
+     * 
+     * @param b true to enable the widget, false to disable the widget
+     */
     public void setEnabled( boolean b )
     {
-        this.group.setEnabled( b );
-        this.findingButton.setEnabled( b );
-        this.searchButton.setEnabled( b );
+        group.setEnabled( b );
+        findingButton.setEnabled( b );
+        searchButton.setEnabled( b );
     }
 
 }

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ConnectionWidget.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ConnectionWidget.java?view=diff&rev=514464&r1=514463&r2=514464
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ConnectionWidget.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ConnectionWidget.java Sun Mar  4 12:15:08 2007
@@ -25,7 +25,6 @@
 import org.apache.directory.ldapstudio.browser.ui.dialogs.SelectConnectionDialog;
 import org.apache.directory.ldapstudio.browser.ui.widgets.BaseWidgetUtils;
 import org.apache.directory.ldapstudio.browser.ui.widgets.BrowserWidget;
-
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.widgets.Button;
@@ -33,28 +32,52 @@
 import org.eclipse.swt.widgets.Text;
 
 
+/**
+ * The ConnectionWidget could be used to select a connection. 
+ * It is composed of a text to display the selected connection
+ * and a browse button to open a {@link SelectConnectionDialog}.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class ConnectionWidget extends BrowserWidget
 {
 
+    /** The connection text, displays the selected connection */
     private Text connectionText;
 
+    /** The connection browse button, opens the dialog */
     private Button connectionBrowseButton;
 
+    /** The selected connection */
     private IConnection selectedConnection;
 
 
+    /**
+     * Creates a new instance of ConnectionWidget.
+     * 
+     * @param connection the initial connection
+     */
     public ConnectionWidget( IConnection connection )
     {
         this.selectedConnection = connection;
     }
 
 
+    /**
+     * Creates a new instance of ConnectionWidget with no initial connection.
+     */
     public ConnectionWidget()
     {
         this.selectedConnection = null;
     }
 
 
+    /**
+     * Creates the widget.
+     * 
+     * @param parent the parent
+     */
     public void createWidget( final Composite parent )
     {
 
@@ -82,28 +105,43 @@
         } );
 
         // initial values
-        this.setConnection( this.selectedConnection );
+        setConnection( selectedConnection );
 
     }
 
 
+    /**
+     * Gets the selected connection.
+     * 
+     * @return the connection
+     */
     public IConnection getConnection()
     {
-        return this.selectedConnection;
+        return selectedConnection;
     }
 
 
+    /**
+     * Sets the selected connection.
+     * 
+     * @param connection the connection
+     */
     public void setConnection( IConnection connection )
     {
-        this.selectedConnection = connection;
-        connectionText.setText( this.selectedConnection != null ? this.selectedConnection.getName() : "" );
+        selectedConnection = connection;
+        connectionText.setText( selectedConnection != null ? selectedConnection.getName() : "" );
     }
 
 
+    /**
+     * Sets the enabled state of the widget.
+     * 
+     * @param b true to enable the widget, false to disable the widget
+     */
     public void setEnabled( boolean b )
     {
-        this.connectionText.setEnabled( b );
-        this.connectionBrowseButton.setEnabled( b );
+        connectionText.setEnabled( b );
+        connectionBrowseButton.setEnabled( b );
     }
 
 }

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/EntryWidget.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/EntryWidget.java?view=diff&rev=514464&r1=514463&r2=514464
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/EntryWidget.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/EntryWidget.java Sun Mar  4 12:15:08 2007
@@ -33,7 +33,6 @@
 import org.apache.directory.ldapstudio.browser.ui.widgets.BaseWidgetUtils;
 import org.apache.directory.ldapstudio.browser.ui.widgets.BrowserWidget;
 import org.apache.directory.ldapstudio.browser.ui.widgets.HistoryUtils;
-
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
@@ -45,20 +44,41 @@
 import org.eclipse.swt.widgets.Composite;
 
 
+/**
+ * The EntryWidget could be used to select an entry. 
+ * It is composed
+ * <ul>
+ * <li>a combo to manually enter an DN or to choose one from
+ *     the history
+ * <li>an up button to switch to the parent's DN
+ * <li>a browse button to open a {@link SelectEntryDialog}
+ * </ul>
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class EntryWidget extends BrowserWidget
 {
-
+    
+    /** The DN combo. */
     private Combo dnCombo;
 
+    /** The up button. */
     private Button upButton;
 
+    /** The entry browse button. */
     private Button entryBrowseButton;
 
+    /** The connection. */
     private IConnection connection;
 
+    /** The selected DN. */
     private DN dn;
 
 
+    /**
+     * Creates a new instance of EntryWidget.
+     */
     public EntryWidget()
     {
         this.connection = null;
@@ -66,6 +86,12 @@
     }
 
 
+    /**
+     * Creates a new instance of EntryWidget.
+     *
+     * @param connection the connection
+     * @param dn the initial DN
+     */
     public EntryWidget( IConnection connection, DN dn )
     {
         this.connection = connection;
@@ -73,17 +99,23 @@
     }
 
 
+    /**
+     * Creates the widget.
+     * 
+     * @param parent the parent
+     */
     public void createWidget( final Composite parent )
     {
 
-        // Text and up
+        // DN combo
         Composite textAndUpComposite = BaseWidgetUtils.createColumnContainer( parent, 2, 1 );
         dnCombo = BaseWidgetUtils.createCombo( textAndUpComposite, new String[0], -1, 1 );
         GridData gd = new GridData( GridData.FILL_HORIZONTAL );
         gd.horizontalSpan = 1;
         gd.widthHint = 200;
         dnCombo.setLayoutData( gd );
-        // dn history
+        
+        // DN history
         String[] history = HistoryUtils.load( BrowserUIConstants.DIALOGSETTING_KEY_DN_HISTORY );
         dnCombo.setItems( history );
         dnCombo.addModifyListener( new ModifyListener()
@@ -110,6 +142,8 @@
                 notifyListeners();
             }
         } );
+        
+        // Up button
         upButton = new Button( textAndUpComposite, SWT.PUSH );
         upButton.setToolTipText( "Parent" );
         upButton.setImage( BrowserUIPlugin.getDefault().getImage( BrowserUIConstants.IMG_PARENT ) );
@@ -128,16 +162,14 @@
             }
         } );
 
-        // Button
+        // Browse button
         entryBrowseButton = BaseWidgetUtils.createButton( parent, "Br&owse...", 1 );
         entryBrowseButton.addSelectionListener( new SelectionAdapter()
         {
             public void widgetSelected( SelectionEvent e )
             {
-
                 if ( connection != null )
                 {
-
                     IEntry entry = null;
                     if ( dn != null && dn.getRdns().length > 0 )
                     {
@@ -178,15 +210,23 @@
     }
 
 
+    /**
+     * Notifies that the DN has been changed.
+     */
     private void dnChanged()
     {
-        if ( this.dnCombo != null && this.entryBrowseButton != null )
+        if ( dnCombo != null && entryBrowseButton != null )
         {
             dnCombo.setText( dn != null ? dn.toString() : "" );
         }
     }
 
 
+    /**
+     * Sets the enabled state of the widget.
+     * 
+     * @param b true to enable the widget, false to disable the widget
+     */
     public void setEnabled( boolean b )
     {
         dnCombo.setEnabled( b );
@@ -200,31 +240,53 @@
     }
 
 
+    /**
+     * Internal set enabled.
+     */
     private void internalSetEnabled()
     {
         upButton.setEnabled( dn != null && dn.getParentDn() != null && dnCombo.isEnabled() );
-        entryBrowseButton.setEnabled( this.connection != null && dnCombo.isEnabled() );
+        entryBrowseButton.setEnabled( connection != null && dnCombo.isEnabled() );
     }
 
 
+    /**
+     * Saves dialog settings.
+     */
     public void saveDialogSettings()
     {
         HistoryUtils.save( BrowserUIConstants.DIALOGSETTING_KEY_DN_HISTORY, this.dnCombo.getText() );
     }
 
 
+    /**
+     * Gets the DN.
+     * 
+     * @return the DN
+     */
     public DN getDn()
     {
-        return this.dn;
+        return dn;
     }
 
 
+    /**
+     * Gets the connection.
+     * 
+     * @return the connection
+     */
     public IConnection getConnection()
     {
-        return this.connection;
+        return connection;
     }
 
 
+    /**
+     * Sets the input.
+     * 
+     * @param dn the DN
+     * @param connection the connection
+     */
     public void setInput( IConnection connection, DN dn )
     {
         if ( this.connection != connection || this.dn != dn )

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/FilterWidget.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/FilterWidget.java?view=diff&rev=514464&r1=514463&r2=514464
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/FilterWidget.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/FilterWidget.java Sun Mar  4 12:15:08 2007
@@ -27,10 +27,9 @@
 import org.apache.directory.ldapstudio.browser.ui.dialogs.FilterDialog;
 import org.apache.directory.ldapstudio.browser.ui.editors.filter.FilterContentAssistProcessor;
 import org.apache.directory.ldapstudio.browser.ui.widgets.BaseWidgetUtils;
-import org.apache.directory.ldapstudio.browser.ui.widgets.DialogContentAssistant;
 import org.apache.directory.ldapstudio.browser.ui.widgets.BrowserWidget;
+import org.apache.directory.ldapstudio.browser.ui.widgets.DialogContentAssistant;
 import org.apache.directory.ldapstudio.browser.ui.widgets.HistoryUtils;
-
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
@@ -42,20 +41,39 @@
 import org.eclipse.swt.widgets.Composite;
 
 
+/**
+ * The FileterWidget could be used to specify an LDAP filter. 
+ * It is composed of a text with a content assit to enter 
+ * a filter and a button to open a {@link FilterDialog}.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class FilterWidget extends BrowserWidget
 {
 
+    /** The filter combo. */
     private Combo filterCombo;
 
+    /** The button to open the filter editor. */
     private Button filterEditorButton;
 
+    /** The content assist processor. */
     private FilterContentAssistProcessor contentAssistProcessor;
 
+    /** The connection. */
     private IConnection connection;
 
+    /** The inital filter. */
     private String initalFilter;
 
 
+    /**
+     * Creates a new instance of FilterWidget.
+     * 
+     * @param connection the connection
+     * @param initalFilter the inital filter
+     */
     public FilterWidget( IConnection connection, String initalFilter )
     {
         this.connection = connection;
@@ -63,6 +81,10 @@
     }
 
 
+    /**
+     * Creates a new instance of FilterWidget with no connection and
+     * no initial filter.
+     */
     public FilterWidget()
     {
         this.connection = null;
@@ -70,9 +92,13 @@
     }
 
 
+    /**
+     * Creates the widget.
+     * 
+     * @param parent the parent
+     */
     public void createWidget( final Composite parent )
     {
-
         // Combo
         filterCombo = BaseWidgetUtils.createCombo( parent, new String[0], -1, 1 );
         GridData gd = new GridData( GridData.FILL_HORIZONTAL );
@@ -87,6 +113,8 @@
                 notifyListeners();
             }
         } );
+
+        // Content assist
         LdapFilterParser parser = new LdapFilterParser();
         contentAssistProcessor = new FilterContentAssistProcessor( parser );
         DialogContentAssistant fca = new DialogContentAssistant();
@@ -96,7 +124,7 @@
         fca.setContentAssistProcessor( contentAssistProcessor, IDocument.DEFAULT_CONTENT_TYPE );
         fca.install( filterCombo );
 
-        // Button
+        // Filter editor button
         filterEditorButton = BaseWidgetUtils.createButton( parent, "F&ilter Editor...", 1 );
         filterEditorButton.addSelectionListener( new SelectionAdapter()
         {
@@ -121,24 +149,38 @@
         filterCombo.setItems( history );
 
         // initial values
-        this.setConnection( this.connection );
+        setConnection( connection );
         filterCombo.setText( initalFilter == null ? "(objectClass=*)" : initalFilter );
-
     }
 
 
+    /**
+     * Gets the filter.
+     * 
+     * @return the filter
+     */
     public String getFilter()
     {
-        return this.filterCombo.getText();
+        return filterCombo.getText();
     }
 
 
+    /**
+     * Sets the filter.
+     * 
+     * @param filter the filter
+     */
     public void setFilter( String filter )
     {
-        this.filterCombo.setText( filter );
+        filterCombo.setText( filter );
     }
 
 
+    /**
+     * Sets the connection.
+     * 
+     * @param connection the connection
+     */
     public void setConnection( IConnection connection )
     {
         this.connection = connection;
@@ -147,22 +189,33 @@
     }
 
 
+    /**
+     * Saves dialog settings.
+     */
     public void saveDialogSettings()
     {
-        HistoryUtils.save( BrowserUIConstants.DIALOGSETTING_KEY_SEARCH_FILTER_HISTORY, this.filterCombo.getText() );
+        HistoryUtils.save( BrowserUIConstants.DIALOGSETTING_KEY_SEARCH_FILTER_HISTORY, filterCombo.getText() );
     }
 
 
+    /**
+     * Sets the focus.
+     */
     public void setFocus()
     {
         // filterCombo.setFocus();
     }
 
 
+    /**
+     * Sets the enabled state of the widget.
+     * 
+     * @param b true to enable the widget, false to disable the widget
+     */
     public void setEnabled( boolean b )
     {
-        this.filterCombo.setEnabled( b );
-        this.filterEditorButton.setEnabled( b );
+        filterCombo.setEnabled( b );
+        filterEditorButton.setEnabled( b );
     }
 
 }

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/LimitWidget.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/LimitWidget.java?view=diff&rev=514464&r1=514463&r2=514464
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/LimitWidget.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/LimitWidget.java Sun Mar  4 12:15:08 2007
@@ -34,24 +34,44 @@
 import org.eclipse.swt.widgets.Text;
 
 
+/**
+ * The LimitWidget could be used to select the limits of a connection
+ * or search. It is composed of a group with text input fields.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class LimitWidget extends BrowserWidget
 {
 
+    /** The initial count limit. */
     private int initialCountLimit;
 
+    /** The initial time limit. */
     private int initialTimeLimit;
 
+    /** The limit group. */
     private Group limitGroup;
 
+    /** The count limit label. */
     private Label countLimitLabel;
 
+    /** The count limit text. */
     private Text countLimitText;
 
+    /** The time limit label. */
     private Label timeLimitLabel;
 
+    /** The time limit text. */
     private Text timeLimitText;
 
 
+    /**
+     * Creates a new instance of LimitWidget.
+     * 
+     * @param initialTimeLimit the initial time limit
+     * @param initialCountLimit the initial count limit
+     */
     public LimitWidget( int initialCountLimit, int initialTimeLimit )
     {
         this.initialCountLimit = initialCountLimit;
@@ -59,6 +79,9 @@
     }
 
 
+    /**
+     * Creates a new instance of LimitWidget with no limits.
+     */
     public LimitWidget()
     {
         this.initialCountLimit = 0;
@@ -66,14 +89,19 @@
     }
 
 
+    /**
+     * Creates the widget.
+     * 
+     * @param parent the parent
+     */
     public void createWidget( Composite parent )
     {
 
         limitGroup = BaseWidgetUtils.createGroup( parent, "Limits", 1 );
-
         GridLayout gl = new GridLayout( 2, false );
         limitGroup.setLayout( gl );
 
+        // Count limit
         countLimitLabel = BaseWidgetUtils.createLabel( limitGroup, "&Count Limit:", 1 );
         countLimitText = BaseWidgetUtils.createText( limitGroup, "", 1 );
         countLimitText.addVerifyListener( new VerifyListener()
@@ -94,6 +122,7 @@
             }
         } );
 
+        // Time limit
         timeLimitLabel = BaseWidgetUtils.createLabel( limitGroup, "&Time Limit:", 1 );
         timeLimitText = BaseWidgetUtils.createText( limitGroup, "", 1 );
         timeLimitText.addVerifyListener( new VerifyListener()
@@ -114,31 +143,46 @@
             }
         } );
 
-        this.setCountLimit( this.initialCountLimit );
-        this.setTimeLimit( this.initialTimeLimit );
+        setCountLimit( initialCountLimit );
+        setTimeLimit( initialTimeLimit );
     }
 
 
+    /**
+     * Sets the count limit.
+     * 
+     * @param countLimit the count limit
+     */
     public void setCountLimit( int countLimit )
     {
-        this.initialCountLimit = countLimit;
-        this.countLimitText.setText( "" + this.initialCountLimit );
+        initialCountLimit = countLimit;
+        countLimitText.setText( Integer.toString( initialCountLimit ) );
     }
 
 
+    /**
+     * Sets the time limit.
+     * 
+     * @param timeLimit the time limit
+     */
     public void setTimeLimit( int timeLimit )
     {
-        this.initialTimeLimit = timeLimit;
-        this.timeLimitText.setText( "" + this.initialTimeLimit );
+        initialTimeLimit = timeLimit;
+        timeLimitText.setText( Integer.toString( initialTimeLimit ) );
     }
 
 
+    /**
+     * Gets the count limit.
+     * 
+     * @return the count limit
+     */
     public int getCountLimit()
     {
         int countLimit;
         try
         {
-            countLimit = new Integer( this.countLimitText.getText() ).intValue();
+            countLimit = new Integer( countLimitText.getText() ).intValue();
         }
         catch ( NumberFormatException e )
         {
@@ -148,12 +192,17 @@
     }
 
 
+    /**
+     * Gets the time limit.
+     * 
+     * @return the time limit
+     */
     public int getTimeLimit()
     {
         int timeLimit;
         try
         {
-            timeLimit = new Integer( this.timeLimitText.getText() ).intValue();
+            timeLimit = new Integer( timeLimitText.getText() ).intValue();
         }
         catch ( NumberFormatException e )
         {
@@ -163,6 +212,11 @@
     }
 
 
+    /**
+     * Sets the enabled state of the widget.
+     * 
+     * @param b true to enable the widget, false to disable the widget
+     */
     public void setEnabled( boolean b )
     {
         limitGroup.setEnabled( b );

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ReferralsHandlingWidget.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ReferralsHandlingWidget.java?view=diff&rev=514464&r1=514463&r2=514464
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ReferralsHandlingWidget.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ReferralsHandlingWidget.java Sun Mar  4 12:15:08 2007
@@ -24,7 +24,6 @@
 import org.apache.directory.ldapstudio.browser.core.model.IConnection;
 import org.apache.directory.ldapstudio.browser.ui.widgets.BaseWidgetUtils;
 import org.apache.directory.ldapstudio.browser.ui.widgets.BrowserWidget;
-
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
 import org.eclipse.swt.widgets.Button;
@@ -32,30 +31,59 @@
 import org.eclipse.swt.widgets.Group;
 
 
+/**
+ * The ReferralsHandlingWidget could be used to select the
+ * referrals handling method. It is composed of a group with 
+ * two radio buttons.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class ReferralsHandlingWidget extends BrowserWidget
 {
 
+    /** The initial referrals handling method. */
     private int initialReferralsHandlingMethod;
 
+    /** The group. */
     private Group group;
 
+    /** The ignore button. */
     private Button ignoreButton;
 
+    /** The follow button. */
     private Button followButton;
 
 
+    /**
+     * Creates a new instance of ReferralsHandlingWidget with the given
+     * referrals handling method. This must be one of
+     * {@link IConnection#HANDLE_REFERRALS_IGNORE} or
+     * {@link IConnection#HANDLE_REFERRALS_FOLLOW}.  
+     * 
+     * @param initialReferralsHandlingMethod the initial referrals handling method
+     */
     public ReferralsHandlingWidget( int initialReferralsHandlingMethod )
     {
         this.initialReferralsHandlingMethod = initialReferralsHandlingMethod;
     }
 
 
+    /**
+     * Creates a new instance of ReferralsHandlingWidget with initial 
+     * referrals handling method {@link IConnection#HANDLE_REFERRALS_IGNORE}.
+     */
     public ReferralsHandlingWidget()
     {
         this.initialReferralsHandlingMethod = IConnection.HANDLE_REFERRALS_IGNORE;
     }
 
 
+    /**
+     * Creates the widget.
+     * 
+     * @param parent the parent
+     */
     public void createWidget( Composite parent )
     {
 
@@ -80,36 +108,55 @@
             }
         } );
 
-        this.setReferralsHandlingMethod( this.initialReferralsHandlingMethod );
+        setReferralsHandlingMethod( initialReferralsHandlingMethod );
     }
 
 
+    /**
+     * Sets the referrals handling method must be one of
+     *  {@link IConnection#HANDLE_REFERRALS_IGNORE} or
+     * {@link IConnection#HANDLE_REFERRALS_FOLLOW}. 
+     * 
+     * @param referralsHandlingMethod the referrals handling method
+     */
     public void setReferralsHandlingMethod( int referralsHandlingMethod )
     {
-        this.initialReferralsHandlingMethod = referralsHandlingMethod;
+        initialReferralsHandlingMethod = referralsHandlingMethod;
         ignoreButton.setSelection( initialReferralsHandlingMethod == IConnection.HANDLE_REFERRALS_IGNORE );
         followButton.setSelection( initialReferralsHandlingMethod == IConnection.HANDLE_REFERRALS_FOLLOW );
     }
 
 
+    /**
+     * Gets the referrals handling method, one of
+     * {@link IConnection#HANDLE_REFERRALS_IGNORE} or
+     * {@link IConnection#HANDLE_REFERRALS_FOLLOW}.
+     * 
+     * @return the referrals handling method
+     */
     public int getReferralsHandlingMethod()
     {
-        if ( this.ignoreButton.getSelection() )
+        if ( ignoreButton.getSelection() )
         {
             return IConnection.HANDLE_REFERRALS_IGNORE;
         }
         else
-        /* if(this.handleButton.getSelection()) */{
+        {
             return IConnection.HANDLE_REFERRALS_FOLLOW;
         }
     }
 
 
+    /**
+     * Sets the enabled state of the widget.
+     * 
+     * @param b true to enable the widget, false to disable the widget
+     */
     public void setEnabled( boolean b )
     {
-        this.group.setEnabled( b );
-        this.ignoreButton.setEnabled( b );
-        this.followButton.setEnabled( b );
+        group.setEnabled( b );
+        ignoreButton.setEnabled( b );
+        followButton.setEnabled( b );
     }
 
 }

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ReturningAttributesContentAssistProcessor.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ReturningAttributesContentAssistProcessor.java?view=diff&rev=514464&r1=514463&r2=514464
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ReturningAttributesContentAssistProcessor.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ReturningAttributesContentAssistProcessor.java Sun Mar  4 12:15:08 2007
@@ -40,7 +40,8 @@
 
 /**
  * The ReturningAttributesContentAssistProcessor provides proposals for the 
- * {@link ReturningAttributesWidget}.
+ * {@link ReturningAttributesWidget}. It splits the comma separted text input
+ * into separate regions.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  * @version $Rev$, $Date$
@@ -134,6 +135,8 @@
     {
         IDocument document = contentAssistSubjectControl.getDocument();
         String text = document.get();
+       
+        // search start of current attribute type
         int start = 0;
         for ( int i = documentOffset - 1; i >= 0; i-- )
         {
@@ -146,6 +149,7 @@
         }
         String attribute = text.substring( start, documentOffset );
 
+        // create proposal list
         List<ICompletionProposal> proposalList = new ArrayList<ICompletionProposal>();
         for ( int k = 0; k < possibleAttributeTypes.length; k++ )
         {

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ReturningAttributesWidget.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ReturningAttributesWidget.java?view=diff&rev=514464&r1=514463&r2=514464
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ReturningAttributesWidget.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ReturningAttributesWidget.java Sun Mar  4 12:15:08 2007
@@ -25,10 +25,9 @@
 import org.apache.directory.ldapstudio.browser.core.utils.Utils;
 import org.apache.directory.ldapstudio.browser.ui.BrowserUIConstants;
 import org.apache.directory.ldapstudio.browser.ui.widgets.BaseWidgetUtils;
-import org.apache.directory.ldapstudio.browser.ui.widgets.DialogContentAssistant;
 import org.apache.directory.ldapstudio.browser.ui.widgets.BrowserWidget;
+import org.apache.directory.ldapstudio.browser.ui.widgets.DialogContentAssistant;
 import org.apache.directory.ldapstudio.browser.ui.widgets.HistoryUtils;
-
 import org.eclipse.jface.text.IDocument;
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
@@ -37,18 +36,36 @@
 import org.eclipse.swt.widgets.Composite;
 
 
+/**
+ * The ReturningAttributesWidget could be used to enter a list of attribute types
+ * return by an LDPA search. It is composed of a combo with content assist
+ * and a history.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class ReturningAttributesWidget extends BrowserWidget
 {
 
+    /** The returning attributes combo. */
     private Combo returningAttributesCombo;
 
+    /** The content assist processor. */
     private ReturningAttributesContentAssistProcessor contentAssistProcessor;
 
+    /** The connection. */
     private IConnection connection;
 
+    /** The initial returning attributes. */
     private String[] initialReturningAttributes;
 
 
+    /**
+     * Creates a new instance of ReturningAttributesWidget.
+     * 
+     * @param initialReturningAttributes the initial returning attributes
+     * @param connection the connection
+     */
     public ReturningAttributesWidget( IConnection connection, String[] initialReturningAttributes )
     {
         this.connection = connection;
@@ -56,6 +73,11 @@
     }
 
 
+    /**
+     * Creates a new instance of ReturningAttributesWidget with no connection
+     * and no initial returning attributes. 
+     *
+     */
     public ReturningAttributesWidget()
     {
         this.connection = null;
@@ -63,16 +85,21 @@
     }
 
 
+    /**
+     * Creates the widget.
+     * 
+     * @param parent the parent
+     */
     public void createWidget( Composite parent )
     {
-
+        // Combo
         returningAttributesCombo = BaseWidgetUtils.createCombo( parent, new String[0], -1, 1 );
-
         GridData gd = new GridData( GridData.FILL_HORIZONTAL );
         gd.horizontalSpan = 1;
         gd.widthHint = 200;
         returningAttributesCombo.setLayoutData( gd );
 
+        // Content assist
         contentAssistProcessor = new ReturningAttributesContentAssistProcessor( new String[0] );
         DialogContentAssistant raca = new DialogContentAssistant();
         raca.enableAutoInsert( true );
@@ -81,6 +108,7 @@
         raca.setContentAssistProcessor( contentAssistProcessor, IDocument.DEFAULT_CONTENT_TYPE );
         raca.install( returningAttributesCombo );
 
+        // History
         String[] history = HistoryUtils.load( BrowserUIConstants.DIALOGSETTING_KEY_RETURNING_ATTRIBUTES_HISTORY );
         for ( int i = 0; i < history.length; i++ )
         {
@@ -97,10 +125,15 @@
             }
         } );
 
-        this.setConnection( this.connection );
+        setConnection( connection );
     }
 
 
+    /**
+     * Sets the connection.
+     * 
+     * @param connection the connection
+     */
     public void setConnection( IConnection connection )
     {
         this.connection = connection;
@@ -109,19 +142,34 @@
     }
 
 
+    /**
+     * Sets the initial returning attributes.
+     * 
+     * @param initialReturningAttributes the initial returning attributes
+     */
     public void setInitialReturningAttributes( String[] initialReturningAttributes )
     {
         this.initialReturningAttributes = initialReturningAttributes;
-        returningAttributesCombo.setText( Utils.arrayToString( this.initialReturningAttributes ) );
+        returningAttributesCombo.setText( Utils.arrayToString( initialReturningAttributes ) );
     }
 
 
+    /**
+     * Sets the enabled state of the widget.
+     * 
+     * @param b true to enable the widget, false to disable the widget
+     */
     public void setEnabled( boolean b )
     {
         this.returningAttributesCombo.setEnabled( b );
     }
 
 
+    /**
+     * Gets the returning attributes.
+     * 
+     * @return the returning attributes
+     */
     public String[] getReturningAttributes()
     {
         String s = this.returningAttributesCombo.getText();
@@ -129,6 +177,9 @@
     }
 
 
+    /**
+     * Saves dialog settings.
+     */
     public void saveDialogSettings()
     {
         HistoryUtils.save( BrowserUIConstants.DIALOGSETTING_KEY_RETURNING_ATTRIBUTES_HISTORY, Utils
@@ -136,6 +187,9 @@
     }
 
 
+    /**
+     * Sets the focus.
+     */
     public void setFocus()
     {
         returningAttributesCombo.setFocus();

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ScopeWidget.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ScopeWidget.java?view=diff&rev=514464&r1=514463&r2=514464
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ScopeWidget.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/ScopeWidget.java Sun Mar  4 12:15:08 2007
@@ -23,7 +23,6 @@
 
 import org.apache.directory.ldapstudio.browser.core.model.ISearch;
 import org.apache.directory.ldapstudio.browser.ui.widgets.BrowserWidget;
-
 import org.eclipse.swt.SWT;
 import org.eclipse.swt.events.SelectionAdapter;
 import org.eclipse.swt.events.SelectionEvent;
@@ -34,41 +33,70 @@
 import org.eclipse.swt.widgets.Group;
 
 
+/**
+ * The ScopeWidget could be used to select the scope of a search. 
+ * It is composed of a group with radio buttons.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class ScopeWidget extends BrowserWidget
 {
 
+    /** The initial scope. */
     private int initialScope;
 
+    /** The scope group. */
     private Group scopeGroup;
 
+    /** The scope object button. */
     private Button scopeObjectButton;
 
+    /** The scope onelevel button. */
     private Button scopeOnelevelButton;
 
+    /** The scope subtree button. */
     private Button scopeSubtreeButton;
 
 
+    /**
+     * Creates a new instance of ScopeWidget with the given
+     * initial scope. That must be one of {@link ISearch#SCOPE_OBJECT},
+     * {@link ISearch#SCOPE_ONELEVEL} or {@link ISearch#SCOPE_SUBTREE}.
+     * 
+     * @param initialScope the initial scope
+     */
     public ScopeWidget( int initialScope )
     {
         this.initialScope = initialScope;
     }
 
 
+    /**
+     * Creates a new instance of ScopeWidget with initial scope
+     * {@link ISearch#SCOPE_OBJECT}.
+     */
     public ScopeWidget()
     {
         this.initialScope = 0;
     }
 
 
+    /**
+     * Creates the widget.
+     * 
+     * @param parent the parent
+     */
     public void createWidget( Composite parent )
     {
 
-        // Search Scope
+        // Scope group
         scopeGroup = new Group( parent, SWT.NONE );
         scopeGroup.setText( "Scope" );
         scopeGroup.setLayout( new GridLayout( 1, false ) );
         scopeGroup.setLayoutData( new GridData( GridData.FILL_BOTH ) );
 
+        // Object radio
         scopeObjectButton = new Button( scopeGroup, SWT.RADIO );
         scopeObjectButton.setText( "&Object" );
         scopeObjectButton.addSelectionListener( new SelectionAdapter()
@@ -78,6 +106,8 @@
                 notifyListeners();
             }
         } );
+
+        // Onelevel radio
         scopeOnelevelButton = new Button( scopeGroup, SWT.RADIO );
         scopeOnelevelButton.setText( "One &Level" );
         scopeOnelevelButton.addSelectionListener( new SelectionAdapter()
@@ -87,6 +117,8 @@
                 notifyListeners();
             }
         } );
+
+        // subtree button
         scopeSubtreeButton = new Button( scopeGroup, SWT.RADIO );
         scopeSubtreeButton.setText( "&Subtree" );
         scopeSubtreeButton.addSelectionListener( new SelectionAdapter()
@@ -97,38 +129,61 @@
             }
         } );
 
-        setScope( this.initialScope );
+        setScope( initialScope );
     }
 
 
+    /**
+     * Sets the scope, must be one of {@link ISearch#SCOPE_OBJECT},
+     * {@link ISearch#SCOPE_ONELEVEL} or {@link ISearch#SCOPE_SUBTREE}.
+     * 
+     * @param scope the scope
+     */
     public void setScope( int scope )
     {
-        this.initialScope = scope;
-
+        initialScope = scope;
         scopeObjectButton.setSelection( initialScope == ISearch.SCOPE_OBJECT );
         scopeOnelevelButton.setSelection( initialScope == ISearch.SCOPE_ONELEVEL );
         scopeSubtreeButton.setSelection( initialScope == ISearch.SCOPE_SUBTREE );
-
     }
 
 
+    /**
+     * Gets the scope, one of {@link ISearch#SCOPE_OBJECT},
+     * {@link ISearch#SCOPE_ONELEVEL} or {@link ISearch#SCOPE_SUBTREE}.
+     * 
+     * @return the scope
+     */
     public int getScope()
     {
         int scope;
 
-        if ( this.scopeSubtreeButton.getSelection() )
+        if ( scopeSubtreeButton.getSelection() )
+        {
             scope = ISearch.SCOPE_SUBTREE;
-        else if ( this.scopeOnelevelButton.getSelection() )
+        }
+        else if ( scopeOnelevelButton.getSelection() )
+        {
             scope = ISearch.SCOPE_ONELEVEL;
-        else if ( this.scopeObjectButton.getSelection() )
+        }
+        else if ( scopeObjectButton.getSelection() )
+        {
             scope = ISearch.SCOPE_OBJECT;
+        }
         else
+        {
             scope = ISearch.SCOPE_ONELEVEL;
+        }
 
         return scope;
     }
 
 
+    /**
+     * Sets the enabled state of the widget.
+     * 
+     * @param b true to enable the widget, false to disable the widget
+     */
     public void setEnabled( boolean b )
     {
         scopeGroup.setEnabled( b );

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/SearchPageWrapper.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/SearchPageWrapper.java?view=diff&rev=514464&r1=514463&r2=514464
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/SearchPageWrapper.java (original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/widgets/search/SearchPageWrapper.java Sun Mar  4 12:15:08 2007
@@ -37,7 +37,6 @@
 import org.apache.directory.ldapstudio.browser.ui.widgets.BrowserWidget;
 import org.apache.directory.ldapstudio.browser.ui.widgets.WidgetModifyEvent;
 import org.apache.directory.ldapstudio.browser.ui.widgets.WidgetModifyListener;
-
 import org.eclipse.swt.events.ModifyEvent;
 import org.eclipse.swt.events.ModifyListener;
 import org.eclipse.swt.events.SelectionAdapter;
@@ -49,98 +48,157 @@
 import org.eclipse.swt.widgets.Text;
 
 
+/**
+ * The SearchPageWrapper is used to arrange all input elements of a
+ * search page. It is used by the search page, the search properties page,
+ * the batch operation wizard and the export wizards.
+ * 
+ * The style is used to specify the invisible and readonly elements. 
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class SearchPageWrapper extends BrowserWidget
 {
 
+    /** The default style */
     public static final int NONE = 0;
 
+    /** Style for invisible name field */
     public static final int NAME_INVISIBLE = 1 << 1;
 
+    /** Style for read-only name field */
     public static final int NAME_READONLY = 1 << 2;
 
+    /** Style for invisible connection field */
     public static final int CONNECTION_INVISIBLE = 1 << 3;
 
+    /** Style for read-only connection field */
     public static final int CONNECTION_READONLY = 1 << 4;
 
+    /** Style for invisible search base field */
     public static final int SEARCHBASE_INVISIBLE = 1 << 5;
 
+    /** Style for read-only search base field */
     public static final int SEARCHBASE_READONLY = 1 << 6;
 
+    /** Style for invisible filter field */
     public static final int FILTER_INVISIBLE = 1 << 7;
 
+    /** Style for read-only filter field */
     public static final int FILTER_READONLY = 1 << 8;
 
+    /** Style for invisible returning attributes field */
     public static final int RETURNINGATTRIBUTES_INVISIBLE = 1 << 9;
 
+    /** Style for read-only returning attributes field */
     public static final int RETURNINGATTRIBUTES_READONLY = 1 << 10;
 
-    public static final int DN_VISIBLE = 1 << 11;
+    /** Style for visible return DN checkbox */
+    public static final int RETURN_DN_VISIBLE = 1 << 11;
 
-    public static final int DN_CHECKED = 1 << 12;
+    /** Style for checked return DN checkbox */
+    public static final int RETURN_DN_CHECKED = 1 << 12;
 
-    public static final int ALLATTRIBUTES_VISIBLE = 1 << 13;
+    /** Style for visible return all attributes checkbox */
+    public static final int RETURN_ALLATTRIBUTES_VISIBLE = 1 << 13;
 
-    public static final int ALLATTRIBUTES_CHECKED = 1 << 14;
+    /** Style for checked return all attributes checkbox */
+    public static final int RETURN_ALLATTRIBUTES_CHECKED = 1 << 14;
 
-    public static final int OPERATIONALATTRIBUTES_VISIBLE = 1 << 15;
+    /** Style for visible return operational attributes checkbox */
+    public static final int RETURN_OPERATIONALATTRIBUTES_VISIBLE = 1 << 15;
 
-    public static final int OPERATIONALATTRIBUTES_CHECKED = 1 << 16;
+    /** Style for checked return operational attributes checkbox */
+    public static final int RETURN_OPERATIONALATTRIBUTES_CHECKED = 1 << 16;
 
+    /** Style for invisible options */
     public static final int OPTIONS_INVISIBLE = 1 << 21;
 
+    /** Style for read-only scope options */
     public static final int SCOPEOPTIONS_READONLY = 1 << 22;
 
+    /** Style for read-only limit options */
     public static final int LIMITOPTIONS_READONLY = 1 << 23;
 
+    /** Style for read-only alias options */
     public static final int ALIASOPTIONS_READONLY = 1 << 24;
 
+    /** Style for read-only referrals options */
     public static final int REFERRALOPTIONS_READONLY = 1 << 25;
 
+    /** Style for invisible controls fields */
     public static final int CONTROLS_INVISIBLE = 1 << 30;
 
+    /** The style. */
     protected int style;
 
+    /** The filter parser. */
     protected LdapFilterParser parser;
 
+    /** The search name label. */
     protected Label searchNameLabel;
 
+    /** The search name text. */
     protected Text searchNameText;
 
+    /** The connection label. */
     protected Label connectionLabel;
 
+    /** The connection widget. */
     protected ConnectionWidget connectionWidget;
 
+    /** The search base label. */
     protected Label searchBaseLabel;
 
+    /** The search base widget. */
     protected EntryWidget searchBaseWidget;
 
+    /** The filter label. */
     protected Label filterLabel;
 
+    /** The filter widget. */
     protected FilterWidget filterWidget;
 
+    /** The returning attributes label. */
     protected Label returningAttributesLabel;
 
+    /** The returning attributes widget. */
     protected ReturningAttributesWidget returningAttributesWidget;
 
-    protected Button dnButton;
+    /** The return dn button. */
+    protected Button returnDnButton;
 
-    protected Button allAttributesButton;
+    /** The return all attributes button. */
+    protected Button returnAllAttributesButton;
 
-    protected Button operationalAttributesButton;
+    /** The return operational attributes button. */
+    protected Button returnOperationalAttributesButton;
 
+    /** The scope widget. */
     protected ScopeWidget scopeWidget;
 
+    /** The limit widget. */
     protected LimitWidget limitWidget;
 
+    /** The aliases dereferencing widget. */
     protected AliasesDereferencingWidget aliasesDereferencingWidget;
 
+    /** The referrals handling widget. */
     protected ReferralsHandlingWidget referralsHandlingWidget;
 
+    /** The control label. */
     protected Label controlLabel;
 
+    /** The subentries control button. */
     protected Button subentriesControlButton;
 
 
+    /**
+     * Creates a new instance of SearchPageWrapper.
+     * 
+     * @param style the style
+     */
     public SearchPageWrapper( int style )
     {
         this.parser = new LdapFilterParser();
@@ -148,9 +206,13 @@
     }
 
 
+    /**
+     * Creates the contents.
+     * 
+     * @param composite the composite
+     */
     public void createContents( final Composite composite )
     {
-
         // Search Name
         createSearchNameLine( composite );
 
@@ -171,20 +233,33 @@
 
         // scope, limit, alias, referral
         createOptionsComposite( composite );
-
     }
 
 
+    /**
+     * Checks if the given style is active.
+     * 
+     * @param requiredStyle the required style to check
+     * 
+     * @return true, if the required style is active
+     */
     protected boolean isActive( int requiredStyle )
     {
-        return ( this.style & requiredStyle ) != 0;
+        return ( style & requiredStyle ) != 0;
     }
 
 
+    /**
+     * Creates the search name line.
+     * 
+     * @param composite the composite
+     */
     protected void createSearchNameLine( final Composite composite )
     {
         if ( isActive( NAME_INVISIBLE ) )
+        {
             return;
+        }
 
         searchNameLabel = BaseWidgetUtils.createLabel( composite, "Search Name:", 1 );
         if ( isActive( NAME_READONLY ) )
@@ -207,10 +282,17 @@
     }
 
 
+    /**
+     * Creates the connection line.
+     * 
+     * @param composite the composite
+     */
     protected void createConnectionLine( final Composite composite )
     {
         if ( isActive( CONNECTION_INVISIBLE ) )
+        {
             return;
+        }
 
         connectionLabel = BaseWidgetUtils.createLabel( composite, "Connection:", 1 );
         connectionWidget = new ConnectionWidget();
@@ -227,10 +309,17 @@
     }
 
 
+    /**
+     * Creates the search base line.
+     * 
+     * @param composite the composite
+     */
     protected void createSearchBaseLine( final Composite composite )
     {
         if ( isActive( SEARCHBASE_INVISIBLE ) )
+        {
             return;
+        }
 
         searchBaseLabel = BaseWidgetUtils.createLabel( composite, "Search Base:", 1 );
         searchBaseWidget = new EntryWidget();
@@ -247,10 +336,17 @@
     }
 
 
+    /**
+     * Creates the filter line.
+     * 
+     * @param composite the composite
+     */
     protected void createFilterLine( final Composite composite )
     {
         if ( isActive( FILTER_INVISIBLE ) )
+        {
             return;
+        }
 
         filterLabel = BaseWidgetUtils.createLabel( composite, "Filter:", 1 );
         filterWidget = new FilterWidget();
@@ -267,10 +363,17 @@
     }
 
 
+    /**
+     * Creates the returning attributes line.
+     * 
+     * @param composite the composite
+     */
     protected void createReturningAttributesLine( final Composite composite )
     {
         if ( isActive( RETURNINGATTRIBUTES_INVISIBLE ) )
+        {
             return;
+        }
 
         BaseWidgetUtils.createLabel( composite, "Returning Attributes:", 1 );
         Composite retComposite = BaseWidgetUtils.createColumnContainer( composite, 1, 2 );
@@ -285,46 +388,48 @@
             }
         } );
 
-        if ( isActive( DN_VISIBLE ) || isActive( ALLATTRIBUTES_VISIBLE ) || isActive( OPERATIONALATTRIBUTES_VISIBLE ) )
+        // special returning attributes options
+        if ( isActive( RETURN_DN_VISIBLE ) || isActive( RETURN_ALLATTRIBUTES_VISIBLE )
+            || isActive( RETURN_OPERATIONALATTRIBUTES_VISIBLE ) )
         {
             BaseWidgetUtils.createSpacer( composite, 1 );
             Composite buttonComposite = BaseWidgetUtils.createColumnContainer( composite, 3, 1 );
-            if ( isActive( DN_VISIBLE ) )
+            if ( isActive( RETURN_DN_VISIBLE ) )
             {
-                dnButton = BaseWidgetUtils.createCheckbox( buttonComposite, "Export DN", 1 );
-                dnButton.addSelectionListener( new SelectionAdapter()
+                returnDnButton = BaseWidgetUtils.createCheckbox( buttonComposite, "Export DN", 1 );
+                returnDnButton.addSelectionListener( new SelectionAdapter()
                 {
                     public void widgetSelected( SelectionEvent e )
                     {
                         validate();
                     }
                 } );
-                dnButton.setSelection( isActive( DN_CHECKED ) );
+                returnDnButton.setSelection( isActive( RETURN_DN_CHECKED ) );
             }
-            if ( isActive( ALLATTRIBUTES_VISIBLE ) )
+            if ( isActive( RETURN_ALLATTRIBUTES_VISIBLE ) )
             {
-                allAttributesButton = BaseWidgetUtils.createCheckbox( buttonComposite, "All user attributes", 1 );
-                allAttributesButton.addSelectionListener( new SelectionAdapter()
+                returnAllAttributesButton = BaseWidgetUtils.createCheckbox( buttonComposite, "All user attributes", 1 );
+                returnAllAttributesButton.addSelectionListener( new SelectionAdapter()
                 {
                     public void widgetSelected( SelectionEvent e )
                     {
                         validate();
                     }
                 } );
-                allAttributesButton.setSelection( isActive( ALLATTRIBUTES_CHECKED ) );
+                returnAllAttributesButton.setSelection( isActive( RETURN_ALLATTRIBUTES_CHECKED ) );
             }
-            if ( isActive( OPERATIONALATTRIBUTES_VISIBLE ) )
+            if ( isActive( RETURN_OPERATIONALATTRIBUTES_VISIBLE ) )
             {
-                operationalAttributesButton = BaseWidgetUtils.createCheckbox( buttonComposite,
+                returnOperationalAttributesButton = BaseWidgetUtils.createCheckbox( buttonComposite,
                     "Operational attributes", 1 );
-                operationalAttributesButton.addSelectionListener( new SelectionAdapter()
+                returnOperationalAttributesButton.addSelectionListener( new SelectionAdapter()
                 {
                     public void widgetSelected( SelectionEvent e )
                     {
                         validate();
                     }
                 } );
-                operationalAttributesButton.setSelection( isActive( OPERATIONALATTRIBUTES_CHECKED ) );
+                returnOperationalAttributesButton.setSelection( isActive( RETURN_OPERATIONALATTRIBUTES_CHECKED ) );
             }
         }
 
@@ -332,12 +437,21 @@
     }
 
 
+    /**
+     * Creates the options composite, this includes the
+     * scope, limit, alias and referral widgets.
+     * 
+     * @param composite the composite
+     */
     protected void createOptionsComposite( final Composite composite )
     {
         if ( isActive( OPTIONS_INVISIBLE ) )
+        {
             return;
+        }
 
         Composite optionsComposite = BaseWidgetUtils.createColumnContainer( composite, 2, 3 );
+
         scopeWidget = new ScopeWidget();
         scopeWidget.createWidget( optionsComposite );
         scopeWidget.setEnabled( !isActive( SCOPEOPTIONS_READONLY ) );
@@ -348,6 +462,7 @@
                 validate();
             }
         } );
+
         limitWidget = new LimitWidget();
         limitWidget.createWidget( optionsComposite );
         limitWidget.setEnabled( !isActive( LIMITOPTIONS_READONLY ) );
@@ -358,6 +473,7 @@
                 validate();
             }
         } );
+
         aliasesDereferencingWidget = new AliasesDereferencingWidget();
         aliasesDereferencingWidget.createWidget( optionsComposite );
         aliasesDereferencingWidget.setEnabled( !isActive( ALIASOPTIONS_READONLY ) );
@@ -368,6 +484,7 @@
                 validate();
             }
         } );
+
         referralsHandlingWidget = new ReferralsHandlingWidget();
         referralsHandlingWidget.createWidget( optionsComposite );
         referralsHandlingWidget.setEnabled( !isActive( REFERRALOPTIONS_READONLY ) );
@@ -381,10 +498,17 @@
     }
 
 
+    /**
+     * Creates the control composite.
+     * 
+     * @param composite the composite
+     */
     protected void createControlComposite( final Composite composite )
     {
         if ( isActive( CONTROLS_INVISIBLE ) )
+        {
             return;
+        }
 
         controlLabel = BaseWidgetUtils.createLabel( composite, "Controls:", 1 );
 
@@ -401,10 +525,12 @@
                 validate();
             }
         } );
-
     }
 
 
+    /**
+     * Validates all elements.
+     */
     protected void validate()
     {
 
@@ -419,20 +545,28 @@
 
         filterWidget.setConnection( connectionWidget.getConnection() );
 
-        // this.fireSearchPageModified();
         super.notifyListeners();
     }
 
 
-    public boolean isExportDn()
-    {
-        return dnButton != null && dnButton.getSelection();
+    /**
+     * Checks if the DNs should be returned/exported.
+     * 
+     * @return true, if DNs should be returnde/exported
+     */
+    public boolean isReturnDn()
+    {
+        return returnDnButton != null && returnDnButton.getSelection();
     }
 
 
+    /**
+     * Initializes all search page widgets from the given search.
+     * 
+     * @param search the search
+     */
     public void loadFromSearch( ISearch search )
     {
-
         if ( searchNameText != null )
         {
             searchNameText.setText( search.getName() );
@@ -465,24 +599,24 @@
                 returningAttributesWidget.setInitialReturningAttributes( search.getReturningAttributes() );
             }
 
-            if ( this.scopeWidget != null )
+            if ( scopeWidget != null )
             {
                 scopeWidget.setScope( search.getScope() );
             }
-            if ( this.limitWidget != null )
+            if ( limitWidget != null )
             {
                 limitWidget.setCountLimit( search.getCountLimit() );
                 limitWidget.setTimeLimit( search.getTimeLimit() );
             }
-            if ( this.aliasesDereferencingWidget != null )
+            if ( aliasesDereferencingWidget != null )
             {
                 aliasesDereferencingWidget.setAliasesDereferencingMethod( search.getAliasesDereferencingMethod() );
             }
-            if ( this.referralsHandlingWidget != null )
+            if ( referralsHandlingWidget != null )
             {
                 referralsHandlingWidget.setReferralsHandlingMethod( search.getReferralsHandlingMethod() );
             }
-            if ( this.subentriesControlButton != null )
+            if ( subentriesControlButton != null )
             {
                 Control[] searchControls = search.getControls();
                 if ( searchControls != null && searchControls.length > 0 )
@@ -492,78 +626,82 @@
                         Control c = searchControls[i];
                         if ( Control.SUBENTRIES_CONTROL.equals( c ) )
                         {
-                            this.subentriesControlButton.setSelection( true );
+                            subentriesControlButton.setSelection( true );
                         }
                     }
-
                 }
             }
         }
     }
 
 
+    /**
+     * Saves all search pages element to the given search.
+     * 
+     * @param search the search
+     * 
+     * @return true, if the given search has been modified.
+     */
     public boolean saveToSearch( ISearch search )
     {
         boolean searchModified = false;
 
-        if ( this.searchNameText != null && !this.searchNameText.getText().equals( search.getName() ) )
+        if ( searchNameText != null && !searchNameText.getText().equals( search.getName() ) )
         {
-            search.getSearchParameter().setName( this.searchNameText.getText() );
+            search.getSearchParameter().setName( searchNameText.getText() );
             searchModified = true;
         }
-        if ( this.connectionWidget != null && this.connectionWidget.getConnection() != null
-            && this.connectionWidget.getConnection() != search.getConnection() )
+        if ( connectionWidget != null && connectionWidget.getConnection() != null
+            && connectionWidget.getConnection() != search.getConnection() )
         {
-            search.setConnection( this.connectionWidget.getConnection() );
+            search.setConnection( connectionWidget.getConnection() );
             searchModified = true;
         }
-        if ( this.searchBaseWidget != null && this.searchBaseWidget.getDn() != null
-            && !this.searchBaseWidget.getDn().equals( search.getSearchBase() ) )
+        if ( searchBaseWidget != null && searchBaseWidget.getDn() != null
+            && !searchBaseWidget.getDn().equals( search.getSearchBase() ) )
         {
-            search.getSearchParameter().setSearchBase( this.searchBaseWidget.getDn() );
+            search.getSearchParameter().setSearchBase( searchBaseWidget.getDn() );
             searchModified = true;
-            this.searchBaseWidget.saveDialogSettings();
+            searchBaseWidget.saveDialogSettings();
         }
-        if ( this.filterWidget != null )
+        if ( filterWidget != null )
         {
-            this.parser.parse( filterWidget.getFilter() );
-            if ( !this.parser.getModel().toString().equals( search.getFilter() ) )
+            parser.parse( filterWidget.getFilter() );
+            if ( !parser.getModel().toString().equals( search.getFilter() ) )
             {
-                search.getSearchParameter().setFilter( this.parser.getModel().toString() );
+                search.getSearchParameter().setFilter( parser.getModel().toString() );
                 searchModified = true;
             }
-            this.filterWidget.saveDialogSettings();
+            filterWidget.saveDialogSettings();
         }
 
         if ( returningAttributesWidget != null )
         {
-            if ( !Arrays.equals( this.returningAttributesWidget.getReturningAttributes(), search
-                .getReturningAttributes() ) )
+            if ( !Arrays.equals( returningAttributesWidget.getReturningAttributes(), search.getReturningAttributes() ) )
             {
-                search.getSearchParameter().setReturningAttributes(
-                    this.returningAttributesWidget.getReturningAttributes() );
+                search.getSearchParameter().setReturningAttributes( returningAttributesWidget.getReturningAttributes() );
                 searchModified = true;
             }
-            this.returningAttributesWidget.saveDialogSettings();
+            returningAttributesWidget.saveDialogSettings();
 
-            if ( allAttributesButton != null || operationalAttributesButton != null )
+            if ( returnAllAttributesButton != null || returnOperationalAttributesButton != null )
             {
-                List raList = new ArrayList();
+                List<String> raList = new ArrayList<String>();
                 raList.addAll( Arrays.asList( search.getReturningAttributes() ) );
-                if ( allAttributesButton != null )
+                if ( returnAllAttributesButton != null )
                 {
-                    if ( allAttributesButton.getSelection() )
+                    if ( returnAllAttributesButton.getSelection() )
                     {
                         raList.add( ISearch.ALL_USER_ATTRIBUTES );
                     }
-                    if ( allAttributesButton.getSelection() != isActive( ALLATTRIBUTES_CHECKED ) )
+                    if ( returnAllAttributesButton.getSelection() != isActive( RETURN_ALLATTRIBUTES_CHECKED ) )
                     {
                         searchModified = true;
                     }
                 }
-                if ( operationalAttributesButton != null )
+                if ( returnOperationalAttributesButton != null )
                 {
-                    if ( operationalAttributesButton.getSelection() )
+                    if ( returnOperationalAttributesButton.getSelection() )
                     {
                         AttributeTypeDescription[] opAtds = SchemaUtils
                             .getOperationalAttributeDescriptions( connectionWidget.getConnection().getSchema() );
@@ -571,17 +709,17 @@
                         raList.addAll( Arrays.asList( attributeTypeDescriptionNames ) );
                         raList.add( ISearch.ALL_OPERATIONAL_ATTRIBUTES );
                     }
-                    if ( operationalAttributesButton.getSelection() != isActive( OPERATIONALATTRIBUTES_CHECKED ) )
+                    if ( returnOperationalAttributesButton.getSelection() != isActive( RETURN_OPERATIONALATTRIBUTES_CHECKED ) )
                     {
                         searchModified = true;
                     }
                 }
-                String[] returningAttributes = ( String[] ) raList.toArray( new String[raList.size()] );
+                String[] returningAttributes = raList.toArray( new String[raList.size()] );
                 search.getSearchParameter().setReturningAttributes( returningAttributes );
             }
         }
 
-        if ( this.scopeWidget != null )
+        if ( scopeWidget != null )
         {
             int scope = scopeWidget.getScope();;
             if ( scope != search.getScope() )
@@ -590,7 +728,7 @@
                 searchModified = true;
             }
         }
-        if ( this.limitWidget != null )
+        if ( limitWidget != null )
         {
             int countLimit = limitWidget.getCountLimit();
             int timeLimit = limitWidget.getTimeLimit();
@@ -605,7 +743,7 @@
                 searchModified = true;
             }
         }
-        if ( this.aliasesDereferencingWidget != null )
+        if ( aliasesDereferencingWidget != null )
         {
             int aliasesDereferencingMethod = aliasesDereferencingWidget.getAliasesDereferencingMethod();
             if ( aliasesDereferencingMethod != search.getAliasesDereferencingMethod() )
@@ -614,7 +752,7 @@
                 searchModified = true;
             }
         }
-        if ( this.referralsHandlingWidget != null )
+        if ( referralsHandlingWidget != null )
         {
             int referralsHandlingMethod = referralsHandlingWidget.getReferralsHandlingMethod();
             if ( referralsHandlingMethod != search.getReferralsHandlingMethod() )
@@ -623,10 +761,9 @@
                 searchModified = true;
             }
         }
-        if ( this.subentriesControlButton != null )
+        if ( subentriesControlButton != null )
         {
-            Control selectedSubControl = this.subentriesControlButton.getSelection() ? Control.SUBENTRIES_CONTROL
-                : null;
+            Control selectedSubControl = subentriesControlButton.getSelection() ? Control.SUBENTRIES_CONTROL : null;
             Control searchSubentriesControl = null;
             Control[] searchControls = search.getControls();
             if ( searchControls != null && searchControls.length > 0 )
@@ -661,6 +798,13 @@
     }
 
 
+    /**
+     * Performs the search.
+     * 
+     * @param search the search
+     * 
+     * @return true, if perform search
+     */
     public boolean performSearch( final ISearch search )
     {
         if ( search.getConnection() != null )
@@ -676,21 +820,26 @@
     }
 
 
+    /**
+     * Checks if is valid.
+     * 
+     * @return true, if is valid
+     */
     public boolean isValid()
     {
-        if ( this.connectionWidget != null && this.connectionWidget.getConnection() == null )
+        if ( connectionWidget != null && connectionWidget.getConnection() == null )
         {
             return false;
         }
-        if ( this.searchBaseWidget != null && this.searchBaseWidget.getDn() == null )
+        if ( searchBaseWidget != null && searchBaseWidget.getDn() == null )
         {
             return false;
         }
-        if ( this.searchNameText != null && "".equals( this.searchNameText.getText() ) )
+        if ( searchNameText != null && "".equals( searchNameText.getText() ) )
         {
             return false;
         }
-        if ( this.filterWidget != null && "".equals( this.filterWidget.getFilter() ) )
+        if ( filterWidget != null && "".equals( filterWidget.getFilter() ) )
         {
             return false;
         }
@@ -699,67 +848,71 @@
     }
 
 
+    /**
+     * Sets the enabled state of the widget.
+     * 
+     * @param b true to enable the widget, false to disable the widget
+     */
     public void setEnabled( boolean b )
     {
-        if ( this.searchNameText != null )
+        if ( searchNameText != null )
         {
-            this.searchNameLabel.setEnabled( b );
-            this.searchNameText.setEnabled( b );
+            searchNameLabel.setEnabled( b );
+            searchNameText.setEnabled( b );
         }
-        if ( this.connectionWidget != null )
+        if ( connectionWidget != null )
         {
-            this.connectionLabel.setEnabled( b );
-            this.connectionWidget.setEnabled( b && !isActive( CONNECTION_READONLY ) );
+            connectionLabel.setEnabled( b );
+            connectionWidget.setEnabled( b && !isActive( CONNECTION_READONLY ) );
         }
-        if ( this.searchBaseWidget != null )
+        if ( searchBaseWidget != null )
         {
-            this.searchBaseLabel.setEnabled( b );
-            this.searchBaseWidget.setEnabled( b && !isActive( SEARCHBASE_READONLY ) );
+            searchBaseLabel.setEnabled( b );
+            searchBaseWidget.setEnabled( b && !isActive( SEARCHBASE_READONLY ) );
         }
-        if ( this.filterWidget != null )
+        if ( filterWidget != null )
         {
-            this.filterLabel.setEnabled( b );
-            this.filterWidget.setEnabled( b && !isActive( FILTER_READONLY ) );
+            filterLabel.setEnabled( b );
+            filterWidget.setEnabled( b && !isActive( FILTER_READONLY ) );
         }
-        if ( this.returningAttributesWidget != null )
+        if ( returningAttributesWidget != null )
         {
-            this.returningAttributesLabel.setEnabled( b );
-            this.returningAttributesWidget.setEnabled( b && !isActive( RETURNINGATTRIBUTES_READONLY ) );
+            returningAttributesLabel.setEnabled( b );
+            returningAttributesWidget.setEnabled( b && !isActive( RETURNINGATTRIBUTES_READONLY ) );
         }
-        if ( this.dnButton != null )
+        if ( returnDnButton != null )
         {
-            this.dnButton.setEnabled( b );
+            returnDnButton.setEnabled( b );
         }
-        if ( this.allAttributesButton != null )
+        if ( returnAllAttributesButton != null )
         {
-            this.allAttributesButton.setEnabled( b );
+            returnAllAttributesButton.setEnabled( b );
         }
-        if ( this.operationalAttributesButton != null )
+        if ( returnOperationalAttributesButton != null )
         {
-            this.operationalAttributesButton.setEnabled( b );
+            returnOperationalAttributesButton.setEnabled( b );
         }
-        if ( this.scopeWidget != null )
+        if ( scopeWidget != null )
         {
-            this.scopeWidget.setEnabled( b && !isActive( SCOPEOPTIONS_READONLY ) );
+            scopeWidget.setEnabled( b && !isActive( SCOPEOPTIONS_READONLY ) );
         }
-        if ( this.limitWidget != null )
+        if ( limitWidget != null )
         {
-            this.limitWidget.setEnabled( b && !isActive( LIMITOPTIONS_READONLY ) );
+            limitWidget.setEnabled( b && !isActive( LIMITOPTIONS_READONLY ) );
         }
-        if ( this.aliasesDereferencingWidget != null )
+        if ( aliasesDereferencingWidget != null )
         {
-            this.aliasesDereferencingWidget.setEnabled( b && !isActive( ALIASOPTIONS_READONLY ) );
+            aliasesDereferencingWidget.setEnabled( b && !isActive( ALIASOPTIONS_READONLY ) );
         }
-        if ( this.referralsHandlingWidget != null )
+        if ( referralsHandlingWidget != null )
         {
-            this.referralsHandlingWidget.setEnabled( b && !isActive( REFERRALOPTIONS_READONLY ) );
+            referralsHandlingWidget.setEnabled( b && !isActive( REFERRALOPTIONS_READONLY ) );
         }
-        if ( this.controlLabel != null )
+        if ( controlLabel != null )
         {
-            this.controlLabel.setEnabled( b );
-            this.subentriesControlButton.setEnabled( b );
+            controlLabel.setEnabled( b );
+            subentriesControlButton.setEnabled( b );
         }
-
     }
 
 }



Mime
View raw message