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 030ba1ed2ce484c4d50dae111148036c35ec7461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Guillaume=20T=C3=A2che?= Date: Thu, 15 Oct 2020 14:35:30 +0200 Subject: [PATCH 2/2] GH-152 Adds origin/location to InformationPanel --- .../ri/common/properties/InformationPanel.java | 16 +++++++++++++++- .../icepdf/ri/resources/MessageBundle.properties | 1 + 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/properties/InformationPanel.java b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/properties/InformationPanel.java index 18aef1668..3449bc807 100644 --- a/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/properties/InformationPanel.java +++ b/viewer/viewer-awt/src/main/java/org/icepdf/ri/common/properties/InformationPanel.java @@ -45,6 +45,7 @@ public InformationPanel(Document document, String producer = ""; String creationDate = ""; String modDate = ""; + final String path; // get duplicate names from message bundle String notAvailable = @@ -66,7 +67,17 @@ public InformationPanel(Document document, modDate = documentInfo.getModDate() != null ? documentInfo.getModDate().toString() : notAvailable; } - + final String origin = document.getDocumentOrigin(); + if (origin == null || origin.isEmpty()) { + final String location = document.getDocumentLocation(); + if (location == null || location.isEmpty()) { + path = ""; + } else { + path = location; + } + } else { + path = origin; + } setLayout(new GridBagLayout()); setAlignmentY(JPanel.TOP_ALIGNMENT); @@ -110,6 +121,8 @@ public InformationPanel(Document document, addGB(layoutPanel, new JLabel( messageBundle.getString("viewer.dialog.documentInformation.modified.label")), 0, 7, 1, 1); + addGB(layoutPanel, new JLabel(messageBundle.getString("viewer.dialog.documentInformation.path.label")), + 0, 8, 1, 1); // add values constraints.anchor = GridBagConstraints.NORTHWEST; @@ -121,6 +134,7 @@ public InformationPanel(Document document, addGB(layoutPanel, new JLabel(producer), 1, 5, 1, 1); addGB(layoutPanel, new JLabel(creationDate), 1, 6, 1, 1); addGB(layoutPanel, new JLabel(modDate), 1, 7, 1, 1); + addGB(layoutPanel, new JLabel(path), 1, 8, 1, 1); constraints.anchor = GridBagConstraints.NORTH; constraints.fill = GridBagConstraints.HORIZONTAL; constraints.insets = new Insets(5, 5, 5, 5); diff --git a/viewer/viewer-awt/src/main/resources/org/icepdf/ri/resources/MessageBundle.properties b/viewer/viewer-awt/src/main/resources/org/icepdf/ri/resources/MessageBundle.properties index 5c2870ea7..a79336617 100644 --- a/viewer/viewer-awt/src/main/resources/org/icepdf/ri/resources/MessageBundle.properties +++ b/viewer/viewer-awt/src/main/resources/org/icepdf/ri/resources/MessageBundle.properties @@ -452,6 +452,7 @@ viewer.dialog.documentInformation.creator.label=Creator: viewer.dialog.documentInformation.producer.label=Producer: viewer.dialog.documentInformation.created.label=Created: viewer.dialog.documentInformation.modified.label=Modified: +viewer.dialog.documentInformation.path.label=Path: viewer.dialog.documentInformation.notAvailable=Not Available ## Go to Page Dialog viewer.dialog.goToPage.title=Go to Page...