Example usage for java.awt.event KeyEvent VK_V

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

Introduction

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

Prototype

int VK_V

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

Click Source Link

Document

Constant for the "V" key.

Usage

From source file:com.virtusa.isq.vtaf.runtime.SeleniumTestBase.java

/**
 * Fires a set of java robot key events into the webpage.
 * /*from w w  w .j  a v a  2s  . com*/
 * @param commands
 *            the commands
 * @throws Exception
 *             the exception
 */

private void fireKeyEvent(final String commands) throws Exception {

    String[] commandSet = commands.split("\\|");
    Robot robot = getRobot();
    for (String fullCommand : commandSet) {
        sleep(retryInterval / 2);
        int commandIndex = 0;
        int inputIndex = 1;
        String command = fullCommand.split("=")[commandIndex];
        String input = fullCommand.split("=")[inputIndex];
        if ("type".equalsIgnoreCase(command)) {

            StringSelection stringSelection = new StringSelection(input);
            clipboard.setContents(stringSelection, null);

            robot.keyPress(KeyEvent.VK_CONTROL);
            robot.keyPress(KeyEvent.VK_V);
            robot.keyRelease(KeyEvent.VK_V);
            robot.keyRelease(KeyEvent.VK_CONTROL);

        } else if ("Key".equalsIgnoreCase(command)) {

            type(input);
        } else if ("wait".equalsIgnoreCase(command)) {

            super.sleep(Integer.parseInt(input));
        } else {
            throw new Exception("Command " + command);
        }
    }
}

From source file:org.apache.openmeetings.screenshare.job.RemoteJob.java

private void paste(String charValue) {
    Clipboard clippy = getDefaultToolkit().getSystemClipboard();
    try {/*from  w  w  w . j a  v  a 2  s .  c  om*/
        Transferable transferableText = new StringSelection(charValue);
        clippy.setContents(transferableText, null);

        if (SystemUtils.IS_OS_MAC) {
            // Macintosh simulate Insert
            press(157, 86);
        } else {
            // pressing CTRL+V == insert-mode
            press(KeyEvent.VK_CONTROL, KeyEvent.VK_V);
        }
    } catch (Exception e) {
        log.error("Unexpected exception while pressSpecialSign", e);
    }
}

From source file:org.apache.tika.gui.TikaGUI.java

private void addMenuBar() {
    JMenuBar bar = new JMenuBar();

    JMenu file = new JMenu("File");
    file.setMnemonic(KeyEvent.VK_F);
    addMenuItem(file, "Open...", "openfile", KeyEvent.VK_O);
    addMenuItem(file, "Open URL...", "openurl", KeyEvent.VK_U);
    file.addSeparator();/*from  w  w  w  .ja va2 s. co m*/
    addMenuItem(file, "Exit", "exit", KeyEvent.VK_X);
    bar.add(file);

    JMenu view = new JMenu("View");
    view.setMnemonic(KeyEvent.VK_V);
    addMenuItem(view, "Metadata", "metadata", KeyEvent.VK_M);
    addMenuItem(view, "Formatted text", "html", KeyEvent.VK_F);
    addMenuItem(view, "Plain text", "text", KeyEvent.VK_P);
    addMenuItem(view, "Main content", "main", KeyEvent.VK_C);
    addMenuItem(view, "Structured text", "xhtml", KeyEvent.VK_S);
    addMenuItem(view, "Recursive JSON", "json", KeyEvent.VK_J);
    bar.add(view);

    bar.add(Box.createHorizontalGlue());
    JMenu help = new JMenu("Help");
    help.setMnemonic(KeyEvent.VK_H);
    addMenuItem(help, "About Tika", "about", KeyEvent.VK_A);
    bar.add(help);

    setJMenuBar(bar);
}

From source file:org.domainmath.gui.MainFrame.java

/** This method is called from within the constructor to
 * initialize the form.//from ww  w  .  ja  va 2s . c om
 * WARNING: Do NOT modify this code. The content of this method is
 * always regenerated by the Form Editor.
 */
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {

    buttonGroup1 = new javax.swing.ButtonGroup();
    jToolBar1 = new javax.swing.JToolBar();
    jButton1 = new javax.swing.JButton();
    jButton2 = new javax.swing.JButton();
    jButton3 = new javax.swing.JButton();
    jSeparator4 = new javax.swing.JToolBar.Separator();
    connectButton = new javax.swing.JButton();
    disconnectButton = new javax.swing.JButton();
    jSeparator9 = new javax.swing.JToolBar.Separator();
    jButton4 = new javax.swing.JButton();
    jButton5 = new javax.swing.JButton();
    jSeparator15 = new javax.swing.JToolBar.Separator();
    jButton6 = new javax.swing.JButton();
    jButton7 = new javax.swing.JButton();
    jButton8 = new javax.swing.JButton();
    jSeparator13 = new javax.swing.JToolBar.Separator();
    jPanel1 = new javax.swing.JPanel();
    jLabel1 = new javax.swing.JLabel();
    dirComboBox = new javax.swing.JComboBox();
    folderUpButton = new javax.swing.JButton();
    browseButton = new javax.swing.JButton();
    addButton = new javax.swing.JButton();
    jMenuBar1 = new javax.swing.JMenuBar();
    fileMenu = new javax.swing.JMenu();
    newFileItem = new javax.swing.JMenuItem();
    openItem = new javax.swing.JMenuItem();
    jSeparator17 = new javax.swing.JPopupMenu.Separator();
    saveFileItem = new javax.swing.JMenuItem();
    saveAsItem = new javax.swing.JMenuItem();
    savePlotItem = new javax.swing.JMenuItem();
    saveAllItem = new javax.swing.JMenuItem();
    jSeparator1 = new javax.swing.JPopupMenu.Separator();
    printFileItem = new javax.swing.JMenuItem();
    printItem = new javax.swing.JMenuItem();
    jSeparator19 = new javax.swing.JPopupMenu.Separator();
    preferencesItem = new javax.swing.JMenuItem();
    jSeparator2 = new javax.swing.JPopupMenu.Separator();
    connectItem = new javax.swing.JMenuItem();
    disconnectItem = new javax.swing.JMenuItem();
    jSeparator3 = new javax.swing.JPopupMenu.Separator();
    exitItem = new javax.swing.JMenuItem();
    editMenu = new javax.swing.JMenu();
    undoItem = new javax.swing.JMenuItem();
    redoItem = new javax.swing.JMenuItem();
    jSeparator20 = new javax.swing.JPopupMenu.Separator();
    cutItem = new javax.swing.JMenuItem();
    copyItem = new javax.swing.JMenuItem();
    pasteItem = new javax.swing.JMenuItem();
    jSeparator21 = new javax.swing.JPopupMenu.Separator();
    deleteItem = new javax.swing.JMenuItem();
    selectAllItem = new javax.swing.JMenuItem();
    jSeparator22 = new javax.swing.JPopupMenu.Separator();
    jMenuItem2 = new javax.swing.JMenuItem();
    jMenuItem3 = new javax.swing.JMenuItem();
    jSeparator23 = new javax.swing.JPopupMenu.Separator();
    jMenuItem4 = new javax.swing.JMenuItem();
    jMenuItem5 = new javax.swing.JMenuItem();
    jSeparator24 = new javax.swing.JPopupMenu.Separator();
    jMenuItem6 = new javax.swing.JMenuItem();
    jMenuItem1 = new javax.swing.JMenuItem();
    jSeparator11 = new javax.swing.JPopupMenu.Separator();
    clearOutWindowItem = new javax.swing.JMenuItem();
    jMenu3 = new javax.swing.JMenu();
    consoleItem = new javax.swing.JMenuItem();
    historyItem = new javax.swing.JMenuItem();
    filesItem = new javax.swing.JMenuItem();
    workspaceItem = new javax.swing.JMenuItem();
    codeEditorItem = new javax.swing.JMenuItem();
    pathsItem = new javax.swing.JMenuItem();
    pkgsItem = new javax.swing.JMenuItem();
    arrayEditItem = new javax.swing.JMenuItem();
    jMenuItem7 = new javax.swing.JMenuItem();
    jMenu1 = new javax.swing.JMenu();
    findItem = new javax.swing.JMenuItem();
    replaceItem = new javax.swing.JMenuItem();
    gotoItem = new javax.swing.JMenuItem();
    jSeparator25 = new javax.swing.JPopupMenu.Separator();
    googleItem = new javax.swing.JMenuItem();
    wikiItem = new javax.swing.JMenuItem();
    pkgMenu = new javax.swing.JMenu();
    debugMenu = new javax.swing.JMenu();
    runScriptItem = new javax.swing.JMenuItem();
    runScriptCItem = new javax.swing.JMenuItem();
    jMenuItem8 = new javax.swing.JMenuItem();
    jSeparator8 = new javax.swing.JPopupMenu.Separator();
    debugScriptMenuItem = new javax.swing.JMenuItem();
    testScriptMenuItem = new javax.swing.JMenuItem();
    toggleBreakpointItem = new javax.swing.JMenuItem();
    removeToggleBreakpointItem = new javax.swing.JMenuItem();
    clearAllBreakpointsItem = new javax.swing.JMenuItem();
    jSeparator10 = new javax.swing.JPopupMenu.Separator();
    stepItem = new javax.swing.JMenuItem();
    stepInItem = new javax.swing.JMenuItem();
    stepOutItem = new javax.swing.JMenuItem();
    continueItem = new javax.swing.JMenuItem();
    jSeparator5 = new javax.swing.JPopupMenu.Separator();
    finishDebugItem = new javax.swing.JMenuItem();
    toolsMenu = new javax.swing.JMenu();
    fltkplotItem = new javax.swing.JMenuItem();
    octaveCmdItem = new javax.swing.JMenuItem();
    jMenu2 = new javax.swing.JMenu();
    previousWindowItem = new javax.swing.JMenuItem();
    nextWindowItem = new javax.swing.JMenuItem();
    jSeparator29 = new javax.swing.JPopupMenu.Separator();
    closeItem = new javax.swing.JMenuItem();
    closeAllItem = new javax.swing.JMenuItem();
    jSeparator18 = new javax.swing.JPopupMenu.Separator();
    windowsItem = new javax.swing.JMenuItem();
    helpMenu = new javax.swing.JMenu();
    forumItem = new javax.swing.JMenuItem();
    octaveInfoItem = new javax.swing.JMenuItem();
    jSeparator12 = new javax.swing.JPopupMenu.Separator();
    quickHelpItem = new javax.swing.JMenuItem();
    jMenuItem9 = new javax.swing.JMenuItem();
    docPkgItem = new javax.swing.JMenuItem();
    referenceMenu = new javax.swing.JMenu();
    referenceItem = new javax.swing.JMenuItem();
    jSeparator6 = new javax.swing.JPopupMenu.Separator();
    checkForUpdatesMenuItem = new javax.swing.JMenuItem();
    onlineHelpItem = new javax.swing.JMenuItem();
    faqItem = new javax.swing.JMenuItem();
    jSeparator14 = new javax.swing.JPopupMenu.Separator();
    reportBugItem = new javax.swing.JMenuItem();
    feedBackItem = new javax.swing.JMenuItem();
    jSeparator7 = new javax.swing.JPopupMenu.Separator();
    AboutItem = new javax.swing.JMenuItem();

    setDefaultCloseOperation(javax.swing.WindowConstants.DO_NOTHING_ON_CLOSE);
    java.util.ResourceBundle bundle = java.util.ResourceBundle
            .getBundle("org/domainmath/gui/resources/DomainMath_en"); // NOI18N
    setTitle(bundle.getString("DomainMath.title")); // NOI18N
    addWindowListener(new java.awt.event.WindowAdapter() {
        public void windowClosing(java.awt.event.WindowEvent evt) {
            formWindowClosing(evt);
        }

        public void windowOpened(java.awt.event.WindowEvent evt) {
            formWindowOpened(evt);
        }
    });

    jToolBar1.setRollover(true);
    jToolBar1.setName("Standard"); // NOI18N

    jButton1.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/document-new.png"))); // NOI18N
    jButton1.setFocusable(false);
    jButton1.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton1.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton1ActionPerformed(evt);
        }
    });
    jToolBar1.add(jButton1);

    jButton2.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/document-open.png"))); // NOI18N
    jButton2.setFocusable(false);
    jButton2.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton2.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton2.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton2ActionPerformed(evt);
        }
    });
    jToolBar1.add(jButton2);

    jButton3.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/document-save-all.png"))); // NOI18N
    jButton3.setFocusable(false);
    jButton3.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton3.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton3.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton3ActionPerformed(evt);
        }
    });
    jToolBar1.add(jButton3);
    jToolBar1.add(jSeparator4);

    connectButton.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/connect.png"))); // NOI18N
    connectButton.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("connectItem.mnemonic").charAt(0));
    connectButton.setToolTipText(bundle.getString("connectItem.tooltip")); // NOI18N
    connectButton.setFocusable(false);
    connectButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    connectButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    connectButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            connectButtonActionPerformed(evt);
        }
    });
    jToolBar1.add(connectButton);

    disconnectButton.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/disconnect.png"))); // NOI18N
    disconnectButton
            .setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
                    .getString("disconnectItem.mnemonic").charAt(0));
    disconnectButton.setToolTipText(bundle.getString("disconnectItem.tooltip")); // NOI18N
    disconnectButton.setFocusable(false);
    disconnectButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    disconnectButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    disconnectButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            disconnectButtonActionPerformed(evt);
        }
    });
    jToolBar1.add(disconnectButton);
    jToolBar1.add(jSeparator9);

    jButton4.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/edit-undo.png"))); // NOI18N
    jButton4.setFocusable(false);
    jButton4.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton4.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton4.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton4ActionPerformed(evt);
        }
    });
    jToolBar1.add(jButton4);

    jButton5.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/edit-redo.png"))); // NOI18N
    jButton5.setFocusable(false);
    jButton5.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton5.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton5.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton5ActionPerformed(evt);
        }
    });
    jToolBar1.add(jButton5);
    jToolBar1.add(jSeparator15);

    jButton6.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/edit-cut.png"))); // NOI18N
    jButton6.setFocusable(false);
    jButton6.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton6.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton6.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton6ActionPerformed(evt);
        }
    });
    jToolBar1.add(jButton6);

    jButton7.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/edit-copy.png"))); // NOI18N
    jButton7.setFocusable(false);
    jButton7.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton7.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton7.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton7ActionPerformed(evt);
        }
    });
    jToolBar1.add(jButton7);

    jButton8.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/edit-paste.png"))); // NOI18N
    jButton8.setFocusable(false);
    jButton8.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    jButton8.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    jButton8.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jButton8ActionPerformed(evt);
        }
    });
    jToolBar1.add(jButton8);
    jToolBar1.add(jSeparator13);

    jLabel1.setText("Current Directory:");

    dirComboBox.setEditable(true);
    dirComboBox.addItemListener(new java.awt.event.ItemListener() {
        public void itemStateChanged(java.awt.event.ItemEvent evt) {
            dirComboBoxItemStateChanged(evt);
        }
    });

    javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
    jPanel1.setLayout(jPanel1Layout);
    jPanel1Layout
            .setHorizontalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel1Layout.createSequentialGroup().addGap(1, 1, 1).addComponent(jLabel1)
                            .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                            .addComponent(dirComboBox, 0, 112, Short.MAX_VALUE).addGap(1, 1, 1)));
    jPanel1Layout.setVerticalGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup().addGap(5, 5, 5).addGroup(jPanel1Layout
                    .createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE).addComponent(jLabel1)
                    .addComponent(dirComboBox, javax.swing.GroupLayout.PREFERRED_SIZE,
                            javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGap(3, 3, 3)));

    jToolBar1.add(jPanel1);

    folderUpButton.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/size22x22/go-up.png"))); // NOI18N
    folderUpButton.setToolTipText("Up");
    folderUpButton.setFocusable(false);
    folderUpButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    folderUpButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    folderUpButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            folderUpButtonActionPerformed(evt);
        }
    });
    jToolBar1.add(folderUpButton);

    browseButton.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/document-open.png"))); // NOI18N
    browseButton.setToolTipText(bundle.getString("browseButton.title")); // NOI18N
    browseButton.setFocusable(false);
    browseButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    browseButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    browseButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            browseButtonActionPerformed(evt);
        }
    });
    jToolBar1.add(browseButton);

    addButton.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/size22x22/edit-add.png"))); // NOI18N
    addButton.setToolTipText(bundle.getString("addButton.title")); // NOI18N
    addButton.setFocusable(false);
    addButton.setHorizontalTextPosition(javax.swing.SwingConstants.CENTER);
    addButton.setVerticalTextPosition(javax.swing.SwingConstants.BOTTOM);
    addButton.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            addButtonActionPerformed(evt);
        }
    });
    jToolBar1.add(addButton);

    getContentPane().add(jToolBar1, java.awt.BorderLayout.PAGE_START);

    fileMenu.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("fileMenu.mnemonic").charAt(0));
    fileMenu.setText(bundle.getString("fileMenu.name")); // NOI18N

    newFileItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_N,
            java.awt.event.InputEvent.CTRL_MASK));
    newFileItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/document-new.png"))); // NOI18N
    newFileItem.setText("New");
    newFileItem.setToolTipText(bundle.getString("newMenuItem.tooltip")); // NOI18N
    newFileItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            newFileItemActionPerformed(evt);
        }
    });
    fileMenu.add(newFileItem);

    openItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_O,
            java.awt.event.InputEvent.CTRL_MASK));
    openItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/document-open.png"))); // NOI18N
    openItem.setText("Open...");
    openItem.setToolTipText("Open File");
    openItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            openItemActionPerformed(evt);
        }
    });
    fileMenu.add(openItem);
    fileMenu.add(jSeparator17);

    saveFileItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S,
            java.awt.event.InputEvent.CTRL_MASK));
    saveFileItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/document-save.png"))); // NOI18N
    saveFileItem.setText("Save ");
    saveFileItem.setToolTipText(bundle.getString("saveMenuItem.tooltp")); // NOI18N
    saveFileItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            saveFileItemActionPerformed(evt);
        }
    });
    fileMenu.add(saveFileItem);

    saveAsItem.setText("Save As...");
    saveAsItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            saveAsItemActionPerformed(evt);
        }
    });
    fileMenu.add(saveAsItem);

    savePlotItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("savePlotItem.mnemonic").charAt(0));
    savePlotItem.setText(bundle.getString("savePlotItem.name")); // NOI18N
    savePlotItem.setToolTipText(bundle.getString("savePlotItem.tooltip")); // NOI18N
    savePlotItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            savePlotItemActionPerformed(evt);
        }
    });
    fileMenu.add(savePlotItem);

    saveAllItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S,
            java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
    saveAllItem.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/document-save-all.png"))); // NOI18N
    saveAllItem.setText(bundle.getString("saveAllMenuItem.text")); // NOI18N
    saveAllItem.setToolTipText(bundle.getString("saveAllMenuItem.tooltip")); // NOI18N
    saveAllItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            saveAllItemActionPerformed(evt);
        }
    });
    fileMenu.add(saveAllItem);
    fileMenu.add(jSeparator1);

    printFileItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P,
            java.awt.event.InputEvent.CTRL_MASK));
    printFileItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/document-print2.png"))); // NOI18N
    printFileItem.setText("Print");
    printFileItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            printFileItemActionPerformed(evt);
        }
    });
    fileMenu.add(printFileItem);

    printItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_P,
            java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
    printItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("printItem.mnemonic").charAt(0));
    printItem.setText(bundle.getString("printItem.name")); // NOI18N
    printItem.setToolTipText(bundle.getString("printItem.tooltip")); // NOI18N
    printItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            printItemActionPerformed(evt);
        }
    });
    fileMenu.add(printItem);
    fileMenu.add(jSeparator19);

    preferencesItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/preferences.png"))); // NOI18N
    preferencesItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("preferecesItem.mnemonic").charAt(0));
    preferencesItem.setText(bundle.getString("preferencesItem.name")); // NOI18N
    preferencesItem.setToolTipText(bundle.getString("preferencesItem.tooltip")); // NOI18N
    preferencesItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            preferencesItemActionPerformed(evt);
        }
    });
    fileMenu.add(preferencesItem);
    fileMenu.add(jSeparator2);

    connectItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/connect.png"))); // NOI18N
    connectItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("connectItem.mnemonic").charAt(0));
    connectItem.setText(bundle.getString("connectItem.name")); // NOI18N
    connectItem.setToolTipText(bundle.getString("connectItem.tooltip")); // NOI18N
    connectItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            connectItemActionPerformed(evt);
        }
    });
    fileMenu.add(connectItem);

    disconnectItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/disconnect.png"))); // NOI18N
    disconnectItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("disconnectItem.mnemonic").charAt(0));
    disconnectItem.setText(bundle.getString("disconnectItem.name")); // NOI18N
    disconnectItem.setToolTipText(bundle.getString("disconnectItem.tooltip")); // NOI18N
    disconnectItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            disconnectItemActionPerformed(evt);
        }
    });
    fileMenu.add(disconnectItem);
    fileMenu.add(jSeparator3);

    exitItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("exitItem.mnemonic").charAt(0));
    exitItem.setText(bundle.getString("exitItem.name")); // NOI18N
    exitItem.setToolTipText(bundle.getString("exitItem.tooltip")); // NOI18N
    exitItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            exitItemActionPerformed(evt);
        }
    });
    fileMenu.add(exitItem);

    jMenuBar1.add(fileMenu);

    editMenu.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("editMenu.mnemonic").charAt(0));
    editMenu.setText("Edit");

    undoItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Z,
            java.awt.event.InputEvent.CTRL_MASK));
    undoItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-undo.png"))); // NOI18N
    undoItem.setText("Undo");
    undoItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            undoItemActionPerformed(evt);
        }
    });
    editMenu.add(undoItem);

    redoItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_Y,
            java.awt.event.InputEvent.CTRL_MASK));
    redoItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-redo.png"))); // NOI18N
    redoItem.setText("Redo");
    redoItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            redoItemActionPerformed(evt);
        }
    });
    editMenu.add(redoItem);
    editMenu.add(jSeparator20);

    cutItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_X,
            java.awt.event.InputEvent.CTRL_MASK));
    cutItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-cut.png"))); // NOI18N
    cutItem.setText("Cut");
    cutItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            cutItemActionPerformed(evt);
        }
    });
    editMenu.add(cutItem);

    copyItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_C,
            java.awt.event.InputEvent.CTRL_MASK));
    copyItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-copy.png"))); // NOI18N
    copyItem.setText("Copy");
    copyItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            copyItemActionPerformed(evt);
        }
    });
    editMenu.add(copyItem);

    pasteItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_V,
            java.awt.event.InputEvent.CTRL_MASK));
    pasteItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-paste.png"))); // NOI18N
    pasteItem.setText("Paste");
    pasteItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            pasteItemActionPerformed(evt);
        }
    });
    editMenu.add(pasteItem);
    editMenu.add(jSeparator21);

    deleteItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-delete.png"))); // NOI18N
    deleteItem.setText("Delete");
    deleteItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            deleteItemActionPerformed(evt);
        }
    });
    editMenu.add(deleteItem);

    selectAllItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_A,
            java.awt.event.InputEvent.CTRL_MASK));
    selectAllItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-select-all.png"))); // NOI18N
    selectAllItem.setText("Select All");
    selectAllItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            selectAllItemActionPerformed(evt);
        }
    });
    editMenu.add(selectAllItem);
    editMenu.add(jSeparator22);

    jMenuItem2.setAction(new RSyntaxTextAreaEditorKit.InsertTabAction());
    jMenuItem2.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_TAB,
            java.awt.event.InputEvent.CTRL_MASK));
    jMenuItem2.setText("Increase Indent");
    editMenu.add(jMenuItem2);

    jMenuItem3.setAction(new RSyntaxTextAreaEditorKit.DecreaseIndentAction());
    jMenuItem3.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_TAB,
            java.awt.event.InputEvent.SHIFT_MASK));
    jMenuItem3.setText("Decrease Indent");
    editMenu.add(jMenuItem3);
    editMenu.add(jSeparator23);

    jMenuItem4.setAction(new RTextAreaEditorKit.UpperSelectionCaseAction());
    jMenuItem4.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U,
            java.awt.event.InputEvent.CTRL_MASK));
    jMenuItem4.setText("Make Uppercase");
    editMenu.add(jMenuItem4);

    jMenuItem5.setAction(new RTextAreaEditorKit.LowerSelectionCaseAction());
    jMenuItem5.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_U,
            java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
    jMenuItem5.setText("Make Lowercase");
    editMenu.add(jMenuItem5);
    editMenu.add(jSeparator24);

    jMenuItem6.setText("Clear All Marks...");
    jMenuItem6.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem6ActionPerformed(evt);
        }
    });
    editMenu.add(jMenuItem6);

    jMenuItem1.setAction(new RSyntaxTextAreaEditorKit.ToggleCommentAction());
    jMenuItem1.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_SLASH,
            java.awt.event.InputEvent.CTRL_MASK));
    jMenuItem1.setText("Toggle Comment");
    jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem1ActionPerformed(evt);
        }
    });
    editMenu.add(jMenuItem1);
    editMenu.add(jSeparator11);

    clearOutWindowItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W,
            java.awt.event.InputEvent.CTRL_MASK));
    clearOutWindowItem
            .setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
                    .getString("clearOutputWindowItem.mnemonic").charAt(0));
    clearOutWindowItem.setText(bundle.getString("clearOutputWindowItem.name")); // NOI18N
    clearOutWindowItem.setToolTipText(bundle.getString("clearOutputWindowItem.tooltip")); // NOI18N
    clearOutWindowItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            clearOutWindowItemActionPerformed(evt);
        }
    });
    editMenu.add(clearOutWindowItem);

    jMenuBar1.add(editMenu);

    jMenu3.setText(bundle.getString("viewMenu.title")); // NOI18N

    consoleItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_0,
            java.awt.event.InputEvent.CTRL_MASK));
    consoleItem.setText(bundle.getString("consoleItem.title")); // NOI18N
    consoleItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            consoleItemActionPerformed(evt);
        }
    });
    jMenu3.add(consoleItem);

    historyItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_1,
            java.awt.event.InputEvent.CTRL_MASK));
    historyItem.setText(bundle.getString("historyItem.title")); // NOI18N
    historyItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            historyItemActionPerformed(evt);
        }
    });
    jMenu3.add(historyItem);

    filesItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_2,
            java.awt.event.InputEvent.CTRL_MASK));
    filesItem.setText(bundle.getString("filesItem.title")); // NOI18N
    filesItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            filesItemActionPerformed(evt);
        }
    });
    jMenu3.add(filesItem);

    workspaceItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_3,
            java.awt.event.InputEvent.CTRL_MASK));
    workspaceItem.setText(bundle.getString("worksaceItem.title")); // NOI18N
    workspaceItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            workspaceItemActionPerformed(evt);
        }
    });
    jMenu3.add(workspaceItem);

    codeEditorItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_4,
            java.awt.event.InputEvent.CTRL_MASK));
    codeEditorItem.setText(bundle.getString("codeEditorItem.title")); // NOI18N
    codeEditorItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            codeEditorItemActionPerformed(evt);
        }
    });
    jMenu3.add(codeEditorItem);

    pathsItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_5,
            java.awt.event.InputEvent.CTRL_MASK));
    pathsItem.setText(bundle.getString("setPathsItem.title")); // NOI18N
    pathsItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            pathsItemActionPerformed(evt);
        }
    });
    jMenu3.add(pathsItem);

    pkgsItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_6,
            java.awt.event.InputEvent.CTRL_MASK));
    pkgsItem.setText(bundle.getString("pkgsItem.title")); // NOI18N
    pkgsItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            pkgsItemActionPerformed(evt);
        }
    });
    jMenu3.add(pkgsItem);

    arrayEditItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_7,
            java.awt.event.InputEvent.CTRL_MASK));
    arrayEditItem.setText(bundle.getString("arrayEidtorItem.title")); // NOI18N
    arrayEditItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            arrayEditItemActionPerformed(evt);
        }
    });
    jMenu3.add(arrayEditItem);

    jMenuItem7.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_8,
            java.awt.event.InputEvent.CTRL_MASK));
    jMenuItem7.setText("Debugger Window");
    jMenuItem7.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem7ActionPerformed(evt);
        }
    });
    jMenu3.add(jMenuItem7);

    jMenuBar1.add(jMenu3);

    jMenu1.setMnemonic('S');
    jMenu1.setText("Search");

    findItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F,
            java.awt.event.InputEvent.CTRL_MASK));
    findItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/edit-find.png"))); // NOI18N
    findItem.setMnemonic('F');
    findItem.setText("Find...");
    findItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            findItemActionPerformed(evt);
        }
    });
    jMenu1.add(findItem);

    replaceItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_H,
            java.awt.event.InputEvent.CTRL_MASK));
    replaceItem.setIcon(new javax.swing.ImageIcon(
            getClass().getResource("/org/domainmath/gui/icons/edit-find-replace.png"))); // NOI18N
    replaceItem.setText("Replace...");
    replaceItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            replaceItemActionPerformed(evt);
        }
    });
    jMenu1.add(replaceItem);

    gotoItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G,
            java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
    gotoItem.setText("Go To...");
    gotoItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            gotoItemActionPerformed(evt);
        }
    });
    jMenu1.add(gotoItem);
    jMenu1.add(jSeparator25);

    googleItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_G,
            java.awt.event.InputEvent.CTRL_MASK));
    googleItem.setText("Google Search");
    googleItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            googleItemActionPerformed(evt);
        }
    });
    jMenu1.add(googleItem);

    wikiItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W,
            java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
    wikiItem.setText("Wikipedia Search");
    wikiItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            wikiItemActionPerformed(evt);
        }
    });
    jMenu1.add(wikiItem);

    jMenuBar1.add(jMenu1);

    pkgMenu.setText(bundle.getString("pkgMenu.name")); // NOI18N
    jMenuBar1.add(pkgMenu);

    debugMenu.setText("Debug");

    runScriptItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F6, 0));
    runScriptItem
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/Run.png"))); // NOI18N
    runScriptItem.setText("Run Script");
    runScriptItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            runScriptItemActionPerformed(evt);
        }
    });
    debugMenu.add(runScriptItem);

    runScriptCItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F6,
            java.awt.event.InputEvent.SHIFT_MASK));
    runScriptCItem.setText("Run Script from Console");
    runScriptCItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            runScriptCItemActionPerformed(evt);
        }
    });
    debugMenu.add(runScriptCItem);

    jMenuItem8.setText("Edit Run Configuration");
    jMenuItem8.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem8ActionPerformed(evt);
        }
    });
    debugMenu.add(jMenuItem8);
    debugMenu.add(jSeparator8);

    debugScriptMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F5,
            java.awt.event.InputEvent.CTRL_MASK));
    debugScriptMenuItem.setText("Debug Script");
    debugScriptMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            debugScriptMenuItemActionPerformed(evt);
        }
    });
    debugMenu.add(debugScriptMenuItem);

    testScriptMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_T,
            java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
    testScriptMenuItem.setText("Test Script");
    testScriptMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            testScriptMenuItemActionPerformed(evt);
        }
    });
    debugMenu.add(testScriptMenuItem);

    toggleBreakpointItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F9, 0));
    toggleBreakpointItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/resources/stop.png"))); // NOI18N
    toggleBreakpointItem.setText("Toggle Breakpoint");
    toggleBreakpointItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            toggleBreakpointItemActionPerformed(evt);
        }
    });
    debugMenu.add(toggleBreakpointItem);

    removeToggleBreakpointItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F9,
            java.awt.event.InputEvent.SHIFT_MASK));
    removeToggleBreakpointItem.setText("Remove Toggle Breakpoint");
    removeToggleBreakpointItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            removeToggleBreakpointItemActionPerformed(evt);
        }
    });
    debugMenu.add(removeToggleBreakpointItem);

    clearAllBreakpointsItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F9,
            java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
    clearAllBreakpointsItem.setText("Clear All Breakpoints...");
    clearAllBreakpointsItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            clearAllBreakpointsItemActionPerformed(evt);
        }
    });
    debugMenu.add(clearAllBreakpointsItem);
    debugMenu.add(jSeparator10);

    stepItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F10,
            java.awt.event.InputEvent.SHIFT_MASK));
    stepItem.setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/step.png"))); // NOI18N
    stepItem.setText("Step");
    stepItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            stepItemActionPerformed(evt);
        }
    });
    debugMenu.add(stepItem);

    stepInItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F11, 0));
    stepInItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/step-in.png"))); // NOI18N
    stepInItem.setText("Step in");
    stepInItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            stepInItemActionPerformed(evt);
        }
    });
    debugMenu.add(stepInItem);

    stepOutItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F11,
            java.awt.event.InputEvent.SHIFT_MASK));
    stepOutItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/step-out.png"))); // NOI18N
    stepOutItem.setText("Step out");
    stepOutItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            stepOutItemActionPerformed(evt);
        }
    });
    debugMenu.add(stepOutItem);

    continueItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F8, 0));
    continueItem.setText("Continue");
    continueItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            continueItemActionPerformed(evt);
        }
    });
    debugMenu.add(continueItem);
    debugMenu.add(jSeparator5);

    finishDebugItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F5,
            java.awt.event.InputEvent.SHIFT_MASK));
    finishDebugItem
            .setIcon(new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/finish.png"))); // NOI18N
    finishDebugItem.setText("Finish Debugger Session");
    finishDebugItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            finishDebugItemActionPerformed(evt);
        }
    });
    debugMenu.add(finishDebugItem);

    jMenuBar1.add(debugMenu);

    toolsMenu.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("ToolsMenu.mnemonic").charAt(0));
    toolsMenu.setText(bundle.getString("ToolsMenu.name")); // NOI18N

    fltkplotItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_R,
            java.awt.event.InputEvent.SHIFT_MASK | java.awt.event.InputEvent.CTRL_MASK));
    fltkplotItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("fltkPlotItem.mnemonic").charAt(0));
    fltkplotItem.setText(bundle.getString("fltkPlotItem.name")); // NOI18N
    fltkplotItem.setToolTipText(bundle.getString("fltkPlotItem.tooltip")); // NOI18N
    fltkplotItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            fltkplotItemActionPerformed(evt);
        }
    });
    toolsMenu.add(fltkplotItem);

    octaveCmdItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("octaveCmdItem.mnemonic").charAt(0));
    octaveCmdItem.setText(bundle.getString("octaveCmdItem.name")); // NOI18N
    octaveCmdItem.setToolTipText(bundle.getString("octaveCmdItem.tooltip")); // NOI18N
    octaveCmdItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            octaveCmdItemActionPerformed(evt);
        }
    });
    toolsMenu.add(octaveCmdItem);

    jMenuBar1.add(toolsMenu);

    jMenu2.setText(bundle.getString("windowMenu.title")); // NOI18N

    previousWindowItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_PAGE_DOWN,
            java.awt.event.InputEvent.CTRL_MASK));
    previousWindowItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/go-previous.png"))); // NOI18N
    previousWindowItem.setText(bundle.getString("previousWindowItem.title")); // NOI18N
    previousWindowItem.setToolTipText(bundle.getString("previousWindowItem.tooltip")); // NOI18N
    previousWindowItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            previousWindowItemActionPerformed(evt);
        }
    });
    jMenu2.add(previousWindowItem);

    nextWindowItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_PAGE_UP,
            java.awt.event.InputEvent.CTRL_MASK));
    nextWindowItem.setIcon(
            new javax.swing.ImageIcon(getClass().getResource("/org/domainmath/gui/icons/go-next.png"))); // NOI18N
    nextWindowItem.setText(bundle.getString("nextWindowItem.title")); // NOI18N
    nextWindowItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            nextWindowItemActionPerformed(evt);
        }
    });
    jMenu2.add(nextWindowItem);
    jMenu2.add(jSeparator29);

    closeItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W,
            java.awt.event.InputEvent.ALT_MASK));
    closeItem.setText(bundle.getString("closeMenuItem.name")); // NOI18N
    closeItem.setToolTipText(bundle.getString("closeItem.tooltip")); // NOI18N
    closeItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            closeItemActionPerformed(evt);
        }
    });
    jMenu2.add(closeItem);

    closeAllItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_W,
            java.awt.event.InputEvent.ALT_MASK | java.awt.event.InputEvent.SHIFT_MASK));
    closeAllItem.setText(bundle.getString("closeAllItem.name")); // NOI18N
    closeAllItem.setToolTipText(bundle.getString("closeAllItem.tooltip")); // NOI18N
    closeAllItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            closeAllItemActionPerformed(evt);
        }
    });
    jMenu2.add(closeAllItem);
    jMenu2.add(jSeparator18);

    windowsItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F4,
            java.awt.event.InputEvent.SHIFT_MASK));
    windowsItem.setText(bundle.getString("windowsItem.title")); // NOI18N
    windowsItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            windowsItemActionPerformed(evt);
        }
    });
    jMenu2.add(windowsItem);

    jMenuBar1.add(jMenu2);

    helpMenu.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("helpMenu.mnemonic").charAt(0));
    helpMenu.setText(bundle.getString("helpMenu.name")); // NOI18N

    forumItem.setText("Forum");
    forumItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            forumItemActionPerformed(evt);
        }
    });
    helpMenu.add(forumItem);

    octaveInfoItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("octInfoItem.mnemonic").charAt(0));
    octaveInfoItem.setText(bundle.getString("octInfoItem.name")); // NOI18N
    octaveInfoItem.setToolTipText(bundle.getString("octInfoItem.tooltip")); // NOI18N
    octaveInfoItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            octaveInfoItemActionPerformed(evt);
        }
    });
    helpMenu.add(octaveInfoItem);
    helpMenu.add(jSeparator12);

    quickHelpItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1, 0));
    quickHelpItem.setText(bundle.getString("quickHelpItem.name")); // NOI18N
    quickHelpItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            quickHelpItemActionPerformed(evt);
        }
    });
    helpMenu.add(quickHelpItem);

    jMenuItem9.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_F1,
            java.awt.event.InputEvent.SHIFT_MASK));
    jMenuItem9.setText("Package  Documentation");
    jMenuItem9.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            jMenuItem9ActionPerformed(evt);
        }
    });
    helpMenu.add(jMenuItem9);

    docPkgItem.setText("Package Online  Documentation");
    docPkgItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            docPkgItemActionPerformed(evt);
        }
    });
    helpMenu.add(docPkgItem);

    referenceMenu.setText(bundle.getString("referencesMenu.name")); // NOI18N
    helpMenu.add(referenceMenu);

    referenceItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("addReferencesItem.mnemonic").charAt(0));
    referenceItem.setText(bundle.getString("addReferencesItem.name")); // NOI18N
    referenceItem.setToolTipText(bundle.getString("addReferencesItem.tooltip")); // NOI18N
    referenceItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            referenceItemActionPerformed(evt);
        }
    });
    helpMenu.add(referenceItem);
    helpMenu.add(jSeparator6);

    checkForUpdatesMenuItem.setText(bundle.getString("checkForUpdatesMenuItem.text")); // NOI18N
    checkForUpdatesMenuItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            checkForUpdatesMenuItemActionPerformed(evt);
        }
    });
    helpMenu.add(checkForUpdatesMenuItem);

    onlineHelpItem.setText("Help and Support");
    onlineHelpItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            onlineHelpItemActionPerformed(evt);
        }
    });
    helpMenu.add(onlineHelpItem);

    faqItem.setText("Online FAQ");
    faqItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            faqItemActionPerformed(evt);
        }
    });
    helpMenu.add(faqItem);
    helpMenu.add(jSeparator14);

    reportBugItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("reportBugItem.mnemonic").charAt(0));
    reportBugItem.setText(bundle.getString("reportBugItem.name")); // NOI18N
    reportBugItem.setToolTipText(bundle.getString("reportBugItem.tooltip")); // NOI18N
    reportBugItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            reportBugItemActionPerformed(evt);
        }
    });
    helpMenu.add(reportBugItem);

    feedBackItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("yourFeedbackItem.mnemonic").charAt(0));
    feedBackItem.setText(bundle.getString("yourFeedbackItem.name")); // NOI18N
    feedBackItem.setToolTipText(bundle.getString("yourFeedbackItem.tooltip")); // NOI18N
    feedBackItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            feedBackItemActionPerformed(evt);
        }
    });
    helpMenu.add(feedBackItem);
    helpMenu.add(jSeparator7);

    AboutItem.setMnemonic(java.util.ResourceBundle.getBundle("org/domainmath/gui/resources/DomainMath_en")
            .getString("aboutItem.mnemonic").charAt(0));
    AboutItem.setText(bundle.getString("aboutItem.name")); // NOI18N
    AboutItem.setToolTipText(bundle.getString("aboutItem.tooltip")); // NOI18N
    AboutItem.addActionListener(new java.awt.event.ActionListener() {
        public void actionPerformed(java.awt.event.ActionEvent evt) {
            AboutItemActionPerformed(evt);
        }
    });
    helpMenu.add(AboutItem);

    jMenuBar1.add(helpMenu);

    setJMenuBar(jMenuBar1);

    pack();
}

From source file:org.executequery.util.LookAndFeelLoader.java

private void applyMacSettings() {

    if (UIUtils.isMac()) {

        String[] textComponents = { "TextField", "TextPane", "TextArea", "EditorPane", "PasswordField" };
        for (String textComponent : textComponents) {

            InputMap im = (InputMap) UIManager.get(textComponent + ".focusInputMap");
            im.put(KeyStroke.getKeyStroke(KeyEvent.VK_C, KeyEvent.META_DOWN_MASK), DefaultEditorKit.copyAction);
            im.put(KeyStroke.getKeyStroke(KeyEvent.VK_V, KeyEvent.META_DOWN_MASK),
                    DefaultEditorKit.pasteAction);
            im.put(KeyStroke.getKeyStroke(KeyEvent.VK_X, KeyEvent.META_DOWN_MASK), DefaultEditorKit.cutAction);
        }/*from  w w w.  j  a  va  2 s.co  m*/

        if (UIUtils.isNativeMacLookAndFeel()) {

            UIManager.put("Table.gridColor", UIUtils.getDefaultBorderColour());
        }

    }

}

From source file:org.fhaes.util.JTableSpreadsheetByRowAdapter.java

/**
 * The Excel Adapter is constructed with a JTable on which it enables Copy-Paste and acts as a Clipboard listener.
 *///from  w ww. ja va2s  .  co m
public JTableSpreadsheetByRowAdapter(JTable myJTable) {

    mainTable = myJTable;
    KeyStroke copy = KeyStroke.getKeyStroke(KeyEvent.VK_C, ActionEvent.CTRL_MASK, false);
    // Identifying the copy KeyStroke user can modify this
    // to copy on some other Key combination.
    KeyStroke paste = KeyStroke.getKeyStroke(KeyEvent.VK_V, ActionEvent.CTRL_MASK, false);
    // KeyStroke pasteappend =
    // KeyStroke.getKeyStroke(KeyEvent.VK_V,ActionEvent.CTRL_MASK+ActionEvent.SHIFT_MASK,false);
    // Identifying the Paste KeyStroke user can modify this
    // to copy on some other Key combination.
    mainTable.registerKeyboardAction(this, "Copy", copy, JComponent.WHEN_FOCUSED);
    mainTable.registerKeyboardAction(this, "Paste", paste, JComponent.WHEN_FOCUSED);
    system = Toolkit.getDefaultToolkit().getSystemClipboard();
}

From source file:org.openecomp.sdc.ci.tests.utilities.GeneralUIUtils.java

public static void uploadFileWithJavaRobot(String FilePath, String FileName) throws Exception {
    StringSelection sel = new StringSelection(FilePath + FileName);
    Toolkit.getDefaultToolkit().getSystemClipboard().setContents(sel, null);
    Thread.sleep(1000);/*from ww  w .ja va  2 s.  com*/
    Robot robot = new Robot();
    robot.delay(1000);

    // Release Enter
    robot.keyRelease(KeyEvent.VK_ENTER);

    // Press CTRL+V
    robot.keyPress(KeyEvent.VK_CONTROL);
    robot.keyPress(KeyEvent.VK_V);

    // Release CTRL+V
    robot.keyRelease(KeyEvent.VK_CONTROL);
    robot.keyRelease(KeyEvent.VK_V);
    Thread.sleep(1000);

    // Press Enter
    robot.keyPress(KeyEvent.VK_ENTER);
    robot.keyRelease(KeyEvent.VK_ENTER);
    Thread.sleep(3000);
}

From source file:org.openmicroscopy.shoola.agents.imviewer.view.ImViewerUI.java

/**
 * Helper method to create the view menu.
 * //from  ww  w.ja v  a  2  s.com
 * @param pref The user preferences.
 * @return The controls sub-menu.
 */
private JMenu createViewMenu(ViewerPreferences pref) {
    JMenu menu = new JMenu("Display");
    menu.setMnemonic(KeyEvent.VK_V);
    unitBarItem = new JCheckBoxMenuItem();
    unitBarItem.setSelected(model.isUnitBar());
    unitBarItem.setAction(controller.getAction(ImViewerControl.UNIT_BAR));
    menu.add(unitBarItem);
    menu.add(createScaleBarLengthSubMenu(pref));
    menu.add(createScaleBarColorSubMenu(pref));
    menu.add(new JSeparator(JSeparator.HORIZONTAL));
    menu.add(createBackgroundColorSubMenu(pref));
    //menu.add(new JSeparator(JSeparator.HORIZONTAL));
    return menu;
}

From source file:org.photovault.swingui.BrowserWindow.java

protected void createUI(PhotoCollection collection) {
    window.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    tabPane = new JTabbedPane();
    queryPane = new QueryPane();
    PhotoFolderTreeController treeCtrl = new PhotoFolderTreeController(window, this);
    viewCtrl = new PhotoViewController(window, this);
    treePane = treeCtrl.folderTree;/*from w  ww  .  java  2 s  .  com*/
    viewPane = viewCtrl.getThumbPane();
    previewPane = viewCtrl.getPreviewPane();
    tabPane.addTab("Query", queryPane);
    tabPane.addTab("Folders", treePane);

    VolumeTreeController volTreeCtrl = new VolumeTreeController(this);
    JTree volumeTree = volTreeCtrl.getView();
    JScrollPane voltreeScrollPane = new JScrollPane(volumeTree);
    voltreeScrollPane.setPreferredSize(new Dimension(200, 500));
    tabPane.add("Volumes", voltreeScrollPane);

    // TODO: get rid of this!!!!
    EditSelectionColorsAction colorAction = (EditSelectionColorsAction) viewPane.getEditSelectionColorsAction();
    colorAction.setPreviewCtrl(previewPane);

    // Set listeners to both query and folder tree panes

    /*
    If an actionEvent comes from query pane, swich to query results.
     */
    queryPane.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            viewCtrl.setCollection(queryPane.getResultCollection());
        }
    });

    /*
    If the selected folder is changed in treePane, switch to that immediately
     */

    treeCtrl.registerEventListener(PhotoFolderTreeEvent.class, new DefaultEventListener<PhotoCollection>() {

        public void handleEvent(DefaultEvent<PhotoCollection> event) {
            PhotoCollection c = event.getPayload();
            if (c != null) {
                viewCtrl.setCollection(c);
                if (c instanceof PhotoFolder) {
                    PhotoFolder f = (PhotoFolder) c;

                    if (f.getExternalDir() != null) {
                        ExternalDir ed = f.getExternalDir();
                        folderIndexer.updateDir(ed.getVolume(), ed.getPath());
                        viewCtrl.setIndexingOngoing(true);
                    }
                }
            }
        }
    });

    volTreeCtrl.registerEventListener(PhotoFolderTreeEvent.class, new DefaultEventListener<PhotoCollection>() {

        public void handleEvent(DefaultEvent<PhotoCollection> event) {
            PhotoCollection c = event.getPayload();
            if (c != null) {
                viewCtrl.setCollection(c);
                if (c instanceof ExtDirPhotos) {
                    ExtDirPhotos photos = (ExtDirPhotos) c;
                    ExternalVolume vol = (ExternalVolume) viewCtrl.getDAOFactory().getVolumeDAO()
                            .getVolume(photos.getVolId());
                    folderIndexer.updateDir(vol, photos.getDirPath());
                    viewCtrl.setIndexingOngoing(true);
                }
            }
        }
    });

    collectionPane = viewCtrl.getCollectionPane();

    JSplitPane split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, tabPane, collectionPane);
    split.putClientProperty(JSplitPane.ONE_TOUCH_EXPANDABLE_PROPERTY, new Boolean(true));
    Container cp = window.getContentPane();
    cp.setLayout(new BorderLayout());
    cp.add(split, BorderLayout.CENTER);

    statusBar = new StatusBar();
    cp.add(statusBar, BorderLayout.SOUTH);

    // Create actions for BrowserWindow UI

    ImageIcon indexDirIcon = getIcon("index_dir.png");
    DefaultAction indexDirAction = new DefaultAction("Index directory...", indexDirIcon) {

        public void actionPerformed(ActionEvent e) {
            indexDir();
        }
    };
    indexDirAction.putValue(AbstractAction.MNEMONIC_KEY, KeyEvent.VK_D);
    indexDirAction.putValue(AbstractAction.SHORT_DESCRIPTION, "Index all images in a directory");
    this.registerAction("new_ext_vol", indexDirAction);

    ImageIcon importIcon = getIcon("import.png");
    importAction = new AbstractAction("Import image...", importIcon) {

        public void actionPerformed(ActionEvent e) {
            importFile();
        }
    };
    importAction.putValue(AbstractAction.MNEMONIC_KEY, KeyEvent.VK_O);
    importAction.putValue(AbstractAction.ACCELERATOR_KEY,
            KeyStroke.getKeyStroke(KeyEvent.VK_O, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));

    importAction.putValue(AbstractAction.SHORT_DESCRIPTION, "Import new image into database");

    ImageIcon updateIcon = getIcon("update_indexed_dirs.png");
    UpdateIndexAction updateIndexAction = new UpdateIndexAction(viewCtrl, "Update indexed dirs", updateIcon,
            "Check for changes in previously indexed directories", KeyEvent.VK_U);
    this.registerAction("update_indexed_dirs", updateIndexAction);
    updateIndexAction.addStatusChangeListener(statusBar);

    ImageIcon previewTopIcon = getIcon("view_preview_top.png");
    DefaultAction previewTopAction = new DefaultAction("Preview on top", previewTopIcon) {

        public void actionPerformed(ActionEvent e) {
            viewCtrl.setLayout(PhotoViewController.Layout.PREVIEW_HORIZONTAL_THUMBS);
        }
    };
    previewTopAction.putValue(AbstractAction.SHORT_DESCRIPTION, "Show preview on top of thumbnails");
    previewTopAction.putValue(AbstractAction.MNEMONIC_KEY, KeyEvent.VK_T);
    this.registerAction("view_preview_top", previewTopAction);

    ImageIcon previewRightIcon = getIcon("view_preview_right.png");
    DefaultAction previewRightAction = new DefaultAction("Preview on right", previewRightIcon) {

        public void actionPerformed(ActionEvent e) {
            viewCtrl.setLayout(PhotoViewController.Layout.PREVIEW_VERTICAL_THUMBS);
        }
    };
    previewRightAction.putValue(AbstractAction.SHORT_DESCRIPTION, "Show preview on right of thumbnails");
    previewRightAction.putValue(AbstractAction.MNEMONIC_KEY, KeyEvent.VK_R);
    this.registerAction("view_preview_right", previewRightAction);

    ImageIcon previewNoneIcon = getIcon("view_no_preview.png");
    DefaultAction previewNoneAction = new DefaultAction("No preview", previewNoneIcon) {

        public void actionPerformed(ActionEvent e) {
            viewCtrl.setLayout(PhotoViewController.Layout.ONLY_THUMBS);
        }
    };
    previewNoneAction.putValue(AbstractAction.SHORT_DESCRIPTION, "Show no preview image");
    previewNoneAction.putValue(AbstractAction.MNEMONIC_KEY, KeyEvent.VK_O);
    this.registerAction("view_no_preview", previewNoneAction);

    DefaultAction previewLargeAction = new DefaultAction("Large", null) {

        public void actionPerformed(ActionEvent e) {
            viewCtrl.setPreviewSize(200);
        }
    };
    DefaultAction previewSmallAction = new DefaultAction("Small", null) {

        public void actionPerformed(ActionEvent e) {
            viewCtrl.setPreviewSize(100);
        }
    };

    JToolBar tb = createToolbar();
    cp.add(tb, BorderLayout.NORTH);

    // Create the menu bar & menus
    JMenuBar menuBar = new JMenuBar();
    window.setJMenuBar(menuBar);
    // File menu
    JMenu fileMenu = new JMenu("File");
    fileMenu.setMnemonic(KeyEvent.VK_F);
    menuBar.add(fileMenu);

    JMenuItem newWindowItem = new JMenuItem("New window", KeyEvent.VK_N);
    newWindowItem.setIcon(getIcon("window_new.png"));
    newWindowItem.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            BrowserWindow br = new BrowserWindow(getParentController(), null);
            //          br.setVisible( true );
        }
    });
    fileMenu.add(newWindowItem);

    JMenuItem importItem = new JMenuItem(importAction);
    fileMenu.add(importItem);

    JMenuItem indexDirItem = new JMenuItem(indexDirAction);
    fileMenu.add(indexDirItem);

    fileMenu.add(new JMenuItem(viewCtrl.getActionAdapter("update_indexed_dirs")));

    ExportSelectedAction exportAction = (ExportSelectedAction) viewPane.getExportSelectedAction();
    JMenuItem exportItem = new JMenuItem(exportAction);
    exportAction.addStatusChangeListener(statusBar);
    fileMenu.add(exportItem);

    JMenu dbMenu = new JMenu("Database");
    dbMenu.setMnemonic(KeyEvent.VK_B);
    dbMenu.setIcon(getIcon("empty_icon.png"));

    ExportMetadataAction exportMetadata = new ExportMetadataAction("Export as XML...", null,
            "Export whole database as XML file", KeyEvent.VK_E);
    dbMenu.add(new JMenuItem(exportMetadata));

    ImportXMLAction importMetadata = new ImportXMLAction("Import XML data...", null,
            "Import data from other Photovault database as XML", KeyEvent.VK_I);
    importMetadata.addStatusChangeListener(statusBar);
    dbMenu.add(new JMenuItem(importMetadata));

    fileMenu.add(dbMenu);

    JMenuItem exitItem = new JMenuItem("Exit", KeyEvent.VK_X);
    exitItem.setIcon(getIcon("exit.png"));
    exitItem.addActionListener(new ActionListener() {

        public void actionPerformed(ActionEvent e) {
            System.exit(0);
        }
    });
    fileMenu.add(exitItem);

    JMenu viewMenu = new JMenu("View");
    viewMenu.setMnemonic(KeyEvent.VK_V);
    menuBar.add(viewMenu);

    JMenuItem vertIconsItem = new JMenuItem(previewRightAction);
    viewMenu.add(vertIconsItem);

    JMenuItem horzIconsItem = new JMenuItem(previewTopAction);
    viewMenu.add(horzIconsItem);

    JMenuItem noPreviewItem = new JMenuItem(previewNoneAction);
    viewMenu.add(noPreviewItem);

    JMenuItem nextPhotoItem = new JMenuItem(viewPane.getSelectNextAction());
    viewMenu.add(nextPhotoItem);

    JMenuItem prevPhotoItem = new JMenuItem(viewPane.getSelectPreviousAction());
    viewMenu.add(prevPhotoItem);

    viewMenu.add(new JMenuItem(previewSmallAction));
    viewMenu.add(new JMenuItem(previewLargeAction));

    JMenu sortMenu = new JMenu("Sort by");
    sortMenu.setMnemonic(KeyEvent.VK_S);
    sortMenu.setIcon(getIcon("empty_icon.png"));
    JMenuItem byDateItem = new JMenuItem(new SetPhotoOrderAction(viewCtrl, new ShootingDateComparator(), "Date",
            null, "Order photos by date", KeyEvent.VK_D));
    sortMenu.add(byDateItem);
    JMenuItem byPlaceItem = new JMenuItem(new SetPhotoOrderAction(viewCtrl, new ShootingPlaceComparator(),
            "Place", null, "Order photos by shooting place", KeyEvent.VK_P));
    sortMenu.add(byPlaceItem);
    JMenuItem byQualityItem = new JMenuItem(new SetPhotoOrderAction(viewCtrl, new QualityComparator(),
            "Quality", null, "Order photos by quality", KeyEvent.VK_Q));
    sortMenu.add(byQualityItem);
    viewMenu.add(sortMenu);

    // Set default ordering by date
    byDateItem.getAction().actionPerformed(new ActionEvent(this, 0, "Setting default"));
    JMenu imageMenu = new JMenu("Image");
    imageMenu.setMnemonic(KeyEvent.VK_I);
    menuBar.add(imageMenu);

    imageMenu.add(new JMenuItem(viewPane.getEditSelectionPropsAction()));
    imageMenu.add(new JMenuItem(viewPane.getShowSelectedPhotoAction()));
    imageMenu.add(new JMenuItem(viewCtrl.getActionAdapter("rotate_cw")));
    imageMenu.add(new JMenuItem(viewCtrl.getActionAdapter("rotate_ccw")));
    imageMenu.add(new JMenuItem(viewCtrl.getActionAdapter("rotate_180")));
    imageMenu.add(new JMenuItem(previewPane.getCropAction()));
    imageMenu.add(new JMenuItem(viewPane.getEditSelectionColorsAction()));
    imageMenu.add(new JMenuItem(viewPane.getDeleteSelectedAction()));

    // Create the Quality submenu
    JMenu qualityMenu = new JMenu("Quality");
    qualityMenu.setIcon(getIcon("empty_icon.png"));

    for (int n = 0; n < 6; n++) {
        Action qualityAction = viewCtrl.getActionAdapter("quality_" + n);
        JMenuItem qualityMenuItem = new JMenuItem(qualityAction);
        qualityMenu.add(qualityMenuItem);
    }
    imageMenu.add(qualityMenu);

    JMenu aboutMenu = new JMenu("About");
    aboutMenu.setMnemonic(KeyEvent.VK_A);
    aboutMenu.add(new JMenuItem(new ShowAboutDlgAction("About Photovault...", null, "", null)));

    menuBar.add(Box.createHorizontalGlue());
    menuBar.add(aboutMenu);
    window.pack();
    window.setVisible(true);
}

From source file:org.pmedv.blackboard.commands.PasteCommand.java

public PasteCommand() {
    putValue(Action.NAME, resources.getResourceByKey("PasteCommand.name"));
    putValue(Action.SMALL_ICON, resources.getIcon("icon.paste"));
    putValue(Action.SHORT_DESCRIPTION, resources.getResourceByKey("PasteCommand.description"));
    putValue(Action.ACCELERATOR_KEY, KeyStroke.getKeyStroke(KeyEvent.VK_V, InputEvent.CTRL_DOWN_MASK));
    setEnabled(false);//  w ww . j  a  va 2s  .  c  om
}