|
|
|
@ -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); |
|
|
|
|
|
|
|
|
@ -87,6 +88,10 @@ public class DocTable extends JPanel{
@@ -87,6 +88,10 @@ public class DocTable extends JPanel{
|
|
|
|
|
this.status.setText(status); |
|
|
|
|
return this; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void removeJoinButton() { |
|
|
|
|
buttons.remove(joinButton); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -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; |
|
|
|
|
|
|
|
|
@ -149,7 +154,8 @@ public class DocTable extends JPanel{
@@ -149,7 +154,8 @@ public class DocTable extends JPanel{
|
|
|
|
|
LOG.error("{} terminated: ",builder,e); |
|
|
|
|
} |
|
|
|
|
for (String page : pdfs) Path.of(path,page).toFile().delete(); |
|
|
|
|
setState(path,"Zusammengefügt."); |
|
|
|
|
setState(path,"Zusammengefügt."); |
|
|
|
|
preview(path); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public void openFolder(String path) { |
|
|
|
|