Example usage for java.awt.event KeyEvent VK_F

List of usage examples for java.awt.event KeyEvent VK_F

Introduction

In this page you can find the example usage for java.awt.event KeyEvent VK_F.

Prototype

int VK_F

To view the source code for java.awt.event KeyEvent VK_F.

Click Source Link

Document

Constant for the "F" key.

Usage

From source file:edu.ku.brc.ui.UIRegistry.java

public JMenu createEditMenu() {
    JMenu menu = new JMenu(getResourceString("EDIT"));
    menu.setMnemonic(KeyEvent.VK_E);
    // Undo and redo are actions of our own creation.
    undoAction = (UndoAction) makeAction(UndoAction.class, this, "Undo", null, null, new Integer(KeyEvent.VK_Z),
            KeyStroke.getKeyStroke(KeyEvent.VK_Z, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    register(UNDO, menu.add(undoAction));
    actionMap.put(UNDO, undoAction);/*from w w  w. j ava  2 s  . c om*/
    redoAction = (RedoAction) makeAction(RedoAction.class, this, "Redo", null, null, new Integer(KeyEvent.VK_Y),
            KeyStroke.getKeyStroke(KeyEvent.VK_Y, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    register(REDO, menu.add(redoAction));
    actionMap.put(REDO, redoAction);

    menu.addSeparator();
    // These actions come from the default editor kit.  Get the ones we want
    // and stick them in the menu.
    Action cutAction = makeAction(DefaultEditorKit.CutAction.class, null, "Cut", null,
            "Cut selection to clipboard", // I18N ????
            new Integer(KeyEvent.VK_X),
            KeyStroke.getKeyStroke(KeyEvent.VK_X, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    register(CUT, menu.add(cutAction));
    cutAction.setEnabled(false);
    actionMap.put(CUT, cutAction);

    Action copyAction = makeAction(DefaultEditorKit.CopyAction.class, null, "Copy", null,
            "Copy selection to clipboard", new Integer(KeyEvent.VK_C),
            KeyStroke.getKeyStroke(KeyEvent.VK_C, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    register(COPY, menu.add(copyAction));
    copyAction.setEnabled(false);
    actionMap.put(COPY, copyAction);

    Action pasteAction = makeAction(DefaultEditorKit.PasteAction.class, null, "Paste", null,
            "Paste contents of clipboard", new Integer(KeyEvent.VK_V),
            KeyStroke.getKeyStroke(KeyEvent.VK_V, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    pasteAction.setEnabled(false);
    register(PASTE, menu.add(pasteAction));
    actionMap.put(PASTE, pasteAction);

    /*
    menu.addSeparator();
    Action selectAllAction = makeAction(SelectAllAction.class,
                                   this,
                                   "Select All",
                                   null,
                                   "Select all text",
                                   new Integer(KeyEvent.VK_A),
                                   KeyStroke.getKeyStroke(KeyEvent.VK_A, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    menu.add(selectAllAction);
    */
    launchFindReplaceAction = (LaunchFindReplaceAction) makeAction(LaunchFindReplaceAction.class, this, "Find",
            null, null, new Integer(KeyEvent.VK_F),
            KeyStroke.getKeyStroke(KeyEvent.VK_F, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
    //menu.add(launchFindReplaceAction);
    //        launchFindReplaceAction.setEnabled(false);
    //        register(FIND, menu.add(launchFindReplaceAction));
    //        actionMap.put(FIND, launchFindReplaceAction);

    launchFindReplaceAction.setEnabled(false);
    register(FIND, menu.add(launchFindReplaceAction));
    actionMap.put(FIND, launchFindReplaceAction);

    return menu;
}

From source file:com.monead.semantic.workbench.SemanticWorkbench.java

/**
 * Create the edit menu//from   w w w  . jav  a 2s. c  o  m
 * 
 * @return The edit menu
 */
private JMenu setupEditMenu() {
    final JMenu menu = new JMenu("Edit");

    menu.setMnemonic(KeyEvent.VK_E);
    menu.setToolTipText("Menu items related to editing the ontology");

    editFind = new JMenuItem("Find (in assertions)");
    editFind.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_F, KeyEvent.CTRL_MASK));
    editFind.setMnemonic(KeyEvent.VK_F);
    editFind.setToolTipText("Find text in the assertions editor");
    editFind.addActionListener(new FindAssertionsTextListener());
    menu.add(editFind);

    editFindNextMatch = new JMenuItem("Next (matching assertion text)");
    editFindNextMatch.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_N, KeyEvent.CTRL_MASK));
    editFindNextMatch.setMnemonic(KeyEvent.VK_N);
    editFindNextMatch.setToolTipText("Find next text match in the assertions editor");
    editFindNextMatch.addActionListener(new FindNextAssertionsTextListener());
    menu.add(editFindNextMatch);

    menu.addSeparator();

    editCommentToggle = new JMenuItem("Toggle Comment");
    editCommentToggle.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_T, KeyEvent.CTRL_MASK));
    editCommentToggle.setMnemonic(KeyEvent.VK_T);
    editCommentToggle
            .setToolTipText("Switch the chosen assertion or query lines between commented and not commented");
    editCommentToggle.addActionListener(new CommentToggleListener());
    editCommentToggle.setEnabled(false);
    menu.add(editCommentToggle);

    editInsertPrefixes = new JMenuItem("Insert Prefixes");
    editInsertPrefixes.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_I, ActionEvent.CTRL_MASK));
    editInsertPrefixes.setMnemonic(KeyEvent.VK_I);
    editInsertPrefixes.setToolTipText("Insert standard prefixes (namespaces)");
    editInsertPrefixes.addActionListener(new InsertPrefixesListener());
    menu.add(editInsertPrefixes);

    menu.addSeparator();

    editExpandAllTreeNodes = new JMenuItem("Expand Entire Tree");
    editExpandAllTreeNodes.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_ADD, ActionEvent.ALT_MASK));
    editExpandAllTreeNodes.setMnemonic(KeyEvent.VK_E);
    editExpandAllTreeNodes.setToolTipText("Expand all tree nodes");
    editExpandAllTreeNodes.addActionListener(new ExpandTreeListener());
    menu.add(editExpandAllTreeNodes);

    editCollapseAllTreeNodes = new JMenuItem("Collapse Entire Tree");
    editCollapseAllTreeNodes.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, ActionEvent.ALT_MASK));
    editCollapseAllTreeNodes.setMnemonic(KeyEvent.VK_C);
    editCollapseAllTreeNodes.setToolTipText("Expand all tree nodes");
    editCollapseAllTreeNodes.addActionListener(new CollapseTreeListener());
    menu.add(editCollapseAllTreeNodes);

    menu.addSeparator();

    editEditListOfSparqlServiceUrls = new JMenuItem("Edit SPARQL Service URLs List");
    editEditListOfSparqlServiceUrls.setMnemonic(KeyEvent.VK_S);
    editEditListOfSparqlServiceUrls.setToolTipText("Remove unwanted URLs from the dropdown list");
    editEditListOfSparqlServiceUrls.addActionListener(new EditListOfSparqlServiceUrls());
    menu.add(editEditListOfSparqlServiceUrls);

    return menu;
}

From source file:com.monead.semantic.workbench.SemanticWorkbench.java

/**
 * Create the configuration menu/*from w w w .  j ava  2 s .c  o m*/
 * 
 * @return The configuration menu
 */
private JMenu setupConfigurationMenu() {
    final JMenu menu = new JMenu("Configure");
    ButtonGroup buttonGroup;

    menu.setMnemonic(KeyEvent.VK_C);
    menu.setToolTipText("Menu items related to configuration");

    buttonGroup = new ButtonGroup();
    setupOutputAssertionLanguage = new JCheckBoxMenuItem[FORMATS.length + 1];
    setupOutputAssertionLanguage[0] = new JCheckBoxMenuItem("Output Format: Auto");
    buttonGroup.add(setupOutputAssertionLanguage[0]);
    menu.add(setupOutputAssertionLanguage[0]);

    for (int index = 0; index < FORMATS.length; ++index) {
        setupOutputAssertionLanguage[index + 1] = new JCheckBoxMenuItem("Output Format: " + FORMATS[index]);
        buttonGroup.add(setupOutputAssertionLanguage[index + 1]);
        menu.add(setupOutputAssertionLanguage[index + 1]);
    }
    setupOutputAssertionLanguage[0].setSelected(true);

    menu.addSeparator();

    buttonGroup = new ButtonGroup();
    setupOutputModelTypeAssertions = new JCheckBoxMenuItem("Output Assertions Only");
    buttonGroup.add(setupOutputModelTypeAssertions);
    menu.add(setupOutputModelTypeAssertions);

    setupOutputModelTypeAssertionsAndInferences = new JCheckBoxMenuItem("Output Assertions and Inferences");
    buttonGroup.add(setupOutputModelTypeAssertionsAndInferences);
    menu.add(setupOutputModelTypeAssertionsAndInferences);

    setupOutputModelTypeAssertions.setSelected(true);

    menu.addSeparator();

    setupAllowMultilineResultOutput = new JCheckBoxMenuItem(
            "Allow Multiple Lines of Text Per Row in SPARQL Query Output");
    setupAllowMultilineResultOutput.setToolTipText("Wrap long values into multiple lines in a display cell");
    setupAllowMultilineResultOutput.setSelected(false);
    menu.add(setupAllowMultilineResultOutput);

    setupOutputFqnNamespaces = new JCheckBoxMenuItem("Show FQN Namespaces Instead of Prefixes in Query Output");
    setupOutputFqnNamespaces
            .setToolTipText("Use the fully qualified namespace. If unchecked use the prefix, if defined");
    setupOutputFqnNamespaces.setSelected(false);
    menu.add(setupOutputFqnNamespaces);

    setupOutputDatatypesForLiterals = new JCheckBoxMenuItem("Show Datatypes on Literals");
    setupOutputDatatypesForLiterals.setToolTipText("Display the datatype after the value, e.g. 4^^xsd:integer");
    setupOutputDatatypesForLiterals.setSelected(false);
    menu.add(setupOutputDatatypesForLiterals);

    setupOutputFlagLiteralValues = new JCheckBoxMenuItem("Flag Literal Values in Query Output");
    setupOutputFlagLiteralValues.setToolTipText("Includes the text 'Lit:' in front of any literal values");
    setupOutputFlagLiteralValues.setSelected(false);
    menu.add(setupOutputFlagLiteralValues);

    setupApplyFormattingToLiteralValues = new JCheckBoxMenuItem("Apply Formatting to Literal Values");
    setupApplyFormattingToLiteralValues.setToolTipText(
            "Apply the XSD-based formatting defined in the configuration to literal values in SPARQL results and tree view display");
    setupApplyFormattingToLiteralValues.setSelected(true);
    menu.add(setupApplyFormattingToLiteralValues);

    setupDisplayImagesInSparqlResults = new JCheckBoxMenuItem(
            "Display Images in Query Output (Slows Results Retrieval)");
    setupDisplayImagesInSparqlResults.setToolTipText("Attempts to download images linked in the results. "
            + "Can run very slowly depending on number and size of images");
    setupDisplayImagesInSparqlResults.setSelected(true);
    menu.add(setupDisplayImagesInSparqlResults);

    menu.addSeparator();

    buttonGroup = new ButtonGroup();
    setupExportSparqlResultsAsCsv = new JCheckBoxMenuItem(
            "Export SPARQL Results to " + EXPORT_FORMAT_LABEL_CSV);
    setupExportSparqlResultsAsCsv.setToolTipText("Export to Comma Separated Value format");
    buttonGroup.add(setupExportSparqlResultsAsCsv);
    menu.add(setupExportSparqlResultsAsCsv);

    setupExportSparqlResultsAsTsv = new JCheckBoxMenuItem(
            "Export SPARQL Results to " + EXPORT_FORMAT_LABEL_TSV);
    setupExportSparqlResultsAsTsv.setToolTipText("Export to Tab Separated Value format");
    buttonGroup.add(setupExportSparqlResultsAsTsv);
    menu.add(setupExportSparqlResultsAsTsv);

    menu.addSeparator();

    setupSparqlResultsToFile = new JCheckBoxMenuItem("Send SPARQL Results Directly to File");
    setupSparqlResultsToFile.setToolTipText(
            "For large results sets this permits writing to file without trying to render on screen");
    menu.add(setupSparqlResultsToFile);

    menu.addSeparator();

    setupEnableStrictMode = new JCheckBoxMenuItem("Enable Strict Checking Mode");
    setupEnableStrictMode.setSelected(true);
    setupEnableStrictMode.addActionListener(new ReasonerConfigurationChange());
    menu.add(setupEnableStrictMode);

    menu.addSeparator();

    setupFont = new JMenuItem("Font");
    setupFont.setMnemonic(KeyEvent.VK_F);
    setupFont.setToolTipText("Set the font used for the display");
    setupFont.addActionListener(new FontSetupListener());
    menu.add(setupFont);

    menu.addSeparator();

    setupProxyEnabled = new JCheckBoxMenuItem("Enable Proxy");
    setupProxyEnabled.setToolTipText("Pass network SPARQL requests through a proxy");
    setupProxyEnabled.addActionListener(new ProxyStatusChangeListener());
    menu.add(setupProxyEnabled);

    setupProxyConfiguration = new JMenuItem("Proxy Settings");
    setupProxyConfiguration.setToolTipText("Configure the proxy");
    setupProxyConfiguration.addActionListener(new ProxySetupListener());
    menu.add(setupProxyConfiguration);

    return menu;
}

From source file:com.monead.semantic.workbench.SemanticWorkbench.java

/**
 * Create the filters menu/* w w  w  .j a  va 2s.  c  om*/
 * 
 * @return The filters menu
 */
private JMenu setupFiltersMenu() {
    final JMenu menu = new JMenu("Tree Filter");

    menu.setMnemonic(KeyEvent.VK_F);
    menu.setToolTipText("Menu items related to filtering values out of the model's tree");

    filterEnableFilters = new JCheckBoxMenuItem("Enable Filters");
    filterEnableFilters.setSelected(true);
    filterEnableFilters
            .setToolTipText("Enforce the filtered list of classes and properties when creating the tree view");
    menu.add(filterEnableFilters);

    filterShowAnonymousNodes = new JCheckBoxMenuItem("Show Anonymous Nodes");
    filterShowAnonymousNodes.setSelected(false);
    filterShowAnonymousNodes.setToolTipText("Include anonymous nodes in the tree view");
    menu.add(filterShowAnonymousNodes);

    showFqnInTree = new JCheckBoxMenuItem("Show FQN In Tree");
    showFqnInTree.setSelected(false);
    showFqnInTree
            .setToolTipText("Show the fully qualified name for classes, properties and objects in the tree");
    menu.add(showFqnInTree);

    menu.addSeparator();

    filterEditFilteredClasses = new JMenuItem("Edit List of Filtered Classes");
    filterEditFilteredClasses
            .setToolTipText("Present the list of filtered classes and allow them to be edited");
    filterEditFilteredClasses.addActionListener(new EditFilteredClassesListener());
    menu.add(filterEditFilteredClasses);

    filterEditFilteredProperties = new JMenuItem("Edit List of Filtered Properties");
    filterEditFilteredProperties
            .setToolTipText("Present the list of filtered properties and allow them to be edited");
    filterEditFilteredProperties.addActionListener(new EditFilteredPropertiesListener());
    menu.add(filterEditFilteredProperties);

    menu.addSeparator();

    filterSetMaximumIndividualsPerClassInTree = new JMenuItem("Set Maximum Individuals Per Class in Tree");
    filterSetMaximumIndividualsPerClassInTree
            .setToolTipText("Limit number of individuals shown for each class in the tree view.");
    filterSetMaximumIndividualsPerClassInTree
            .addActionListener(new SetMaximumIndividualsPerClassInTreeListener());
    menu.add(filterSetMaximumIndividualsPerClassInTree);

    return menu;
}

From source file:com.projity.pm.graphic.frames.GraphicManager.java

public void setToolBarAndMenus(final Container contentPane) {
    JToolBar toolBar;//  w w  w.  j  av  a2  s.c o  m
    if (Environment.isRibbonUI()) {
        if (Environment.isNeedToRestart()) {
            contentPane.add(new JLabel(Messages.getString("Error.restart")), BorderLayout.CENTER);
            return;
        }

        setRibbon((JRibbonFrame) container, getMenuManager());

        //         JToolBar viewToolBar = getMenuManager().getToolBar(MenuManager.VIEW_TOOL_BAR_WITH_NO_SUB_VIEW_OPTION);
        //         topTabs = new TabbedNavigation();
        //         JComponent tabs = topTabs.createContentPanel(getMenuManager(),viewToolBar,0,JTabbedPane.TOP,true);
        //         tabs.setAlignmentX(0.0f); // so it is left justified
        //
        //
        //          Box top = new Box(BoxLayout.Y_AXIS);
        //          JComponent bottom;
        //         top.add(tabs);
        //         bottom = new TabbedNavigation().createContentPanel(getMenuManager(),viewToolBar,1,JTabbedPane.BOTTOM,false);
        //         contentPane.add(top, BorderLayout.BEFORE_FIRST_LINE);
        //         contentPane.add(bottom,BorderLayout.AFTER_LAST_LINE);
        //         if (Environment.isNewLaf())
        //            contentPane.setBackground(Color.WHITE);

        //         if (Environment.isMac()){
        //            //System.setProperty("apple.laf.useScreenMenuBar","true");
        //            //System.setProperty("com.apple.mrj.application.apple.menu.about.name", Messages.getMetaString("Text.ShortTitle"));
        //            JMenuBar menu = getMenuManager().getMenu(Environment.getStandAlone()?MenuManager.MAC_STANDARD_MENU:MenuManager.SERVER_STANDARD_MENU);
        //            //((JComponent)menu).setBorder(BorderFactory.createEmptyBorder());
        //
        //            ((JFrame)container).setJMenuBar(menu);
        //            projectListMenu = (JMenu) menu.getComponent(5);
        //         }

    } else if (Environment.isNewLook()) {
        if (Environment.isNeedToRestart()) {
            contentPane.add(new JLabel(Messages.getString("Error.restart")), BorderLayout.CENTER);
            return;
        }

        toolBar = getMenuManager().getToolBar(MenuManager.BIG_TOOL_BAR);
        if (!getLafManager().isToolbarOpaque())
            toolBar.setOpaque(false);
        if (!isApplet())
            getMenuManager().setActionVisible(ACTION_FULL_SCREEN, false);

        if (Environment.isExternal()) // external users only see project team
            getMenuManager().setActionVisible(ACTION_TEAM_FILTER, false);

        toolBar.addSeparator(new Dimension(20, 20));
        toolBar.add(new Box.Filler(new Dimension(0, 0), new Dimension(0, 0),
                new Dimension(Integer.MAX_VALUE, Integer.MAX_VALUE)));
        toolBar.add(((DefaultFrameManager) getFrameManager()).getProjectComboPanel());
        toolBar.add(Box.createRigidArea(new Dimension(20, 20)));
        if (Environment.isNewLaf())
            toolBar.setBackground(Color.WHITE);
        toolBar.setFloatable(false);
        toolBar.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        Box top;
        JComponent bottom;

        top = new Box(BoxLayout.Y_AXIS);
        toolBar.setAlignmentX(0.0f); // so it is left justified
        top.add(toolBar);

        JToolBar viewToolBar = getMenuManager().getToolBar(MenuManager.VIEW_TOOL_BAR_WITH_NO_SUB_VIEW_OPTION);
        topTabs = new TabbedNavigation();
        JComponent tabs = topTabs.createContentPanel(getMenuManager(), viewToolBar, 0, JTabbedPane.TOP, true);
        tabs.setAlignmentX(0.0f); // so it is left justified

        top.add(tabs);
        bottom = new TabbedNavigation().createContentPanel(getMenuManager(), viewToolBar, 1, JTabbedPane.BOTTOM,
                false);
        contentPane.add(top, BorderLayout.BEFORE_FIRST_LINE);
        contentPane.add(bottom, BorderLayout.AFTER_LAST_LINE);
        if (Environment.isNewLaf())
            contentPane.setBackground(Color.WHITE);

        if (Environment.isMac()) {
            //System.setProperty("apple.laf.useScreenMenuBar","true");
            //System.setProperty("com.apple.mrj.application.apple.menu.about.name", Messages.getMetaString("Text.ShortTitle"));
            JMenuBar menu = getMenuManager().getMenu(Environment.getStandAlone() ? MenuManager.MAC_STANDARD_MENU
                    : MenuManager.SERVER_STANDARD_MENU);
            //((JComponent)menu).setBorder(BorderFactory.createEmptyBorder());

            ((JFrame) container).setJMenuBar(menu);
            projectListMenu = (JMenu) menu.getComponent(5);
        }

    } else {

        toolBar = getMenuManager().getToolBar(
                Environment.isMac() ? MenuManager.MAC_STANDARD_TOOL_BAR : MenuManager.STANDARD_TOOL_BAR);
        filterToolBarManager = FilterToolBarManager.create(getMenuManager());
        filterToolBarManager.addButtons(toolBar);
        contentPane.add(toolBar, BorderLayout.BEFORE_FIRST_LINE);
        JToolBar viewToolBar = getMenuManager().getToolBar(MenuManager.VIEW_TOOL_BAR);
        viewToolBar.setOrientation(JToolBar.VERTICAL);
        viewToolBar.setRollover(true);
        contentPane.add(viewToolBar, BorderLayout.WEST);

        JMenuBar menu = getMenuManager().getMenu(Environment.getStandAlone()
                ? (Environment.isMac() ? MenuManager.MAC_STANDARD_MENU : MenuManager.STANDARD_MENU)
                : MenuManager.SERVER_STANDARD_MENU);

        if (!Environment.isMac()) {
            ((JComponent) menu).setBorder(BorderFactory.createEmptyBorder());
            JMenuItem logo = (JMenuItem) menu.getComponent(0);
            logo.setBorder(BorderFactory.createEmptyBorder());
            logo.setMaximumSize(new Dimension(124, 52));
            logo.setCursor(Cursor.getPredefinedCursor(Cursor.HAND_CURSOR));
        }
        ((JFrame) container).setJMenuBar(menu);
        projectListMenu = (JMenu) menu.getComponent(Environment.isMac() ? 5 : 6);
    }

    //accelerators
    addCtrlAccel(KeyEvent.VK_G, ACTION_GOTO, null);
    addCtrlAccel(KeyEvent.VK_L, ACTION_GOTO, null);
    addCtrlAccel(KeyEvent.VK_F, ACTION_FIND, null);
    addCtrlAccel(KeyEvent.VK_Z, ACTION_UNDO, null); //- Sanhita
    addCtrlAccel(KeyEvent.VK_Y, ACTION_REDO, null);
    addCtrlAccel(KeyEvent.VK_N, ACTION_NEW_PROJECT, null);
    addCtrlAccel(KeyEvent.VK_O, ACTION_OPEN_PROJECT, null);
    addCtrlAccel(KeyEvent.VK_S, ACTION_SAVE_PROJECT, null);
    addCtrlAccel(KeyEvent.VK_P, ACTION_PRINT, null); //-Sanhita
    addCtrlAccel(KeyEvent.VK_I, ACTION_INSERT_TASK, null);
    addCtrlAccel(KeyEvent.VK_PERIOD, ACTION_INDENT, null);
    addCtrlAccel(KeyEvent.VK_COMMA, ACTION_OUTDENT, null);
    addCtrlAccel(KeyEvent.VK_PLUS, ACTION_EXPAND, new ExpandAction());
    addCtrlAccel(KeyEvent.VK_ADD, ACTION_EXPAND, new ExpandAction());
    addCtrlAccel(KeyEvent.VK_EQUALS, ACTION_EXPAND, new ExpandAction());
    addCtrlAccel(KeyEvent.VK_MINUS, ACTION_COLLAPSE, new CollapseAction());
    addCtrlAccel(KeyEvent.VK_SUBTRACT, ACTION_COLLAPSE, new CollapseAction());

    // To force a recalculation. This normally shouldn't be needed.
    addCtrlAccel(KeyEvent.VK_R, ACTION_RECALCULATE, new RecalculateAction());
}

From source file:src.gui.ItSIMPLE.java

/**
 * This method initializes jMenu/*from  www  . j av a 2s . c o m*/
 *
 * @return javax.swing.JMenu
 */
private JMenu getFileMenu() {
    if (fileMenu == null) {
        fileMenu = new JMenu();
        fileMenu.setText("File");
        fileMenu.setMnemonic(KeyEvent.VK_F);
    }
    fileMenu.removeAll();
    fileMenu.add(getNewMenu());
    fileMenu.add(getOpenMenuItem());
    fileMenu.add(getOpenRecentProjectMenu());
    fileMenu.addSeparator();
    fileMenu.add(getSaveMenuItem());
    fileMenu.add(getSaveAsMenuItem());
    fileMenu.add(getSaveAllMenuItem());

    fileMenu.addSeparator();
    //Database
    //TODO left for the futures versions
    //fileMenu.add(getExportToDataBaseMenuItem());
    //fileMenu.add(getImportFromDataBaseMenuItem());
    //fileMenu.addSeparator();

    //Modeling Pattern
    fileMenu.add(getImportMenu());
    fileMenu.addSeparator();

    fileMenu.add(getExitMenuItem());

    return fileMenu;
}