From 013494192c189ce5bd101f198c4d33230374d4b8 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Thu, 17 Dec 2009 21:11:04 +0000
Subject: [PATCH] Fix for issue 3601 (Control Panel: unable to modify schema objects or attributes)

---
 opends/src/guitools/org/opends/guitools/controlpanel/ui/SchemaBrowserRightPanel.java |   43 +++++++++++++++++++++++++++++++++++++------
 1 files changed, 37 insertions(+), 6 deletions(-)

diff --git a/opends/src/guitools/org/opends/guitools/controlpanel/ui/SchemaBrowserRightPanel.java b/opends/src/guitools/org/opends/guitools/controlpanel/ui/SchemaBrowserRightPanel.java
index 09528ab..7899656 100644
--- a/opends/src/guitools/org/opends/guitools/controlpanel/ui/SchemaBrowserRightPanel.java
+++ b/opends/src/guitools/org/opends/guitools/controlpanel/ui/SchemaBrowserRightPanel.java
@@ -22,7 +22,7 @@
  * CDDL HEADER END
  *
  *
- *      Copyright 2008 Sun Microsystems, Inc.
+ *      Copyright 2008-2009 Sun Microsystems, Inc.
  */
 
 package org.opends.guitools.controlpanel.ui;
@@ -37,6 +37,8 @@
 
 import org.opends.guitools.controlpanel.datamodel.ControlPanelInfo;
 import org.opends.guitools.controlpanel.event.ConfigurationChangeEvent;
+import org.opends.guitools.controlpanel.event.
+ ConfigurationElementCreatedListener;
 import org.opends.guitools.controlpanel.event.SchemaElementSelectionListener;
 import org.opends.guitools.controlpanel.util.Utilities;
 import org.opends.messages.Message;
@@ -74,8 +76,9 @@
 
   private final SchemaElementPanel[] panels =
   {   standardObjectClassPanel, configurationObjectClassPanel,
-      customObjectClassPanel, standardAttributePanel,
-      configurationAttributePanel, customAttributePanel, matchingRulePanel,
+      customObjectClassPanel,
+      standardAttributePanel, configurationAttributePanel, customAttributePanel,
+      matchingRulePanel,
       attributeSyntaxPanel
   };
 
@@ -145,6 +148,34 @@
   }
 
   /**
+   * Adds a configuration element created listener.
+   * @param listener the listener.
+   */
+  public void addConfigurationElementCreatedListener(
+      ConfigurationElementCreatedListener listener)
+  {
+    super.addConfigurationElementCreatedListener(listener);
+    for (SchemaElementPanel panel : panels)
+    {
+      panel.addConfigurationElementCreatedListener(listener);
+    }
+  }
+
+  /**
+   * Removes a configuration element created listener.
+   * @param listener the listener.
+   */
+  public void removeConfigurationElementCreatedListener(
+      ConfigurationElementCreatedListener listener)
+  {
+    super.removeConfigurationElementCreatedListener(listener);
+    for (SchemaElementPanel panel : panels)
+    {
+      panel.removeConfigurationElementCreatedListener(listener);
+    }
+  }
+
+  /**
    * Updates the contents of the panel with the provided standard object class.
    * @param oc the object class.
    * @param schema the schema.
@@ -242,7 +273,7 @@
    * @param syntax the attribute syntax.
    * @param schema the schema.
    */
-  public void updateAttributeSyntax(AttributeSyntax syntax, Schema schema)
+  public void updateAttributeSyntax(AttributeSyntax<?> syntax, Schema schema)
   {
     attributeSyntaxPanel.update(syntax, schema);
     schemaElementPanel = attributeSyntaxPanel;
@@ -348,9 +379,9 @@
 
   /**
    * Tells whether the user chose to save the changes in the panel, to not save
-   * them or simply cancelled the selection in the tree.
+   * them or simply canceled the selection in the tree.
    * @return the value telling whether the user chose to save the changes in the
-   * panel, to not save them or simply cancelled the selection in the tree.
+   * panel, to not save them or simply canceled the selection in the tree.
    */
   public UnsavedChangesDialog.Result checkUnsavedChanges()
   {

--
Gitblit v1.10.0