Skip to content

Commit

Permalink
Merge pull request #3 from delftswa2017/resizeCleanupWindow
Browse files Browse the repository at this point in the history
Cleanup dialog has a scroll bar now.
  • Loading branch information
TRvanRossum authored Mar 5, 2017
2 parents 07d7076 + cfd7cdb commit c8b2472
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
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

0 comments on commit c8b2472

Please sign in to comment.