Search in sources :

Example 81 with JSeparator

use of javax.swing.JSeparator in project binnavi by google.

the class CProjectNodeMenuBuilder method createMenu.

@Override
protected void createMenu(final JComponent menu) {
    if ((m_projects.length == 1) && (m_addAddressSpaceAction == null)) {
        // We delay the creation of the m_addAddressSpaceAction object because we need to have
        // getSelectionUpdater working.
        final INaviProject singleProject = m_projects[0];
        m_addAddressSpaceAction = CActionProxy.proxy(new CAddAddressSpaceAction(getProjectTree(), singleProject, getSelectionUpdater()));
        updateActions(singleProject);
    }
    final boolean isSingleSelection = m_projects.length == 1;
    if (canOpen()) {
        menu.add(new JMenuItem(m_loadProjectAction));
        menu.add(new JSeparator());
    }
    if (isSingleSelection) {
        // We can not search in more than one project at a time, and only if the project
        // is already loaded.
        menu.add(new JMenuItem(m_searchViewAction));
        menu.add(new JSeparator());
        // We do not allow the user to add address spaces to more than one
        // project at a time. And the project must be loaded too.
        menu.add(new JMenuItem(m_addAddressSpaceAction));
        menu.add(new JSeparator());
        menu.add(new JMenuItem(m_forwardAction));
        menu.add(new JSeparator());
    }
    menu.add(new JMenuItem(CActionProxy.proxy(new CDeleteProjectAction(getParent(), m_database, m_projects, getParentUpdater()))));
    if (m_table != null) {
        menu.add(new JSeparator());
        menu.add(new JMenuItem(CActionProxy.proxy(new CSearchTableAction(getParent(), m_table))));
        menu.add(new JMenuItem(CActionProxy.proxy(new CopySelectionAction(m_table))));
    }
    addPluginMenus(menu);
}
Also used : INaviProject(com.google.security.zynamics.binnavi.disassembly.INaviProject) CopySelectionAction(com.google.security.zynamics.zylib.gui.tables.CopySelectionAction) CAddAddressSpaceAction(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Actions.CAddAddressSpaceAction) CDeleteProjectAction(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Actions.CDeleteProjectAction) JMenuItem(javax.swing.JMenuItem) CSearchTableAction(com.google.security.zynamics.binnavi.Gui.MainWindow.ProjectTree.Actions.CSearchTableAction) JSeparator(javax.swing.JSeparator)

Example 82 with JSeparator

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

the class AlarmTable method buildPopupMenu.

/**
	 * Build the popup menu
	 */
private void buildPopupMenu() {
    popupM.add(ackMI);
    popupM.add(showReducedMI);
    popupM.add(new JSeparator());
    popupM.add(saveMI);
    popupM.add(clipMI);
    popupM.pack();
    ackMI.addActionListener(this);
    saveMI.addActionListener(this);
    clipMI.addActionListener(this);
    showReducedMI.addActionListener(this);
}
Also used : JSeparator(javax.swing.JSeparator)

Example 83 with JSeparator

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

the class ZoomPrefsDlg method initialize.

/**
	 * Init the GUI
	 */
private void initialize() {
    // Window setup
    setTitle("Drill down preferences");
    ImageIcon zoomIcon = new ImageIcon(LogTypeHelper.class.getResource("/zoom.png"));
    setIconImage(zoomIcon.getImage());
    setModal(true);
    setDefaultCloseOperation(DISPOSE_ON_CLOSE);
    // Window content setup
    JPanel contentPanel = new JPanel();
    contentPanel.setLayout(new BoxLayout(contentPanel, BoxLayout.Y_AXIS));
    // The panel with levels
    JPanel levelsPnl = new JPanel();
    levelsPnl.setBorder(BorderFactory.createTitledBorder("Levels"));
    levelsPnl.setLayout(new BoxLayout(levelsPnl, BoxLayout.Y_AXIS));
    JPanel minPnl = new JPanel();
    minPnl.add(new JLabel("Min log level to load: "));
    minLevelCB = buildLogLevelCB(zoomManager.getMinLevel());
    minPnl.add(minLevelCB);
    levelsPnl.add(minPnl);
    JPanel maxPnl = new JPanel();
    maxPnl.add(new JLabel("Max log level to load: "));
    maxLevelCB = buildLogLevelCB(zoomManager.getMaxLevel());
    maxPnl.add(maxLevelCB);
    levelsPnl.add(maxPnl);
    contentPanel.add(levelsPnl);
    // The panel with the folder
    JPanel folderPnl = new JPanel(new BorderLayout());
    folderPnl.setBorder(BorderFactory.createTitledBorder("Folder of XML files"));
    folderPnl.add(folderBtn, BorderLayout.EAST);
    folderBtn.addActionListener(this);
    folderPnl.add(folderLbl, BorderLayout.CENTER);
    setupFolderLbl();
    contentPanel.add(folderPnl);
    // The Ok/Cancel buttons
    contentPanel.add(new JSeparator());
    JPanel buttonPnl = new JPanel(new BorderLayout());
    buttonPnl.add(cancelBtn, BorderLayout.WEST);
    cancelBtn.addActionListener(this);
    buttonPnl.add(okBtn, BorderLayout.EAST);
    okBtn.addActionListener(this);
    okBtn.setEnabled(folder != null);
    contentPanel.add(buttonPnl);
    rootPane.setContentPane(contentPanel);
}
Also used : ImageIcon(javax.swing.ImageIcon) JPanel(javax.swing.JPanel) BorderLayout(java.awt.BorderLayout) LogTypeHelper(com.cosylab.logging.engine.log.LogTypeHelper) BoxLayout(javax.swing.BoxLayout) JLabel(javax.swing.JLabel) JSeparator(javax.swing.JSeparator)

Example 84 with JSeparator

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

the class FilterChooserDialog method initialize.

/**
	 * Init the GUI
	 */
private void initialize() {
    setLocation(50, 50);
    // Add the toolbars
    initMenubar();
    initToolbar();
    JPanel panel = new JPanel(new GridBagLayout());
    GridBagConstraints c = new GridBagConstraints();
    description = new JLabel("Select filter to apply");
    c = newConstraints(0, 0, 0, 4);
    c.gridwidth = 3;
    panel.add(description, c);
    c = newConstraints(0, 1, 0, 4);
    c.gridwidth = 3;
    c.weighty = 1.0;
    c.fill = GridBagConstraints.BOTH;
    filterList = new CheckList();
    panel.add(new JScrollPane(filterList), c);
    JSeparator sep = new JSeparator();
    GridBagConstraints constr = newConstraints(0, 2, 4, 4);
    constr.gridwidth = 3;
    panel.add(sep, constr);
    buttonApply = new JButton("Apply");
    buttonApply.addActionListener(bl);
    panel.add(buttonApply, newConstraints(0, 3, 4, 4));
    buttonRestore = new JButton("Restore");
    buttonRestore.addActionListener(bl);
    panel.add(buttonRestore, newConstraints(1, 3, 4, 4));
    buttonClose = new JButton("Close");
    buttonClose.addActionListener(bl);
    panel.add(buttonClose, newConstraints(2, 3, 4, 4));
    getContentPane().add(panel, BorderLayout.CENTER);
    pack();
}
Also used : JScrollPane(javax.swing.JScrollPane) JPanel(javax.swing.JPanel) GridBagConstraints(java.awt.GridBagConstraints) GridBagLayout(java.awt.GridBagLayout) CheckList(alma.acs.gui.widgets.CheckList) JButton(javax.swing.JButton) JLabel(javax.swing.JLabel) JSeparator(javax.swing.JSeparator)

Example 85 with JSeparator

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

the class ObjectExplorer method initEngines.

/**
	 * Insert the method's description here.
	 * Creation date: (9.4.2002 17:46:00)
	 * @param param java.lang.String[]
	 */
private void initEngines(String[] param) {
    if (param == null)
        return;
    for (int i = 0; i < param.length; i++) {
        JRadioButtonMenuItem radio = new JRadioButtonMenuItem();
        radio.setActionCommand(param[i]);
        radio.setName(param[i]);
        radio.setText(param[i]);
        radio.setSelected(false);
        radio.addActionListener(new java.awt.event.ActionListener() {

            public void actionPerformed(java.awt.event.ActionEvent a) {
                startConnect(((JRadioButtonMenuItem) a.getSource()).getName());
            }
        });
        getConnectMenu().add(radio);
    }
    getConnectMenu().add(new JSeparator());
    JMenuItem radio = new JMenuItem();
    radio.setActionCommand("Other");
    radio.setName("Other");
    radio.setText("Other...");
    radio.addActionListener(new java.awt.event.ActionListener() {

        public void actionPerformed(java.awt.event.ActionEvent a) {
            getOtherRemoteAccessDialog().show();
        }
    });
    getConnectMenu().add(radio);
    if (param.length > 0)
        startConnect(param[0]);
}
Also used : ActionListener(java.awt.event.ActionListener) JRadioButtonMenuItem(javax.swing.JRadioButtonMenuItem) JMenuItem(javax.swing.JMenuItem) ActionEvent(java.awt.event.ActionEvent) JSeparator(javax.swing.JSeparator)

Aggregations

JSeparator (javax.swing.JSeparator)147 JPanel (javax.swing.JPanel)74 JLabel (javax.swing.JLabel)65 ActionEvent (java.awt.event.ActionEvent)44 BoxLayout (javax.swing.BoxLayout)44 JButton (javax.swing.JButton)44 JMenuItem (javax.swing.JMenuItem)38 JMenu (javax.swing.JMenu)32 GridBagConstraints (java.awt.GridBagConstraints)31 Insets (java.awt.Insets)30 ActionListener (java.awt.event.ActionListener)30 Dimension (java.awt.Dimension)24 FlowLayout (java.awt.FlowLayout)24 JScrollPane (javax.swing.JScrollPane)24 GridBagLayout (java.awt.GridBagLayout)22 JPopupMenu (javax.swing.JPopupMenu)19 BorderLayout (java.awt.BorderLayout)16 JTextField (javax.swing.JTextField)16 JCheckBox (javax.swing.JCheckBox)13 AbstractAction (javax.swing.AbstractAction)12