directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r964813 - in /directory/studio/trunk/ldapservers: resources/icons/ src/main/java/org/apache/directory/studio/ldapservers/ src/main/java/org/apache/directory/studio/ldapservers/actions/ src/main/java/org/apache/directory/studio/ldapservers/a...
Date Fri, 16 Jul 2010 14:38:29 GMT
Author: pamarcelot
Date: Fri Jul 16 14:38:28 2010
New Revision: 964813

URL: http://svn.apache.org/viewvc?rev=964813&view=rev
Log:
Added basic Start/Stop Actions and Jobs.

Added:
    directory/studio/trunk/ldapservers/resources/icons/run.gif   (with props)
    directory/studio/trunk/ldapservers/resources/icons/stop.gif   (with props)
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/MementoTest.java
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/StartAction.java
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/StopAction.java
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/Messages.java
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/StartLdapServerJob.java
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/StopLdapServerJob.java
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/messages.properties
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/messages_de.properties
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/messages_fr.properties
Modified:
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersPluginConstants.java
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/DeleteAction.java
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/messages.properties
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/messages_de.properties
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/messages_fr.properties
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/apacheds/ApacheDS156LdapServerAdapter.java
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/apacheds/ApacheDS157LdapServerAdapter.java
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapter.java
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerStatus.java
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersView.java
    directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersViewLabelProvider.java

Added: directory/studio/trunk/ldapservers/resources/icons/run.gif
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/resources/icons/run.gif?rev=964813&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/studio/trunk/ldapservers/resources/icons/run.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Added: directory/studio/trunk/ldapservers/resources/icons/stop.gif
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/resources/icons/stop.gif?rev=964813&view=auto
==============================================================================
Binary file - no diff available.

Propchange: directory/studio/trunk/ldapservers/resources/icons/stop.gif
------------------------------------------------------------------------------
    svn:mime-type = application/octet-stream

Modified: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersPluginConstants.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersPluginConstants.java?rev=964813&r1=964812&r2=964813&view=diff
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersPluginConstants.java (original)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/LdapServersPluginConstants.java Fri Jul 16 14:38:28 2010
@@ -38,6 +38,7 @@ public interface LdapServersPluginConsta
     // IMAGES
     // ------
     public static final String IMG_FOLDER = "resources/icons/folder.gif";
+    public static final String IMG_RUN = "resources/icons/run.gif";
     public static final String IMG_SERVER_NEW = "resources/icons/server_new.gif";
     public static final String IMG_SERVER_NEW_WIZARD = "resources/icons/server_new_wizard.png";
     public static final String IMG_SERVER = "resources/icons/server.gif";
@@ -49,6 +50,7 @@ public interface LdapServersPluginConsta
     public static final String IMG_SERVER_STOPPING1 = "resources/icons/server_stopping1.gif";
     public static final String IMG_SERVER_STOPPING2 = "resources/icons/server_stopping2.gif";
     public static final String IMG_SERVER_STOPPING3 = "resources/icons/server_stopping3.gif";
+    public static final String IMG_STOP = "resources/icons/stop.gif";
 
     // --------------
     // PROPERTY PAGES

Added: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/MementoTest.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/MementoTest.java?rev=964813&view=auto
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/MementoTest.java (added)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/MementoTest.java Fri Jul 16 14:38:28 2010
@@ -0,0 +1,35 @@
+package org.apache.directory.studio.ldapservers;
+
+
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+
+import org.eclipse.ui.IMemento;
+import org.eclipse.ui.WorkbenchException;
+import org.eclipse.ui.XMLMemento;
+
+
+public class MementoTest
+{
+    public static void main( String[] args ) throws IOException, WorkbenchException
+    {
+        XMLMemento memento = XMLMemento.createReadRoot( new FileReader( new File( "testfile" ) ) );
+
+
+        XMLMemento memento2 = XMLMemento.createWriteRoot( "type" );
+
+        memento2.putMemento( memento );
+        memento2.save( new FileWriter( new File( "testfile2" ) ) );
+        
+        //        memento.putBoolean( "bool", true );
+        //
+        //        IMemento mem = memento.createChild( "child" );
+        //
+        //        mem.putTextData( "blablabla" );
+        //
+        //        memento.save( new FileWriter( new File( "testfile" ) ) );
+        //        System.out.println( "written." );
+    }
+}

Modified: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/DeleteAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/DeleteAction.java?rev=964813&r1=964812&r2=964813&view=diff
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/DeleteAction.java (original)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/DeleteAction.java Fri Jul 16 14:38:28 2010
@@ -110,7 +110,7 @@ public class DeleteAction extends Action
                     //                    server.setStatus( LdapServerStatus.STOPPING ); // TODO
 
                     // Getting the launch job // TODO
-                    //                    LaunchServerJob launchJob = server.getLaunchJob();
+                    //                    StartLdapServerJob launchJob = server.getLaunchJob();
                     //                    if ( launchJob != null )
                     //                    {
                     //                        // Getting the launch

Added: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/StartAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/StartAction.java?rev=964813&view=auto
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/StartAction.java (added)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/StartAction.java Fri Jul 16 14:38:28 2010
@@ -0,0 +1,139 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.studio.ldapservers.actions;
+
+
+import org.apache.directory.studio.ldapservers.LdapServersPlugin;
+import org.apache.directory.studio.ldapservers.LdapServersPluginConstants;
+import org.apache.directory.studio.ldapservers.jobs.StartLdapServerJob;
+import org.apache.directory.studio.ldapservers.model.LdapServer;
+import org.apache.directory.studio.ldapservers.views.ServersView;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+
+
+/**
+ * This class implements the start action for a server.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StartAction extends Action implements IWorkbenchWindowActionDelegate
+{
+    /** The associated view */
+    private ServersView view;
+
+
+    /**
+     * Creates a new instance of StartAction.
+     */
+    public StartAction()
+    {
+        super( Messages.getString( "StartAction.Run" ) ); //$NON-NLS-1$
+        init();
+    }
+
+
+    /**
+     * Creates a new instance of StartAction.
+     *
+     * @param view
+     *      the associated view
+     */
+    public StartAction( ServersView view )
+    {
+        super( Messages.getString( "StartAction.Run" ) ); //$NON-NLS-1$
+        this.view = view;
+        init();
+    }
+
+
+    /**
+     * Initializes the action.
+     */
+    private void init()
+    {
+        //        setId( ApacheDsPluginConstants.CMD_RUN ); // TODO
+        //        setActionDefinitionId( ApacheDsPluginConstants.CMD_RUN ); // TODO
+        setToolTipText( Messages.getString( "StartAction.RunToolTip" ) ); //$NON-NLS-1$
+        setImageDescriptor( LdapServersPlugin.getDefault().getImageDescriptor( LdapServersPluginConstants.IMG_RUN ) );
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.action.Action#run()
+     */
+    public void run()
+    {
+        if ( view != null )
+        {
+            // Getting the selection
+            StructuredSelection selection = ( StructuredSelection ) view.getViewer().getSelection();
+            if ( ( !selection.isEmpty() ) && ( selection.size() == 1 ) )
+            {
+                // Getting the server
+                LdapServer server = ( LdapServer ) selection.getFirstElement();
+
+                // Creating and scheduling the job to start the server
+                StartLdapServerJob job = new StartLdapServerJob( server );
+                job.schedule();
+            }
+        }
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+     */
+    public void run( IAction action )
+    {
+        run();
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
+     */
+    public void dispose()
+    {
+        // Nothing to do
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
+     */
+    public void init( IWorkbenchWindow window )
+    {
+        // Nothing to do
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+     */
+    public void selectionChanged( IAction action, ISelection selection )
+    {
+        // Nothing to do
+    }
+}

Added: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/StopAction.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/StopAction.java?rev=964813&view=auto
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/StopAction.java (added)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/StopAction.java Fri Jul 16 14:38:28 2010
@@ -0,0 +1,143 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+package org.apache.directory.studio.ldapservers.actions;
+
+
+import java.io.IOException;
+
+import org.apache.directory.studio.ldapservers.LdapServersPlugin;
+import org.apache.directory.studio.ldapservers.LdapServersPluginConstants;
+import org.apache.directory.studio.ldapservers.jobs.StartLdapServerJob;
+import org.apache.directory.studio.ldapservers.jobs.StopLdapServerJob;
+import org.apache.directory.studio.ldapservers.model.LdapServer;
+import org.apache.directory.studio.ldapservers.views.ServersView;
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.action.IAction;
+import org.eclipse.jface.viewers.ISelection;
+import org.eclipse.jface.viewers.StructuredSelection;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.IWorkbenchWindowActionDelegate;
+
+
+/**
+ * This class implements the stop action for a server.
+ *
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StopAction extends Action implements IWorkbenchWindowActionDelegate
+{
+    /** The associated view */
+    private ServersView view;
+
+
+    /**
+     * Creates a new instance of StopAction.
+     */
+    public StopAction()
+    {
+        super( Messages.getString( "StopAction.Stop" ) ); //$NON-NLS-1$
+        init();
+    }
+
+
+    /**
+     * Creates a new instance of StopAction.
+     *
+     * @param view
+     *      the associated view
+     */
+    public StopAction( ServersView view )
+    {
+        super( Messages.getString( "StopAction.Stop" ) ); //$NON-NLS-1$
+        this.view = view;
+        init();
+    }
+
+
+    /**
+     * Initializes the action.
+     */
+    private void init()
+    {
+        //        setId( ApacheDsPluginConstants.CMD_STOP ); // TODO
+        //        setActionDefinitionId( ApacheDsPluginConstants.CMD_STOP ); // TODO
+        setToolTipText( Messages.getString( "StopAction.StopToolTip" ) ); //$NON-NLS-1$
+        setImageDescriptor( LdapServersPlugin.getDefault().getImageDescriptor( LdapServersPluginConstants.IMG_STOP ) );
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.jface.action.Action#run()
+     */
+    public void run()
+    {
+        if ( view != null )
+        {
+            // Getting the selection
+            StructuredSelection selection = ( StructuredSelection ) view.getViewer().getSelection();
+            if ( ( !selection.isEmpty() ) && ( selection.size() == 1 ) )
+            {
+                // Getting the server
+                LdapServer server = ( LdapServer ) selection.getFirstElement();
+
+                // Creating and scheduling the job to stop the server
+                StopLdapServerJob job = new StopLdapServerJob( server );
+                job.schedule();
+            }
+        }
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IActionDelegate#run(org.eclipse.jface.action.IAction)
+     */
+    public void run( IAction action )
+    {
+        run();
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
+     */
+    public void dispose()
+    {
+        // Nothing to do
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
+     */
+    public void init( IWorkbenchWindow window )
+    {
+        // Nothing to do
+    }
+
+
+    /* (non-Javadoc)
+     * @see org.eclipse.ui.IActionDelegate#selectionChanged(org.eclipse.jface.action.IAction, org.eclipse.jface.viewers.ISelection)
+     */
+    public void selectionChanged( IAction action, ISelection selection )
+    {
+        // Nothing to do
+    }
+}

Modified: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/messages.properties?rev=964813&r1=964812&r2=964813&view=diff
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/messages.properties (original)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/messages.properties Fri Jul 16 14:38:28 2010
@@ -39,21 +39,21 @@ RenameAction.ErrorNameInUse=The name is 
 RenameAction.Rename=R&ename...
 RenameAction.RenameToolTip=Rename...
 RenameAction.Server=Server
-RunAction.ChangePasswordPort=ChangePassword (port {0})
-RunAction.Continue=Do you wish to continue?
-RunAction.DNSPort=DNS (port {0})
-RunAction.FollowingErrorOccurred=The following error occurred\: 
-RunAction.KerberosPort=Kerberos (port {0})
-RunAction.LDAPPort=LDAP (port {0})
-RunAction.LDAPSPort=LDAPS (port {0})
-RunAction.NTPPort=NTP (port {0})
-RunAction.PortInUse=Port already in use
-RunAction.PortOfProtocolInUse=The port of the protocol {0} is already in use.
-RunAction.PortsInUse=Ports already in use
-RunAction.PortsOfProtocolsInUse=The ports of the following protocols are already in use\:
-RunAction.Run=&Run
-RunAction.RunToolTip=Run
-RunAction.UnableReadServerConfiguration=Unable to read the server configuration.
+StartAction.ChangePasswordPort=ChangePassword (port {0})
+StartAction.Continue=Do you wish to continue?
+StartAction.DNSPort=DNS (port {0})
+StartAction.FollowingErrorOccurred=The following error occurred\: 
+StartAction.KerberosPort=Kerberos (port {0})
+StartAction.LDAPPort=LDAP (port {0})
+StartAction.LDAPSPort=LDAPS (port {0})
+StartAction.NTPPort=NTP (port {0})
+StartAction.PortInUse=Port already in use
+StartAction.PortOfProtocolInUse=The port of the protocol {0} is already in use.
+StartAction.PortsInUse=Ports already in use
+StartAction.PortsOfProtocolsInUse=The ports of the following protocols are already in use\:
+StartAction.Run=&Run
+StartAction.RunToolTip=Run
+StartAction.UnableReadServerConfiguration=Unable to read the server configuration.
 StopAction.ErrorWhenStopping=An error occurred when stopping the server.\n\n
 StopAction.ErrorWhenWriting=An error occurred when writing to the Info console message stream.\n\n
 StopAction.ServerStopped=Server stopped.\n

Modified: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/messages_de.properties?rev=964813&r1=964812&r2=964813&view=diff
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/messages_de.properties (original)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/messages_de.properties Fri Jul 16 14:38:28 2010
@@ -37,15 +37,15 @@ PropertiesAction.PropertiesToolTip=Eigen
 RenameAction.ErrorNameInUse=Der Name wird bereits verwendet. Geben Sie einen anderen Namen an.
 RenameAction.Rename=Umb&enennen...
 RenameAction.RenameToolTip=Umbenennen...
-RunAction.Continue=Wollen Sie weiterfahren?
-RunAction.FollowingErrorOccurred=Folgender Fehler ist aufgetreten\: 
-RunAction.PortInUse=Der Port wird bereits verwendet
-RunAction.PortOfProtocolInUse=Der Port des Protokolls {0} wird bereits verwendet.
-RunAction.PortsInUse=Die Ports werden bereits verwendet
-RunAction.PortsOfProtocolsInUse=Die Ports folgender Protokolle werden bereits verwendet\:
-RunAction.UnableReadServerConfiguration=Unf\u00E4hig die Server Konfiguration zu lesen.
-RunAction.Run=&Starten
-RunAction.RunToolTip=Starten
+StartAction.Continue=Wollen Sie weiterfahren?
+StartAction.FollowingErrorOccurred=Folgender Fehler ist aufgetreten\: 
+StartAction.PortInUse=Der Port wird bereits verwendet
+StartAction.PortOfProtocolInUse=Der Port des Protokolls {0} wird bereits verwendet.
+StartAction.PortsInUse=Die Ports werden bereits verwendet
+StartAction.PortsOfProtocolsInUse=Die Ports folgender Protokolle werden bereits verwendet\:
+StartAction.UnableReadServerConfiguration=Unf\u00E4hig die Server Konfiguration zu lesen.
+StartAction.Run=&Starten
+StartAction.RunToolTip=Starten
 StopAction.Stop=S&toppen
 StopAction.StopToolTip=Stoppen
 StopAction.ErrorWhenStopping=Beim Stoppen des Servers ist ein Fehler aufgetreten.\n\n

Modified: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/messages_fr.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/messages_fr.properties?rev=964813&r1=964812&r2=964813&view=diff
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/messages_fr.properties (original)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/actions/messages_fr.properties Fri Jul 16 14:38:28 2010
@@ -46,15 +46,15 @@ RenameAction.ErrorNameInUse=Ce nom est d
 RenameAction.Rename=&Renommer...
 RenameAction.RenameToolTip=Renommer...
 RenameAction.Server=Serveur
-RunAction.Continue=Voulez-vous poursuivre l'op\u00E9ration ?
-RunAction.FollowingErrorOccurred=L'erreur suivante est survenue \:
-RunAction.PortInUse=Le port est d\u00E9j\u00E0 utilis\u00E9
-RunAction.PortOfProtocolInUse=Le port associ\u00E9 au protocole "{0}" est d\u00E9j\u00E0 utilis\u00E9.
-RunAction.PortsInUse=Les ports sont d\u00E9j\u00E0 utilis\u00E9s.
-RunAction.PortsOfProtocolsInUse=Les ports associ\u00E9s aux protocoles suivants sont d\u00E9j\u00E0 utilis\u00E9s \:
-RunAction.Run=&D\u00E9marrer
-RunAction.RunToolTip=D\u00E9marrer
-RunAction.UnableReadServerConfiguration=Impossible de lire la configuration du serveur.
+StartAction.Continue=Voulez-vous poursuivre l'op\u00E9ration ?
+StartAction.FollowingErrorOccurred=L'erreur suivante est survenue \:
+StartAction.PortInUse=Le port est d\u00E9j\u00E0 utilis\u00E9
+StartAction.PortOfProtocolInUse=Le port associ\u00E9 au protocole "{0}" est d\u00E9j\u00E0 utilis\u00E9.
+StartAction.PortsInUse=Les ports sont d\u00E9j\u00E0 utilis\u00E9s.
+StartAction.PortsOfProtocolsInUse=Les ports associ\u00E9s aux protocoles suivants sont d\u00E9j\u00E0 utilis\u00E9s \:
+StartAction.Run=&D\u00E9marrer
+StartAction.RunToolTip=D\u00E9marrer
+StartAction.UnableReadServerConfiguration=Impossible de lire la configuration du serveur.
 StopAction.ErrorWhenStopping=Une erreur est survenue lors de l'arr\u00EAt du serveur.\n\n
 StopAction.ErrorWhenWriting=Une erreur est survenue lors de l'\u00E9criture dans la console d'information.\n\n
 StopAction.ServerStopped=Le serveur est arr\u00EAt\u00E9.\n

Modified: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/apacheds/ApacheDS156LdapServerAdapter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/apacheds/ApacheDS156LdapServerAdapter.java?rev=964813&r1=964812&r2=964813&view=diff
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/apacheds/ApacheDS156LdapServerAdapter.java (original)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/apacheds/ApacheDS156LdapServerAdapter.java Fri Jul 16 14:38:28 2010
@@ -23,6 +23,7 @@ package org.apache.directory.studio.ldap
 
 import org.apache.directory.studio.ldapservers.model.LdapServer;
 import org.apache.directory.studio.ldapservers.model.LdapServerAdapter;
+import org.eclipse.core.runtime.IProgressMonitor;
 
 
 /**
@@ -45,20 +46,14 @@ public class ApacheDS156LdapServerAdapte
     }
 
 
-    public void start( LdapServer server ) throws Exception
+    public void start( LdapServer server, IProgressMonitor monitor ) throws Exception
     {
         System.out.println( "start " + server.getName() );
     }
 
 
-    public void stop( LdapServer server ) throws Exception
+    public void stop( LdapServer server, IProgressMonitor monitor ) throws Exception
     {
         System.out.println( "stop " + server.getName() );
     }
-
-
-    public void restart( LdapServer server ) throws Exception
-    {
-        System.out.println( "restart " + server.getName() );
-    }
 }

Modified: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/apacheds/ApacheDS157LdapServerAdapter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/apacheds/ApacheDS157LdapServerAdapter.java?rev=964813&r1=964812&r2=964813&view=diff
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/apacheds/ApacheDS157LdapServerAdapter.java (original)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/apacheds/ApacheDS157LdapServerAdapter.java Fri Jul 16 14:38:28 2010
@@ -23,6 +23,7 @@ package org.apache.directory.studio.ldap
 
 import org.apache.directory.studio.ldapservers.model.LdapServer;
 import org.apache.directory.studio.ldapservers.model.LdapServerAdapter;
+import org.eclipse.core.runtime.IProgressMonitor;
 
 
 /**
@@ -45,20 +46,14 @@ public class ApacheDS157LdapServerAdapte
     }
 
 
-    public void start( LdapServer server ) throws Exception
+    public void start( LdapServer server, IProgressMonitor monitor ) throws Exception
     {
         System.out.println( "start " + server.getName() );
     }
 
 
-    public void stop( LdapServer server ) throws Exception
+    public void stop( LdapServer server, IProgressMonitor monitor ) throws Exception
     {
         System.out.println( "stop " + server.getName() );
     }
-
-
-    public void restart( LdapServer server ) throws Exception
-    {
-        System.out.println( "restart " + server.getName() );
-    }
 }

Added: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/Messages.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/Messages.java?rev=964813&view=auto
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/Messages.java (added)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/Messages.java Fri Jul 16 14:38:28 2010
@@ -0,0 +1,51 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+
+package org.apache.directory.studio.ldapservers.jobs;
+
+
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+
+public class Messages
+{
+    private static final String BUNDLE_NAME = "org.apache.directory.studio.ldapservers.jobs.messages"; //$NON-NLS-1$
+
+    private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle.getBundle( BUNDLE_NAME );
+
+
+    private Messages()
+    {
+    }
+
+
+    public static String getString( String key )
+    {
+        try
+        {
+            return RESOURCE_BUNDLE.getString( key );
+        }
+        catch ( MissingResourceException e )
+        {
+            return '!' + key + '!';
+        }
+    }
+}

Added: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/StartLdapServerJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/StartLdapServerJob.java?rev=964813&view=auto
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/StartLdapServerJob.java (added)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/StartLdapServerJob.java Fri Jul 16 14:38:28 2010
@@ -0,0 +1,104 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+
+package org.apache.directory.studio.ldapservers.jobs;
+
+
+import org.apache.directory.studio.ldapservers.model.LdapServer;
+import org.apache.directory.studio.ldapservers.model.LdapServerAdapter;
+import org.apache.directory.studio.ldapservers.model.LdapServerAdapterExtension;
+import org.apache.directory.studio.ldapservers.model.LdapServerStatus;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osgi.util.NLS;
+
+
+/**
+ * This class implements a {@link Job} that is used to start an LDAP Server.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StartLdapServerJob extends Job
+{
+    /** The server */
+    private LdapServer server;
+
+
+    /**
+     * Creates a new instance of StartLdapServerJob.
+     * 
+     * @param server
+     *            the LDAP Server
+     */
+    public StartLdapServerJob( LdapServer server )
+    {
+        super( "" ); //$NON-NLS-1$
+        this.server = server;
+    }
+
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+     */
+    protected IStatus run( IProgressMonitor monitor )
+    {
+        // Setting the name of the Job
+        setName( NLS.bind( Messages.getString( "StartLdapServerJob.Starting" ), new String[] { server.getName() } ) ); //$NON-NLS-1$
+
+        // Setting the status on the server to 'starting'
+        server.setStatus( LdapServerStatus.STARTING );
+
+        LdapServerAdapterExtension ldapServerAdapterExtension = server.getLdapServerAdapterExtension();
+        if ( ldapServerAdapterExtension != null )
+        {
+            LdapServerAdapter ldapServerAdapter = ldapServerAdapterExtension.getInstance();
+            if ( ldapServerAdapter != null )
+            {
+                try
+                {
+                    ldapServerAdapter.start( server, monitor );
+                }
+                catch ( Exception e )
+                {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+            }
+        }
+
+        // TODO remove this
+        try
+        {
+            Thread.sleep( 3000 );
+        }
+        catch ( InterruptedException e )
+        {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        server.setStatus( LdapServerStatus.STARTED );
+
+        return Status.OK_STATUS;
+    }
+}

Added: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/StopLdapServerJob.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/StopLdapServerJob.java?rev=964813&view=auto
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/StopLdapServerJob.java (added)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/StopLdapServerJob.java Fri Jul 16 14:38:28 2010
@@ -0,0 +1,104 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you under the Apache License, Version 2.0 (the
+ *  "License"); you may not use this file except in compliance
+ *  with the License.  You may obtain a copy of the License at
+ *  
+ *    http://www.apache.org/licenses/LICENSE-2.0
+ *  
+ *  Unless required by applicable law or agreed to in writing,
+ *  software distributed under the License is distributed on an
+ *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *  KIND, either express or implied.  See the License for the
+ *  specific language governing permissions and limitations
+ *  under the License. 
+ *  
+ */
+
+package org.apache.directory.studio.ldapservers.jobs;
+
+
+import org.apache.directory.studio.ldapservers.model.LdapServer;
+import org.apache.directory.studio.ldapservers.model.LdapServerAdapter;
+import org.apache.directory.studio.ldapservers.model.LdapServerAdapterExtension;
+import org.apache.directory.studio.ldapservers.model.LdapServerStatus;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.core.runtime.jobs.Job;
+import org.eclipse.osgi.util.NLS;
+
+
+/**
+ * This class implements a {@link Job} that is used to stop an LDAP Server.
+ * 
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ */
+public class StopLdapServerJob extends Job
+{
+    /** The server */
+    private LdapServer server;
+
+
+    /**
+     * Creates a new instance of StartLdapServerJob.
+     * 
+     * @param server
+     *            the LDAP Server
+     */
+    public StopLdapServerJob( LdapServer server )
+    {
+        super( "" ); //$NON-NLS-1$
+        this.server = server;
+    }
+
+
+    /*
+     * (non-Javadoc)
+     * 
+     * @see org.eclipse.core.runtime.jobs.Job#run(org.eclipse.core.runtime.IProgressMonitor)
+     */
+    protected IStatus run( IProgressMonitor monitor )
+    {
+        // Setting the name of the Job
+        setName( NLS.bind( Messages.getString( "StopLdapServerJob.Stoping" ), new String[] { server.getName() } ) ); //$NON-NLS-1$
+
+        // Setting the status on the server to 'stopping'
+        server.setStatus( LdapServerStatus.STOPPING );
+
+        LdapServerAdapterExtension ldapServerAdapterExtension = server.getLdapServerAdapterExtension();
+        if ( ldapServerAdapterExtension != null )
+        {
+            LdapServerAdapter ldapServerAdapter = ldapServerAdapterExtension.getInstance();
+            if ( ldapServerAdapter != null )
+            {
+                try
+                {
+                    ldapServerAdapter.stop( server, monitor );
+                }
+                catch ( Exception e )
+                {
+                    // TODO Auto-generated catch block
+                    e.printStackTrace();
+                }
+            }
+        }
+
+        // TODO remove this
+        try
+        {
+            Thread.sleep( 3000 );
+        }
+        catch ( InterruptedException e )
+        {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+        server.setStatus( LdapServerStatus.STOPPED );
+
+        return Status.OK_STATUS;
+    }
+}

Added: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/messages.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/messages.properties?rev=964813&view=auto
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/messages.properties (added)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/messages.properties Fri Jul 16 14:38:28 2010
@@ -0,0 +1,19 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+StartLdapServerJob.Starting=Starting Server "{0}" ...
+StopLdapServerJob.Stopping=Stopping Server "{0}" ...

Added: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/messages_de.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/messages_de.properties?rev=964813&view=auto
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/messages_de.properties (added)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/messages_de.properties Fri Jul 16 14:38:28 2010
@@ -0,0 +1,19 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+StartLdapServerJob.Starting=TODO:Starting Server "{0}" ...
+StopLdapServerJob.Stopping=TODO:Stopping Server "{0}" ...

Added: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/messages_fr.properties
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/messages_fr.properties?rev=964813&view=auto
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/messages_fr.properties (added)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/jobs/messages_fr.properties Fri Jul 16 14:38:28 2010
@@ -0,0 +1,19 @@
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+
+StartLdapServerJob.Starting=D\u00E9marrage du serveur "{0}" ...
+StopLdapServerJob.Stopping=ArrĂȘt du server "{0}" ...

Modified: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapter.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapter.java?rev=964813&r1=964812&r2=964813&view=diff
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapter.java (original)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerAdapter.java Fri Jul 16 14:38:28 2010
@@ -21,6 +21,9 @@
 package org.apache.directory.studio.ldapservers.model;
 
 
+import org.eclipse.core.runtime.IProgressMonitor;
+
+
 /**
  * The {@link LdapServerAdapter} interface defines the required methods
  * to implement an LDAP Server adapter.
@@ -54,21 +57,12 @@ public interface LdapServerAdapter
      *
      * @param server
      *      the server
+     * @param monitor
+     *      the progress monitor
      * @throws Exception
      *      if an error occurs when restarting the server
      */
-    public void start( LdapServer server ) throws Exception;
-
-
-    /**
-     * This method is called when a server needs to be restarted.
-     *
-     * @param server
-     *      the server
-     * @throws Exception
-     *      if an error occurs when restarting the server
-     */
-    public void stop( LdapServer server ) throws Exception;
+    public void start( LdapServer server, IProgressMonitor monitor ) throws Exception;
 
 
     /**
@@ -76,8 +70,10 @@ public interface LdapServerAdapter
      *
      * @param server
      *      the server
+     * @param monitor
+     *      the progress monitor
      * @throws Exception
      *      if an error occurs when restarting the server
      */
-    public void restart( LdapServer server ) throws Exception;
+    public void stop( LdapServer server, IProgressMonitor monitor ) throws Exception;
 }

Modified: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerStatus.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerStatus.java?rev=964813&r1=964812&r2=964813&view=diff
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerStatus.java (original)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/model/LdapServerStatus.java Fri Jul 16 14:38:28 2010
@@ -27,5 +27,5 @@ package org.apache.directory.studio.ldap
  */
 public enum LdapServerStatus
 {
-    STARTED, STARTING, RESTARTED, RESTARTING, STOPPED, STOPPING, UNKNOWN
+    STARTED, STARTING, STOPPED, STOPPING, UNKNOWN
 }

Modified: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersView.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersView.java?rev=964813&r1=964812&r2=964813&view=diff
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersView.java (original)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersView.java Fri Jul 16 14:38:28 2010
@@ -26,6 +26,8 @@ import org.apache.directory.studio.ldaps
 import org.apache.directory.studio.ldapservers.actions.NewServerAction;
 import org.apache.directory.studio.ldapservers.actions.PropertiesAction;
 import org.apache.directory.studio.ldapservers.actions.RenameAction;
+import org.apache.directory.studio.ldapservers.actions.StartAction;
+import org.apache.directory.studio.ldapservers.actions.StopAction;
 import org.apache.directory.studio.ldapservers.model.LdapServer;
 import org.eclipse.jface.action.IMenuListener;
 import org.eclipse.jface.action.IMenuManager;
@@ -88,8 +90,8 @@ public class ServersView extends ViewPar
     //    private OpenConfigurationAction openConfiguration;
     private DeleteAction delete;
     private RenameAction rename;
-    //    private RunAction run;
-    //    private StopAction stop;
+    private StartAction run;
+    private StopAction stop;
     //    private CreateConnectionAction createConnection;
     private PropertiesAction properties;
 
@@ -249,12 +251,12 @@ public class ServersView extends ViewPar
         rename = new RenameAction( this );
         rename.setEnabled( false );
 
-        //        run = new RunAction( this );
-        //        run.setEnabled( false );
-        //
-        //        stop = new StopAction( this );
-        //        stop.setEnabled( false );
-        //
+        run = new StartAction( this );
+        run.setEnabled( false );
+
+        stop = new StopAction( this );
+        stop.setEnabled( false );
+
         //        createConnection = new CreateConnectionAction( this );
         //        createConnection.setEnabled( false );
         //
@@ -270,9 +272,9 @@ public class ServersView extends ViewPar
     {
         IToolBarManager toolbar = getViewSite().getActionBars().getToolBarManager();
         toolbar.add( newServer );
-        //        toolbar.add( new Separator() );
-        //        toolbar.add( run );
-        //        toolbar.add( stop );
+        toolbar.add( new Separator() );
+        toolbar.add( run );
+        toolbar.add( stop );
     }
 
 
@@ -295,9 +297,9 @@ public class ServersView extends ViewPar
                 manager.add( delete );
                 manager.add( rename );
                 manager.add( new Separator() );
-                //                manager.add( run );
-                //                manager.add( stop );
-                //                manager.add( new Separator() );
+                manager.add( run );
+                manager.add( stop );
+                manager.add( new Separator() );
                 //                MenuManager ldapBrowserManager = new MenuManager( Messages.getString( "ServersView.ldapBrowser" ) ); //$NON-NLS-1$
                 //                ldapBrowserManager.add( createConnection );
                 //                manager.add( ldapBrowserManager );
@@ -451,24 +453,24 @@ public class ServersView extends ViewPar
             switch ( server.getStatus() )
             {
                 case STARTED:
-                    //                    run.setEnabled( false );
-                    //                    stop.setEnabled( true );
+                    run.setEnabled( false );
+                    stop.setEnabled( true );
                     break;
                 case STARTING:
-                    //                    run.setEnabled( false );
-                    //                    stop.setEnabled( false );
+                    run.setEnabled( false );
+                    stop.setEnabled( false );
                     break;
                 case STOPPED:
-                    //                    run.setEnabled( true );
-                    //                    stop.setEnabled( false );
+                    run.setEnabled( true );
+                    stop.setEnabled( false );
                     break;
                 case STOPPING:
-                    //                    run.setEnabled( false );
-                    //                    stop.setEnabled( false );
+                    run.setEnabled( false );
+                    stop.setEnabled( false );
                     break;
                 case UNKNOWN:
-                    //                    run.setEnabled( false );
-                    //                    stop.setEnabled( false );
+                    run.setEnabled( false );
+                    stop.setEnabled( false );
                     break;
             }
 
@@ -483,8 +485,8 @@ public class ServersView extends ViewPar
             //            openConfiguration.setEnabled( false );
             delete.setEnabled( false );
             rename.setEnabled( false );
-            //            run.setEnabled( false );
-            //            stop.setEnabled( false );
+            run.setEnabled( false );
+            stop.setEnabled( false );
             //            createConnection.setEnabled( false );
             properties.setEnabled( false );
         }

Modified: directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersViewLabelProvider.java
URL: http://svn.apache.org/viewvc/directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersViewLabelProvider.java?rev=964813&r1=964812&r2=964813&view=diff
==============================================================================
--- directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersViewLabelProvider.java (original)
+++ directory/studio/trunk/ldapservers/src/main/java/org/apache/directory/studio/ldapservers/views/ServersViewLabelProvider.java Fri Jul 16 14:38:28 2010
@@ -60,19 +60,15 @@ public class ServersViewLabelProvider ex
                 switch ( status )
                 {
                     case STARTED:
-                        return "started"; // TODO
+                        return "Started"; // TODO
                     case STARTING:
-                        return "starting" + getDots(); // TODO
-                    case RESTARTED:
-                        return "restarted"; // TODO
-                    case RESTARTING:
-                        return "restarting" + getDots(); // TODO
+                        return "Starting" + getDots(); // TODO
                     case STOPPED:
-                        return "stopped"; // TODO
+                        return "Stopped"; // TODO
                     case STOPPING:
-                        return "stopped" + getDots(); // TODO
+                        return "Stopping" + getDots(); // TODO
                     case UNKNOWN:
-                        return "unkown"; // TODO
+                        return "Unkown"; // TODO
                 }
             }
 



Mime
View raw message