Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show origin info #153

Merged
merged 12 commits into from
Mar 25, 2021
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand All @@ -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);

Expand Down Expand Up @@ -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;
Expand All @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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...
Expand Down