| | |
| | | * CDDL HEADER END |
| | | * |
| | | * |
| | | * Copyright 2008 Sun Microsystems, Inc. |
| | | * Copyright 2008-2009 Sun Microsystems, Inc. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | |
| | | { |
| | | private static final long serialVersionUID = 6441273044772077947L; |
| | | |
| | | private GenericDialog dlg; |
| | | private RefreshOptionsPanel panel; |
| | | |
| | | /** |
| | | * Constructor. |
| | | * @param info the control panel information. |
| | |
| | | |
| | | add(menu); |
| | | } |
| | | add(createViewMenuBar()); |
| | | add(createHelpMenuBar()); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 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. |
| | |
| | | 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(); |
| | | } |
| | | } |
| | | } |