Skip to content

Commit

Permalink
added remove single pdf from order before sending ePost or export pdfs
Browse files Browse the repository at this point in the history
  • Loading branch information
iradraconis committed Nov 17, 2024
1 parent 8150146 commit 0599306
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,15 @@
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Inhaltsverzeichnis"/>
<Property name="toolTipText" type="java.lang.String" value="Inhaltsverzeichnis wird hinzugef&#xfc;gt"/>
<Property name="actionCommand" type="java.lang.String" value="addToc"/>
<Property name="actionCommand" type="java.lang.String" value=""/>
</Properties>
</Component>
<Component class="javax.swing.JCheckBox" name="addPageNbrsCb">
<Properties>
<Property name="selected" type="boolean" value="true"/>
<Property name="text" type="java.lang.String" value="Seitenzahlen"/>
<Property name="toolTipText" type="java.lang.String" value="Seitenzahlen werden hinzugef&#xfc;gt"/>
<Property name="actionCommand" type="java.lang.String" value="addPageNbrs"/>
<Property name="actionCommand" type="java.lang.String" value=""/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="addPageNbrsCbActionPerformed"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -693,6 +693,19 @@ public ExportAsPdfOrderingStep() {
UserSettings uset = UserSettings.getInstance();
this.addTocCb.setSelected(uset.getSettingAsBoolean(UserSettings.CONF_CASES_EXPORT_TOC, true));
this.addPageNbrsCb.setSelected(uset.getSettingAsBoolean(UserSettings.CONF_CASES_EXPORT_PAGENUMBERS, true));

// ComponentListener für pnlConversionList
this.pnlConversionList.addContainerListener(new java.awt.event.ContainerListener() {
@Override
public void componentRemoved(java.awt.event.ContainerEvent e) {
refreshDisplay();
}

@Override
public void componentAdded(java.awt.event.ContainerEvent e) {
refreshDisplay();
}
});
}

@Override
Expand Down Expand Up @@ -776,12 +789,12 @@ private void initComponents() {
addTocCb.setSelected(true);
addTocCb.setText("Inhaltsverzeichnis");
addTocCb.setToolTipText("Inhaltsverzeichnis wird hinzugefügt");
addTocCb.setActionCommand("addToc");
addTocCb.setActionCommand("");

addPageNbrsCb.setSelected(true);
addPageNbrsCb.setText("Seitenzahlen");
addPageNbrsCb.setToolTipText("Seitenzahlen werden hinzugefügt");
addPageNbrsCb.setActionCommand("addPageNbrs");
addPageNbrsCb.setActionCommand("");
addPageNbrsCb.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
addPageNbrsCbActionPerformed(evt);
Expand Down Expand Up @@ -887,4 +900,21 @@ public void setData(WizardDataContainer data) {
public void setWizardPanel(WizardMainPanel wizard) {

}

private void refreshDisplay() {
long totalSize=0;
long totalPages=0;

for (Component c: this.pnlConversionList.getComponents()) {
if(c instanceof EpostPdfPanel) {
EpostPdfPanel pdfPanel=(EpostPdfPanel)c;
totalSize+=pdfPanel.getFile().length();
totalPages+=pdfPanel.getPageCount();
}
}

this.lblFileSize.setText("" + FileUtils.getFileSizeHumanReadable(totalSize));
this.lblFileSizeMax.setText("Gesamtgröße:");
this.lblPages.setText("" + totalPages);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
<Group type="103" groupAlignment="0" attributes="0">
<Component id="cmdDown" min="-2" max="-2" attributes="0"/>
<Component id="cmdUp" alignment="1" min="-2" max="-2" attributes="0"/>
<Component id="cmdRemove" min="-2" max="-2" attributes="0"/>
</Group>
<EmptySpace type="unrelated" max="-2" attributes="0"/>
<Group type="103" groupAlignment="0" attributes="0">
Expand Down Expand Up @@ -72,6 +73,8 @@
<Component id="cmdUp" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="cmdDown" min="-2" max="-2" attributes="0"/>
<EmptySpace max="-2" attributes="0"/>
<Component id="cmdRemove" min="-2" max="-2" attributes="0"/>
</Group>
</Group>
<EmptySpace min="0" pref="0" max="32767" attributes="0"/>
Expand Down Expand Up @@ -151,5 +154,16 @@
<Property name="text" type="java.lang.String" value="jLabel3"/>
</Properties>
</Component>
<Component class="javax.swing.JButton" name="cmdRemove">
<Properties>
<Property name="icon" type="javax.swing.Icon" editor="org.netbeans.modules.form.editors2.IconEditor">
<Image iconType="3" name="/icons16/material/outline_backspace_black_48dp.png"/>
</Property>
<Property name="toolTipText" type="java.lang.String" value="PDF Datei aus Sortierung entfernen"/>
</Properties>
<Events>
<EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="cmdRemoveActionPerformed"/>
</Events>
</Component>
</SubComponents>
</Form>
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,7 @@ You should also get your employer (if you work as a programmer) or school,
*/
package com.jdimension.jlawyer.client.voip;

import com.jdimension.jlawyer.client.editors.files.ExportAsPdfOrderingStep;
import com.jdimension.jlawyer.client.utils.FileUtils;
import java.awt.Image;
import java.awt.image.BufferedImage;
Expand Down Expand Up @@ -734,6 +735,7 @@ private void initComponents() {
cmdDown = new javax.swing.JButton();
jLabel2 = new javax.swing.JLabel();
lblFileSize = new javax.swing.JLabel();
cmdRemove = new javax.swing.JButton();

lblPdfPicture.setText("PDF");

Expand Down Expand Up @@ -765,6 +767,14 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {

lblFileSize.setText("jLabel3");

cmdRemove.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icons16/material/outline_backspace_black_48dp.png"))); // NOI18N
cmdRemove.setToolTipText("PDF Datei aus Sortierung entfernen");
cmdRemove.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
cmdRemoveActionPerformed(evt);
}
});

javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
this.setLayout(layout);
layout.setHorizontalGroup(
Expand All @@ -775,7 +785,8 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(cmdDown)
.addComponent(cmdUp, javax.swing.GroupLayout.Alignment.TRAILING))
.addComponent(cmdUp, javax.swing.GroupLayout.Alignment.TRAILING)
.addComponent(cmdRemove))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(lblFileName, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
Expand Down Expand Up @@ -813,7 +824,9 @@ public void actionPerformed(java.awt.event.ActionEvent evt) {
.addGroup(layout.createSequentialGroup()
.addComponent(cmdUp)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cmdDown)))
.addComponent(cmdDown)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(cmdRemove)))
.addGap(0, 0, Short.MAX_VALUE)))
.addContainerGap())
);
Expand All @@ -834,10 +847,26 @@ private void cmdDownActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST
this.getParent().doLayout();
}
}//GEN-LAST:event_cmdDownActionPerformed



private void cmdRemoveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cmdRemoveActionPerformed
int response = javax.swing.JOptionPane.showConfirmDialog(this,
"Diese PDF wirklich aus der Liste entfernen?",
"PDF entfernen",
javax.swing.JOptionPane.YES_NO_OPTION);
if(response == javax.swing.JOptionPane.YES_OPTION) {
javax.swing.JPanel parent = (javax.swing.JPanel)this.getParent();
parent.remove(this);
parent.revalidate();
parent.repaint();
}
}//GEN-LAST:event_cmdRemoveActionPerformed


// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JButton cmdDown;
private javax.swing.JButton cmdRemove;
private javax.swing.JButton cmdUp;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
Expand Down

0 comments on commit 0599306

Please sign in to comment.