From 2f91945eb6c64b752a17531f174ad8c8daa20846 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillaume=20T=C3=A2che?= Date: Wed, 12 Feb 2020 08:52:44 +0100 Subject: [PATCH 1/2] Fixes conflict with PropertiesManager renaming --- .../icepdf/ri/common/utility/search/SearchFilterButton.java | 2 +- .../java/org/icepdf/ri/common/utility/search/SearchPanel.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/utility/search/SearchFilterButton.java b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/utility/search/SearchFilterButton.java index 920fd9677..6486bf09c 100644 --- a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/utility/search/SearchFilterButton.java +++ b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/utility/search/SearchFilterButton.java @@ -11,7 +11,7 @@ import java.util.ResourceBundle; import java.util.prefs.Preferences; -import static org.icepdf.ri.util.PropertiesManager.*; +import static org.icepdf.ri.util.ViewerPropertiesManager.*; public class SearchFilterButton extends DropDownButton { diff --git a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/utility/search/SearchPanel.java b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/utility/search/SearchPanel.java index 46eb9accc..402601187 100644 --- a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/utility/search/SearchPanel.java +++ b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/utility/search/SearchPanel.java @@ -55,6 +55,7 @@ import java.util.List; import java.util.ResourceBundle; import java.util.logging.Logger; +import java.util.prefs.Preferences; import java.util.regex.Pattern; import java.util.regex.PatternSyntaxException; @@ -244,7 +245,7 @@ private void setGui() { clearSearchButton.addActionListener(this); // apply default preferences - preferences = controller.getPropertiesManager().getPreferences(); + Preferences preferences = controller.getPropertiesManager().getPreferences(); String iconSize = preferences.get(ViewerPropertiesManager.PROPERTY_ICON_DEFAULT_SIZE, Images.SIZE_LARGE); boolean isRegex = preferences.getBoolean(PROPERTY_SEARCH_PANEL_REGEX_ENABLED, true); boolean isWholeWord = preferences.getBoolean(PROPERTY_SEARCH_PANEL_WHOLE_WORDS_ENABLED, false); From 87122b1ad7686f71a7de370a5c697e42c4bd46aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillaume=20T=C3=A2che?= Date: Thu, 13 Feb 2020 10:45:32 +0100 Subject: [PATCH 2/2] GH-2 Fixes PersistentJCheckboxMenuItem UI in case SynthUI is not available --- .../common/PersistentJCheckBoxMenuItem.java | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/PersistentJCheckBoxMenuItem.java b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/PersistentJCheckBoxMenuItem.java index b5d1ea34e..3efeeaff3 100644 --- a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/PersistentJCheckBoxMenuItem.java +++ b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/PersistentJCheckBoxMenuItem.java @@ -1,6 +1,7 @@ package org.icepdf.ri.common; import javax.swing.*; +import javax.swing.plaf.basic.BasicCheckBoxMenuItemUI; import javax.swing.plaf.synth.SynthCheckBoxMenuItemUI; /** @@ -19,11 +20,20 @@ public PersistentJCheckBoxMenuItem(String title, boolean b) { @Override public void updateUI() { super.updateUI(); - setUI(new SynthCheckBoxMenuItemUI() { - @Override - protected void doClick(MenuSelectionManager msm) { - menuItem.doClick(0); - } - }); + if (getUI() instanceof SynthCheckBoxMenuItemUI) { + setUI(new SynthCheckBoxMenuItemUI() { + @Override + protected void doClick(MenuSelectionManager msm) { + menuItem.doClick(0); + } + }); + } else { + setUI(new BasicCheckBoxMenuItemUI() { + @Override + protected void doClick(MenuSelectionManager msm) { + menuItem.doClick(0); + } + }); + } } }