From 4068598bb0ff99fb62fc2ee4bce45bd749415459 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Wed, 11 Nov 2009 15:09:00 +0000
Subject: [PATCH] Fix for issue 4356 ('Number of elements' hardcoded in the control panel)

---
 opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/BrowseSchemaPanel.java |   12 +++++++-----
 opendj-sdk/opends/src/messages/messages/admin_tool.properties                             |    3 ++-
 2 files changed, 9 insertions(+), 6 deletions(-)

diff --git a/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/BrowseSchemaPanel.java b/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/BrowseSchemaPanel.java
index ad88b1b..6b4aa72 100644
--- a/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/BrowseSchemaPanel.java
+++ b/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/BrowseSchemaPanel.java
@@ -811,7 +811,7 @@
     TreeSet<String> syntaxNames = new TreeSet<String>(lowerCaseComparator);
     HashMap<String, AttributeSyntaxTreeNode> hmSyntaxes =
       new HashMap<String, AttributeSyntaxTreeNode>();
-    for (AttributeSyntax syntax : lastSchema.getSyntaxes().values())
+    for (AttributeSyntax<?> syntax : lastSchema.getSyntaxes().values())
     {
       if (mustAdd(syntax))
       {
@@ -1030,7 +1030,8 @@
     treePane.setVisible(nElements > 0);
     if (nElements > 0)
     {
-      lNumberOfElements.setText("Number of elements: "+nElements);
+      lNumberOfElements.setText(
+          INFO_CTRL_PANEL_SCHEMA_ELEMENT_NUMBER.get(nElements).toString());
       lNumberOfElements.setVisible(true);
     }
     else
@@ -1679,7 +1680,7 @@
    * @return <CODE>true</CODE> if the attribute syntax must be added and
    * <CODE>false</CODE> otherwise.
    */
-  private boolean mustAdd(AttributeSyntax syntax)
+  private boolean mustAdd(AttributeSyntax<?> syntax)
   {
     boolean mustAdd = true;
     String f = filter.getText().trim();
@@ -1787,7 +1788,8 @@
 
   private HashMap<Object, ImageIcon> hmCategoryImages =
     new HashMap<Object, ImageIcon>();
-  private HashMap<Class, ImageIcon> hmImages = new HashMap<Class, ImageIcon>();
+  private HashMap<Class<?>, ImageIcon> hmImages =
+    new HashMap<Class<?>, ImageIcon>();
   {
     Object[] nodes = {attributes, objectClasses, standardObjectClasses,
         standardAttributes, configurationObjectClasses, configurationAttributes,
@@ -1801,7 +1803,7 @@
       hmCategoryImages.put(nodes[i],
           Utilities.createImageIcon(IconPool.IMAGE_PATH+"/"+paths[i]));
     }
-    Class[] classes = {ConfigurationAttributeTreeNode.class,
+    Class<?>[] classes = {ConfigurationAttributeTreeNode.class,
         StandardAttributeTreeNode.class, CustomAttributeTreeNode.class,
         ConfigurationObjectClassTreeNode.class,
         StandardObjectClassTreeNode.class, CustomObjectClassTreeNode.class,
diff --git a/opendj-sdk/opends/src/messages/messages/admin_tool.properties b/opendj-sdk/opends/src/messages/messages/admin_tool.properties
index 88df7b8..4d3dbf6 100644
--- a/opendj-sdk/opends/src/messages/messages/admin_tool.properties
+++ b/opendj-sdk/opends/src/messages/messages/admin_tool.properties
@@ -1271,7 +1271,7 @@
 INFO_CTRL_PANEL_MAXIMUM_CHILDREN_DISPLAYED=Maximum %d Children Displayed.  Try \
  Applying a Filter.
 INFO_CTRL_PANEL_SUBSTRING_SEARCH_INLINE_HELP=Use '*' for substring search.
-INFO_CTRL_BROWSER_NUMBER_OF_ENTRIES=Number of entries: %d
+INFO_CTRL_BROWSER_NUMBER_OF_ENTRIES=Number of Entries: %d
 
 INFO_CTRL_PANEL_AUTHENTICATION_REQUIRED_TO_BROWSE_SUMMARY=The server is \
  running.  You must provide authentication to browse data.
@@ -1611,6 +1611,7 @@
 INFO_CTRL_PANEL_CHILD_CLASS=Child Class
 INFO_CTRL_PANEL_REQUIRED_ATTRIBUTES=Required Attributes
 INFO_CTRL_PANEL_OPTIONAL_ATTRIBUTES=Optional Attributes
+INFO_CTRL_PANEL_SCHEMA_ELEMENT_NUMBER=Number of Elements: %d
 
 INFO_CTRL_PANEL_NO_SCHEMA_ITEM_SELECTED=No Schema Item Selected
 INFO_CTRL_PANEL_CATEGORY_ITEM_SELECTED=Category Item Selected

--
Gitblit v1.10.0