From ad42fe808889ebd10ac8787ae5a36247d69ebe66 Mon Sep 17 00:00:00 2001
From: jvergara <jvergara@localhost>
Date: Fri, 06 Feb 2009 13:48:08 +0000
Subject: [PATCH] Add UI to allow the user the refreshing period using by the control panel to update its contents.
---
opends/src/guitools/org/opends/guitools/controlpanel/ui/MainMenuBar.java | 56 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 55 insertions(+), 1 deletions(-)
diff --git a/opends/src/guitools/org/opends/guitools/controlpanel/ui/MainMenuBar.java b/opends/src/guitools/org/opends/guitools/controlpanel/ui/MainMenuBar.java
index b7057f0..70ad84c 100644
--- a/opends/src/guitools/org/opends/guitools/controlpanel/ui/MainMenuBar.java
+++ b/opends/src/guitools/org/opends/guitools/controlpanel/ui/MainMenuBar.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;
@@ -54,6 +54,9 @@
{
private static final long serialVersionUID = 6441273044772077947L;
+ private GenericDialog dlg;
+ private RefreshOptionsPanel panel;
+
/**
* Constructor.
* @param info the control panel information.
@@ -99,6 +102,7 @@
add(menu);
}
+ add(createViewMenuBar());
add(createHelpMenuBar());
}
@@ -134,6 +138,30 @@
}
}
+
+
+ /**
+ * Creates the View menu bar.
+ * @return the View menu bar.
+ */
+ protected JMenu createViewMenuBar()
+ {
+ JMenu menu = Utilities.createMenu(INFO_CTRL_PANEL_VIEW_MENU.get(),
+ INFO_CTRL_PANEL_HELP_VIEW_DESCRIPTION.get());
+ menu.setMnemonic(KeyEvent.VK_V);
+ JMenuItem menuItem = Utilities.createMenuItem(
+ INFO_CTRL_PANEL_REFRESH_MENU.get());
+ menuItem.addActionListener(new ActionListener()
+ {
+ public void actionPerformed(ActionEvent ev)
+ {
+ refreshOptionsClicked();
+ }
+ });
+ menu.add(menuItem);
+ return menu;
+ }
+
/**
* Specific method to be able to handle the Quit events sent from the COCOA
* menu of Mac OS.
@@ -177,4 +205,30 @@
t.printStackTrace();
}
}
+
+ /**
+ * The method called when the user clicks on 'Refresh Options'.
+ *
+ */
+ protected void refreshOptionsClicked()
+ {
+ if (panel == null)
+ {
+ panel = new RefreshOptionsPanel();
+ panel.setInfo(getInfo());
+ dlg = new GenericDialog(
+ Utilities.getFrame(MainMenuBar.this),
+ panel);
+ dlg.setModal(true);
+ Utilities.centerGoldenMean(dlg,
+ Utilities.getFrame(MainMenuBar.this));
+ }
+ dlg.setVisible(true);
+ if (!panel.isCancelled())
+ {
+ getInfo().setPoolingPeriod(panel.getPoolingPeriod());
+ getInfo().stopPooling();
+ getInfo().startPooling();
+ }
+ }
}
--
Gitblit v1.10.0