2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2010 - Calixte DENIZET
4 * Copyright (C) 2010 - Allan Simon
6 * This file must be used under the terms of the CeCILL.
7 * This source file is licensed as described in the file COPYING, which
8 * you should have received as part of this distribution. The terms
9 * are also available at
10 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
14 package org.scilab.modules.ui_data.variablebrowser.actions;
16 import java.awt.Toolkit;
17 import java.awt.event.ActionEvent;
18 import java.awt.event.KeyEvent;
20 import org.scilab.modules.gui.menuitem.MenuItem;
21 import org.scilab.modules.ui_data.actions.DefaultAction;
22 import org.scilab.modules.ui_data.utils.UiDataMessages;
23 import org.scilab.modules.ui_data.variablebrowser.ScilabVariableBrowser;
25 @SuppressWarnings(value = { "serial" })
26 public class CloseAction extends DefaultAction {
28 /** Name of the action */
29 public static final String NAME = UiDataMessages.CLOSE;
30 /** Icon name of the action */
31 public static final String SMALL_ICON = "";
32 /** Mnemonic key of the action */
33 public static final int MNEMONIC_KEY = KeyEvent.VK_W;
34 /** Accelerator key for the action */
35 public static final int ACCELERATOR_KEY = Toolkit.getDefaultToolkit().getMenuShortcutKeyMask();
39 * Menu for diagram menubar
40 * @param scilabGraph associated diagram
43 public static MenuItem createMenu() {
44 return createMenu(new CloseAction());
49 public void actionPerformed(ActionEvent e) {
50 ScilabVariableBrowser.getVariableBrowser().close();