Skip to content

Commit ca06bc8

Browse files
committed
PDFBOX-6047: refactor
git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1927585 13f79535-47bb-0310-9956-ffa450edef68
1 parent 75e0284 commit ca06bc8

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

debugger/src/main/java/org/apache/pdfbox/debugger/ui/TextStripperMenu.java

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,17 @@
2626
public class TextStripperMenu extends MenuBase
2727
{
2828
private static TextStripperMenu instance;
29-
private static JCheckBoxMenuItem sortOptionMenuItem;
30-
private static JCheckBoxMenuItem ignoreSpacesOptionMenuItem;
29+
private static final JCheckBoxMenuItem SORTOPTIONMENUITEM = new JCheckBoxMenuItem("sort");
30+
private static final JCheckBoxMenuItem IGNORESPACESOPTIONMENUITEM = new JCheckBoxMenuItem("ignore spaces");
3131

3232
/**
3333
* Constructor.
3434
*/
3535
private TextStripperMenu()
3636
{
3737
JMenu menu = new JMenu("Text extraction options");
38-
39-
sortOptionMenuItem = new JCheckBoxMenuItem("sort");
40-
menu.add(sortOptionMenuItem);
41-
42-
ignoreSpacesOptionMenuItem = new JCheckBoxMenuItem("ignore spaces");
43-
menu.add(ignoreSpacesOptionMenuItem);
44-
38+
menu.add(SORTOPTIONMENUITEM);
39+
menu.add(IGNORESPACESOPTIONMENUITEM);
4540
setMenu(menu);
4641
}
4742

@@ -61,11 +56,11 @@ public static TextStripperMenu getInstance()
6156

6257
public static boolean isSorted()
6358
{
64-
return sortOptionMenuItem.isSelected();
59+
return SORTOPTIONMENUITEM.isSelected();
6560
}
6661

6762
public static boolean isIgnoreSpaces()
6863
{
69-
return ignoreSpacesOptionMenuItem.isSelected();
64+
return IGNORESPACESOPTIONMENUITEM.isSelected();
7065
}
7166
}

0 commit comments

Comments
 (0)