directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1694439 [2/4] - in /directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui: ./ actions/ dialogs/ dnd/ preferences/ properties/ widgets/ wizards/
Date Thu, 06 Aug 2015 10:03:43 GMT
Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PasteAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PasteAction.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PasteAction.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PasteAction.java Thu Aug  6 10:03:42 2015
@@ -43,8 +43,8 @@ import org.eclipse.swt.dnd.TextTransfer;
 import org.eclipse.swt.dnd.Transfer;
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.ui.ISharedImages;
+import org.eclipse.ui.IWorkbenchCommandConstants;
 import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
 
 
 /**
@@ -55,28 +55,34 @@ import org.eclipse.ui.texteditor.IWorkbe
 public class PasteAction extends StudioAction
 {
     /**
-     * Creates a new instance of PasteAction.
-     */
-    public PasteAction()
-    {
-        super();
-    }
-
-
-    /**
      * {@inheritDoc}
      */
     public String getText()
     {
         List<Connection> connections = getConnectionsToPaste();
         List<ConnectionFolder> connectionFolders = getConnectionFoldersToPaste();
-        if ( connections.size() > 0 && connectionFolders.size() == 0 )
+        
+        if ( !connections.isEmpty() && connectionFolders.isEmpty() )
         {
-            return connections.size() > 1 ? Messages.getString( "PasteAction.PasteConnections" ) : Messages.getString( "PasteAction.PasteConnection" ); //$NON-NLS-1$ //$NON-NLS-2$
+            if ( connections.size() > 1 )
+            {
+                return Messages.getString( "PasteAction.PasteConnections" );
+            }
+            else
+            {
+                return Messages.getString( "PasteAction.PasteConnection" ); //$NON-NLS-1$ //$NON-NLS-2$
+            }
         }
-        else if ( connectionFolders.size() > 0 && connections.size() == 0 )
+        else if ( !connectionFolders.isEmpty() && connections.isEmpty() )
         {
-            return connectionFolders.size() > 1 ? Messages.getString( "PasteAction.PasteConnectionFolders" ) : Messages.getString( "PasteAction.PasteConnectionFolder" ); //$NON-NLS-1$ //$NON-NLS-2$
+            if ( connectionFolders.size() > 1 )
+            {
+                return Messages.getString( "PasteAction.PasteConnectionFolders" );
+            }
+            else
+            {
+                return  Messages.getString( "PasteAction.PasteConnectionFolder" ); //$NON-NLS-1$ //$NON-NLS-2$
+            }
         }
         else
         {
@@ -99,7 +105,7 @@ public class PasteAction extends StudioA
      */
     public String getCommandId()
     {
-        return IWorkbenchActionDefinitionIds.PASTE;
+        return IWorkbenchCommandConstants.EDIT_PASTE;
     }
 
 
@@ -125,6 +131,7 @@ public class PasteAction extends StudioA
         ConnectionFolder[] selectedFolders = getSelectedConnectionFolders();
         Connection[] selectedConnections = getSelectedConnections();
         ConnectionFolder targetFolder = null;
+        
         if ( selectedFolders.length > 0 )
         {
             targetFolder = selectedFolders[0];
@@ -133,6 +140,7 @@ public class PasteAction extends StudioA
         {
             targetFolder = connectionFolderManager.getParentConnectionFolder( selectedConnections[0] );
         }
+        
         if ( targetFolder == null )
         {
             targetFolder = connectionFolderManager.getRootConnectionFolder();
@@ -140,6 +148,7 @@ public class PasteAction extends StudioA
 
         // connections
         List<Connection> connections = getConnectionsToPaste();
+        
         for ( Connection connection : connections )
         {
             Connection newConnection = ( Connection ) connection.clone();
@@ -149,6 +158,7 @@ public class PasteAction extends StudioA
 
         // connection folders
         List<ConnectionFolder> connectionFolders = getConnectionFoldersToPaste();
+        
         for ( ConnectionFolder connectionFolder : connectionFolders )
         {
             ConnectionFolder newConnectionFolder = ( ConnectionFolder ) connectionFolder.clone();
@@ -169,10 +179,10 @@ public class PasteAction extends StudioA
 
         // first check for Connection objects in the clipboard
         Object content = getFromClipboard( ConnectionTransfer.getInstance() );
+        
         if ( content instanceof Object[] )
         {
-            Object[] objects = ( Object[] ) content;
-            for ( Object object : objects )
+            for ( Object object : ( Object[] )content )
             {
                 if ( object instanceof Connection )
                 {
@@ -198,25 +208,30 @@ public class PasteAction extends StudioA
         List<Connection> connections = new ArrayList<Connection>();
 
         Object content = getFromClipboard( TextTransfer.getInstance() );
+        
         if ( content instanceof String )
         {
             ConnectionParameterPage[] connectionParameterPages = ConnectionParameterPageManager
                 .getConnectionParameterPages();
 
             String[] lines = ( ( String ) content ).split( ConnectionCoreConstants.LINE_SEPARATOR );
+            
             for ( String line : lines )
             {
                 line = line.trim();
+                
                 if ( StringUtils.isNotEmpty( line ) )
                 {
                     try
                     {
                         LdapUrl ldapUrl = new LdapUrl( line );
                         ConnectionParameter parameter = new ConnectionParameter();
+                        
                         for ( ConnectionParameterPage connectionParameterPage : connectionParameterPages )
                         {
                             connectionParameterPage.mergeLdapUrlToParameters( ldapUrl, parameter );
                         }
+                        
                         Connection connection = new Connection( parameter );
                         connections.add( connection );
                     }
@@ -242,10 +257,10 @@ public class PasteAction extends StudioA
         List<ConnectionFolder> folders = new ArrayList<ConnectionFolder>();
 
         Object content = this.getFromClipboard( ConnectionTransfer.getInstance() );
+        
         if ( content instanceof Object[] )
         {
-            Object[] objects = ( Object[] ) content;
-            for ( Object object : objects )
+            for ( Object object : ( Object[] ) content )
             {
                 if ( object instanceof ConnectionFolder )
                 {
@@ -261,23 +276,25 @@ public class PasteAction extends StudioA
     /**
      * Retrieve the data of the specified type currently available on the system clipboard.
      *
-     * @param dataType
-     *      the transfer agent for the type of data being requested
-     * @return
-     *      the data obtained from the clipboard or null if no data of this type is available
+     * @param dataType the transfer agent for the type of data being requested
+     * @return the data obtained from the clipboard or null if no data of this type is available
      */
     protected Object getFromClipboard( Transfer dataType )
     {
         Clipboard clipboard = null;
+        
         try
         {
             clipboard = new Clipboard( Display.getCurrent() );
+            
             return clipboard.getContents( dataType );
         }
         finally
         {
             if ( clipboard != null )
+            {
                 clipboard.dispose();
+            }
         }
     }
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PropertiesAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PropertiesAction.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PropertiesAction.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/PropertiesAction.java Thu Aug  6 10:03:42 2015
@@ -27,8 +27,8 @@ import org.eclipse.core.runtime.IAdaptab
 import org.eclipse.jface.preference.PreferenceDialog;
 import org.eclipse.jface.resource.ImageDescriptor;
 import org.eclipse.osgi.util.NLS;
+import org.eclipse.ui.IWorkbenchCommandConstants;
 import org.eclipse.ui.dialogs.PreferencesUtil;
-import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
 
 
 /**
@@ -39,15 +39,6 @@ import org.eclipse.ui.texteditor.IWorkbe
 public class PropertiesAction extends StudioAction
 {
     /**
-     * Creates a new instance of PropertiesAction.
-     */
-    public PropertiesAction()
-    {
-        super();
-    }
-
-
-    /**
      * {@inheritDoc}
      */
     public String getText()
@@ -70,7 +61,7 @@ public class PropertiesAction extends St
      */
     public String getCommandId()
     {
-        return IWorkbenchActionDefinitionIds.PROPERTIES;
+        return IWorkbenchCommandConstants.FILE_PROPERTIES;
     }
 
 
@@ -79,7 +70,6 @@ public class PropertiesAction extends St
      */
     public boolean isEnabled()
     {
-
         return getSelectedConnections().length == 1;
 
     }
@@ -104,8 +94,12 @@ public class PropertiesAction extends St
         if ( element != null )
         {
             PreferenceDialog dialog = PreferencesUtil.createPropertyDialogOn( getShell(), element, pageId, null, null );
+            
             if ( dialog != null )
+            {
                 title = Utils.shorten( title, 30 );
+            }
+            
             dialog.getShell().setText(
                 NLS.bind( Messages.getString( "PropertiesAction.PropertiesFor" ), new String[] { title } ) ); //$NON-NLS-1$
             dialog.open();

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/RenameAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/RenameAction.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/RenameAction.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/RenameAction.java Thu Aug  6 10:03:42 2015
@@ -27,7 +27,7 @@ import org.apache.directory.studio.conne
 import org.eclipse.jface.dialogs.IInputValidator;
 import org.eclipse.jface.dialogs.InputDialog;
 import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
+import org.eclipse.ui.IWorkbenchCommandConstants;
 
 
 /**
@@ -38,27 +38,18 @@ import org.eclipse.ui.texteditor.IWorkbe
 public class RenameAction extends StudioAction
 {
     /**
-     * Creates a new instance of RenameAction.
-     *
-     */
-    public RenameAction()
-    {
-        super();
-    }
-
-
-    /**
      * {@inheritDoc}
      */
     public String getText()
     {
         Connection[] connections = getSelectedConnections();
         ConnectionFolder[] connectionFolders = getSelectedConnectionFolders();
-        if ( connections.length == 1 && connectionFolders.length == 0 )
+        
+        if ( ( connections.length == 1 ) && ( connectionFolders.length == 0 ) )
         {
             return Messages.getString( "RenameAction.Connection" ); //$NON-NLS-1$
         }
-        else if ( connectionFolders.length == 1 && connections.length == 0 )
+        else if ( ( connectionFolders.length == 1) && ( connections.length == 0 ) )
         {
             return Messages.getString( "RenameAction.ConnectionFolder" ); //$NON-NLS-1$
         }
@@ -83,7 +74,7 @@ public class RenameAction extends Studio
      */
     public String getCommandId()
     {
-        return IWorkbenchActionDefinitionIds.RENAME;
+        return IWorkbenchCommandConstants.FILE_RENAME;
     }
 
 
@@ -94,6 +85,7 @@ public class RenameAction extends Studio
     {
         Connection[] connections = getSelectedConnections();
         ConnectionFolder[] connectionFolders = getSelectedConnectionFolders();
+        
         if ( connections.length == 1 )
         {
             renameConnection( connections[0] );
@@ -124,19 +116,22 @@ public class RenameAction extends Studio
     {
         IInputValidator validator = new IInputValidator()
         {
+            /**
+             * {@inheritDoc}
+             */
             public String isValid( String newName )
             {
                 if ( connection.getName().equals( newName ) )
                 {
                     return null;
                 }
-                else if ( ConnectionCorePlugin.getDefault().getConnectionManager().getConnectionByName( newName ) != null )
+                else if ( ConnectionCorePlugin.getDefault().getConnectionManager().getConnectionByName( newName ) == null )
                 {
-                    return Messages.getString( "RenameAction.ConnectionAlreadyExists" ); //$NON-NLS-1$
+                    return null;
                 }
                 else
                 {
-                    return null;
+                    return Messages.getString( "RenameAction.ConnectionAlreadyExists" ); //$NON-NLS-1$
                 }
             }
         };
@@ -148,6 +143,7 @@ public class RenameAction extends Studio
 
         dialog.open();
         String newName = dialog.getValue();
+        
         if ( newName != null )
         {
             connection.setName( newName );
@@ -165,6 +161,9 @@ public class RenameAction extends Studio
     {
         IInputValidator validator = new IInputValidator()
         {
+            /**
+             * {@inheritDoc}
+             */
             public String isValid( String newName )
             {
                 if ( connectionFolder.getName().equals( newName ) )
@@ -172,13 +171,13 @@ public class RenameAction extends Studio
                     return null;
                 }
                 else if ( ConnectionCorePlugin.getDefault().getConnectionFolderManager().getConnectionFolderByName(
-                    newName ) != null )
+                    newName ) == null )
                 {
-                    return Messages.getString( "RenameAction.ConnectionFolderAlreadyExists" ); //$NON-NLS-1$
+                    return null;
                 }
                 else
                 {
-                    return null;
+                    return Messages.getString( "RenameAction.ConnectionFolderAlreadyExists" ); //$NON-NLS-1$
                 }
             }
         };
@@ -190,10 +189,10 @@ public class RenameAction extends Studio
 
         dialog.open();
         String newName = dialog.getValue();
+        
         if ( newName != null )
         {
             connectionFolder.setName( newName );
         }
     }
-
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/SelectionUtils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/SelectionUtils.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/SelectionUtils.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/SelectionUtils.java Thu Aug  6 10:03:42 2015
@@ -37,9 +37,8 @@ import org.eclipse.jface.viewers.IStruct
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public abstract class SelectionUtils
+public class SelectionUtils
 {
-
     /**
      * Gets the Strings contained in the given selection.
      *
@@ -49,6 +48,7 @@ public abstract class SelectionUtils
     public static String[] getProperties( ISelection selection )
     {
         List<Object> list = getTypes( selection, String.class );
+        
         return list.toArray( new String[list.size()] );
     }
 
@@ -63,19 +63,23 @@ public abstract class SelectionUtils
     private static List<Object> getTypes( ISelection selection, Class<?> type )
     {
         List<Object> list = new ArrayList<Object>();
+        
         if ( selection instanceof IStructuredSelection )
         {
             IStructuredSelection structuredSelection = ( IStructuredSelection ) selection;
-            Iterator<?> it = structuredSelection.iterator();
-            while ( it.hasNext() )
+            Iterator<?> iterator = structuredSelection.iterator();
+            
+            while ( iterator.hasNext() )
             {
-                Object o = it.next();
-                if ( type.isInstance( o ) )
+                Object object = iterator.next();
+                
+                if ( type.isInstance( object ) )
                 {
-                    list.add( o );
+                    list.add( object );
                 }
             }
         }
+        
         return list;
     }
 
@@ -89,6 +93,7 @@ public abstract class SelectionUtils
     public static Connection[] getConnections( ISelection selection )
     {
         List<Object> list = getTypes( selection, Connection.class );
+        
         return list.toArray( new Connection[list.size()] );
     }
 
@@ -102,6 +107,7 @@ public abstract class SelectionUtils
     public static ConnectionFolder[] getConnectionFolders( ISelection selection )
     {
         List<Object> list = getTypes( selection, ConnectionFolder.class );
+        
         return list.toArray( new ConnectionFolder[list.size()] );
     }
 
@@ -115,6 +121,7 @@ public abstract class SelectionUtils
     public static Object[] getObjects( ISelection selection )
     {
         List<Object> list = getTypes( selection, Object.class );
+        
         return list.toArray( new Object[list.size()] );
     }
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioAction.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioAction.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioAction.java Thu Aug  6 10:03:42 2015
@@ -21,6 +21,7 @@
 package org.apache.directory.studio.connection.ui.actions;
 
 
+import org.apache.directory.studio.common.ui.CommonUIUtils;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.ConnectionFolder;
 import org.eclipse.jface.action.Action;
@@ -96,9 +97,9 @@ public abstract class StudioAction imple
         setSelectedConnections( SelectionUtils.getConnections( selection ) );
         setSelectedConnectionFolders( SelectionUtils.getConnectionFolders( selection ) );
 
-        action.setEnabled( this.isEnabled() );
-        action.setText( this.getText() );
-        action.setToolTipText( this.getText() );
+        action.setEnabled( isEnabled() );
+        action.setText( CommonUIUtils.getTextValue( getText() ) );
+        action.setToolTipText( CommonUIUtils.getTextValue( getText() ) );
     }
 
 
@@ -129,8 +130,7 @@ public abstract class StudioAction imple
     /**
      * Returns the command identifier.
      *
-     * @return
-     *      the command identifier
+     * @return the command identifier
      */
     public abstract String getCommandId();
 
@@ -196,8 +196,7 @@ public abstract class StudioAction imple
     /**
      * Returns the current active shell
      *
-     * @return
-     *      the current active shell
+     * @return the current active shell
      */
     protected Shell getShell()
     {
@@ -208,8 +207,7 @@ public abstract class StudioAction imple
     /**
      * Gets the selected Connections.
      *
-     * @return
-     *      the selected Connections
+     * @return the selected Connections
      */
     public Connection[] getSelectedConnections()
     {
@@ -220,8 +218,7 @@ public abstract class StudioAction imple
     /**
      * Sets the selected Connections.
      *
-     * @param selectedConnections
-     *      the selected Connections to set
+     * @param selectedConnections the selected Connections to set
      */
     public void setSelectedConnections( Connection[] selectedConnections )
     {
@@ -232,8 +229,7 @@ public abstract class StudioAction imple
     /**
      * Gets the selected connection folders.
      *
-     * @return
-     *      the selected connection folders
+     * @return the selected connection folders
      */
     public ConnectionFolder[] getSelectedConnectionFolders()
     {
@@ -256,8 +252,7 @@ public abstract class StudioAction imple
     /**
      * Gets the input.
      *
-     * @return
-     *      the input
+     * @return the input
      */
     public Object getInput()
     {
@@ -268,12 +263,10 @@ public abstract class StudioAction imple
     /**
      * Sets the input.
      *
-     * @param input
-     *      the input to set
+     * @param input the input to set
      */
     public void setInput( Object input )
     {
         this.input = input;
     }
-
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioActionProxy.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioActionProxy.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioActionProxy.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/actions/StudioActionProxy.java Thu Aug  6 10:03:42 2015
@@ -21,6 +21,7 @@
 package org.apache.directory.studio.connection.ui.actions;
 
 
+import org.apache.directory.studio.common.ui.CommonUIUtils;
 import org.apache.directory.studio.connection.core.Connection;
 import org.apache.directory.studio.connection.core.ConnectionFolder;
 import org.apache.directory.studio.connection.core.event.ConnectionEventRegistry;
@@ -119,7 +120,8 @@ public abstract class StudioActionProxy
 
 
     /**
-     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionUpdated(org.apache.directory.studio.connection.core.Connection)
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#
+     *          connectionUpdated(org.apache.directory.studio.connection.core.Connection)
      */
     public final void connectionUpdated( Connection connection )
     {
@@ -131,7 +133,8 @@ public abstract class StudioActionProxy
 
 
     /**
-     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionAdded(org.apache.directory.studio.connection.core.Connection)
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#
+     *          connectionAdded(org.apache.directory.studio.connection.core.Connection)
      */
     public void connectionAdded( Connection connection )
     {
@@ -140,7 +143,8 @@ public abstract class StudioActionProxy
 
 
     /**
-     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionRemoved(org.apache.directory.studio.connection.core.Connection)
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#
+     *          connectionRemoved(org.apache.directory.studio.connection.core.Connection)
      */
     public void connectionRemoved( Connection connection )
     {
@@ -149,7 +153,8 @@ public abstract class StudioActionProxy
 
 
     /**
-     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionOpened(org.apache.directory.studio.connection.core.Connection)
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#
+     *          connectionOpened(org.apache.directory.studio.connection.core.Connection)
      */
     public void connectionOpened( Connection connection )
     {
@@ -158,7 +163,8 @@ public abstract class StudioActionProxy
 
 
     /**
-     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionClosed(org.apache.directory.studio.connection.core.Connection)
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#
+     *          connectionClosed(org.apache.directory.studio.connection.core.Connection)
      */
     public void connectionClosed( Connection connection )
     {
@@ -167,7 +173,8 @@ public abstract class StudioActionProxy
 
 
     /**
-     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderModified(org.apache.directory.studio.connection.core.ConnectionFolder)
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#
+     *          connectionFolderModified(org.apache.directory.studio.connection.core.ConnectionFolder)
      */
     public void connectionFolderModified( ConnectionFolder connectionFolder )
     {
@@ -176,7 +183,8 @@ public abstract class StudioActionProxy
 
 
     /**
-     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderAdded(org.apache.directory.studio.connection.core.ConnectionFolder)
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#
+     *          connectionFolderAdded(org.apache.directory.studio.connection.core.ConnectionFolder)
      */
     public void connectionFolderAdded( ConnectionFolder connectionFolder )
     {
@@ -185,7 +193,8 @@ public abstract class StudioActionProxy
 
 
     /**
-     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#connectionFolderRemoved(org.apache.directory.studio.connection.core.ConnectionFolder)
+     * @see org.apache.directory.studio.connection.core.event.ConnectionUpdateListener#
+     *          connectionFolderRemoved(org.apache.directory.studio.connection.core.ConnectionFolder)
      */
     public void connectionFolderRemoved( ConnectionFolder connectionFolder )
     {
@@ -231,8 +240,8 @@ public abstract class StudioActionProxy
     {
         if ( !isDisposed() )
         {
-            setText( action.getText() );
-            setToolTipText( action.getText() );
+            setText( CommonUIUtils.getTextValue( action.getText() ) );
+            setToolTipText( CommonUIUtils.getTextValue( action.getText() ) );
             setEnabled( action.isEnabled() );
             setImageDescriptor( action.getImageDescriptor() );
             setChecked( action.isChecked() );
@@ -273,5 +282,4 @@ public abstract class StudioActionProxy
     {
         return action;
     }
-
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/CertificateInfoDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/CertificateInfoDialog.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/CertificateInfoDialog.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/CertificateInfoDialog.java Thu Aug  6 10:03:42 2015
@@ -39,7 +39,6 @@ import org.eclipse.swt.widgets.Shell;
  */
 public class CertificateInfoDialog extends Dialog
 {
-
     /** The title. */
     private String title;
 
@@ -62,6 +61,9 @@ public class CertificateInfoDialog exten
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected void configureShell( Shell shell )
     {
@@ -70,6 +72,9 @@ public class CertificateInfoDialog exten
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected void createButtonsForButtonBar( Composite parent )
     {
@@ -77,20 +82,23 @@ public class CertificateInfoDialog exten
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected Control createDialogArea( final Composite parent )
     {
         Composite composite = ( Composite ) super.createDialogArea( parent );
-        GridData gd = new GridData( GridData.FILL_BOTH );
-        gd.widthHint = convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH * 3 / 2 );
-        gd.heightHint = convertVerticalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH );
-        composite.setLayoutData( gd );
+        GridData gridData = new GridData( GridData.FILL_BOTH );
+        gridData.widthHint = convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH * 3 / 2 );
+        gridData.heightHint = convertVerticalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH );
+        composite.setLayoutData( gridData );
 
         CertificateInfoComposite certificateInfoComposite = new CertificateInfoComposite( composite, SWT.NONE );
         certificateInfoComposite.setInput( certificateChain );
 
         applyDialogFont( composite );
+        
         return composite;
     }
-
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/CertificateTrustDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/CertificateTrustDialog.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/CertificateTrustDialog.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/CertificateTrustDialog.java Thu Aug  6 10:03:42 2015
@@ -45,7 +45,6 @@ import org.eclipse.swt.widgets.Shell;
  */
 public class CertificateTrustDialog extends Dialog
 {
-
     /** The title. */
     private String title;
 
@@ -61,15 +60,6 @@ public class CertificateTrustDialog exte
     /** The causes of failed certificate validation. */
     private List<ICertificateHandler.FailCause> failCauses;
 
-    /** The "Don't trust" button. */
-    private Button trustNotButton;
-
-    /** The "Trust in current session" button. */
-    private Button trustSessionButton;
-
-    /** The "Trust permanent" button. */
-    private Button trustPermanentButton;
-
 
     /**
      * Creates a new instance of CertificateTrustDialog.
@@ -84,14 +74,17 @@ public class CertificateTrustDialog exte
     {
         super( parentShell );
         super.setShellStyle( super.getShellStyle() | SWT.RESIZE );
-        this.title = Messages.getString( "CertificateTrustDialog.CertificateTrust" ); //$NON-NLS-1$
+        title = Messages.getString( "CertificateTrustDialog.CertificateTrust" ); //$NON-NLS-1$
         this.host = host;
         this.certificateChain = certificateChain;
         this.failCauses = failCauses;
-        this.trustLevel = null;
+        trustLevel = null;
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected void configureShell( Shell shell )
     {
@@ -100,6 +93,9 @@ public class CertificateTrustDialog exte
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected void createButtonsForButtonBar( Composite parent )
     {
@@ -109,6 +105,9 @@ public class CertificateTrustDialog exte
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected void buttonPressed( int buttonId )
     {
@@ -116,24 +115,29 @@ public class CertificateTrustDialog exte
         {
             new CertificateInfoDialog( getShell(), certificateChain ).open();
         }
+        
         super.buttonPressed( buttonId );
     }
 
 
+    /**
+     * {@inheritDoc}
+     */
     @Override
     protected Control createDialogArea( final Composite parent )
     {
         Composite composite = ( Composite ) super.createDialogArea( parent );
-        GridData gd = new GridData( GridData.FILL_BOTH );
-        gd.widthHint = convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH );
-        gd.heightHint = convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH / 2 );
-        composite.setLayoutData( gd );
+        GridData gridData = new GridData( GridData.FILL_BOTH );
+        gridData.widthHint = convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH );
+        gridData.heightHint = convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH / 2 );
+        composite.setLayoutData( gridData );
 
         BaseWidgetUtils.createWrappedLabel( composite, NLS.bind( Messages
             .getString( "CertificateTrustDialog.InvalidCertificate" ), host ), 1 ); //$NON-NLS-1$
 
         // failed cause
         Composite failedCauseContainer = BaseWidgetUtils.createColumnContainer( composite, 1, 1 );
+        
         for ( ICertificateHandler.FailCause failCause : failCauses )
         {
             // BaseWidgetUtils.createRadioIndent( failedCauseContainer, 1 );
@@ -143,18 +147,22 @@ public class CertificateTrustDialog exte
                     BaseWidgetUtils.createWrappedLabel( failedCauseContainer, Messages
                         .getString( "CertificateTrustDialog.SelfSignedCertificate" ), 1 ); //$NON-NLS-1$
                     break;
+                    
                 case CertificateExpired:
                     BaseWidgetUtils.createWrappedLabel( failedCauseContainer, Messages
                         .getString( "CertificateTrustDialog.CertificateExpired" ), 1 ); //$NON-NLS-1$
                     break;
+                    
                 case CertificateNotYetValid:
                     BaseWidgetUtils.createWrappedLabel( failedCauseContainer, Messages
                         .getString( "CertificateTrustDialog.CertificateNotYetValid" ), 1 ); //$NON-NLS-1$
                     break;
+                    
                 case NoValidCertificationPath:
                     BaseWidgetUtils.createWrappedLabel( failedCauseContainer, Messages
                         .getString( "CertificateTrustDialog.NoValidCertificationPath" ), 1 ); //$NON-NLS-1$
                     break;
+                    
                 case HostnameVerificationFailed:
                     BaseWidgetUtils.createWrappedLabel( failedCauseContainer, Messages
                         .getString( "CertificateTrustDialog.HostnameVerificationFailed" ), 1 ); //$NON-NLS-1$
@@ -168,32 +176,45 @@ public class CertificateTrustDialog exte
         BaseWidgetUtils.createWrappedLabel( composite, NLS.bind( Messages
             .getString( "CertificateTrustDialog.ChooseTrustLevel" ), host ), 1 ); //$NON-NLS-1$
 
-        trustNotButton = BaseWidgetUtils.createRadiobutton( composite, Messages
+        // The "Don't trust" button
+        Button trustNotButton = BaseWidgetUtils.createRadiobutton( composite, Messages
             .getString( "CertificateTrustDialog.DoNotTrust" ), 1 ); //$NON-NLS-1$
+        
         trustNotButton.addSelectionListener( new SelectionAdapter()
         {
-            public void widgetSelected( final SelectionEvent e )
+            /**
+             * {@inheritDoc}
+             */
+            public void widgetSelected( final SelectionEvent event )
             {
                 CertificateTrustDialog.this.trustLevel = ICertificateHandler.TrustLevel.Not;
             }
         } );
 
-        trustSessionButton = BaseWidgetUtils.createRadiobutton( composite, Messages
+        // The "Trust in current session" button.
+        Button trustSessionButton = BaseWidgetUtils.createRadiobutton( composite, Messages
             .getString( "CertificateTrustDialog.TrustForThisSession" ), 1 ); //$NON-NLS-1$
 
         trustSessionButton.addSelectionListener( new SelectionAdapter()
         {
-            public void widgetSelected( final SelectionEvent e )
+            /**
+             * {@inheritDoc}
+             */
+            public void widgetSelected( final SelectionEvent event )
             {
                 CertificateTrustDialog.this.trustLevel = ICertificateHandler.TrustLevel.Session;
             }
         } );
 
-        trustPermanentButton = BaseWidgetUtils.createRadiobutton( composite, Messages
+        // The "Trust permanent" button.
+        Button trustPermanentButton = BaseWidgetUtils.createRadiobutton( composite, Messages
             .getString( "CertificateTrustDialog.AlwaysTrust" ), 1 ); //$NON-NLS-1$
         trustPermanentButton.addSelectionListener( new SelectionAdapter()
         {
-            public void widgetSelected( final SelectionEvent e )
+            /**
+             * {@inheritDoc}
+             */
+            public void widgetSelected( final SelectionEvent event )
             {
                 CertificateTrustDialog.this.trustLevel = ICertificateHandler.TrustLevel.Permanent;
             }
@@ -216,5 +237,4 @@ public class CertificateTrustDialog exte
     {
         return trustLevel;
     }
-
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/ConnectionFolderDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/ConnectionFolderDialog.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/ConnectionFolderDialog.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/ConnectionFolderDialog.java Thu Aug  6 10:03:42 2015
@@ -35,7 +35,6 @@ import org.eclipse.swt.widgets.Shell;
  */
 public class ConnectionFolderDialog extends InputDialog
 {
-
     /**
      * Creates a new instance of ConnectionFolderDialog.
      * 
@@ -60,5 +59,4 @@ public class ConnectionFolderDialog exte
         Composite composite = ( Composite ) super.createDialogArea( parent );
         return composite;
     }
-
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/Messages.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/Messages.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/Messages.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/Messages.java Thu Aug  6 10:03:42 2015
@@ -29,13 +29,20 @@ import java.util.ResourceBundle;
  *  
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class Messages
+public final class Messages
 {
     /** The resource name */
     private static final ResourceBundle RESOURCE_BUNDLE = 
         ResourceBundle.getBundle( Messages.class.getPackage().getName() + ".messages" );
     
     /**
+     * A private constructor : this is an utility class
+     */
+    private Messages()
+    {
+    }
+
+    /**
      * Get back a message from the resource file given a key
      * 
      * @param key The key associated with the message

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/PasswordDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/PasswordDialog.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/PasswordDialog.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/PasswordDialog.java Thu Aug  6 10:03:42 2015
@@ -21,6 +21,8 @@
 package org.apache.directory.studio.connection.ui.dialogs;
 
 
+import org.apache.commons.lang.StringUtils;
+import org.apache.directory.studio.common.ui.CommonUIUtils;
 import org.apache.directory.studio.common.ui.widgets.BaseWidgetUtils;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
@@ -53,10 +55,13 @@ public class PasswordDialog extends Dial
     private String message;
 
     /** The input value; the empty string by default */
-    private String value = "";//$NON-NLS-1$
+    private String value = StringUtils.EMPTY;//$NON-NLS-1$
 
     // UI Widgets
+    /** The password Text widget */
     private Text passwordText;
+    
+    /** The Show Password text widget */
     private Button showPasswordCheckbox;
 
 
@@ -76,7 +81,7 @@ public class PasswordDialog extends Dial
 
         if ( initialValue == null )
         {
-            value = "";//$NON-NLS-1$
+            value = StringUtils.EMPTY;//$NON-NLS-1$
         }
         else
         {
@@ -92,10 +97,7 @@ public class PasswordDialog extends Dial
     {
         super.configureShell( shell );
 
-        if ( title != null )
-        {
-            shell.setText( title );
-        }
+        shell.setText( CommonUIUtils.getTextValue( title ) );
     }
 
 
@@ -112,9 +114,31 @@ public class PasswordDialog extends Dial
         {
             value = null;
         }
+        
         super.buttonPressed( buttonId );
     }
 
+    
+    /**
+     * The listener for the ShowPassword checkbox
+     */
+    private SelectionAdapter showPasswordCheckboxListener = new SelectionAdapter()
+    {
+        /**
+         * {@inheritDoc}
+         */
+        public void widgetSelected( SelectionEvent event )
+        {
+            if ( showPasswordCheckbox.getSelection() )
+            {
+                passwordText.setEchoChar( '\0' );
+            }
+            else
+            {
+                passwordText.setEchoChar( '\u2022' );
+            }
+        }
+    };
 
     /**
      * {@inheritDoc}
@@ -149,25 +173,12 @@ public class PasswordDialog extends Dial
         // Show Password Checkbox
         showPasswordCheckbox = BaseWidgetUtils.createCheckbox( composite,
             Messages.getString( "PasswordDialog.ShowPassword" ), 1 ); //$NON-NLS-1$
-        showPasswordCheckbox.addSelectionListener( new SelectionAdapter()
-        {
-            public void widgetSelected( SelectionEvent e )
-            {
-                if ( showPasswordCheckbox.getSelection() )
-                {
-                    passwordText.setEchoChar( '\0' );
-                }
-                else
-                {
-                    passwordText.setEchoChar( '\u2022' );
-                }
-            }
-        } );
+        showPasswordCheckbox.addSelectionListener( showPasswordCheckboxListener );
 
         // Setting focus
         passwordText.setFocus();
-
         applyDialogFont( composite );
+        
         return composite;
     }
 

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/ResetPasswordDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/ResetPasswordDialog.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/ResetPasswordDialog.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/ResetPasswordDialog.java Thu Aug  6 10:03:42 2015
@@ -21,6 +21,9 @@
 package org.apache.directory.studio.connection.ui.dialogs;
 
 
+import org.apache.commons.lang.StringUtils;
+import org.apache.directory.api.util.Strings;
+import org.apache.directory.studio.common.ui.CommonUIUtils;
 import org.apache.directory.studio.common.ui.widgets.BaseWidgetUtils;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
@@ -57,18 +60,31 @@ public class ResetPasswordDialog extends
     private String message;
 
     /** The current password value; the empty string by default */
-    private String currentPassword = ""; //$NON-NLS-1$
+    private String currentPassword = StringUtils.EMPTY; //$NON-NLS-1$
 
     /** The new password value; the empty string by default */
-    private String newPassword = ""; //$NON-NLS-1$
+    private String newPassword = StringUtils.EMPTY; //$NON-NLS-1$
 
     // UI Widgets
+    /** The OK button */
     private Button okButton;
+
+    /** The Current Password Text */
     private Text currentPasswordText;
+    
+    /** The Show Current Password Checkbox */
     private Button showCurrentPasswordCheckbox;
+
+    /** The New Password Text */
     private Text newPasswordText;
+    
+    /** The Show New Password checkbox */
     private Button showNewPasswordCheckbox;
+
+    /** The Verify New Password Text */
     private Text verifyNewPasswordText;
+    
+    /** The Show Verify New Password button */
     private Button showVerifyNewPasswordCheckbox;
 
 
@@ -88,7 +104,7 @@ public class ResetPasswordDialog extends
 
         if ( initialValue == null )
         {
-            currentPassword = ""; //$NON-NLS-1$
+            currentPassword = StringUtils.EMPTY; //$NON-NLS-1$
         }
         else
         {
@@ -104,10 +120,7 @@ public class ResetPasswordDialog extends
     {
         super.configureShell( shell );
 
-        if ( title != null )
-        {
-            shell.setText( title );
-        }
+        shell.setText( CommonUIUtils.getTextValue( title ) );
     }
 
 
@@ -177,23 +190,29 @@ public class ResetPasswordDialog extends
         // Current Password Text
         BaseWidgetUtils.createLabel( currentPasswordGroup,
             Messages.getString( "ResetPasswordDialog.CurrentPasswordColon" ), 1 ); //$NON-NLS-1$
-        currentPasswordText = BaseWidgetUtils.createText( currentPasswordGroup, "", 1 ); //$NON-NLS-1$
+        currentPasswordText = BaseWidgetUtils.createText( currentPasswordGroup, StringUtils.EMPTY, 1 ); //$NON-NLS-1$
         currentPasswordText.setEchoChar( '\u2022' );
         currentPasswordText.addModifyListener( new ModifyListener()
         {
-            public void modifyText( ModifyEvent e )
+            /**
+             * {@inheritDoc}
+             */
+            public void modifyText( ModifyEvent event )
             {
                 validate();
             }
         } );
 
         // Show Current Password Checkbox
-        BaseWidgetUtils.createLabel( currentPasswordGroup, "", 1 ); //$NON-NLS-1$
+        BaseWidgetUtils.createLabel( currentPasswordGroup, StringUtils.EMPTY, 1 ); //$NON-NLS-1$
         showCurrentPasswordCheckbox = BaseWidgetUtils.createCheckbox( currentPasswordGroup,
             Messages.getString( "ResetPasswordDialog.ShowPassword" ), 1 ); //$NON-NLS-1$
         showCurrentPasswordCheckbox.addSelectionListener( new SelectionAdapter()
         {
-            public void widgetSelected( SelectionEvent e )
+            /**
+             * {@inheritDoc}
+             */
+            public void widgetSelected( SelectionEvent event )
             {
                 if ( showCurrentPasswordCheckbox.getSelection() )
                 {
@@ -213,23 +232,29 @@ public class ResetPasswordDialog extends
 
         // New Password Text
         BaseWidgetUtils.createLabel( newPasswordGroup, Messages.getString( "ResetPasswordDialog.NewPasswordColon" ), 1 ); //$NON-NLS-1$
-        newPasswordText = BaseWidgetUtils.createText( newPasswordGroup, "", 1 ); //$NON-NLS-1$
+        newPasswordText = BaseWidgetUtils.createText( newPasswordGroup, StringUtils.EMPTY, 1 ); //$NON-NLS-1$
         newPasswordText.setEchoChar( '\u2022' );
         newPasswordText.addModifyListener( new ModifyListener()
         {
-            public void modifyText( ModifyEvent e )
+            /**
+             * {@inheritDoc}
+             */
+            public void modifyText( ModifyEvent event )
             {
                 validate();
             }
         } );
 
         // Show New Password Checkbox
-        BaseWidgetUtils.createLabel( newPasswordGroup, "", 1 ); //$NON-NLS-1$
+        BaseWidgetUtils.createLabel( newPasswordGroup, StringUtils.EMPTY, 1 ); //$NON-NLS-1$
         showNewPasswordCheckbox = BaseWidgetUtils.createCheckbox( newPasswordGroup,
             Messages.getString( "ResetPasswordDialog.ShowPassword" ), 1 ); //$NON-NLS-1$
         showNewPasswordCheckbox.addSelectionListener( new SelectionAdapter()
         {
-            public void widgetSelected( SelectionEvent e )
+            /**
+             * {@inheritDoc}
+             */
+            public void widgetSelected( SelectionEvent event )
             {
                 if ( showNewPasswordCheckbox.getSelection() )
                 {
@@ -245,23 +270,29 @@ public class ResetPasswordDialog extends
         // Verify Text
         BaseWidgetUtils.createLabel( newPasswordGroup,
             Messages.getString( "ResetPasswordDialog.VerifyNewPasswordColon" ), 1 ); //$NON-NLS-1$
-        verifyNewPasswordText = BaseWidgetUtils.createText( newPasswordGroup, "", 1 ); //$NON-NLS-1$
+        verifyNewPasswordText = BaseWidgetUtils.createText( newPasswordGroup, StringUtils.EMPTY, 1 ); //$NON-NLS-1$
         verifyNewPasswordText.setEchoChar( '\u2022' );
         verifyNewPasswordText.addModifyListener( new ModifyListener()
         {
-            public void modifyText( ModifyEvent e )
+            /**
+             * {@inheritDoc}
+             */
+            public void modifyText( ModifyEvent event )
             {
                 validate();
             }
         } );
 
         // Show Verify New Password Checkbox
-        BaseWidgetUtils.createLabel( newPasswordGroup, "", 1 ); //$NON-NLS-1$
+        BaseWidgetUtils.createLabel( newPasswordGroup, StringUtils.EMPTY, 1 ); //$NON-NLS-1$
         showVerifyNewPasswordCheckbox = BaseWidgetUtils.createCheckbox( newPasswordGroup,
             Messages.getString( "ResetPasswordDialog.ShowPassword" ), 1 ); //$NON-NLS-1$
         showVerifyNewPasswordCheckbox.addSelectionListener( new SelectionAdapter()
         {
-            public void widgetSelected( SelectionEvent e )
+            /**
+             * {@inheritDoc}
+             */
+            public void widgetSelected( SelectionEvent event )
             {
                 if ( showVerifyNewPasswordCheckbox.getSelection() )
                 {
@@ -313,7 +344,7 @@ public class ResetPasswordDialog extends
         String newPassword = newPasswordText.getText();
         String verifyNewPassword = verifyNewPasswordText.getText();
 
-        okButton
-            .setEnabled( ( !"".equals( currentPassword ) ) && ( !"".equals( newPassword ) ) && ( newPassword.equals( verifyNewPassword ) ) && ( !currentPassword.equals( newPassword ) ) ); //$NON-NLS-1$ //$NON-NLS-2$
+        okButton.setEnabled( !Strings.isEmpty( currentPassword ) && !Strings.isEmpty( newPassword ) && 
+                newPassword.equals( verifyNewPassword ) && !currentPassword.equals( newPassword ) ); //$NON-NLS-1$ //$NON-NLS-2$
     }
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/SelectReferralConnectionDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/SelectReferralConnectionDialog.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/SelectReferralConnectionDialog.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/SelectReferralConnectionDialog.java Thu Aug  6 10:03:42 2015
@@ -57,19 +57,25 @@ import org.eclipse.swt.widgets.Shell;
  */
 public class SelectReferralConnectionDialog extends Dialog
 {
-
+    /** The dialog title */
     private String title;
 
+    /** The list of available referrals */ 
     private List<String> referralUrls;
 
+    /** The selected connection */
     private Connection selectedConnection;
 
+    /** The connection configuration */
     private ConnectionConfiguration configuration;
 
+    /** The connection listener */
     private ConnectionUniversalListener universalListener;
 
+    /** The connection action group */
     private ConnectionActionGroup actionGroup;
 
+    /** The connection widget */
     private ConnectionWidget mainWidget;
 
 
@@ -116,6 +122,7 @@ public class SelectReferralConnectionDia
             mainWidget.dispose();
             mainWidget = null;
         }
+        
         return super.close();
     }
 
@@ -158,15 +165,16 @@ public class SelectReferralConnectionDia
     protected Control createDialogArea( Composite parent )
     {
         Composite composite = ( Composite ) super.createDialogArea( parent );
-        GridLayout gl = new GridLayout();
-        composite.setLayout( gl );
-        GridData gd = new GridData( GridData.FILL_BOTH );
-        gd.widthHint = convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH );
-        gd.heightHint = convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH / 2 );
-        composite.setLayoutData( gd );
+        GridLayout gridLayout = new GridLayout();
+        composite.setLayout( gridLayout );
+        GridData gridData = new GridData( GridData.FILL_BOTH );
+        gridData.widthHint = convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH );
+        gridData.heightHint = convertHorizontalDLUsToPixels( IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH / 2 );
+        composite.setLayoutData( gridData );
 
         BaseWidgetUtils.createWrappedLabeledText( composite, Messages
             .getString( "SelectReferralConnectionDialog.SelectConnectionToHandleReferral" ), 1 ); //$NON-NLS-1$
+        
         for ( String url : referralUrls )
         {
             BaseWidgetUtils.createWrappedLabeledText( composite, " - " + url, 1 ); //$NON-NLS-1$
@@ -192,34 +200,46 @@ public class SelectReferralConnectionDia
 
         mainWidget.getViewer().addSelectionChangedListener( new ISelectionChangedListener()
         {
+            /**
+             * {@inheritDoc}
+             */
             public void selectionChanged( SelectionChangedEvent event )
             {
                 selectedConnection = null;
+                
                 if ( !event.getSelection().isEmpty() )
                 {
-                    Object o = ( ( IStructuredSelection ) event.getSelection() ).getFirstElement();
-                    if ( o instanceof Connection )
+                    Object object = ( ( IStructuredSelection ) event.getSelection() ).getFirstElement();
+                    
+                    if ( object instanceof Connection )
                     {
-                        selectedConnection = ( Connection ) o;
+                        selectedConnection = ( Connection ) object;
                     }
                 }
+                
                 validate();
             }
         } );
 
         mainWidget.getViewer().addDoubleClickListener( new IDoubleClickListener()
         {
+            /**
+             * {@inheritDoc}
+             */
             public void doubleClick( DoubleClickEvent event )
             {
                 selectedConnection = null;
+                
                 if ( !event.getSelection().isEmpty() )
                 {
-                    Object o = ( ( IStructuredSelection ) event.getSelection() ).getFirstElement();
-                    if ( o instanceof Connection )
+                    Object object = ( ( IStructuredSelection ) event.getSelection() ).getFirstElement();
+                    
+                    if ( object instanceof Connection )
                     {
-                        selectedConnection = ( Connection ) o;
+                        selectedConnection = ( Connection ) object;
                     }
                 }
+                
                 validate();
             }
         } );
@@ -227,17 +247,18 @@ public class SelectReferralConnectionDia
         if ( referralUrls != null )
         {
             Connection[] connections = ConnectionCorePlugin.getDefault().getConnectionManager().getConnections();
-            for ( int i = 0; i < connections.length; i++ )
+            
+            for ( Connection connection : connections )
             {
-                Connection connection = connections[i];
                 LdapUrl connectionUrl = connection.getUrl();
                 String normalizedConnectionUrl = Utils.getSimpleNormalizedUrl( connectionUrl );
+                
                 for ( String url : referralUrls )
                 {
                     try
                     {
-                        if ( url != null
-                            && Utils.getSimpleNormalizedUrl( new LdapUrl( url ) ).equals( normalizedConnectionUrl ) )
+                        if ( ( url != null ) &&
+                             Utils.getSimpleNormalizedUrl( new LdapUrl( url ) ).equals( normalizedConnectionUrl ) )
                         {
                             mainWidget.getViewer().reveal( connection );
                             mainWidget.getViewer().setSelection( new StructuredSelection( connection ), true );
@@ -253,7 +274,6 @@ public class SelectReferralConnectionDia
         }
 
         applyDialogFont( composite );
-
         validate();
 
         return composite;
@@ -269,5 +289,4 @@ public class SelectReferralConnectionDia
     {
         return selectedConnection;
     }
-
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/SetupPasswordDialog.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/SetupPasswordDialog.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/SetupPasswordDialog.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dialogs/SetupPasswordDialog.java Thu Aug  6 10:03:42 2015
@@ -21,6 +21,9 @@
 package org.apache.directory.studio.connection.ui.dialogs;
 
 
+import org.apache.commons.lang.StringUtils;
+import org.apache.directory.api.util.Strings;
+import org.apache.directory.studio.common.ui.CommonUIUtils;
 import org.apache.directory.studio.common.ui.widgets.BaseWidgetUtils;
 import org.eclipse.jface.dialogs.Dialog;
 import org.eclipse.jface.dialogs.IDialogConstants;
@@ -57,13 +60,22 @@ public class SetupPasswordDialog extends
     private String message;
 
     /** The input value; the empty string by default */
-    private String value = "";//$NON-NLS-1$
+    private String value = StringUtils.EMPTY;//$NON-NLS-1$
 
     // UI Widgets
+    /** The OK button */
     private Button okButton;
+
+    /** The Password Text */
     private Text passwordText;
+    
+    /** The Show Password Checkbox */
     private Button showPasswordCheckbox;
+    
+    /** The Verify Password Text */
     private Text verifyPasswordText;
+
+    /** The Show Verify Password Checkbox */
     private Button showVerifyPasswordCheckbox;
 
 
@@ -83,7 +95,7 @@ public class SetupPasswordDialog extends
 
         if ( initialValue == null )
         {
-            value = "";//$NON-NLS-1$
+            value = StringUtils.EMPTY;//$NON-NLS-1$
         }
         else
         {
@@ -99,10 +111,7 @@ public class SetupPasswordDialog extends
     {
         super.configureShell( shell );
 
-        if ( title != null )
-        {
-            shell.setText( title );
-        }
+        shell.setText( CommonUIUtils.getTextValue( title ) );
     }
 
 
@@ -172,19 +181,25 @@ public class SetupPasswordDialog extends
         passwordText.setEchoChar( '\u2022' );
         passwordText.addModifyListener( new ModifyListener()
         {
-            public void modifyText( ModifyEvent e )
+            /**
+             * {@inheritDoc}
+             */
+            public void modifyText( ModifyEvent event )
             {
                 validate();
             }
         } );
 
         // Show Password Checkbox
-        BaseWidgetUtils.createLabel( passwordGroup, "", 1 ); //$NON-NLS-1$
+        BaseWidgetUtils.createLabel( passwordGroup, StringUtils.EMPTY, 1 ); //$NON-NLS-1$
         showPasswordCheckbox = BaseWidgetUtils.createCheckbox( passwordGroup,
             Messages.getString( "SetupPasswordDialog.ShowPassword" ), 1 ); //$NON-NLS-1$
         showPasswordCheckbox.addSelectionListener( new SelectionAdapter()
         {
-            public void widgetSelected( SelectionEvent e )
+            /**
+             * {@inheritDoc}
+             */
+            public void widgetSelected( SelectionEvent event )
             {
                 if ( showPasswordCheckbox.getSelection() )
                 {
@@ -203,19 +218,25 @@ public class SetupPasswordDialog extends
         verifyPasswordText.setEchoChar( '\u2022' );
         verifyPasswordText.addModifyListener( new ModifyListener()
         {
-            public void modifyText( ModifyEvent e )
+            /**
+             * {@inheritDoc}
+             */
+            public void modifyText( ModifyEvent event )
             {
                 validate();
             }
         } );
 
         // Show Verify Password Checkbox
-        BaseWidgetUtils.createLabel( passwordGroup, "", 1 ); //$NON-NLS-1$
+        BaseWidgetUtils.createLabel( passwordGroup, StringUtils.EMPTY, 1 ); //$NON-NLS-1$
         showVerifyPasswordCheckbox = BaseWidgetUtils.createCheckbox( passwordGroup,
             Messages.getString( "SetupPasswordDialog.ShowPassword" ), 1 ); //$NON-NLS-1$
         showVerifyPasswordCheckbox.addSelectionListener( new SelectionAdapter()
         {
-            public void widgetSelected( SelectionEvent e )
+            /**
+             * {@inheritDoc}
+             */
+            public void widgetSelected( SelectionEvent event )
             {
                 if ( showVerifyPasswordCheckbox.getSelection() )
                 {
@@ -255,6 +276,6 @@ public class SetupPasswordDialog extends
         String password = passwordText.getText();
         String verifyPassword = verifyPasswordText.getText();
 
-        okButton.setEnabled( ( !"".equals( password ) ) && ( password.equals( verifyPassword ) ) ); //$NON-NLS-1$ //$NON-NLS-2$
+        okButton.setEnabled( ( !Strings.isEmpty( password ) ) && ( password.equals( verifyPassword ) ) ); //$NON-NLS-1$ //$NON-NLS-2$
     }
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/ConnectionTransfer.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/ConnectionTransfer.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/ConnectionTransfer.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/ConnectionTransfer.java Thu Aug  6 10:03:42 2015
@@ -48,7 +48,7 @@ import org.eclipse.swt.dnd.TransferData;
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class ConnectionTransfer extends ByteArrayTransfer
+public final class ConnectionTransfer extends ByteArrayTransfer
 {
     /** The Constant TYPENAME. */
     private static final String TYPENAME = ConnectionUIConstants.TYPENAME;
@@ -65,6 +65,7 @@ public class ConnectionTransfer extends
      */
     private ConnectionTransfer()
     {
+        super();
     }
 
 
@@ -96,6 +97,7 @@ public class ConnectionTransfer extends
         if ( isSupportedType( transferData ) )
         {
             Object[] objects = ( Object[] ) object;
+            
             try
             {
                 ByteArrayOutputStream out = new ByteArrayOutputStream();
@@ -105,15 +107,15 @@ public class ConnectionTransfer extends
                 {
                     if ( objects[i] instanceof Connection )
                     {
-                        byte[] id = ( ( Connection ) objects[i] ).getConnectionParameter().getId().getBytes();
-                        writeOut.writeInt( id.length );
-                        writeOut.write( id );
+                        byte[] idBytes = ( ( Connection ) objects[i] ).getConnectionParameter().getId().getBytes();
+                        writeOut.writeInt( idBytes.length );
+                        writeOut.write( idBytes );
                     }
                     else if ( objects[i] instanceof ConnectionFolder )
                     {
-                        byte[] id = ( ( ConnectionFolder ) objects[i] ).getId().getBytes();
-                        writeOut.writeInt( id.length );
-                        writeOut.write( id );
+                        byte[] idBytes = ( ( ConnectionFolder ) objects[i] ).getId().getBytes();
+                        writeOut.writeInt( idBytes.length );
+                        writeOut.write( idBytes );
                     }
                 }
 
@@ -143,12 +145,14 @@ public class ConnectionTransfer extends
         if ( isSupportedType( transferData ) )
         {
             byte[] buffer = ( byte[] ) super.nativeToJava( transferData );
+            
             if ( buffer == null )
             {
                 return null;
             }
 
             List<Object> objectList = new ArrayList<Object>();
+            
             try
             {
                 ByteArrayInputStream in = new ByteArrayInputStream( buffer );
@@ -159,23 +163,25 @@ public class ConnectionTransfer extends
                     if ( readIn.available() > 1 )
                     {
                         int size = readIn.readInt();
-                        byte[] id = new byte[size];
-                        readIn.read( id );
+                        byte[] idBytes = new byte[size];
+                        readIn.read( idBytes );
                         Connection connection = ConnectionCorePlugin.getDefault().getConnectionManager()
-                            .getConnectionById( new String( id ) );
-                        if ( connection != null )
-                        {
-                            objectList.add( connection );
-                        }
-                        else
+                            .getConnectionById( new String( idBytes ) );
+                        
+                        if ( connection == null )
                         {
                             ConnectionFolder folder = ConnectionCorePlugin.getDefault().getConnectionFolderManager()
-                                .getConnectionFolderById( new String( id ) );
+                                .getConnectionFolderById( new String( idBytes ) );
+                            
                             if ( folder != null )
                             {
                                 objectList.add( folder );
                             }
                         }
+                        else
+                        {
+                            objectList.add( connection );
+                        }
                     }
                 }
                 while ( readIn.available() > 1 );
@@ -212,5 +218,4 @@ public class ConnectionTransfer extends
         return new int[]
             { TYPEID };
     }
-
 }
\ No newline at end of file

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/DragConnectionListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/DragConnectionListener.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/DragConnectionListener.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/DragConnectionListener.java Thu Aug  6 10:03:42 2015
@@ -79,27 +79,29 @@ public class DragConnectionListener impl
      */
     public void dragSetData( DragSourceEvent event )
     {
-        if ( ConnectionTransfer.getInstance().isSupportedType( event.dataType ) )
+        if ( ConnectionTransfer.getInstance().isSupportedType( event.dataType ) &&
+            ( event.widget instanceof DragSource ) )
         {
-            if ( event.widget instanceof DragSource )
+            DragSource dragSource = ( DragSource ) event.widget;
+            
+            if ( dragSource.getControl() instanceof Tree )
             {
-                DragSource dragSource = ( DragSource ) event.widget;
-                if ( dragSource.getControl() instanceof Tree )
+                List<Object> objectList = new ArrayList<Object>();
+                
+                if ( selection != null )
                 {
-                    List<Object> objectList = new ArrayList<Object>();
-                    if ( selection != null )
+                    for ( Iterator<?> iterator = selection.iterator(); iterator.hasNext(); )
                     {
-                        for ( Iterator<?> iterator = selection.iterator(); iterator.hasNext(); )
+                        Object item = iterator.next();
+                        
+                        if ( ( item instanceof Connection ) || ( item instanceof ConnectionFolder ) )
                         {
-                            Object item = iterator.next();
-                            if ( item instanceof Connection || item instanceof ConnectionFolder )
-                            {
-                                objectList.add( item );
-                            }
+                            objectList.add( item );
                         }
                     }
-                    event.data = objectList.toArray();
                 }
+                
+                event.data = objectList.toArray();
             }
         }
     }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/DropConnectionListener.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/DropConnectionListener.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/DropConnectionListener.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/dnd/DropConnectionListener.java Thu Aug  6 10:03:42 2015
@@ -44,15 +44,6 @@ import org.eclipse.swt.widgets.TreeItem;
  */
 public class DropConnectionListener implements DropTargetListener
 {
-
-    /**
-     * Creates a new instance of DropConnectionListener.
-     */
-    public DropConnectionListener()
-    {
-    }
-
-
     /**
      * {@inheritDoc}
      * 
@@ -101,36 +92,36 @@ public class DropConnectionListener impl
         {
             // move connection folder: check that the new connection folder is not the same or a parent folder
             boolean isMoveConnectionFolderForbidden = false;
-            if ( event.detail == DND.DROP_MOVE || event.detail == DND.DROP_NONE )
-            {
-                if ( ConnectionTransfer.getInstance().isSupportedType( event.currentDataType ) )
+            
+            if ( ( ( event.detail == DND.DROP_MOVE ) || ( event.detail == DND.DROP_NONE ) ) &&
+                ( ConnectionTransfer.getInstance().isSupportedType( event.currentDataType ) ) &&
+                ( ( event.item != null ) && ( event.item.getData() instanceof ConnectionFolder ) ) )
+            {
+                ConnectionFolderManager connectionFolderManager = ConnectionCorePlugin.getDefault()
+                    .getConnectionFolderManager();
+                ConnectionFolder overFolder = ( ConnectionFolder ) event.item.getData();
+                Set<ConnectionFolder> allParentFolders = connectionFolderManager
+                    .getAllParentFolders( overFolder );
+
+                if ( event.widget instanceof DropTarget )
                 {
-                    if ( event.item != null && event.item.getData() instanceof ConnectionFolder )
+                    DropTarget dropTarget = ( DropTarget ) event.widget;
+                    
+                    if ( dropTarget.getControl() instanceof Tree )
                     {
-                        ConnectionFolderManager connectionFolderManager = ConnectionCorePlugin.getDefault()
-                            .getConnectionFolderManager();
-                        ConnectionFolder overFolder = ( ConnectionFolder ) event.item.getData();
-                        Set<ConnectionFolder> allParentFolders = connectionFolderManager
-                            .getAllParentFolders( overFolder );
-
-                        if ( event.widget instanceof DropTarget )
+                        Tree tree = ( Tree ) dropTarget.getControl();
+                        
+                        for ( TreeItem treeItem : tree.getSelection() )
                         {
-                            DropTarget dropTarget = ( DropTarget ) event.widget;
-                            if ( dropTarget.getControl() instanceof Tree )
+                            if ( treeItem.getData() instanceof ConnectionFolder )
                             {
-                                Tree tree = ( Tree ) dropTarget.getControl();
-                                TreeItem[] items = tree.getSelection();
-                                for ( int i = 0; i < items.length; i++ )
+                                ConnectionFolder folder = ( ConnectionFolder ) treeItem.getData();
+                                
+                                if ( allParentFolders.contains( folder ) )
                                 {
-                                    if ( items[i].getData() instanceof ConnectionFolder )
-                                    {
-                                        ConnectionFolder folder = ( ConnectionFolder ) items[i].getData();
-                                        if ( allParentFolders.contains( folder ) )
-                                        {
-                                            isMoveConnectionFolderForbidden = true;
-                                            break;
-                                        }
-                                    }
+                                    isMoveConnectionFolderForbidden = true;
+                                    
+                                    break;
                                 }
                             }
                         }
@@ -191,10 +182,19 @@ public class DropConnectionListener impl
             {
                 // get connection and folders to handle
                 Object[] objects = ( Object[] ) event.data;
-                Object target = event.item != null ? event.item.getData() : connectionFolderManager
-                    .getRootConnectionFolder();
+                Object target;
+                
+                if ( event.item == null ) 
+                {
+                    target = connectionFolderManager .getRootConnectionFolder();
+                }
+                else
+                {
+                    target = event.item.getData();
+                }
 
                 ConnectionFolder targetFolder = null;
+                
                 if ( target instanceof ConnectionFolder )
                 {
                     targetFolder = ( ConnectionFolder ) target;
@@ -210,6 +210,7 @@ public class DropConnectionListener impl
                     if ( object instanceof Connection )
                     {
                         Connection connection = ( Connection ) object;
+                        
                         if ( event.detail == DND.DROP_MOVE )
                         {
                             ConnectionFolder parentConnectionFolder = connectionFolderManager
@@ -227,6 +228,7 @@ public class DropConnectionListener impl
                     else if ( object instanceof ConnectionFolder )
                     {
                         ConnectionFolder folder = ( ConnectionFolder ) object;
+                        
                         if ( event.detail == DND.DROP_MOVE )
                         {
                             ConnectionFolder parentConnectionFolder = connectionFolderManager
@@ -256,5 +258,4 @@ public class DropConnectionListener impl
             e.printStackTrace();
         }
     }
-
 }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/preferences/CertificateValidationPreferencePage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/preferences/CertificateValidationPreferencePage.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/preferences/CertificateValidationPreferencePage.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/preferences/CertificateValidationPreferencePage.java Thu Aug  6 10:03:42 2015
@@ -55,12 +55,6 @@ public class CertificateValidationPrefer
     /** The tab folder. */
     private TabFolder tabFolder;
 
-    /** The composite containing permanent trusted certificates */
-    private CertificateListComposite permanentCLComposite;
-
-    /** The composite containing temporary trusted certificates */
-    private CertificateListComposite sessionCLComposite;
-
 
     /**
      * 
@@ -99,7 +93,7 @@ public class CertificateValidationPrefer
         verifyCertificatesButton.addSelectionListener( new SelectionAdapter()
         {
             @Override
-            public void widgetSelected( SelectionEvent e )
+            public void widgetSelected( SelectionEvent event )
             {
                 tabFolder.setEnabled( verifyCertificatesButton.getSelection() );
             }
@@ -109,13 +103,13 @@ public class CertificateValidationPrefer
         tabFolder = new TabFolder( composite, SWT.TOP );
         tabFolder.setLayoutData( new GridData( GridData.FILL, GridData.FILL, true, true ) );
 
-        permanentCLComposite = new CertificateListComposite( tabFolder, SWT.NONE );
+        CertificateListComposite permanentCLComposite = new CertificateListComposite( tabFolder, SWT.NONE );
         permanentCLComposite.setInput( ConnectionCorePlugin.getDefault().getPermanentTrustStoreManager() );
         TabItem permanentTab = new TabItem( tabFolder, SWT.NONE, 0 );
         permanentTab.setText( Messages.getString( "CertificateValidationPreferencePage.PermanentTrusted" ) ); //$NON-NLS-1$
         permanentTab.setControl( permanentCLComposite );
 
-        sessionCLComposite = new CertificateListComposite( tabFolder, SWT.NONE );
+        CertificateListComposite sessionCLComposite = new CertificateListComposite( tabFolder, SWT.NONE );
         sessionCLComposite.setInput( ConnectionCorePlugin.getDefault().getSessionTrustStoreManager() );
         TabItem sessionTab = new TabItem( tabFolder, SWT.NONE, 1 );
         sessionTab.setText( Messages.getString( "CertificateValidationPreferencePage.TemporaryTrusted" ) ); //$NON-NLS-1$

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/preferences/ConnectionsPreferencePage.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/preferences/ConnectionsPreferencePage.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/preferences/ConnectionsPreferencePage.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/preferences/ConnectionsPreferencePage.java Thu Aug  6 10:03:42 2015
@@ -133,7 +133,7 @@ public class ConnectionsPreferencePage e
 
         useKrb5SystemPropertiesButton.addSelectionListener( new SelectionAdapter()
         {
-            public void widgetSelected( SelectionEvent e )
+            public void widgetSelected( SelectionEvent event )
             {
                 validate();
             }

Modified: directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/preferences/Messages.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/preferences/Messages.java?rev=1694439&r1=1694438&r2=1694439&view=diff
==============================================================================
--- directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/preferences/Messages.java (original)
+++ directory/studio/trunk/plugins/connection.ui/src/main/java/org/apache/directory/studio/connection/ui/preferences/Messages.java Thu Aug  6 10:03:42 2015
@@ -30,13 +30,20 @@ import java.util.ResourceBundle;
  *  
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
  */
-public class Messages
+public final class Messages
 {
     /** The resource name */
     private static final ResourceBundle RESOURCE_BUNDLE = 
         ResourceBundle.getBundle( Messages.class.getPackage().getName() + ".messages" );
     
     /**
+     * A private constructor : this is an utility class
+     */
+    private Messages()
+    {
+    }
+
+    /**
      * Get back a message from the resource file given a key
      * 
      * @param key The key associated with the message



Mime
View raw message