Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup dialog has a scroll bar now. #3

Merged
merged 1 commit into from
Mar 5, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/main/java/org/jabref/gui/actions/CleanupAction.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import java.util.Objects;

import javax.swing.JOptionPane;

import org.jabref.Globals;
import org.jabref.gui.BasePanel;
import org.jabref.gui.JabRefFrame;
Expand Down Expand Up @@ -133,8 +132,7 @@ public void update() {

private int showDialog(CleanupPresetPanel presetPanel) {
String dialogTitle = Localization.lang("Cleanup entries");

Object[] messages = {Localization.lang("What would you like to clean up?"), presetPanel.getPanel()};
Object[] messages = {Localization.lang("What would you like to clean up?"), presetPanel.getScrollPane()};
return JOptionPane.showConfirmDialog(frame, messages, dialogTitle, JOptionPane.OK_CANCEL_OPTION,
JOptionPane.QUESTION_MESSAGE);
}
Expand Down
11 changes: 10 additions & 1 deletion src/main/java/org/jabref/gui/cleanup/CleanupPresetPanel.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import javax.swing.JCheckBox;
import javax.swing.JLabel;
import javax.swing.JPanel;

import javax.swing.JScrollPane;
import org.jabref.Globals;
import org.jabref.logic.cleanup.CleanupPreset;
import org.jabref.logic.cleanup.Cleanups;
Expand All @@ -33,6 +33,7 @@ public class CleanupPresetPanel {
private FieldFormatterCleanupsPanel cleanUpFormatters;

private JPanel panel;
private JScrollPane scrollPane;
private CleanupPreset cleanupPreset;


Expand Down Expand Up @@ -90,6 +91,10 @@ private void init() {
builder.add(cleanUpISSN).xyw(1, 9, 2);
builder.add(cleanUpFormatters).xyw(1, 10, 2);
panel = builder.build();
scrollPane = new JScrollPane(panel);
scrollPane.setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
scrollPane.setVisible(true);
scrollPane.setBorder(null);
}

private void updateDisplay(CleanupPreset preset) {
Expand All @@ -111,6 +116,10 @@ public JPanel getPanel() {
return panel;
}

public JScrollPane getScrollPane() {
return scrollPane;
}

public CleanupPreset getCleanupPreset() {

Set<CleanupPreset.CleanupStep> activeJobs = EnumSet.noneOf(CleanupPreset.CleanupStep.class);
Expand Down