Search in sources :

Example 76 with JToggleButton

use of javax.swing.JToggleButton in project android-classyshark by google.

the class Toolbar method buildLeftPanelToggleButton.

private JToggleButton buildLeftPanelToggleButton() {
    final ImageIcon toggleIcon = theme.getToggleIcon();
    final JToggleButton jToggleButton = new JToggleButton(toggleIcon, true);
    jToggleButton.setToolTipText("Show/hide navigation tree");
    jToggleButton.setBorderPainted(false);
    jToggleButton.addActionListener(new ActionListener() {

        @Override
        public void actionPerformed(ActionEvent e) {
            toolbarController.onChangeLeftPaneVisibility(jToggleButton.isSelected());
        }
    });
    return jToggleButton;
}
Also used : ImageIcon(javax.swing.ImageIcon) JToggleButton(javax.swing.JToggleButton) ActionListener(java.awt.event.ActionListener) ActionEvent(java.awt.event.ActionEvent)

Example 77 with JToggleButton

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

the class RequestSplitComponent method initUi.

protected void initUi() {
    buttonShowView = new JToggleButton(DisplayUtils.getScaledIcon(new ImageIcon(RequestSplitComponent.class.getResource("/resource/icon/view_split.png"))));
    buttonShowView.setToolTipText(BUTTON_TOOL_TIP);
    panelOptions = new JPanel();
    panelOptions.add(headerViews.getSelectableViewsComponent());
    panelOptions.add(bodyViews.getSelectableViewsComponent());
    headerViews.addView(createHttpPanelHeaderTextView());
    splitMain = new JSplitPane();
    splitMain.setDividerSize(3);
    splitMain.setResizeWeight(0.5d);
    splitMain.setContinuousLayout(false);
    splitMain.setOrientation(JSplitPane.VERTICAL_SPLIT);
    splitMain.setTopComponent(headerViews.getViewsPanel());
    splitMain.setBottomComponent(bodyViews.getViewsPanel());
    initViews();
    panelMain = new JPanel(new BorderLayout());
    panelMain.add(splitMain, BorderLayout.CENTER);
    setSelected(false);
}
Also used : ImageIcon(javax.swing.ImageIcon) JPanel(javax.swing.JPanel) JToggleButton(javax.swing.JToggleButton) BorderLayout(java.awt.BorderLayout) JSplitPane(javax.swing.JSplitPane)

Example 78 with JToggleButton

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

the class HttpPanel method addComponent.

private void addComponent(HttpPanelComponentInterface component) {
    synchronized (components) {
        final String componentName = component.getName();
        if (components.containsKey(componentName)) {
            removeComponent(componentName);
        }
        component.setEditable(isEditable);
        component.setEnableViewSelect(isEnableViewSelect);
        components.put(componentName, component);
        panelContent.add(component.getMainPanel(), componentName);
        final JToggleButton button = component.getButton();
        button.setActionCommand(componentName);
        button.addActionListener(getSwitchComponentItemListener());
        button.setEnabled(isEnableViewSelect);
        if (component.isEnabled(message)) {
            enableComponent(component);
            if (currentComponent == null) {
                switchComponent(componentName);
            } else if (savedLastSelectedComponentName != null && savedLastSelectedComponentName.equals(componentName)) {
                switchComponent(componentName);
            } else if (savedLastSelectedComponentName == null && currentComponent.getPosition() > component.getPosition()) {
                switchComponent(componentName);
            }
        }
    }
}
Also used : JToggleButton(javax.swing.JToggleButton)

Example 79 with JToggleButton

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

the class MainFrame method getFullLayoutButton.

private JToggleButton getFullLayoutButton() {
    if (fullLayoutButton == null) {
        fullLayoutButton = new JToggleButton(new ChangeWorkbenchLayoutAction(WorkbenchPanel.class.getResource("/resource/icon/expand_full.png"), WorkbenchPanel.Layout.FULL));
        fullLayoutButton.setToolTipText(Constant.messages.getString("view.toolbar.expandFull"));
    }
    return fullLayoutButton;
}
Also used : JToggleButton(javax.swing.JToggleButton)

Example 80 with JToggleButton

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

the class HttpPanelSender method getButtonFollowRedirects.

private JToggleButton getButtonFollowRedirects() {
    if (followRedirect == null) {
        followRedirect = new JToggleButton(new ImageIcon(HttpPanelSender.class.getResource(// Arrow
        "/resource/icon/16/118.png")));
        // turn
        // around
        // left
        followRedirect.setToolTipText(Constant.messages.getString("manReq.checkBox.followRedirect"));
        followRedirect.setSelected(true);
    }
    return followRedirect;
}
Also used : ImageIcon(javax.swing.ImageIcon) JToggleButton(javax.swing.JToggleButton)

Aggregations

JToggleButton (javax.swing.JToggleButton)179 ActionEvent (java.awt.event.ActionEvent)92 ActionListener (java.awt.event.ActionListener)90 ImageIcon (javax.swing.ImageIcon)76 Dimension (java.awt.Dimension)69 JPanel (javax.swing.JPanel)58 JButton (javax.swing.JButton)46 JLabel (javax.swing.JLabel)39 Point (java.awt.Point)29 JScrollPane (javax.swing.JScrollPane)19 BorderLayout (java.awt.BorderLayout)17 ChangeEvent (javax.swing.event.ChangeEvent)15 Insets (java.awt.Insets)14 ItemEvent (java.awt.event.ItemEvent)14 ChangeListener (javax.swing.event.ChangeListener)14 ItemListener (java.awt.event.ItemListener)13 Component (java.awt.Component)12 FlowLayout (java.awt.FlowLayout)12 BoxLayout (javax.swing.BoxLayout)12 JToolBar (javax.swing.JToolBar)12