Search in sources :

Example 6 with JMenuItem

use of javax.swing.JMenuItem in project ACS by ACS-Community.

the class ScriptFilter method getFileMenuLoadStatusButton.

/**
	 * This method initializes FileMenuLoadStatusButton
	 * @return javax.swing.JMenuItem
	 */
private JMenuItem getFileMenuLoadStatusButton() {
    if (FileMenuLoadStatusButton == null) {
        FileMenuLoadStatusButton = new JMenuItem();
        FileMenuLoadStatusButton.setText("Load GUI Status");
        FileMenuLoadStatusButton.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent e) {
                JFileChooser chooser = new JFileChooser();
                Filter filter = new Filter();
                chooser.setFileFilter(filter);
                int returnVal = chooser.showOpenDialog(cl.utfsm.samplingSystemUI.SamplingSystemGUI.this);
                if (returnVal == JFileChooser.APPROVE_OPTION) {
                    try {
                        readStatusFile(chooser.getSelectedFile().getAbsolutePath(), false);
                    } catch (ParserConfigurationException e1) {
                        e1.printStackTrace();
                    } catch (SAXException e1) {
                        e1.printStackTrace();
                    } catch (IOException e1) {
                        e1.printStackTrace();
                    }
                }
            }
        });
    }
    return FileMenuLoadStatusButton;
}
Also used : JFileChooser(javax.swing.JFileChooser) FileFilter(javax.swing.filechooser.FileFilter) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) IOException(java.io.IOException) JMenuItem(javax.swing.JMenuItem) ActionEvent(java.awt.event.ActionEvent) SAXException(org.xml.sax.SAXException)

Example 7 with JMenuItem

use of javax.swing.JMenuItem in project ACS by ACS-Community.

the class BeanGrouper method getDelScriptMenuItem.

private JMenuItem getDelScriptMenuItem() {
    if (delScriptMenuItem == null) {
        delScriptMenuItem = new JMenuItem();
        delScriptMenuItem.setText("Delete script");
        delScriptMenuItem.setEnabled(false);
        delScriptMenuItem.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent e) {
                script = null;
                delScriptMenuItem.setEnabled(false);
                getAddScriptMenuItem().setEnabled(true);
                getStartButton().setIcon(new ImageIcon(getClass().getClassLoader().getResource("cl/utfsm/samplingSystemUI/img/player_play.png")));
                getStartButton().setToolTipText("Start the sampling, and also start the configurated script.\nThe sampling will end with the script.");
                getTimeSampSpinner().setEnabled(true);
            }
        });
    }
    return delScriptMenuItem;
}
Also used : ImageIcon(javax.swing.ImageIcon) JMenuItem(javax.swing.JMenuItem) ActionEvent(java.awt.event.ActionEvent)

Example 8 with JMenuItem

use of javax.swing.JMenuItem in project ACS by ACS-Community.

the class BeanGrouper method getDelEditMenuItem.

private JMenuItem getDelEditMenuItem() {
    if (delEditMenuItem == null) {
        delEditMenuItem = new JMenuItem();
        delEditMenuItem.setText("Delete Property");
        delEditMenuItem.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent e) {
                createDelPropWindow();
            }
        });
    }
    return delEditMenuItem;
}
Also used : JMenuItem(javax.swing.JMenuItem) ActionEvent(java.awt.event.ActionEvent)

Example 9 with JMenuItem

use of javax.swing.JMenuItem in project ACS by ACS-Community.

the class ConnectionWidget method initialize.

/**
	 * Init the GUI
	 */
private void initialize() {
    popMenu = new JPopupMenu();
    reconnectMI = new JMenuItem("Reconnect");
    popMenu.add(reconnectMI);
    reconnectMI.addActionListener(this);
}
Also used : JMenuItem(javax.swing.JMenuItem) JPopupMenu(javax.swing.JPopupMenu)

Example 10 with JMenuItem

use of javax.swing.JMenuItem in project ACS by ACS-Community.

the class ErrorTreeCellRenderer method getAddDefaultsItem.

/**
	 * This method initializes jMenuItem	
	 * 	
	 * @return javax.swing.JMenuItem	
	 */
private JMenuItem getAddDefaultsItem() {
    if (addDefaultsItem == null) {
        addDefaultsItem = new JMenuItem();
        addDefaultsItem.setText("Defaults");
        addDefaultsItem.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent e) {
                manager.addDefaults();
                refreshDocsTree();
            }
        });
    }
    return addDefaultsItem;
}
Also used : JMenuItem(javax.swing.JMenuItem)

Aggregations

JMenuItem (javax.swing.JMenuItem)1138 ActionEvent (java.awt.event.ActionEvent)559 ActionListener (java.awt.event.ActionListener)463 JMenu (javax.swing.JMenu)373 JPopupMenu (javax.swing.JPopupMenu)229 JMenuBar (javax.swing.JMenuBar)104 AbstractAction (javax.swing.AbstractAction)90 JCheckBoxMenuItem (javax.swing.JCheckBoxMenuItem)76 ArrayList (java.util.ArrayList)72 JPanel (javax.swing.JPanel)70 Point (java.awt.Point)65 JSeparator (javax.swing.JSeparator)63 File (java.io.File)61 JLabel (javax.swing.JLabel)61 BorderLayout (java.awt.BorderLayout)57 JButton (javax.swing.JButton)54 Component (java.awt.Component)53 ButtonGroup (javax.swing.ButtonGroup)50 Dimension (java.awt.Dimension)46 MouseEvent (java.awt.event.MouseEvent)45