| | |
| | | * information: "Portions Copyright [year] [name of copyright owner]". |
| | | * |
| | | * Copyright 2008-2010 Sun Microsystems, Inc. |
| | | * Portions Copyright 2014-2015 ForgeRock AS. |
| | | * Portions Copyright 2014-2016 ForgeRock AS. |
| | | */ |
| | | |
| | | package org.opends.guitools.controlpanel.ui; |
| | |
| | | import org.opends.guitools.controlpanel.util.Utilities; |
| | | import org.forgerock.i18n.LocalizableMessage; |
| | | |
| | | /** |
| | | * The menu bar that appears on the main panel. |
| | | * |
| | | */ |
| | | /** The menu bar that appears on the main panel. */ |
| | | public class MainMenuBar extends GenericMenuBar |
| | | { |
| | | private static final long serialVersionUID = 6441273044772077947L; |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * Method that can be overwritten to set specific menus. |
| | | * |
| | | */ |
| | | /** Method that can be overwritten to set specific menus. */ |
| | | protected void addMenus() |
| | | { |
| | | add(createFileMenuBar()); |
| | |
| | | * The method called when the user clicks on quick. It will check that there |
| | | * are not ongoing tasks. If there are tasks, it will ask the user for |
| | | * confirmation to quit. |
| | | * |
| | | */ |
| | | public void quitClicked() |
| | | { |
| | |
| | | INFO_CTRL_PANEL_CONNECT_TO_SERVER_MENU.get()); |
| | | menuItem.addActionListener(new ActionListener() |
| | | { |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | connectToServerClicked(); |
| | |
| | | menuItem = Utilities.createMenuItem(INFO_CTRL_PANEL_EXIT_MENU.get()); |
| | | menuItem.addActionListener(new ActionListener() |
| | | { |
| | | /** {@inheritDoc} */ |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | quitClicked(); |
| | |
| | | INFO_CTRL_PANEL_REFRESH_MENU.get()); |
| | | menuItem.addActionListener(new ActionListener() |
| | | { |
| | | @Override |
| | | public void actionPerformed(ActionEvent ev) |
| | | { |
| | | refreshOptionsClicked(); |
| | |
| | | return menu; |
| | | } |
| | | |
| | | /** |
| | | * Specific method to be able to handle the Quit events sent from the COCOA |
| | | * menu of Mac OS. |
| | | * |
| | | */ |
| | | /** Specific method to be able to handle the Quit events sent from the COCOA menu of Mac OS. */ |
| | | private void setMacOSQuitHandler() |
| | | { |
| | | try |
| | |
| | | (Class[])null).newInstance((Object[])null); |
| | | InvocationHandler adapter = new InvocationHandler() |
| | | { |
| | | @Override |
| | | public Object invoke (Object proxy, Method method, Object[] args) |
| | | throws Throwable |
| | | { |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * The method called when the user clicks on 'Refresh Options'. |
| | | * |
| | | */ |
| | | /** The method called when the user clicks on 'Refresh Options'. */ |
| | | protected void refreshOptionsClicked() |
| | | { |
| | | if (panel == null) |
| | |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * The method called when the user clicks on 'Connect to Server...'. |
| | | */ |
| | | /** The method called when the user clicks on 'Connect to Server...'. */ |
| | | protected void connectToServerClicked() |
| | | { |
| | | Set<String> runningTasks = new HashSet<>(); |