From 06ec8c88556b02782c7b91a233de91eaf4a1439d Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Tue, 09 Jun 2009 12:28:05 +0000
Subject: [PATCH] Fix for issue 3550 (Consider making the control panel able to manage remote servers)

---
 opends/src/guitools/org/opends/guitools/controlpanel/ui/NewVLVIndexPanel.java |   18 +++++++-----------
 1 files changed, 7 insertions(+), 11 deletions(-)

diff --git a/opends/src/guitools/org/opends/guitools/controlpanel/ui/NewVLVIndexPanel.java b/opends/src/guitools/org/opends/guitools/controlpanel/ui/NewVLVIndexPanel.java
index a44f57f..86ff4bf 100644
--- a/opends/src/guitools/org/opends/guitools/controlpanel/ui/NewVLVIndexPanel.java
+++ b/opends/src/guitools/org/opends/guitools/controlpanel/ui/NewVLVIndexPanel.java
@@ -44,6 +44,7 @@
 
 import org.opends.guitools.controlpanel.datamodel.BackendDescriptor;
 import org.opends.guitools.controlpanel.datamodel.ControlPanelInfo;
+import org.opends.guitools.controlpanel.datamodel.ServerDescriptor;
 import org.opends.guitools.controlpanel.datamodel.VLVIndexDescriptor;
 import org.opends.guitools.controlpanel.datamodel.VLVSortOrder;
 import org.opends.guitools.controlpanel.event.ConfigurationChangeEvent;
@@ -91,7 +92,6 @@
   /**
    * {@inheritDoc}
    */
-  @Override
   public Message getTitle()
   {
     return INFO_CTRL_PANEL_NEW_VLV_INDEX_TITLE.get();
@@ -100,7 +100,6 @@
   /**
    * {@inheritDoc}
    */
-  @Override
   public Component getPreferredFocusComponent()
   {
     return name;
@@ -111,10 +110,12 @@
    */
   public void configurationChanged(ConfigurationChangeEvent ev)
   {
-    if (updateLayout(ev.getNewDescriptor()))
+    ServerDescriptor desc = ev.getNewDescriptor();
+    if (updateLayout(desc))
     {
-      updateErrorPaneAndOKButtonIfAuthRequired(ev.getNewDescriptor(),
-          INFO_CTRL_PANEL_AUTHENTICATION_REQUIRED_FOR_NEW_VLV.get());
+      updateErrorPaneAndOKButtonIfAuthRequired(desc,
+         isLocal() ? INFO_CTRL_PANEL_AUTHENTICATION_REQUIRED_FOR_NEW_VLV.get() :
+      INFO_CTRL_PANEL_CANNOT_CONNECT_TO_REMOTE_DETAILS.get(desc.getHostname()));
     }
   }
 
@@ -131,7 +132,6 @@
   /**
    * {@inheritDoc}
    */
-  @Override
   public void okClicked()
   {
     List<Message> errors = checkErrors(true);
@@ -214,7 +214,6 @@
     /**
      * {@inheritDoc}
      */
-    @Override
     public Type getType()
     {
       return Type.NEW_INDEX;
@@ -223,7 +222,6 @@
     /**
      * {@inheritDoc}
      */
-    @Override
     public Set<String> getBackends()
     {
       return backendSet;
@@ -232,7 +230,6 @@
     /**
      * {@inheritDoc}
      */
-    @Override
     public Message getTaskDescription()
     {
       return INFO_CTRL_PANEL_NEW_VLV_INDEX_TASK_DESCRIPTION.get(
@@ -242,12 +239,11 @@
     /**
      * {@inheritDoc}
      */
-    @Override
     public boolean canLaunch(Task taskToBeLaunched,
         Collection<Message> incompatibilityReasons)
     {
       boolean canLaunch = true;
-      if (state == State.RUNNING)
+      if (state == State.RUNNING && runningOnSameServer(taskToBeLaunched))
       {
         // All the operations are incompatible if they apply to this
         // backend for safety.  This is a short operation so the limitation

--
Gitblit v1.10.0