You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by pa...@apache.org on 2011/10/03 17:27:54 UTC

svn commit: r1178432 - in /directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers: ./ wizards/

Author: pamarcelot
Date: Mon Oct  3 15:27:53 2011
New Revision: 1178432

URL: http://svn.apache.org/viewvc?rev=1178432&view=rev
Log:
Added a title to the NewServerWizard.
Code formatting.
String externalization.

Modified:
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersUtils.java
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages.properties
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages_de.properties
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages_fr.properties
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizard.java
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/messages.properties
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/messages_de.properties
    directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/messages_fr.properties

Modified: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersUtils.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersUtils.java?rev=1178432&r1=1178431&r2=1178432&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersUtils.java (original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersUtils.java Mon Oct  3 15:27:53 2011
@@ -152,14 +152,10 @@ public class LdapServersUtils
         // Creating the thread
         Thread thread = new Thread()
         {
-            /** The debug event listener */
-            private IDebugEventSetListener debugEventSetListener;
-
-
             public void run()
             {
-                // Creating the listener
-                debugEventSetListener = new IDebugEventSetListener()
+                // Adding the listener
+                DebugPlugin.getDefault().addDebugEventListener( new IDebugEventSetListener()
                 {
                     public void handleDebugEvents( DebugEvent[] events )
                     {
@@ -185,7 +181,7 @@ public class LdapServersUtils
                                         server.setStatus( LdapServerStatus.STOPPED );
 
                                         // Removing the listener
-                                        DebugPlugin.getDefault().removeDebugEventListener( debugEventSetListener );
+                                        DebugPlugin.getDefault().removeDebugEventListener( this );
 
                                         // ... and we exit the thread
                                         return;
@@ -194,10 +190,7 @@ public class LdapServersUtils
                             }
                         }
                     }
-                };
-
-                // Adding the listener
-                DebugPlugin.getDefault().addDebugEventListener( debugEventSetListener );
+                } );
             }
         };
 
@@ -214,9 +207,23 @@ public class LdapServersUtils
      */
     public static void startConsolePrinterThread( LdapServer server )
     {
+        startConsolePrinterThread( server, LdapServersManager.getServerFolder( server )
+            .append( "log" ) //$NON-NLS-1$
+            .append( "apacheds.log" ).toFile() );//$NON-NLS-1$
+    }
+
+
+    /**
+     * Starts the console printer thread.
+     *
+     * @param server
+     *      the server
+     */
+    public static void startConsolePrinterThread( LdapServer server, File serverLogsFile )
+    {
         MessageConsole messageConsole = ConsolesManager.getDefault().getMessageConsole( server );
-        ConsolePrinterThread consolePrinter = new ConsolePrinterThread( LdapServersManager.getServerFolder( server ).append( "log" ) //$NON-NLS-1$
-            .append( "apacheds.log" ).toFile(), messageConsole.newMessageStream() ); //$NON-NLS-1$
+        ConsolePrinterThread consolePrinter = new ConsolePrinterThread( serverLogsFile,
+            messageConsole.newMessageStream() );
         consolePrinter.start();
 
         // Storing the console printer as a custom object in the LDAP Server for later use
@@ -233,7 +240,8 @@ public class LdapServersUtils
     public static void stopConsolePrinterThread( LdapServer server )
     {
         // Getting the console printer
-        ConsolePrinterThread consolePrinter = ( ConsolePrinterThread ) server.removeCustomObject( CONSOLE_PRINTER_CUSTOM_OBJECT );
+        ConsolePrinterThread consolePrinter = ( ConsolePrinterThread ) server
+            .removeCustomObject( CONSOLE_PRINTER_CUSTOM_OBJECT );
         if ( ( consolePrinter != null ) && ( consolePrinter.isAlive() ) )
         {
             // Closing the console printer
@@ -243,7 +251,7 @@ public class LdapServersUtils
 
 
     /**
-     * Launches Apache DS using a launch configuration.
+     * Launches ApacheDS using a launch configuration.
      *
      * @param server
      *      the server
@@ -263,8 +271,9 @@ public class LdapServersUtils
         // Creating a new editable launch configuration
         ILaunchConfigurationType type = DebugPlugin.getDefault().getLaunchManager()
             .getLaunchConfigurationType( IJavaLaunchConfigurationConstants.ID_JAVA_APPLICATION );
-        ILaunchConfigurationWorkingCopy workingCopy = type.newInstance( null, NLS.bind( "Starting {0}", new String[]
-            { server.getName() } ) );
+        ILaunchConfigurationWorkingCopy workingCopy = type.newInstance( null,
+            NLS.bind( Messages.getString( "LdapServersUtils.Starting" ), new String[] //$NON-NLS-1$
+                { server.getName() } ) );
 
         // Setting the JRE container path attribute
         workingCopy.setAttribute( IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, vmInstall

Modified: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages.properties?rev=1178432&r1=1178431&r2=1178432&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages.properties (original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages.properties Mon Oct  3 15:27:53 2011
@@ -22,3 +22,5 @@ LdapServersPlugin.UnableGetPluginPropert
 LdapServersManager.ErrorLoadingServer=An error occurred when loading the servers.\n\n
 
 LdapServersManagerIO.ErrorNotValidServersFile=The file does not seem to be a valid servers file.
+
+LdapServersUtils.Starting=Starting {0}...

Modified: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages_de.properties?rev=1178432&r1=1178431&r2=1178432&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages_de.properties (original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages_de.properties Mon Oct  3 15:27:53 2011
@@ -22,3 +22,5 @@ LdapServersPlugin.UnableGetPluginPropert
 LdapServersManager.ErrorLoadingServer=Beim Laden des Servers ist ein Fehler aufgetreten.\n\n
 
 LdapServersManagerIO.ErrorNotValidServersFile=Die Datei scheint keine g\u00FCltige Server-Datei zu sein.
+
+LdapServersUtils.Starting=Startend {0}...

Modified: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages_fr.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages_fr.properties?rev=1178432&r1=1178431&r2=1178432&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages_fr.properties (original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/messages_fr.properties Mon Oct  3 15:27:53 2011
@@ -22,3 +22,5 @@ LdapServersPlugin.UnableGetPluginPropert
 LdapServersManager.ErrorLoadingServer=Une erreur est survenue lors du chargement des serveurs.\n\n
 
 LdapServersManagerIO.ErrorNotValidServersFile=Le fichier de configuration ne semble pas \u00EAtre valide.
+
+LdapServersUtils.Starting=D\u00E9marrage du serveur {0}...

Modified: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizard.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizard.java?rev=1178432&r1=1178431&r2=1178432&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizard.java (original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/NewServerWizard.java Mon Oct  3 15:27:53 2011
@@ -65,7 +65,7 @@ public class NewServerWizard extends Wiz
         for ( LdapServerAdapterExtension ldapServerAdapterExtension : ldapServerAdapterExtensions )
         {
             String configurationPageClassName = ldapServerAdapterExtension.getConfigurationPageClassName();
-            if ( ( configurationPageClassName != null ) && ( !"".equals( configurationPageClassName ) ) )
+            if ( ( configurationPageClassName != null ) && ( !"".equals( configurationPageClassName ) ) ) //$NON-NLS-1$
             {
                 try
                 {
@@ -96,18 +96,18 @@ public class NewServerWizard extends Wiz
 
         // Getting the configuration page (in any
         NewServerWizardConfigurationPage configurationPage = getConfigurationPage();
-        
+
         // Creating the new server
         final LdapServer server = new LdapServer();
         server.setName( serverName );
         server.setLdapServerAdapterExtension( adapterExtension );
-        
+
         // Saving the configuration page (is any)
         if ( configurationPage != null )
         {
             configurationPage.saveConfiguration( server );
         }
-        
+
         try
         {
             getContainer().run( true, false, new IRunnableWithProgress()
@@ -118,8 +118,8 @@ public class NewServerWizard extends Wiz
                     StudioProgressMonitor spm = new StudioProgressMonitor( monitor );
 
                     // Setting the title
-                    spm.beginTask( "Creating LDAP Server: ", IProgressMonitor.UNKNOWN );
-                    spm.subTask( "creating server folder" );
+                    spm.beginTask( Messages.getString("NewServerWizard.CreatingLdapServer"), IProgressMonitor.UNKNOWN ); //$NON-NLS-1$
+                    spm.subTask( Messages.getString("NewServerWizard.CreatingServerFolder") ); //$NON-NLS-1$
 
                     // Adding the new server to the servers handler
                     LdapServersManager.getDefault().addServer( server );
@@ -157,6 +157,7 @@ public class NewServerWizard extends Wiz
      */
     public void init( IWorkbench workbench, IStructuredSelection selection )
     {
+        setWindowTitle( Messages.getString( "NewServerWizard.NewLdapServer" ) ); //$NON-NLS-1$
         setNeedsProgressMonitor( true );
     }
 
@@ -216,7 +217,7 @@ public class NewServerWizard extends Wiz
         {
             String configurationPageClassName = ldapServerAdapterExtension.getConfigurationPageClassName();
 
-            if ( ( configurationPageClassName != null ) && ( !"".equals( configurationPageClassName ) ) )
+            if ( ( configurationPageClassName != null ) && ( !"".equals( configurationPageClassName ) ) ) //$NON-NLS-1$
             {
                 return configurationPages.get( ldapServerAdapterExtension.getId() );
             }

Modified: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/messages.properties?rev=1178432&r1=1178431&r2=1178432&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/messages.properties (original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/messages.properties Mon Oct  3 15:27:53 2011
@@ -15,3 +15,6 @@
 #  specific language governing permissions and limitations
 #  under the License.
 
+NewServerWizard.CreatingLdapServer=Creating LDAP Server: 
+NewServerWizard.CreatingServerFolder=creating server folder
+NewServerWizard.NewLdapServer=New LDAP Server

Modified: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/messages_de.properties?rev=1178432&r1=1178431&r2=1178432&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/messages_de.properties (original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/messages_de.properties Mon Oct  3 15:27:53 2011
@@ -14,3 +14,7 @@
 #  KIND, either express or implied.  See the License for the
 #  specific language governing permissions and limitations
 #  under the License.
+
+NewServerWizard.CreatingLdapServer=TODO:Creating LDAP Server: 
+NewServerWizard.CreatingServerFolder=TODO:creating server folder
+NewServerWizard.NewLdapServer=TODO:New LDAP Server

Modified: directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/messages_fr.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/messages_fr.properties?rev=1178432&r1=1178431&r2=1178432&view=diff
==============================================================================
--- directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/messages_fr.properties (original)
+++ directory/studio/trunk/plugins/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/wizards/messages_fr.properties Mon Oct  3 15:27:53 2011
@@ -14,3 +14,7 @@
 #  KIND, either express or implied.  See the License for the
 #  specific language governing permissions and limitations
 #  under the License.
+
+NewServerWizard.CreatingLdapServer=Création du serveur LDAP : 
+NewServerWizard.CreatingServerFolder=création du dossier du serveur
+NewServerWizard.NewLdapServer=Nouveau Serveur LDAP