|
|
|
@ -41,6 +41,7 @@ public class DocTable extends JPanel{
@@ -41,6 +41,7 @@ public class DocTable extends JPanel{
|
|
|
|
|
private JLabel pathLabel; |
|
|
|
|
private JPanel buttons; |
|
|
|
|
private String path; |
|
|
|
|
private JButton joinButton; |
|
|
|
|
|
|
|
|
|
public Row(String path) { |
|
|
|
|
this.path = path; |
|
|
|
@ -58,7 +59,7 @@ public class DocTable extends JPanel{
@@ -58,7 +59,7 @@ public class DocTable extends JPanel{
|
|
|
|
|
folderButton.addActionListener(ev -> openFolder(path)); |
|
|
|
|
buttons.add(folderButton); |
|
|
|
|
|
|
|
|
|
JButton joinButton = new JButton("Zusammenfügen"); |
|
|
|
|
joinButton = new JButton("Zusammenfügen"); |
|
|
|
|
joinButton.addActionListener(ev -> joinDocs(path)); |
|
|
|
|
buttons.add(joinButton); |
|
|
|
|
|
|
|
|
@ -88,6 +89,10 @@ public class DocTable extends JPanel{
@@ -88,6 +89,10 @@ public class DocTable extends JPanel{
|
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void removeJoinButton() { |
|
|
|
|
buttons.remove(joinButton); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private static final long serialVersionUID = 1073955198529023744L; |
|
|
|
@ -121,8 +126,8 @@ public class DocTable extends JPanel{
@@ -121,8 +126,8 @@ public class DocTable extends JPanel{
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void joinDocs(String path) { |
|
|
|
|
|
|
|
|
|
LOG.debug("joinFiles({})",path); |
|
|
|
|
rows.get(path).removeJoinButton(); |
|
|
|
|
File folder = new File(path); |
|
|
|
|
if (!folder.exists()) return; |
|
|
|
|
|
|
|
|
@ -150,6 +155,7 @@ public class DocTable extends JPanel{
@@ -150,6 +155,7 @@ public class DocTable extends JPanel{
|
|
|
|
|
} |
|
|
|
|
for (String page : pdfs) Path.of(path,page).toFile().delete(); |
|
|
|
|
setState(path,"Zusammengefügt."); |
|
|
|
|
preview(path); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void openFolder(String path) { |
|
|
|
|