-
-
Notifications
You must be signed in to change notification settings - Fork 344
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
close #555: Added a default output PDF version setting
- Loading branch information
Showing
16 changed files
with
243 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
47 changes: 47 additions & 0 deletions
47
pdfsam-model/src/main/java/org/pdfsam/model/ui/DefaultPdfVersionComboItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package org.pdfsam.model.ui; | ||
/* | ||
* This file is part of the PDF Split And Merge source code | ||
* Created on 17/10/23 | ||
* Copyright 2023 by Sober Lemur S.r.l. ([email protected]). | ||
* | ||
* This program is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as | ||
* published by the Free Software Foundation, either version 3 of the | ||
* License, or (at your option) any later version. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import org.sejda.model.pdf.PdfVersion; | ||
|
||
import static org.pdfsam.i18n.I18nContext.i18n; | ||
import static org.sejda.commons.util.RequireUtils.requireNotNullArg; | ||
|
||
/** | ||
* Default implementation for a combo item representing a {@link PdfVersion} | ||
* | ||
* @author Andrea Vacondio | ||
*/ | ||
public class DefaultPdfVersionComboItem extends ComboItem<PdfVersion> implements PdfVersionComboItem { | ||
|
||
public DefaultPdfVersionComboItem(PdfVersion version) { | ||
super(version, i18n().tr("Version {0}", version.getVersionString())); | ||
requireNotNullArg(version, "PDF version cannot be null"); | ||
} | ||
|
||
@Override | ||
public PdfVersion getVersion() { | ||
return this.key(); | ||
} | ||
|
||
@Override | ||
public boolean isHigherOrEqual(PdfVersion version) { | ||
return this.key().getVersion() >= version.getVersion(); | ||
} | ||
} |
Oops, something went wrong.