From cfd7cdb87c05bfaf42649c2cbf708865bba155d5 Mon Sep 17 00:00:00 2001 From: Tim Date: Fri, 3 Mar 2017 13:08:16 +0100 Subject: [PATCH] Cleanup dialog has a scroll bar now. --- .../java/org/jabref/gui/actions/CleanupAction.java | 4 +--- .../org/jabref/gui/cleanup/CleanupPresetPanel.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/org/jabref/gui/actions/CleanupAction.java b/src/main/java/org/jabref/gui/actions/CleanupAction.java index 7746caf9085..a62461fe362 100644 --- a/src/main/java/org/jabref/gui/actions/CleanupAction.java +++ b/src/main/java/org/jabref/gui/actions/CleanupAction.java @@ -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; @@ -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); } diff --git a/src/main/java/org/jabref/gui/cleanup/CleanupPresetPanel.java b/src/main/java/org/jabref/gui/cleanup/CleanupPresetPanel.java index d75f791dfe1..c2bcde211fc 100644 --- a/src/main/java/org/jabref/gui/cleanup/CleanupPresetPanel.java +++ b/src/main/java/org/jabref/gui/cleanup/CleanupPresetPanel.java @@ -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; @@ -33,6 +33,7 @@ public class CleanupPresetPanel { private FieldFormatterCleanupsPanel cleanUpFormatters; private JPanel panel; + private JScrollPane scrollPane; private CleanupPreset cleanupPreset; @@ -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) { @@ -111,6 +116,10 @@ public JPanel getPanel() { return panel; } + public JScrollPane getScrollPane() { + return scrollPane; + } + public CleanupPreset getCleanupPreset() { Set activeJobs = EnumSet.noneOf(CleanupPreset.CleanupStep.class);