Search in sources :

Example 31 with ImageIcon

use of javax.swing.ImageIcon in project zaproxy by zaproxy.

the class MainFrame method getShowAllTabsButton.

private JButton getShowAllTabsButton() {
    if (showAllTabsButton == null) {
        showAllTabsButton = new JButton();
        showAllTabsButton.setIcon(new ImageIcon(WorkbenchPanel.class.getResource("/resource/icon/fugue/ui-tab-show.png")));
        showAllTabsButton.setToolTipText(Constant.messages.getString("menu.view.tabs.show"));
        DisplayUtils.scaleIcon(showAllTabsButton);
        showAllTabsButton.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(ActionEvent e) {
                View.getSingleton().showAllTabs();
            }
        });
    }
    return showAllTabsButton;
}
Also used : ImageIcon(javax.swing.ImageIcon) ActionEvent(java.awt.event.ActionEvent) JButton(javax.swing.JButton)

Example 32 with ImageIcon

use of javax.swing.ImageIcon in project zaproxy by zaproxy.

the class MainFrame method getShowTabIconNamesButton.

private JToggleButton getShowTabIconNamesButton() {
    if (showTabIconNamesButton == null) {
        showTabIconNamesButton = new ZapToggleButton();
        showTabIconNamesButton.setIcon(new ImageIcon(WorkbenchPanel.class.getResource("/resource/icon/ui_tab_icon.png")));
        showTabIconNamesButton.setToolTipText(Constant.messages.getString("view.toolbar.showNames"));
        showTabIconNamesButton.setSelectedIcon(new ImageIcon(WorkbenchPanel.class.getResource("/resource/icon/ui_tab_text.png")));
        showTabIconNamesButton.setSelectedToolTipText(Constant.messages.getString("view.toolbar.showIcons"));
        showTabIconNamesButton.setSelected(Model.getSingleton().getOptionsParam().getViewParam().getShowTabNames());
        DisplayUtils.scaleIcon(showTabIconNamesButton);
        showTabIconNamesButton.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(ActionEvent evt) {
                boolean showTabNames = getShowTabIconNamesButton().isSelected();
                setShowTabNames(showTabNames);
                Model.getSingleton().getOptionsParam().getViewParam().setShowTabNames(showTabNames);
                try {
                    Model.getSingleton().getOptionsParam().getViewParam().getConfig().save();
                } catch (ConfigurationException e) {
                    LOGGER.error(e.getMessage(), e);
                }
            }
        });
    }
    return showTabIconNamesButton;
}
Also used : ImageIcon(javax.swing.ImageIcon) ConfigurationException(org.apache.commons.configuration.ConfigurationException) ActionEvent(java.awt.event.ActionEvent) ZapToggleButton(org.zaproxy.zap.view.ZapToggleButton)

Example 33 with ImageIcon

use of javax.swing.ImageIcon in project zaproxy by zaproxy.

the class AlertPanel method getLinkWithSitesTreeButton.

/**
     * Returns the toggle button that enables/disables the "Alerts" tree filtering based on the "Sites" tree selection.
     * <p>
     * The instance variable {@code linkWithSitesTreeButton} is initialised on the first call to this method.
     * </p>
     * 
     * @see #linkWithSitesTreeButton
     * @return the toggle button that enables/disables the "Alerts" tree filtering based on the "Sites" tree selection
     */
private JToggleButton getLinkWithSitesTreeButton() {
    if (linkWithSitesTreeButton == null) {
        linkWithSitesTreeButton = new ZapToggleButton();
        linkWithSitesTreeButton.setIcon(new ImageIcon(AlertPanel.class.getResource("/resource/icon/16/earth-grey.png")));
        linkWithSitesTreeButton.setToolTipText(Constant.messages.getString("alerts.panel.linkWithSitesSelection.unselected.button.tooltip"));
        linkWithSitesTreeButton.setSelectedIcon(new ImageIcon(AlertPanel.class.getResource("/resource/icon/16/094.png")));
        linkWithSitesTreeButton.setSelectedToolTipText(Constant.messages.getString("alerts.panel.linkWithSitesSelection.selected.button.tooltip"));
        DisplayUtils.scaleIcon(linkWithSitesTreeButton);
        linkWithSitesTreeButton.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(java.awt.event.ActionEvent e) {
                setLinkWithSitesTreeSelection(linkWithSitesTreeButton.isSelected());
            }
        });
        alertsTreeFiltersButtonGroup.add(linkWithSitesTreeButton);
    }
    return linkWithSitesTreeButton;
}
Also used : ImageIcon(javax.swing.ImageIcon) ActionListener(java.awt.event.ActionListener) ZapToggleButton(org.zaproxy.zap.view.ZapToggleButton) ActionEvent(java.awt.event.ActionEvent)

Example 34 with ImageIcon

use of javax.swing.ImageIcon in project zaproxy by zaproxy.

the class AlertPanel method initialize.

/**
	 * This method initializes this
	 */
private void initialize() {
    this.setLayout(new CardLayout());
    this.setSize(274, 251);
    this.setName(Constant.messages.getString("alerts.panel.title"));
    // 'flag' icon
    this.setIcon(new ImageIcon(AlertPanel.class.getResource("/resource/icon/16/071.png")));
    this.add(getPanelCommand(), getPanelCommand().getName());
    this.setDefaultAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_A, Toolkit.getDefaultToolkit().getMenuShortcutKeyMask() | Event.SHIFT_MASK, false));
    this.setMnemonic(Constant.messages.getChar("alerts.panel.mnemonic"));
    this.setShowByDefault(true);
}
Also used : CardLayout(java.awt.CardLayout) ImageIcon(javax.swing.ImageIcon)

Example 35 with ImageIcon

use of javax.swing.ImageIcon in project zaproxy by zaproxy.

the class AlertPanel method getScopeButton.

private JToggleButton getScopeButton() {
    if (scopeButton == null) {
        scopeButton = new ZapToggleButton();
        scopeButton.setIcon(new ImageIcon(AlertPanel.class.getResource("/resource/icon/fugue/target-grey.png")));
        scopeButton.setToolTipText(Constant.messages.getString("history.scope.button.unselected"));
        scopeButton.setSelectedIcon(new ImageIcon(AlertPanel.class.getResource("/resource/icon/fugue/target.png")));
        scopeButton.setSelectedToolTipText(Constant.messages.getString("history.scope.button.selected"));
        DisplayUtils.scaleIcon(scopeButton);
        scopeButton.addActionListener(new java.awt.event.ActionListener() {

            @Override
            public void actionPerformed(java.awt.event.ActionEvent e) {
                extension.setShowJustInScope(scopeButton.isSelected());
            }
        });
        alertsTreeFiltersButtonGroup.add(scopeButton);
    }
    return scopeButton;
}
Also used : ImageIcon(javax.swing.ImageIcon) ActionListener(java.awt.event.ActionListener) ZapToggleButton(org.zaproxy.zap.view.ZapToggleButton) ActionEvent(java.awt.event.ActionEvent)

Aggregations

ImageIcon (javax.swing.ImageIcon)427 JButton (javax.swing.JButton)109 ActionEvent (java.awt.event.ActionEvent)83 ActionListener (java.awt.event.ActionListener)70 JLabel (javax.swing.JLabel)67 Dimension (java.awt.Dimension)62 BufferedImage (java.awt.image.BufferedImage)51 JPanel (javax.swing.JPanel)48 Insets (java.awt.Insets)42 Image (java.awt.Image)31 BorderLayout (java.awt.BorderLayout)28 IOException (java.io.IOException)28 URL (java.net.URL)26 GridBagLayout (java.awt.GridBagLayout)23 JMenuItem (javax.swing.JMenuItem)23 Color (java.awt.Color)21 Point (java.awt.Point)21 LogTypeHelper (com.cosylab.logging.engine.log.LogTypeHelper)20 JToggleButton (javax.swing.JToggleButton)20 JScrollPane (javax.swing.JScrollPane)19