From 238c8badcbbdca5e8b187f37dc0b66eae9b70d5b Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Tue, 28 Apr 2009 22:44:09 +0000
Subject: [PATCH] Fix for issue 3948 (control-panel: some information in the "Monitoring -> General Information -> Entry Cache" panel are not mapped) Display the attributes when the server returns them (so the layout of the panel will vary depending on the entry cache implementation used by the server).
---
opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/EntryCachesMonitoringPanel.java | 23 +++++++++++++++++++++--
1 files changed, 21 insertions(+), 2 deletions(-)
diff --git a/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/EntryCachesMonitoringPanel.java b/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/EntryCachesMonitoringPanel.java
index 81b86eb..cb9b9f6 100644
--- a/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/EntryCachesMonitoringPanel.java
+++ b/opendj-sdk/opends/src/guitools/org/opends/guitools/controlpanel/ui/EntryCachesMonitoringPanel.java
@@ -66,6 +66,13 @@
monitoringLabels.add(Utilities.createDefaultLabel());
}
}
+ private ArrayList<JLabel> labels = new ArrayList<JLabel>();
+ {
+ for (int i=0; i<ngOperations.size(); i++)
+ {
+ labels.add(Utilities.createPrimaryLabel(getLabel(ngOperations.get(i))));
+ }
+ }
/**
* Default constructor.
@@ -108,13 +115,12 @@
gbc.gridwidth = 1;
for (int i=0; i<ngOperations.size(); i++)
{
- JLabel l = Utilities.createPrimaryLabel(getLabel(ngOperations.get(i)));
gbc.gridy ++;
gbc.insets.left = 0;
gbc.gridx = 0;
gbc.weightx = 0.0;
gbc.gridwidth = 1;
- add(l, gbc);
+ add(labels.get(i), gbc);
gbc.insets.left = 10;
gbc.gridx = 1;
gbc.gridwidth = 2;
@@ -151,6 +157,19 @@
if (csr != null)
{
updateMonitoringInfo(ngOperations, monitoringLabels, csr);
+ int index = 0;
+ for (MonitoringAttributes attr : ngOperations)
+ {
+ if (Utilities.getFirstMonitoringValue(csr, attr.getAttributeName())
+ == null)
+ {
+ monitoringLabels.get(index).setVisible(false);
+ labels.get(index).setVisible(false);
+ }
+ index ++;
+ }
+ revalidate();
+ repaint();
}
else
{
--
Gitblit v1.10.0