directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From seelm...@apache.org
Subject svn commit: r518755 - in /directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views: browser/ connection/
Date Thu, 15 Mar 2007 21:16:19 GMT
Author: seelmann
Date: Thu Mar 15 14:16:16 2007
New Revision: 518755

URL: http://svn.apache.org/viewvc?view=rev&rev=518755
Log:
Small refactorings, code cleaning, Javadocs.

Modified:
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/BrowserViewActionGroup.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/BrowserViewLabelDecorator.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/BrowserViewUniversalListener.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/DragListener.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/DropListener.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/LinkWithEditorAction.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/OpenBrowserPreferencePageAction.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/ShowBookmarksAction.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/ShowDITAction.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/ShowDirectoryMetadataEntriesAction.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/ShowSearchesAction.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/connection/ConnectionViewActionGroup.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/connection/DragConnectionListener.java
    directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/connection/DropConnectionListener.java

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/BrowserViewActionGroup.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/BrowserViewActionGroup.java?view=diff&rev=518755&r1=518754&r2=518755
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/BrowserViewActionGroup.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/BrowserViewActionGroup.java
Thu Mar 15 14:16:16 2007
@@ -239,17 +239,10 @@
             linkWithEditorAction.dispose();
             linkWithEditorAction = null;
 
-            showDITAction.dispose();
             showDITAction = null;
-            showSearchesAction.dispose();
             showSearchesAction = null;
-            showBookmarksAction.dispose();
             showBookmarksAction = null;
-            showDirectoryMetadataEntriesAction.dispose();
             showDirectoryMetadataEntriesAction = null;
-            openBrowserPreferencePageAction.dispose();
-            openBrowserPreferencePageAction = null;
-
             openBrowserPreferencePageAction = null;
         }
 

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/BrowserViewLabelDecorator.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/BrowserViewLabelDecorator.java?view=diff&rev=518755&r1=518754&r2=518755
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/BrowserViewLabelDecorator.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/BrowserViewLabelDecorator.java
Thu Mar 15 14:16:16 2007
@@ -31,12 +31,22 @@
 import org.eclipse.jface.viewers.LabelProvider;
 
 
+/**
+ * This class implements the label decorator for the browser view. It adds
+ * an overlay image to the main image to mark search results, filtered
+ * entries and inconsistent entries.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class BrowserViewLabelDecorator extends LabelProvider implements ILightweightLabelDecorator
 {
 
+    /**
+     * {@inheritDoc}
+     */
     public void decorate( Object element, IDecoration decoration )
     {
-
         IEntry entry = null;
 
         if ( element instanceof ISearchResult )

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/BrowserViewUniversalListener.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/BrowserViewUniversalListener.java?view=diff&rev=518755&r1=518754&r2=518755
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/BrowserViewUniversalListener.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/BrowserViewUniversalListener.java
Thu Mar 15 14:16:16 2007
@@ -223,6 +223,11 @@
     };
 
 
+    /**
+     * Creates a new instance of BrowserViewUniversalListener.
+     * 
+     * @param view the browser view
+     */
     public BrowserViewUniversalListener( BrowserView view )
     {
         super( view.getMainWidget().getViewer() );
@@ -346,7 +351,6 @@
      */
     void setInput( IConnection connection )
     {
-
         // only if another connection is selected
         if ( connection != viewer.getInput() )
         {

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/DragListener.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/DragListener.java?view=diff&rev=518755&r1=518754&r2=518755
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/DragListener.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/DragListener.java
Thu Mar 15 14:16:16 2007
@@ -20,7 +20,17 @@
 
 package org.apache.directory.ldapstudio.browser.ui.views.browser;
 
+import org.eclipse.swt.dnd.DragSourceListener;
 
+
+/**
+ * This class implements the {@link DragSourceListener} for the browser view.
+ * 
+ * TODO: The code isn't working yet, just a test implementation.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class DragListener /* implements DragSourceListener */
 {
 

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/DropListener.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/DropListener.java?view=diff&rev=518755&r1=518754&r2=518755
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/DropListener.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/DropListener.java
Thu Mar 15 14:16:16 2007
@@ -20,7 +20,17 @@
 
 package org.apache.directory.ldapstudio.browser.ui.views.browser;
 
+import org.eclipse.swt.dnd.DropTargetListener;
 
+
+/**
+ * This class implements the {@link DropTargetListener} for the browser view.
+ * 
+ * TODO: The code isn't working yet, just a test implementation.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class DropListener /* implements DropTargetListener, ModelModifier */
 {/*
  * 

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/LinkWithEditorAction.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/LinkWithEditorAction.java?view=diff&rev=518755&r1=518754&r2=518755
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/LinkWithEditorAction.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/LinkWithEditorAction.java
Thu Mar 15 14:16:16 2007
@@ -124,14 +124,11 @@
     public LinkWithEditorAction( BrowserView browserView )
     {
         super( "Link with editor", AS_CHECK_BOX );
-
-        super.setImageDescriptor( BrowserUIPlugin.getDefault().getImageDescriptor(
-            BrowserUIConstants.IMG_LINK_WITH_EDITOR ) );
-        super.setEnabled( true );
-        this.browserView = browserView;
-
-        super.setChecked( BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
+        setImageDescriptor( BrowserUIPlugin.getDefault().getImageDescriptor( BrowserUIConstants.IMG_LINK_WITH_EDITOR
) );
+        setEnabled( true );
+        setChecked( BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
             BrowserUIConstants.PREFERENCE_BROWSER_LINK_WITH_EDITOR ) );
+        this.browserView = browserView;
 
         // Enable the listeners
         if ( isChecked() )

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/OpenBrowserPreferencePageAction.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/OpenBrowserPreferencePageAction.java?view=diff&rev=518755&r1=518754&r2=518755
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/OpenBrowserPreferencePageAction.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/OpenBrowserPreferencePageAction.java
Thu Mar 15 14:16:16 2007
@@ -28,28 +28,36 @@
 import org.eclipse.ui.dialogs.PreferencesUtil;
 
 
+/**
+ * The OpenBrowserPreferencePageAction is used to open the 
+ * preference dialog with the browser's preference page.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class OpenBrowserPreferencePageAction extends Action
 {
 
+    /**
+     * Creates a new instance of OpenBrowserPreferencePageAction.
+     */
     public OpenBrowserPreferencePageAction()
     {
         super.setText( "Preferences..." );
-        super.setToolTipText( "Preferences..." );
-        super.setEnabled( true );
+        setToolTipText( "Preferences..." );
+        setEnabled( true );
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void run()
     {
         Shell shell = Display.getCurrent().getActiveShell();
         String pageId = BrowserUIConstants.PREFERENCEPAGEID_BROWSER;
         PreferencesUtil.createPreferenceDialogOn( shell, pageId, new String[]
             { pageId }, null ).open();
-    }
-
-
-    public void dispose()
-    {
     }
 
 }

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/ShowBookmarksAction.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/ShowBookmarksAction.java?view=diff&rev=518755&r1=518754&r2=518755
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/ShowBookmarksAction.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/ShowBookmarksAction.java
Thu Mar 15 14:16:16 2007
@@ -27,27 +27,35 @@
 import org.eclipse.jface.action.IAction;
 
 
+/**
+ * The ShowBookmarksAction is used to select wheater the bookmark category
+ * should be visible in the browser view or not.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class ShowBookmarksAction extends Action
 {
 
+    /**
+     * Creates a new instance of ShowBookmarksAction.
+     */
     public ShowBookmarksAction()
     {
         super( "Show Bookmarks", IAction.AS_CHECK_BOX );
-        super.setEnabled( true );
-        super.setChecked( BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
+        setEnabled( true );
+        setChecked( BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
             BrowserUIConstants.PREFERENCE_BROWSER_SHOW_BOOKMARKS ) );
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void run()
     {
         BrowserUIPlugin.getDefault().getPreferenceStore().setValue(
-            BrowserUIConstants.PREFERENCE_BROWSER_SHOW_BOOKMARKS, super.isChecked() );
-    }
-
-
-    public void dispose()
-    {
+            BrowserUIConstants.PREFERENCE_BROWSER_SHOW_BOOKMARKS, isChecked() );
     }
 
 }

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/ShowDITAction.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/ShowDITAction.java?view=diff&rev=518755&r1=518754&r2=518755
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/ShowDITAction.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/ShowDITAction.java
Thu Mar 15 14:16:16 2007
@@ -27,27 +27,35 @@
 import org.eclipse.jface.action.IAction;
 
 
+/**
+ * The ShowDITAction is used to select wheater the DIT category
+ * should be visible in the browser view or not.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class ShowDITAction extends Action
 {
 
+    /**
+     * Creates a new instance of ShowDITAction.
+     */
     public ShowDITAction()
     {
         super( "Show DIT", IAction.AS_CHECK_BOX );
-        super.setEnabled( true );
-        super.setChecked( BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
+        setEnabled( true );
+        setChecked( BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
             BrowserUIConstants.PREFERENCE_BROWSER_SHOW_DIT ) );
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void run()
     {
         BrowserUIPlugin.getDefault().getPreferenceStore().setValue( BrowserUIConstants.PREFERENCE_BROWSER_SHOW_DIT,
-            super.isChecked() );
-    }
-
-
-    public void dispose()
-    {
+            isChecked() );
     }
 
 }

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/ShowDirectoryMetadataEntriesAction.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/ShowDirectoryMetadataEntriesAction.java?view=diff&rev=518755&r1=518754&r2=518755
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/ShowDirectoryMetadataEntriesAction.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/ShowDirectoryMetadataEntriesAction.java
Thu Mar 15 14:16:16 2007
@@ -27,27 +27,35 @@
 import org.eclipse.jface.action.IAction;
 
 
+/**
+ * The ShowDirectoryMetadataEntriesAction is used to select wheater metadata entries
+ * should be visible in the browser view or not.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class ShowDirectoryMetadataEntriesAction extends Action
 {
 
+    /**
+     * Creates a new instance of ShowDirectoryMetadataEntriesAction.
+     */
     public ShowDirectoryMetadataEntriesAction()
     {
         super( "Show Directory Metadata", IAction.AS_CHECK_BOX );
-        super.setEnabled( true );
-        super.setChecked( BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
+        setEnabled( true );
+        setChecked( BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
             BrowserUIConstants.PREFERENCE_BROWSER_SHOW_DIRECTORY_META_ENTRIES ) );
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void run()
     {
         BrowserUIPlugin.getDefault().getPreferenceStore().setValue(
-            BrowserUIConstants.PREFERENCE_BROWSER_SHOW_DIRECTORY_META_ENTRIES, super.isChecked()
);
-    }
-
-
-    public void dispose()
-    {
+            BrowserUIConstants.PREFERENCE_BROWSER_SHOW_DIRECTORY_META_ENTRIES, isChecked()
);
     }
 
 }

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/ShowSearchesAction.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/ShowSearchesAction.java?view=diff&rev=518755&r1=518754&r2=518755
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/ShowSearchesAction.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/browser/ShowSearchesAction.java
Thu Mar 15 14:16:16 2007
@@ -27,27 +27,35 @@
 import org.eclipse.jface.action.IAction;
 
 
+/**
+ * The ShowSearchesAction is used to select wheater the search category
+ * should be visible in the browser view or not.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class ShowSearchesAction extends Action
 {
 
+    /**
+     * Creates a new instance of ShowSearchesAction.
+     */
     public ShowSearchesAction()
     {
         super( "Show Searches", IAction.AS_CHECK_BOX );
-        super.setEnabled( true );
-        super.setChecked( BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
+        setEnabled( true );
+        setChecked( BrowserUIPlugin.getDefault().getPreferenceStore().getBoolean(
             BrowserUIConstants.PREFERENCE_BROWSER_SHOW_SEARCHES ) );
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     public void run()
     {
         BrowserUIPlugin.getDefault().getPreferenceStore().setValue(
-            BrowserUIConstants.PREFERENCE_BROWSER_SHOW_SEARCHES, super.isChecked() );
-    }
-
-
-    public void dispose()
-    {
+            BrowserUIConstants.PREFERENCE_BROWSER_SHOW_SEARCHES, isChecked() );
     }
 
 }

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/connection/ConnectionViewActionGroup.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/connection/ConnectionViewActionGroup.java?view=diff&rev=518755&r1=518754&r2=518755
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/connection/ConnectionViewActionGroup.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/connection/ConnectionViewActionGroup.java
Thu Mar 15 14:16:16 2007
@@ -136,12 +136,8 @@
         {
             linkWithEditorAction.dispose();
             linkWithEditorAction = null;
-
-            dragConnectionListener.dispose();
             dragConnectionListener = null;
-            dropConnectionListener.dispose();
             dropConnectionListener = null;
-
             view = null;
         }
     }

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/connection/DragConnectionListener.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/connection/DragConnectionListener.java?view=diff&rev=518755&r1=518754&r2=518755
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/connection/DragConnectionListener.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/connection/DragConnectionListener.java
Thu Mar 15 14:16:16 2007
@@ -26,33 +26,49 @@
 
 import org.apache.directory.ldapstudio.browser.core.model.IConnection;
 import org.apache.directory.ldapstudio.browser.ui.dnd.ConnectionTransfer;
-
 import org.eclipse.swt.dnd.DND;
 import org.eclipse.swt.dnd.DragSource;
+import org.eclipse.swt.dnd.DragSourceEvent;
 import org.eclipse.swt.dnd.DragSourceListener;
 import org.eclipse.swt.widgets.Table;
 import org.eclipse.swt.widgets.TableItem;
 
 
+/**
+ * This class implements a {@link DragSourceListener} that is used to
+ * drag and drop connections withing the connections view.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class DragConnectionListener implements DragSourceListener
 {
 
+    /**
+     * Creates a new instance of DragConnectionListener.
+     */
     public DragConnectionListener()
     {
     }
 
 
-    public void dispose()
-    {
-    }
-
-
-    public void dragStart( org.eclipse.swt.dnd.DragSourceEvent event )
+    /**
+     * {@inheritDoc}
+     * 
+     * This implementation does nothing.
+     */
+    public void dragStart( DragSourceEvent event )
     {
     }
 
 
-    public void dragSetData( org.eclipse.swt.dnd.DragSourceEvent event )
+    /**
+     * {@inheritDoc}
+     * 
+     * This implementation adds the dragged connections to the 
+     * given event data.
+     */
+    public void dragSetData( DragSourceEvent event )
     {
         if ( ConnectionTransfer.getInstance().isSupportedType( event.dataType ) )
         {
@@ -63,22 +79,27 @@
                 {
                     Table table = ( Table ) dragSource.getControl();
                     TableItem[] items = table.getSelection();
-                    List connectionList = new ArrayList();
+                    List<IConnection> connectionList = new ArrayList<IConnection>();
                     for ( int i = 0; i < items.length; i++ )
                     {
                         if ( items[i].getData() instanceof IConnection )
                         {
-                            connectionList.add( items[i].getData() );
+                            connectionList.add( ( IConnection ) items[i].getData() );
                         }
                     }
-                    event.data = ( IConnection[] ) connectionList.toArray( new IConnection[connectionList.size()]
);
+                    event.data = connectionList.toArray( new IConnection[connectionList.size()]
);
                 }
             }
         }
     }
 
 
-    public void dragFinished( org.eclipse.swt.dnd.DragSourceEvent event )
+    /**
+     * {@inheritDoc}
+     * 
+     * This implementation does nothing.
+     */
+    public void dragFinished( DragSourceEvent event )
     {
         if ( event.detail == DND.DROP_MOVE && event.doit )
         {

Modified: directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/connection/DropConnectionListener.java
URL: http://svn.apache.org/viewvc/directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/connection/DropConnectionListener.java?view=diff&rev=518755&r1=518754&r2=518755
==============================================================================
--- directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/connection/DropConnectionListener.java
(original)
+++ directory/ldapstudio/trunk/ldapstudio-browser-ui/src/main/java/org/apache/directory/ldapstudio/browser/ui/views/connection/DropConnectionListener.java
Thu Mar 15 14:16:16 2007
@@ -24,11 +24,10 @@
 import java.util.ArrayList;
 import java.util.List;
 
-import org.apache.directory.ldapstudio.browser.core.ConnectionManager;
 import org.apache.directory.ldapstudio.browser.core.BrowserCorePlugin;
+import org.apache.directory.ldapstudio.browser.core.ConnectionManager;
 import org.apache.directory.ldapstudio.browser.core.model.IConnection;
 import org.apache.directory.ldapstudio.browser.ui.dnd.ConnectionTransfer;
-
 import org.eclipse.swt.dnd.DND;
 import org.eclipse.swt.dnd.DropTarget;
 import org.eclipse.swt.dnd.DropTargetEvent;
@@ -37,19 +36,30 @@
 import org.eclipse.swt.widgets.TableItem;
 
 
+/**
+ * This class implements a {@link DropTargetListener} that is used to
+ * drag and drop connections withing the connections view.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public class DropConnectionListener implements DropTargetListener
 {
 
+    /**
+     * Creates a new instance of DropConnectionListener.
+     */
     public DropConnectionListener()
     {
     }
 
 
-    public void dispose()
-    {
-    }
-
-
+    /**
+     * {@inheritDoc}
+     * 
+     * This implementation checks if the event's data type is 
+     * supported. If not supported dropping is rejected.
+     */
     public void dragEnter( DropTargetEvent event )
     {
         if ( !ConnectionTransfer.getInstance().isSupportedType( event.currentDataType ) )
@@ -59,17 +69,33 @@
     }
 
 
+    /**
+     * {@inheritDoc}
+     * 
+     * This implementation just calls {@link #dragOver(DropTargetEvent)}.
+     */
     public void dragOperationChanged( DropTargetEvent event )
     {
-        this.dragOver( event );
+        dragOver( event );
     }
 
 
+    /**
+     * {@inheritDoc}
+     * 
+     * This implementation does nothing.
+     */
     public void dragLeave( DropTargetEvent event )
     {
     }
 
 
+    /**
+     * {@inheritDoc}
+     * 
+     * This implementation checks if the event's data type is 
+     * supported. If not supported dropping is rejected.
+     */
     public void dragOver( DropTargetEvent event )
     {
         boolean isOverSelection = false;
@@ -87,12 +113,12 @@
                         {
                             Table table = ( Table ) dropTarget.getControl();
                             TableItem[] items = table.getSelection();
-                            List connectionList = new ArrayList();
+                            List<IConnection> connectionList = new ArrayList<IConnection>();
                             for ( int i = 0; i < items.length; i++ )
                             {
                                 if ( items[i].getData() instanceof IConnection )
                                 {
-                                    connectionList.add( items[i].getData() );
+                                    connectionList.add( ( IConnection ) items[i].getData()
);
                                 }
                             }
                             if ( connectionList.contains( overConn ) )
@@ -125,15 +151,25 @@
         {
             event.detail = DND.DROP_DEFAULT;
         }
-
     }
 
 
+    /**
+     * {@inheritDoc}
+     * 
+     * This implementation does nothing.
+     */
     public void dropAccept( DropTargetEvent event )
     {
     }
 
 
+    /**
+     * {@inheritDoc}
+     * 
+     * This implementation drops the dragged connection to
+     * the selected position.
+     */
     public void drop( DropTargetEvent event )
     {
         ConnectionManager connectionManager = BrowserCorePlugin.getDefault().getConnectionManager();
@@ -166,7 +202,6 @@
                         {
                             connectionManager.addConnection( index, connections[i] );
                         }
-
                     }
                 }
                 else if ( event.detail == DND.DROP_COPY )



Mime
View raw message