Skip to content

Commit

Permalink
selenium: add scroll bar to options panel
Browse files Browse the repository at this point in the history
Prevent the options from being hidden when resizing the panel.
Reduce the number of rows that need to be shown in the extensions
table, as they are not usually many and keeps the panel smaller.

Fix zaproxy/zaproxy#8178.

Signed-off-by: thc202 <thc202@gmail.com>
  • Loading branch information
thc202 committed Nov 8, 2023
1 parent 6258b24 commit 4b923bb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
3 changes: 3 additions & 0 deletions addOns/selenium/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Changed
- Update Selenium to version 4.14.1.

### Fixed
- Add vertical scroll bar to the options panel to prevent the options from being hidden when resizing the Options dialogue (Issue 8178).

## [15.15.0] - 2023-10-12
### Changed
- Update Selenium to version 4.14.0.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
*/
package org.zaproxy.zap.extension.selenium;

import java.awt.BorderLayout;
import java.awt.Dialog;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
Expand All @@ -40,7 +41,9 @@
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
import javax.swing.ScrollPaneConstants;
import javax.swing.border.TitledBorder;
import org.parosproxy.paros.model.OptionsParam;
import org.parosproxy.paros.view.AbstractParamPanel;
Expand Down Expand Up @@ -326,8 +329,9 @@ public SeleniumOptionsPanel(
browserExtLayout.setVerticalGroup(
browserExtLayout.createSequentialGroup().addComponent(browserExtOptionsPanel));

GroupLayout layout = new GroupLayout(this);
setLayout(layout);
JPanel innerPanel = new JPanel();
GroupLayout layout = new GroupLayout(innerPanel);
innerPanel.setLayout(layout);

layout.setAutoCreateGaps(true);
layout.setAutoCreateContainerGaps(true);
Expand All @@ -342,6 +346,13 @@ public SeleniumOptionsPanel(
.addComponent(driversPanel)
.addComponent(binariesPanel)
.addComponent(browserExtPanel));

setLayout(new BorderLayout());
add(
new JScrollPane(
innerPanel,
ScrollPaneConstants.VERTICAL_SCROLLBAR_AS_NEEDED,
ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER));
}

private static JPanel createBinaryPanel(
Expand Down Expand Up @@ -664,6 +675,8 @@ public BrowserExtMultipleOptionsPanel(
ResourceBundle resourceBundle) {
super(model, false);
this.resourceBundle = resourceBundle;

getTable().setVisibleRowCount(5);
}

@Override
Expand Down

0 comments on commit 4b923bb

Please sign in to comment.