Skip to content

Commit d2b5521

Browse files
committed
Improve cli and gui separation
1 parent f1b7172 commit d2b5521

File tree

6 files changed

+9
-15
lines changed

6 files changed

+9
-15
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Call Maven install:
113113

114114
You can test your build by running the greenfield GUI application from the `gui` sub-module.
115115

116-
java -jar greenfield-apps/target/gui-${project.version}.jar
116+
java -jar gui/target/gui-${project.version}.jar
117117

118118
Where `${project.version}` is the current Maven project version. This should bring up the veraPDF GUI main window if the build was successful.
119119

apps/src/main/java/org/verapdf/apps/AppsConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
public class AppsConstants {
44

5+
// File extensions
56
public static final String PDF = "pdf"; //$NON-NLS-1$
67
public static final String ZIP = "zip"; //$NON-NLS-1$
78

apps/src/main/java/org/verapdf/apps/SoftwareUpdaterImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252

5353
public class SoftwareUpdaterImpl implements SoftwareUpdater {
5454
private static final Logger logger = Logger.getLogger(SoftwareUpdaterImpl.class.getCanonicalName());
55-
private static final String latestGF = "https://search.maven.org/solrsearch/select?q=g:org.verapdf.apps+AND+a:greenfield-apps&core=gav&rows=1&wt=xml";
55+
private static final String latestGF = "https://search.maven.org/solrsearch/select?q=g:org.verapdf.apps+AND+a:gui&core=gav&rows=1&wt=xml";
5656
private final String currentVersion = Applications.getAppDetails().getVersion();
5757

5858
/**

cli/pom.xml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,6 @@
111111
<version>${project.version}</version>
112112
</dependency>
113113

114-
<dependency>
115-
<groupId>org.verapdf</groupId>
116-
<artifactId>core</artifactId>
117-
<version>${verapdf.library.version}</version>
118-
</dependency>
119-
120114
<dependency>
121115
<groupId>com.beust</groupId>
122116
<artifactId>jcommander</artifactId>

gui/src/main/java/org/verapdf/gui/CheckerPanel.java

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
package org.verapdf.gui;
2222

2323
import org.verapdf.apps.Applications;
24+
import org.verapdf.apps.AppsConstants;
2425
import org.verapdf.apps.utils.ApplicationUtils;
2526
import org.verapdf.core.utils.FileUtils;
2627
import org.verapdf.gui.utils.*;
@@ -115,7 +116,7 @@ class CheckerPanel extends JPanel {
115116

116117
this.initGui();
117118

118-
this.pdfChooser = getChooser(true, GUIConstants.PDF, GUIConstants.ZIP);
119+
this.pdfChooser = getChooser(true, AppsConstants.PDF, AppsConstants.ZIP);
119120
this.pdfChooser.setMultiSelectionEnabled(true);
120121
this.pdfChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES);
121122
this.xmlChooser = getChooser(false, GUIConstants.XML);
@@ -266,7 +267,7 @@ private void setupChosenPDFField(final GridBagLayout gbl, final GridBagConstrain
266267
this.add(this.chosenPDF);
267268

268269
PanelDropTargetListener dtdPDFListener = new PanelDropTargetListener(-1,
269-
GUIConstants.PDF, GUIConstants.ZIP);
270+
AppsConstants.PDF, AppsConstants.ZIP);
270271
targetPDF = new DropTarget(this.chosenPDF, DnDConstants.ACTION_COPY_OR_MOVE,
271272
dtdPDFListener, true, null);
272273
}
@@ -284,7 +285,7 @@ private void setupChoosePDFButton(final GridBagLayout gbl, final GridBagConstrai
284285
choosePDF.addActionListener(new ActionListener() {
285286
@Override
286287
public void actionPerformed(final ActionEvent e) {
287-
CheckerPanel.this.chooseFile(CheckerPanel.this.pdfChooser, new String[] { GUIConstants.PDF });
288+
CheckerPanel.this.chooseFile(CheckerPanel.this.pdfChooser, new String[] { AppsConstants.PDF });
288289
}
289290
});
290291
}
@@ -782,7 +783,7 @@ public void insertFilesInfo(List<File> selectedFiles, String[] extensions){
782783
this.viewHTML.setEnabled(false);
783784

784785
switch (extensions[0]) {
785-
case GUIConstants.PDF:
786+
case AppsConstants.PDF:
786787
this.pdfsToProcess = ApplicationUtils.filterPdfFiles(selectedFiles, true, true);
787788
this.chosenPDF.setText(getSelectedPathsMessage(selectedFiles));
788789
break;
@@ -889,7 +890,7 @@ VeraAppConfig appConfigFromState() {
889890
ProcessType selectedItem = (ProcessType) this.processTypes.getSelectedItem();
890891
if (isFixMetadata() && config.getApplicationConfig().getFixesFolder().isEmpty() && this.pdfsToProcess != null) {
891892
for (File pdf : pdfsToProcess) {
892-
if (FileUtils.hasExtNoCase(pdf.getName(), GUIConstants.ZIP)) {
893+
if (FileUtils.hasExtNoCase(pdf.getName(), AppsConstants.ZIP)) {
893894
logger.log(Level.WARNING, "Fixing metadata are not supported for zip processing, if save folder isn't defined");
894895
this.fixMetadata.setSelected(false);
895896
break;

gui/src/main/java/org/verapdf/gui/utils/GUIConstants.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ public final class GUIConstants {
4646
public static final String DOCS_POLICY_LINK_URL = DOCS_LINK_URL + "/policy";
4747

4848
// File extensions
49-
public static final String PDF = "pdf"; //$NON-NLS-1$
50-
public static final String ZIP = "zip"; //$NON-NLS-1$
5149
public static final String XML = "xml"; //$NON-NLS-1$
5250
public static final String HTML = "html"; //$NON-NLS-1$
5351
public static final String SCH = "sch"; //$NON-NLS-1$

0 commit comments

Comments
 (0)