Faxtomail-commits
Threads by month
- ----- 2026 -----
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
September 2014
- 2 participants
- 59 discussions
30 Sep '14
Author: kmorin
Date: 2014-09-30 19:12:03 +0200 (Tue, 30 Sep 2014)
New Revision: 656
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/656
Log:
- highlighter : ligne en erreur prioritaire sur les lignes oranges
- ne pas fermer les combo avec checkbox dans la recherche quand on s?\195?\169lectionne un ?\195?\169l?\195?\169ment dedans
- recherche : entr?\195?\169e pour soumettre
Modified:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SearchAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SearchToGroupAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java 2014-09-30 15:09:55 UTC (rev 655)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailTopiaDao.java 2014-09-30 17:12:03 UTC (rev 656)
@@ -464,6 +464,14 @@
Hibernate.initialize(history.getFields());
}
}
+ EmailGroup emailGroup = email.getEmailGroup();
+ if (emailGroup != null) {
+ Hibernate.initialize(emailGroup.getEmail());
+ // initialize folder of the grouped demand to transmit the grouped emails of the same folder
+ for (Email groupedEmail : emailGroup.getEmail()) {
+ Hibernate.initialize(groupedEmail.getMailFolder());
+ }
+ }
}
return result;
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SearchAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SearchAction.java 2014-09-30 15:09:55 UTC (rev 655)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SearchAction.java 2014-09-30 17:12:03 UTC (rev 656)
@@ -77,7 +77,7 @@
for (Email email : emails) {
DemandeUIModel demand = new DemandeUIModel();
- demand.fromEntityExcluding(email, Sets.newHashSet(Email.PROPERTY_MAIL_FOLDER, Email.PROPERTY_EMAIL_GROUP, Email.PROPERTY_HISTORY));
+ demand.fromEntityExcluding(email, Sets.newHashSet(Email.PROPERTY_MAIL_FOLDER, Email.PROPERTY_HISTORY));
// on ajoute toutes les lignes de rangeRow,
// qui sont toutes valides puisqu'on les récupère de la base et qu'on ne sauvegarde que les lignes valides
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SearchToGroupAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SearchToGroupAction.java 2014-09-30 15:09:55 UTC (rev 655)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/SearchToGroupAction.java 2014-09-30 17:12:03 UTC (rev 656)
@@ -76,7 +76,7 @@
for (Email email : emails) {
DemandeUIModel demand = new DemandeUIModel();
- demand.fromEntityExcluding(email, Sets.newHashSet(Email.PROPERTY_MAIL_FOLDER, Email.PROPERTY_EMAIL_GROUP, Email.PROPERTY_HISTORY));
+ demand.fromEntityExcluding(email, Sets.newHashSet(Email.PROPERTY_MAIL_FOLDER, Email.PROPERTY_HISTORY));
// on ajoute toutes les lignes de rangeRow,
// qui sont toutes valides puisqu'on les récupère de la base et qu'on ne sauvegarde que les lignes valides
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-09-30 15:09:55 UTC (rev 655)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-09-30 17:12:03 UTC (rev 656)
@@ -397,8 +397,6 @@
@Override
public void initDemandeTable(final JXTable table, boolean sortable) {
- super.initDemandeTable(table, sortable);
-
HighlightPredicate reportNotTakenPredicate = new HighlightPredicate() {
@Override
public boolean isHighlighted(Component renderer, ComponentAdapter adapter) {
@@ -418,6 +416,8 @@
};
Color color = Color.ORANGE;
table.addHighlighter(new ColorHighlighter(reportNotTakenPredicate, color, Color.WHITE, color.darker(), Color.WHITE));
+
+ super.initDemandeTable(table, sortable);
}
@Override
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUI.css 2014-09-30 15:09:55 UTC (rev 655)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/reply/ReplyFormUI.css 2014-09-30 17:12:03 UTC (rev 656)
@@ -76,7 +76,7 @@
}
#splitPane {
- dividerLocation: 300;
+ dividerLocation: 270;
}
#message {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.css 2014-09-30 15:09:55 UTC (rev 655)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUI.css 2014-09-30 17:12:03 UTC (rev 656)
@@ -276,7 +276,7 @@
#searchButton {
text: "faxtomail.search.button.label";
- /* _applicationAction: { com.franciaflex.faxtomail.ui.swing.actions.SearchToGroupAction.class };*/
+ i18nMnemonic: "faxtomail.search.button.mnemonic";
}
#dataTable {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java 2014-09-30 15:09:55 UTC (rev 655)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchToGroupUIHandler.java 2014-09-30 17:12:03 UTC (rev 656)
@@ -28,8 +28,11 @@
import java.awt.Color;
import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
+import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
@@ -41,17 +44,18 @@
import java.util.Date;
import java.util.List;
-import javax.swing.JComponent;
-import javax.swing.ListSelectionModel;
-import javax.swing.SwingUtilities;
+import javax.swing.*;
import javax.swing.event.ListSelectionEvent;
import javax.swing.event.ListSelectionListener;
+import com.franciaflex.faxtomail.persistence.entities.HasLabel;
import com.franciaflex.faxtomail.persistence.entities.SearchFilter;
+import jaxx.runtime.swing.editor.bean.BeanFilterableComboBox;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jdesktop.swingx.JXDatePicker;
import org.jdesktop.swingx.JXTable;
import org.jdesktop.swingx.decorator.ColorHighlighter;
import org.jdesktop.swingx.decorator.ComponentAdapter;
@@ -229,6 +233,44 @@
getContext().getSwingSession().add(ui, true);
}
+
+ @Override
+ protected void initTextField(JTextField jTextField) {
+ super.initTextField(jTextField);
+ jTextField.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ searchDemandes();
+ }
+ });
+ }
+
+ @Override
+ protected <HL extends HasLabel> void initCheckBoxComboBox(JComboBox<HL> comboBox, List<HL> values, List<HL> selection, String property, boolean addNull) {
+ super.initCheckBoxComboBox(comboBox, values, selection, property, addNull);
+ comboBox.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent e) {
+ if (e.getKeyCode() == KeyEvent.VK_ENTER) {
+ searchDemandes();
+ }
+ }
+ });
+ }
+
+ @Override
+ protected void initDatePicker(JXDatePicker picker) {
+ super.initDatePicker(picker);
+ picker.getEditor().addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent e) {
+ if (e.getKeyCode() == KeyEvent.VK_ENTER) {
+ searchDemandes();
+ }
+ }
+ });
+ }
+
public void searchDemandes() {
getModel().resetPaginationParameter();
runSearchAction();
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.css 2014-09-30 15:09:55 UTC (rev 655)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.css 2014-09-30 17:12:03 UTC (rev 656)
@@ -289,6 +289,7 @@
#searchButton {
text: "faxtomail.search.button.label";
+ i18nMnemonic: "faxtomail.search.button.mnemonic";
}
#dataTable {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-09-30 15:09:55 UTC (rev 655)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-09-30 17:12:03 UTC (rev 656)
@@ -24,8 +24,12 @@
import static org.nuiton.i18n.I18n.t;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
+import java.awt.event.KeyAdapter;
+import java.awt.event.KeyEvent;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.util.Arrays;
@@ -33,15 +37,17 @@
import java.util.Date;
import java.util.List;
-import javax.swing.JComponent;
-import javax.swing.ListSelectionModel;
+import javax.swing.*;
+import com.franciaflex.faxtomail.persistence.entities.HasLabel;
import com.franciaflex.faxtomail.persistence.entities.SearchFilter;
import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext;
+import jaxx.runtime.swing.editor.bean.BeanFilterableComboBox;
import jaxx.runtime.validator.swing.SwingValidator;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.jdesktop.swingx.JXDatePicker;
import org.jdesktop.swingx.JXTable;
import org.nuiton.jaxx.application.swing.action.ApplicationActionEngine;
import org.nuiton.jaxx.application.swing.table.AbstractApplicationTableModel;
@@ -190,7 +196,43 @@
});
}
+ @Override
+ protected void initTextField(JTextField jTextField) {
+ super.initTextField(jTextField);
+ jTextField.addActionListener(new ActionListener() {
+ @Override
+ public void actionPerformed(ActionEvent e) {
+ searchDemandes();
+ }
+ });
+ }
+ @Override
+ protected <HL extends HasLabel> void initCheckBoxComboBox(JComboBox<HL> comboBox, List<HL> values, List<HL> selection, String property, boolean addNull) {
+ super.initCheckBoxComboBox(comboBox, values, selection, property, addNull);
+ comboBox.addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent e) {
+ if (e.getKeyCode() == KeyEvent.VK_ENTER) {
+ searchDemandes();
+ }
+ }
+ });
+ }
+
+ @Override
+ protected void initDatePicker(JXDatePicker picker) {
+ super.initDatePicker(picker);
+ picker.getEditor().addKeyListener(new KeyAdapter() {
+ @Override
+ public void keyReleased(KeyEvent e) {
+ if (e.getKeyCode() == KeyEvent.VK_ENTER) {
+ searchDemandes();
+ }
+ }
+ });
+ }
+
protected void onDoubleClickOnDemande(DemandeUIModel selectedEmail) {
getContext().setCurrentPaginationParameter(getModel().getPaginationParameter());
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-09-30 15:09:55 UTC (rev 655)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-09-30 17:12:03 UTC (rev 656)
@@ -28,6 +28,7 @@
import java.awt.Container;
import java.awt.Dimension;
import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.awt.event.KeyEvent;
@@ -42,15 +43,7 @@
import java.util.List;
import java.util.Set;
-import javax.swing.AbstractAction;
-import javax.swing.ComboBoxModel;
-import javax.swing.JComboBox;
-import javax.swing.JComponent;
-import javax.swing.JFrame;
-import javax.swing.JOptionPane;
-import javax.swing.JRootPane;
-import javax.swing.KeyStroke;
-import javax.swing.WindowConstants;
+import javax.swing.*;
import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
import javax.swing.table.TableColumnModel;
@@ -438,7 +431,12 @@
comboBox.addItemListener(new ItemListener() {
@Override
public void itemStateChanged(ItemEvent e) {
- comboBox.showPopup();
+ //reopen the combo
+ SwingUtilities.invokeLater(new Runnable() {
+ public void run() {
+ comboBox.showPopup();
+ }
+ });
if (e.getStateChange() == ItemEvent.SELECTED) {
BeanUIUtil.invokeMethod(mutator,
Modified: trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties
===================================================================
--- trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-09-30 15:09:55 UTC (rev 655)
+++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-09-30 17:12:03 UTC (rev 656)
@@ -221,7 +221,7 @@
faxtomail.main.action.exit=Quitter
faxtomail.main.action.exit.tip=Quitter l'application
faxtomail.main.action.recherche=Recherche
-faxtomail.main.action.recherche.tip=Recherche de demandes archivées
+faxtomail.main.action.recherche.tip=Recherche parmi tous les éléments
faxtomail.main.title.application=FaxToMail
faxtomail.main.title.applicationName=FaxToMail
faxtomail.pdfEditor.action.cancel=Annuler
@@ -284,6 +284,7 @@
faxtomail.search.archivedBetween.label=Archivé entre le
faxtomail.search.between2ndPart.label=et le
faxtomail.search.button.label=Rechercher
+faxtomail.search.button.mnemonic=R
faxtomail.search.hideAdvancedSearch.label=Cacher la recherche avancée
faxtomail.search.modifiedBetween.label=Modifié entre le
faxtomail.search.modifiedBy.label=Modifié par
1
0
r655 - in trunk: . faxtomail-service/src/main/resources/pdf faxtomail-ui-swing faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util
by kmorin@users.forge.codelutin.com 30 Sep '14
by kmorin@users.forge.codelutin.com 30 Sep '14
30 Sep '14
Author: kmorin
Date: 2014-09-30 17:09:55 +0200 (Tue, 30 Sep 2014)
New Revision: 655
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/655
Log:
impression avec pdfbox
Modified:
trunk/faxtomail-service/src/main/resources/pdf/demande.mustache
trunk/faxtomail-ui-swing/pom.xml
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java
trunk/pom.xml
Modified: trunk/faxtomail-service/src/main/resources/pdf/demande.mustache
===================================================================
--- trunk/faxtomail-service/src/main/resources/pdf/demande.mustache 2014-09-30 12:22:29 UTC (rev 654)
+++ trunk/faxtomail-service/src/main/resources/pdf/demande.mustache 2014-09-30 15:09:55 UTC (rev 655)
@@ -1,6 +1,9 @@
<html>
<head>
<style>
+ body {
+ font-family: "Trebuchet MS", Helvetica, sans-serif;
+ }
.title {
text-align:center;
}
Modified: trunk/faxtomail-ui-swing/pom.xml
===================================================================
--- trunk/faxtomail-ui-swing/pom.xml 2014-09-30 12:22:29 UTC (rev 654)
+++ trunk/faxtomail-ui-swing/pom.xml 2014-09-30 15:09:55 UTC (rev 655)
@@ -221,11 +221,6 @@
</dependency>
<dependency>
- <groupId>org.swinglabs</groupId>
- <artifactId>pdf-renderer</artifactId>
- </dependency>
-
- <dependency>
<groupId>org.apache.pdfbox</groupId>
<artifactId>pdfbox</artifactId>
</dependency>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUI.css 2014-09-30 12:22:29 UTC (rev 654)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUI.css 2014-09-30 15:09:55 UTC (rev 655)
@@ -59,14 +59,14 @@
#prevPageButton {
actionIcon: left;
- enabled: { getModel().getCurrentPageIndex() > 1 };
+ enabled: { getModel().getCurrentPageIndex() > 0 };
toolTipText: "faxtomail.pdfEditor.button.previousPage";
}
#pageNumber {
bean: { model };
property: "currentPageIndex";
- modelText: { String.valueOf(model.getCurrentPageIndex()) };
+ modelText: { String.valueOf(model.getCurrentPageIndex() + 1) };
useFloat: false;
useSign: false;
autoPopup: false;
@@ -81,7 +81,7 @@
#nextPageButton {
actionIcon: right;
- enabled: { getModel().getCurrentPageIndex() < getModel().getPages().length };
+ enabled: { getModel().getCurrentPageIndex() < getModel().getPages().length - 1 };
toolTipText: "faxtomail.pdfEditor.button.nextPage";
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIHandler.java 2014-09-30 12:22:29 UTC (rev 654)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIHandler.java 2014-09-30 15:09:55 UTC (rev 655)
@@ -26,16 +26,12 @@
import static org.nuiton.i18n.I18n.t;
-import java.awt.Component;
-import java.awt.Cursor;
-import java.awt.Dimension;
-import java.awt.Image;
-import java.awt.Insets;
-import java.awt.Rectangle;
+import java.awt.*;
import java.awt.event.ContainerEvent;
import java.awt.event.ContainerListener;
import java.awt.event.MouseEvent;
import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
import java.awt.image.RenderedImage;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
@@ -65,6 +61,10 @@
import org.apache.commons.io.IOUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.pdfbox.io.RandomAccess;
+import org.apache.pdfbox.pdmodel.PDDocument;
+import org.apache.pdfbox.pdmodel.PDPage;
+import org.apache.pdfbox.pdmodel.common.PDRectangle;
import org.nuiton.jaxx.application.swing.util.Cancelable;
import org.nuiton.jaxx.application.swing.util.CloseableUI;
@@ -79,8 +79,6 @@
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil;
import com.franciaflex.faxtomail.ui.swing.util.JImagePanel;
import com.itextpdf.text.DocumentException;
-import com.sun.pdfview.PDFFile;
-import com.sun.pdfview.PDFPage;
/**
* @author Kevin Morin (Code Lutin)
@@ -93,7 +91,7 @@
protected ComponentMover cm = new ComponentMover();
protected ComponentResizer cr = new ComponentResizer();
- protected PDFFile pdf;
+ protected PDDocument pdf;
@Override
public void afterInit(PDFEditorUI pdfEditorUI) {
@@ -194,27 +192,21 @@
}
}
if (FaxToMailUIUtil.isFileAPDF(attachmentFile)) {
- RandomAccessFile raf = null;
try {
- raf = new RandomAccessFile(file, "r");
- FileChannel channel = raf.getChannel();
- ByteBuffer buf = channel.map(FileChannel.MapMode.READ_ONLY, 0, channel.size());
- pdf = new PDFFile(buf);
+ pdf = PDDocument.load(file);
- model.setPageNumber(pdf.getNumPages());
- model.setCurrentPageIndex(1);
- raf.close();
+ model.setPageNumber(pdf.getNumberOfPages());
+ model.setCurrentPageIndex(0);
+
} catch (IOException e) {
if (log.isErrorEnabled()) {
log.error("", e);
}
getContext().getErrorHelper().showErrorDialog(t("faxtomail.pdfEditor.readPdf.error"));
- } finally {
- IOUtils.closeQuietly(raf);
}
}
getUI().setCursor(Cursor.getDefaultCursor());
- model.firePropertyChanged(PDFEditorUIModel.PROPERTY_CURRENT_PAGE_INDEX, null, 1);
+ model.firePropertyChanged(PDFEditorUIModel.PROPERTY_CURRENT_PAGE_INDEX, null, 0);
}
}
}
@@ -359,9 +351,10 @@
}
protected void displayPage(int pageNb, float previousZoom, int previousRotation) {
- PDFPage page = pdf.getPage(pageNb);
+ List<PDPage> pages = pdf.getDocumentCatalog().getAllPages();
+ PDPage page = pages.get(pageNb);
// create the image
- Rectangle2D bBox = page.getBBox();
+ PDRectangle bBox = page.findCropBox();
Rectangle rect = new Rectangle(0, 0, (int) bBox.getWidth(),
(int) bBox.getHeight());
@@ -370,157 +363,165 @@
int width = (int) (zoom * rect.width);
int height = (int) (zoom * rect.height);
- Image image = page.getImage(width, height, // width & height
- rect, // clip rect
- null, // null for the ImageObserver
- true, // fill background with white
- true // block until drawing is done
- );
+ try {
+ Image image = page.convertToImage(BufferedImage.TYPE_INT_RGB, 72);
+ // page.getImage(width, height, // width & height
+ // rect, // clip rect
+ // null, // null for the ImageObserver
+ // true, // fill background with white
+ // true // block until drawing is done
+ // );
- JPanel container = getUI().getContainer();
- Dimension containerSize = new Dimension(rotation % 180 == 0 ? width : height,
- rotation % 180 == 0 ? height : width);
- container.setPreferredSize(containerSize);
- container.setMinimumSize(containerSize);
- container.setMaximumSize(containerSize);
- container.setSize(containerSize);
+ JPanel container = getUI().getContainer();
+ Dimension containerSize = new Dimension(rotation % 180 == 0 ? width : height,
+ rotation % 180 == 0 ? height : width);
+ container.setPreferredSize(containerSize);
+ container.setMinimumSize(containerSize);
+ container.setMaximumSize(containerSize);
+ container.setSize(containerSize);
- JImagePanel documentPanel = ui.getDocumentPanel();
- documentPanel.setRotation(rotation);
- documentPanel.setImage(image);
+ JImagePanel documentPanel = ui.getDocumentPanel();
+ documentPanel.setRotation(rotation);
+ documentPanel.setImage(image);
- Insets insets = container.getInsets();
- rect = container.getBounds();
+ Insets insets = container.getInsets();
+ rect = container.getBounds();
- float zoomRatio = zoom / previousZoom;
- int rotationDiff = rotation - previousRotation;
+ float zoomRatio = zoom / previousZoom;
+ int rotationDiff = rotation - previousRotation;
- PDFEditorUIModel.Page p = getModel().getPage(pageNb);
+ PDFEditorUIModel.Page p = getModel().getPage(pageNb);
- for (PDFEditorNoteUI panel : p.getNotes()) {
- panel.setVisible(true);
+ for (PDFEditorNoteUI panel : p.getNotes()) {
+ panel.setVisible(true);
- panel.setZoom(zoom);
- Rectangle bounds = panel.getBounds();
- int x, y;
+ panel.setZoom(zoom);
+ Rectangle bounds = panel.getBounds();
+ int x, y;
- if (rotationDiff == 0) {
- x = bounds.x;
- y = bounds.y;
+ if (rotationDiff == 0) {
+ x = bounds.x;
+ y = bounds.y;
- } else if (rotationDiff == 90 || rotationDiff == -270) {
- x = rect.width - bounds.height / 2 - bounds.width / 2 - bounds.y;
- y = bounds.x + bounds.width / 2 - bounds.height / 2;
+ } else if (rotationDiff == 90 || rotationDiff == -270) {
+ x = rect.width - bounds.height / 2 - bounds.width / 2 - bounds.y;
+ y = bounds.x + bounds.width / 2 - bounds.height / 2;
- } else {
- x = bounds.y + bounds.height / 2 - bounds.width / 2;
- y = rect.height - bounds.height / 2 - bounds.width / 2 - bounds.x;
+ } else {
+ x = bounds.y + bounds.height / 2 - bounds.width / 2;
+ y = rect.height - bounds.height / 2 - bounds.width / 2 - bounds.x;
+ }
+
+ panel.setBounds((int) (zoomRatio * x) + insets.left,
+ (int) (zoomRatio * y) + insets.top,
+ (int) (zoomRatio * bounds.width), (int) (zoomRatio * bounds.height));
+
}
- panel.setBounds((int)(zoomRatio * x) + insets.left,
- (int)(zoomRatio * y) + insets.top,
- (int)(zoomRatio * bounds.width), (int)(zoomRatio * bounds.height));
+ boolean orientation180 = Math.abs(rotationDiff) % 180 == 0;
- }
+ for (PDFEditorCrossUI panel : p.getCrosses()) {
+ panel.setVisible(true);
- boolean orientation180 = Math.abs(rotationDiff) % 180 == 0;
+ Rectangle bounds = panel.getBounds();
- for (PDFEditorCrossUI panel : p.getCrosses()) {
- panel.setVisible(true);
+ int newWidth = orientation180 ? bounds.width : bounds.height;
+ int newHeight = orientation180 ? bounds.height : bounds.width;
- Rectangle bounds = panel.getBounds();
+ int x, y;
- int newWidth = orientation180 ? bounds.width : bounds.height;
- int newHeight = orientation180 ? bounds.height : bounds.width;
+ if (rotationDiff == 0) {
+ x = bounds.x;
+ y = bounds.y;
- int x, y;
+ } else if (rotationDiff == 90 || rotationDiff == -270) {
+ x = rect.width - newWidth - bounds.y;
+ y = bounds.x;
- if (rotationDiff == 0) {
- x = bounds.x;
- y = bounds.y;
+ } else {
+ x = bounds.y;
+ y = rect.height - newHeight - bounds.x;
+ }
- } else if (rotationDiff == 90 || rotationDiff == -270) {
- x = rect.width - newWidth - bounds.y;
- y = bounds.x;
+ panel.setBounds((int) (zoomRatio * x) + insets.left,
+ (int) (zoomRatio * y) + insets.top,
+ (int) (zoomRatio * newWidth), (int) (zoomRatio * newHeight));
- } else {
- x = bounds.y;
- y = rect.height - newHeight - bounds.x;
}
- panel.setBounds((int) (zoomRatio * x) + insets.left,
- (int) (zoomRatio * y) + insets.top,
- (int) (zoomRatio * newWidth), (int) (zoomRatio * newHeight));
+ List<PDFEditorLineUI> lines = p.getLines();
+ cr.deregisterComponent(lines.toArray(new PDFEditorLineUI[lines.size()]));
- }
+ for (PDFEditorLineUI panel : lines) {
+ panel.setVisible(true);
- List<PDFEditorLineUI> lines = p.getLines();
- cr.deregisterComponent(lines.toArray(new PDFEditorLineUI[lines.size()]));
+ Rectangle bounds = panel.getBounds();
- for (PDFEditorLineUI panel : lines) {
- panel.setVisible(true);
+ boolean horizontal = panel.isHorizontal();
+ panel.setHorizontal(orientation180 ? horizontal : !horizontal);
- Rectangle bounds = panel.getBounds();
+ int newWidth = orientation180 ? bounds.width : bounds.height;
+ int newHeight = orientation180 ? bounds.height : bounds.width;
- boolean horizontal = panel.isHorizontal();
- panel.setHorizontal(orientation180 ? horizontal : ! horizontal);
+ int x, y;
- int newWidth = orientation180 ? bounds.width : bounds.height;
- int newHeight = orientation180 ? bounds.height : bounds.width;
+ if (rotationDiff == 0) {
+ x = bounds.x;
+ y = bounds.y;
- int x, y;
+ } else if (rotationDiff == 90 || rotationDiff == -270) {
+ x = rect.width - newWidth - bounds.y;
+ y = bounds.x;
- if (rotationDiff == 0) {
- x = bounds.x;
- y = bounds.y;
+ } else {
+ x = bounds.y;
+ y = rect.height - newHeight - bounds.x;
+ }
- } else if (rotationDiff == 90 || rotationDiff == -270) {
- x = rect.width - newWidth - bounds.y;
- y = bounds.x;
+ panel.setBounds((int) (zoomRatio * x) + insets.left,
+ (int) (zoomRatio * y) + insets.top,
+ (int) (zoomRatio * newWidth), (int) (zoomRatio * newHeight));
- } else {
- x = bounds.y;
- y = rect.height - newHeight - bounds.x;
+ cr.registerComponent(panel.isHorizontal() ? ComponentResizer.DIRECTION_HORIZONTAL : ComponentResizer.DIRECTION_VERTICAL,
+ panel);
}
- panel.setBounds((int) (zoomRatio * x) + insets.left,
- (int) (zoomRatio * y) + insets.top,
- (int) (zoomRatio * newWidth), (int) (zoomRatio * newHeight));
+ for (PDFEditorHighlighterUI panel : p.getHighlighters()) {
+ panel.setVisible(true);
- cr.registerComponent(panel.isHorizontal() ? ComponentResizer.DIRECTION_HORIZONTAL : ComponentResizer.DIRECTION_VERTICAL,
- panel);
- }
+ Rectangle bounds = panel.getBounds();
- for (PDFEditorHighlighterUI panel : p.getHighlighters()) {
- panel.setVisible(true);
+ int newWidth = orientation180 ? bounds.width : bounds.height;
+ int newHeight = orientation180 ? bounds.height : bounds.width;
- Rectangle bounds = panel.getBounds();
+ int x, y;
- int newWidth = orientation180 ? bounds.width : bounds.height;
- int newHeight = orientation180 ? bounds.height : bounds.width;
+ if (rotationDiff == 0) {
+ x = bounds.x;
+ y = bounds.y;
- int x, y;
+ } else if (rotationDiff == 90 || rotationDiff == -270) {
+ x = rect.width - newWidth - bounds.y;
+ y = bounds.x;
- if (rotationDiff == 0) {
- x = bounds.x;
- y = bounds.y;
+ } else {
+ x = bounds.y;
+ y = rect.height - newHeight - bounds.x;
+ }
- } else if (rotationDiff == 90 || rotationDiff == -270) {
- x = rect.width - newWidth - bounds.y;
- y = bounds.x;
+ panel.setBounds((int) (zoomRatio * x) + insets.left,
+ (int) (zoomRatio * y) + insets.top,
+ (int) (zoomRatio * newWidth), (int) (zoomRatio * newHeight));
- } else {
- x = bounds.y;
- y = rect.height - newHeight - bounds.x;
}
- panel.setBounds((int) (zoomRatio * x) + insets.left,
- (int) (zoomRatio * y) + insets.top,
- (int) (zoomRatio * newWidth), (int) (zoomRatio * newHeight));
+ container.updateUI();
+ } catch (IOException e) {
+ if (log.isErrorEnabled()) {
+ log.error("Cannot convert page into image", e);
+ }
}
-
- container.updateUI();
}
public File convertFileToPdf(AttachmentFile attachmentFile) throws IOException, DocumentException {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIModel.java 2014-09-30 12:22:29 UTC (rev 654)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIModel.java 2014-09-30 15:09:55 UTC (rev 655)
@@ -124,7 +124,6 @@
protected Page[] pages;
- // first page is 1 not 0
protected int currentPageIndex = -1;
protected float zoom = 1.0f;
@@ -194,17 +193,17 @@
}
public Page getCurrentPage() {
- if (pages == null || currentPageIndex < 1 || currentPageIndex > pages.length) {
+ if (pages == null || currentPageIndex < 0 || currentPageIndex >= pages.length) {
return null;
}
- return pages[currentPageIndex - 1];
+ return pages[currentPageIndex];
}
public Page getPage(int i) {
- if (pages == null || i < 1 || i > pages.length) {
+ if (pages == null || i < 0 || i >= pages.length) {
return null;
}
- return pages[i - 1];
+ return pages[i];
}
public int getCurrentPageIndex() {
@@ -213,9 +212,9 @@
public void setCurrentPageIndex(int currentPageIndex) {
Object oldValue = getCurrentPageIndex();
- currentPageIndex = Math.max(1, currentPageIndex);
+ currentPageIndex = Math.max(0, currentPageIndex);
if (pages != null) {
- currentPageIndex = Math.min(pages.length, currentPageIndex);
+ currentPageIndex = Math.min(pages.length - 1, currentPageIndex);
}
this.currentPageIndex = currentPageIndex;
firePropertyChange(PROPERTY_CURRENT_PAGE_INDEX, oldValue, currentPageIndex);
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-09-30 12:22:29 UTC (rev 654)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-09-30 15:09:55 UTC (rev 655)
@@ -73,6 +73,7 @@
import javax.swing.tree.TreeModel;
import javax.swing.tree.TreePath;
+import com.itextpdf.text.RectangleReadOnly;
import jaxx.runtime.JAXXObject;
import jaxx.runtime.JAXXUtil;
@@ -86,10 +87,6 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.pdfbox.pdmodel.PDDocument;
-import org.apache.pdfbox.pdmodel.PDPage;
-import org.apache.pdfbox.pdmodel.edit.PDPageContentStream;
-import org.apache.pdfbox.pdmodel.font.PDFont;
-import org.apache.pdfbox.pdmodel.font.PDType1Font;
import org.nuiton.jaxx.application.ApplicationTechnicalException;
import org.nuiton.jaxx.application.swing.util.ApplicationUIUtil;
import org.nuiton.util.FileUtil;
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-09-30 12:22:29 UTC (rev 654)
+++ trunk/pom.xml 2014-09-30 15:09:55 UTC (rev 655)
@@ -361,12 +361,6 @@
<version>${swingXVersion}</version>
</dependency>
- <dependency>
- <groupId>org.swinglabs</groupId>
- <artifactId>pdf-renderer</artifactId>
- <version>1.0.5</version>
- </dependency>
-
<!-- Logging -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
1
0
r654 - in trunk: . faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities faxtomail-ui-swing faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util
by kmorin@users.forge.codelutin.com 30 Sep '14
by kmorin@users.forge.codelutin.com 30 Sep '14
30 Sep '14
Author: kmorin
Date: 2014-09-30 14:22:29 +0200 (Tue, 30 Sep 2014)
New Revision: 654
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/654
Log:
test impression avec pdfbox
Modified:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/ClientTopiaDao.java
trunk/faxtomail-ui-swing/pom.xml
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java
trunk/pom.xml
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/ClientTopiaDao.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/ClientTopiaDao.java 2014-09-29 15:02:51 UTC (rev 653)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/ClientTopiaDao.java 2014-09-30 12:22:29 UTC (rev 654)
@@ -40,7 +40,7 @@
String query = "FROM " + Client.class.getName() + " WHERE " + property + " LIKE :propValue";
Map<String, Object> args = new HashMap<>();
- args.put("propValue", "%" + value + "%");
+ args.put("propValue", "%\"" + value + "\"%");
List<Client> result = findAll(query, args);
return result;
}
Modified: trunk/faxtomail-ui-swing/pom.xml
===================================================================
--- trunk/faxtomail-ui-swing/pom.xml 2014-09-29 15:02:51 UTC (rev 653)
+++ trunk/faxtomail-ui-swing/pom.xml 2014-09-30 12:22:29 UTC (rev 654)
@@ -226,6 +226,11 @@
</dependency>
<dependency>
+ <groupId>org.apache.pdfbox</groupId>
+ <artifactId>pdfbox</artifactId>
+ </dependency>
+
+ <dependency>
<groupId>javax.media.jai</groupId>
<artifactId>com.springsource.javax.media.jai.core</artifactId>
<version>1.1.3</version>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIHandler.java 2014-09-29 15:02:51 UTC (rev 653)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/pdfeditor/PDFEditorUIHandler.java 2014-09-30 12:22:29 UTC (rev 654)
@@ -78,15 +78,7 @@
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler;
import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil;
import com.franciaflex.faxtomail.ui.swing.util.JImagePanel;
-import com.itextpdf.text.Document;
import com.itextpdf.text.DocumentException;
-import com.itextpdf.text.PageSize;
-import com.itextpdf.text.Paragraph;
-import com.itextpdf.text.pdf.PdfWriter;
-import com.sun.media.jai.codec.ByteArraySeekableStream;
-import com.sun.media.jai.codec.ImageCodec;
-import com.sun.media.jai.codec.ImageDecoder;
-import com.sun.media.jai.codec.SeekableStream;
import com.sun.pdfview.PDFFile;
import com.sun.pdfview.PDFPage;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-09-29 15:02:51 UTC (rev 653)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/FaxToMailUIUtil.java 2014-09-30 12:22:29 UTC (rev 654)
@@ -52,10 +52,15 @@
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
+import java.util.Locale;
import java.util.Map;
import java.util.regex.Pattern;
import javax.media.jai.PlanarImage;
+import javax.print.PrintService;
+import javax.print.attribute.HashPrintRequestAttributeSet;
+import javax.print.attribute.PrintRequestAttributeSet;
+import javax.print.attribute.standard.JobName;
import javax.swing.Icon;
import javax.swing.JTextPane;
import javax.swing.JTree;
@@ -80,6 +85,11 @@
import org.apache.commons.lang3.SystemUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.apache.pdfbox.pdmodel.PDDocument;
+import org.apache.pdfbox.pdmodel.PDPage;
+import org.apache.pdfbox.pdmodel.edit.PDPageContentStream;
+import org.apache.pdfbox.pdmodel.font.PDFont;
+import org.apache.pdfbox.pdmodel.font.PDType1Font;
import org.nuiton.jaxx.application.ApplicationTechnicalException;
import org.nuiton.jaxx.application.swing.util.ApplicationUIUtil;
import org.nuiton.util.FileUtil;
@@ -113,8 +123,6 @@
import com.sun.media.jai.codec.ImageCodec;
import com.sun.media.jai.codec.ImageDecoder;
import com.sun.media.jai.codec.SeekableStream;
-import com.sun.pdfview.PDFFile;
-import com.sun.pdfview.PDFPrintPage;
/**
* @author kmorin - morin(a)codelutin.com
@@ -495,41 +503,28 @@
protected static boolean printWithPdfRenderer(String printName, FileInputStream fis, boolean defaultPrinter) {
boolean result = false;
+ PDDocument document = null;
try {
- // Create a PDFFile from a File reference
- FileChannel fc = fis.getChannel();
- ByteBuffer bb = fc.map(FileChannel.MapMode.READ_ONLY, 0, fc.size());
- PDFFile pdfFile = new PDFFile(bb); // Create PDF Print Page
- PDFPrintPage pages = new PDFPrintPage(pdfFile);
- // fix fit to page
- // see http://lynema.org/2010/12/29/printing-a-pdf-in-java-with-pdfrenderer
PrinterJob pjob = PrinterJob.getPrinterJob();
- PageFormat pf = pjob.defaultPage();
- pf.setOrientation(PageFormat.PORTRAIT);
-
- Paper paper = new Paper();
- paper.setImageableArea(0, 0, paper.getWidth() * 2, paper.getHeight());
- pf.setPaper(paper);
-
- // Create Print Job
pjob.setJobName(printName);
- Book book = new Book();
- book.append(pages, pf, pdfFile.getNumPages());
- pjob.setPageable(book);
-
- // Send print job to default printer
- result = defaultPrinter || pjob.printDialog();
- if (result) {
- pjob.print();
+
+ document = PDDocument.load(fis);
+ if (defaultPrinter) {
+ document.silentPrint(pjob);
+ } else {
+ document.print(pjob);
}
+ result = true;
- } catch (PrinterException | IOException ex) {
+ } catch (PrinterException | IOException e) {
if (log.isErrorEnabled()) {
- log.error("can't print", ex);
+ log.error("can't print", e);
}
- }
+ } finally {
+ IOUtils.closeQuietly(document);
+ }
return result;
}
@@ -570,8 +565,10 @@
try {
br = new BufferedReader(new InputStreamReader(inputStream, StandardCharsets.UTF_8));
StringBuilder text = new StringBuilder();
- while (br.readLine() != null) {
- text.append(br.readLine()).append("\n");
+ String line = br.readLine();
+ while (line != null) {
+ text.append(line).append("\n");
+ line = br.readLine();
}
document.add(new Paragraph(text.toString()));
br.close();
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-09-29 15:02:51 UTC (rev 653)
+++ trunk/pom.xml 2014-09-30 12:22:29 UTC (rev 654)
@@ -304,6 +304,12 @@
<version>5.5.2</version>
</dependency>
+ <dependency>
+ <groupId>org.apache.pdfbox</groupId>
+ <artifactId>pdfbox</artifactId>
+ <version>1.8.7</version>
+ </dependency>
+
<!-- librairie Jaxx -->
<dependency>
<groupId>org.nuiton.jaxx</groupId>
1
0
r653 - in trunk: . faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities faxtomail-ui-swing faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin
by kmorin@users.forge.codelutin.com 29 Sep '14
by kmorin@users.forge.codelutin.com 29 Sep '14
29 Sep '14
Author: kmorin
Date: 2014-09-29 17:02:51 +0200 (Mon, 29 Sep 2014)
New Revision: 653
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/653
Log:
- fix release build
- correction import archives
Modified:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailImpl.java
trunk/faxtomail-ui-swing/pom.xml
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/Common.css
trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ImportArchiveAction.java
trunk/pom.xml
Modified: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailImpl.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailImpl.java 2014-09-29 14:21:28 UTC (rev 652)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailImpl.java 2014-09-29 15:02:51 UTC (rev 653)
@@ -1,5 +1,29 @@
package com.franciaflex.faxtomail.persistence.entities;
+/*
+ * #%L
+ * FaxToMail :: Persistence
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2014 Franciaflex, Code Lutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
+
import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
Modified: trunk/faxtomail-ui-swing/pom.xml
===================================================================
--- trunk/faxtomail-ui-swing/pom.xml 2014-09-29 14:21:28 UTC (rev 652)
+++ trunk/faxtomail-ui-swing/pom.xml 2014-09-29 15:02:51 UTC (rev 653)
@@ -183,6 +183,11 @@
<artifactId>swingx-common</artifactId>
</dependency>
+ <dependency>
+ <groupId>org.swinglabs.swingx</groupId>
+ <artifactId>swingx-autocomplete</artifactId>
+ </dependency>
+
<!-- Logging -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/Common.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/Common.css 2014-09-29 14:21:28 UTC (rev 652)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/Common.css 2014-09-29 15:02:51 UTC (rev 653)
@@ -1,3 +1,26 @@
+/*
+ * #%L
+ * FaxToMail :: UI
+ * $Id:$
+ * $HeadURL:$
+ * %%
+ * Copyright (C) 2014 Franciaflex, Code Lutin
+ * %%
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU 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 General Public
+ * License along with this program. If not, see
+ * <http://www.gnu.org/licenses/gpl-3.0.html>.
+ * #L%
+ */
BeanFilterableComboBox, BeanComboBox {
maximumRowCount: 20;
}
\ No newline at end of file
Modified: trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ImportArchiveAction.java
===================================================================
--- trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ImportArchiveAction.java 2014-09-29 14:21:28 UTC (rev 652)
+++ trunk/faxtomail-ui-web/src/main/java/com/franciaflex/faxtomail/web/action/admin/ImportArchiveAction.java 2014-09-29 15:02:51 UTC (rev 653)
@@ -105,10 +105,7 @@
@Override
public void validate() {
- if (StringUtils.isEmpty(attachmentBase)) {
- addActionError("Le répertoire de base des pièces jointes est obligatoire !");
- }
- else if (!new File(attachmentBase).isDirectory()) {
+ if (StringUtils.isNotEmpty(attachmentBase) && !new File(attachmentBase).isDirectory()) {
addActionError("Le répertoire de base des pièces jointes n'est pas un répertoire lisible !");
}
if (archiveFile == null) {
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-09-29 14:21:28 UTC (rev 652)
+++ trunk/pom.xml 2014-09-29 15:02:51 UTC (rev 653)
@@ -350,6 +350,12 @@
</dependency>
<dependency>
+ <groupId>org.swinglabs.swingx</groupId>
+ <artifactId>swingx-autocomplete</artifactId>
+ <version>${swingXVersion}</version>
+ </dependency>
+
+ <dependency>
<groupId>org.swinglabs</groupId>
<artifactId>pdf-renderer</artifactId>
<version>1.0.5</version>
1
0
r652 - in trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content: demande search
by kmorin@users.forge.codelutin.com 29 Sep '14
by kmorin@users.forge.codelutin.com 29 Sep '14
29 Sep '14
Author: kmorin
Date: 2014-09-29 16:21:28 +0200 (Mon, 29 Sep 2014)
New Revision: 652
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/652
Log:
scroller automatiquement pour voir l'?\195?\169l?\195?\169ment s?\195?\169lectionn?\195?\169
Modified:
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-09-29 13:30:42 UTC (rev 651)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-09-29 14:21:28 UTC (rev 652)
@@ -273,6 +273,7 @@
int row = dataTableModel.getRowIndex(currentEmail);
if (row > 0) {
dataTable.setRowSelectionInterval(row, row);
+ dataTable.scrollRowToVisible(row);
}
}
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-09-29 13:30:42 UTC (rev 651)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-09-29 14:21:28 UTC (rev 652)
@@ -167,6 +167,7 @@
int row = dataTableModel.getRowIndex(currentEmail);
if (row > 0) {
dataTable.setRowSelectionInterval(row, row);
+ dataTable.scrollRowToVisible(row);
}
}
}
1
0
r651 - trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search
by kmorin@users.forge.codelutin.com 29 Sep '14
by kmorin@users.forge.codelutin.com 29 Sep '14
29 Sep '14
Author: kmorin
Date: 2014-09-29 15:30:42 +0200 (Mon, 29 Sep 2014)
New Revision: 651
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/651
Log:
correction icone
Modified:
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.css
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.css 2014-09-29 13:22:47 UTC (rev 650)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUI.css 2014-09-29 13:30:42 UTC (rev 651)
@@ -284,8 +284,7 @@
#showAdvancedSearchButton {
text: { showAdvancedSearchButton.isSelected() ? "faxtomail.search.hideAdvancedSearch.label" : "faxtomail.search.showAdvancedSearch.label" };
- actionIcon: "expand";
- selectedIcon: { JAXXWidgetUtil.createActionIcon("collapse") };
+ icon: { JAXXWidgetUtil.createActionIcon(showAdvancedSearchButton.isSelected() ? "collapse" :"expand") };
}
#searchButton {
1
0
r650 - in trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing: . actions content/demande content/search
by kmorin@users.forge.codelutin.com 29 Sep '14
by kmorin@users.forge.codelutin.com 29 Sep '14
29 Sep '14
Author: kmorin
Date: 2014-09-29 15:22:47 +0200 (Mon, 29 Sep 2014)
New Revision: 650
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/650
Log:
retourner sur la bonne page quand on revient
Modified:
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeListAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowRechercheAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListTableFilter.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-09-29 12:15:22 UTC (rev 649)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/FaxToMailUIContext.java 2014-09-29 13:22:47 UTC (rev 650)
@@ -89,6 +89,7 @@
import com.google.common.base.Preconditions;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
+import org.nuiton.util.pagination.PaginationParameter;
/**
* UI application context.
@@ -189,6 +190,8 @@
/** Le dossier courant (pour ???). */
protected MailFolder currentMailFolder;
+ protected PaginationParameter currentPaginationParameter;
+
/** L'email courant (pour quoi faire ?). */
protected DemandeUIModel currentEmail;
@@ -691,6 +694,14 @@
this.currentMailFolder = currentMailFolder;
}
+ public PaginationParameter getCurrentPaginationParameter() {
+ return currentPaginationParameter;
+ }
+
+ public void setCurrentPaginationParameter(PaginationParameter currentPaginationParameter) {
+ this.currentPaginationParameter = currentPaginationParameter;
+ }
+
public DemandeUIModel getCurrentEmail() {
return currentEmail;
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeListAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeListAction.java 2014-09-29 12:15:22 UTC (rev 649)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowDemandeListAction.java 2014-09-29 13:22:47 UTC (rev 650)
@@ -40,8 +40,10 @@
}
@Override
- public void postSuccessAction() {
- super.postSuccessAction();
+ public void doAction() throws Exception {
getContext().setSearch(null);
+ getContext().setCurrentPaginationParameter(null);
+ super.doAction();
}
+
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowRechercheAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowRechercheAction.java 2014-09-29 12:15:22 UTC (rev 649)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/ShowRechercheAction.java 2014-09-29 13:22:47 UTC (rev 650)
@@ -39,4 +39,9 @@
setActionDescription(t("faxtomail.action.goto.search.tip"));
}
+ @Override
+ public void doAction() throws Exception {
+ getContext().setCurrentPaginationParameter(null);
+ super.doAction();
+ }
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListTableFilter.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListTableFilter.java 2014-09-29 12:15:22 UTC (rev 649)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListTableFilter.java 2014-09-29 13:22:47 UTC (rev 650)
@@ -49,6 +49,7 @@
import org.jdesktop.swingx.JXTable;
import org.nuiton.decorator.Decorator;
import org.nuiton.jaxx.application.swing.table.ColumnIdentifier;
+import org.nuiton.util.pagination.PaginationParameter;
import javax.swing.table.TableModel;
import java.text.DateFormat;
@@ -277,8 +278,17 @@
protected void executeFilter() {
FaxToMailUIContext context = handler.getContext();
- handler.getModel().resetPaginationParameter();
+ // reset pagination when folder change
+ PaginationParameter currentPaginationParameter = context.getCurrentPaginationParameter();
+ if (currentPaginationParameter != null) {
+ handler.getModel().setPaginationParameter(currentPaginationParameter);
+ context.setCurrentPaginationParameter(null);
+
+ } else {
+ handler.getModel().resetPaginationParameter();
+ }
+
LoadFolderEmailsAction loadFolderEmailsAction =
context.getActionFactory().createLogicAction(handler, LoadFolderEmailsAction.class);
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-09-29 12:15:22 UTC (rev 649)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-09-29 13:22:47 UTC (rev 650)
@@ -101,6 +101,7 @@
import com.franciaflex.faxtomail.ui.swing.util.PaginationComboModel;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
+import org.nuiton.util.pagination.PaginationParameter;
/**
* Handler of UI {@link com.franciaflex.faxtomail.ui.swing.content.demande.DemandeListUIHandler}.
@@ -338,12 +339,7 @@
}
protected void loadFolderDemands(MailFolder folder, Map<MailFolder, FolderTreeNode> nodesByFolder) {
- // a new transaction has been opened by getContext().createNewTransaction();
- // 10 line upper
- // reset pagination when folder change
- getModel().resetPaginationParameter();
-
FolderTreeNode folderNode = nodesByFolder.get(folder);
boolean readable = folderNode.isCanRead();
@@ -445,6 +441,7 @@
protected void onDoubleClickOnDemande(DemandeUIModel selectedEmail) {
super.onDoubleClickOnDemande(selectedEmail);
selectedEmail.removePropertyChangeListener(selectedDemandeChangeListener);
+ getContext().setCurrentPaginationParameter(getModel().getPaginationParameter());
}
@Override
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-09-29 12:15:22 UTC (rev 649)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/search/SearchUIHandler.java 2014-09-29 13:22:47 UTC (rev 650)
@@ -56,6 +56,7 @@
import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailDemandListHandler;
import com.franciaflex.faxtomail.ui.swing.util.DemandeTableModel;
import com.franciaflex.faxtomail.ui.swing.util.PaginationComboModel;
+import org.nuiton.util.pagination.PaginationParameter;
/**
* Handler of UI {@link SearchUIHandler}.
@@ -188,6 +189,11 @@
});
}
+
+ protected void onDoubleClickOnDemande(DemandeUIModel selectedEmail) {
+ getContext().setCurrentPaginationParameter(getModel().getPaginationParameter());
+ }
+
public void searchDemandes() {
getModel().resetPaginationParameter();
runSearchAction();
@@ -216,6 +222,12 @@
protected void runSearchAction() {
FaxToMailUIContext context = getContext();
+ PaginationParameter currentPaginationParameter = context.getCurrentPaginationParameter();
+ if (currentPaginationParameter != null) {
+ getModel().setPaginationParameter(currentPaginationParameter);
+ context.setCurrentPaginationParameter(null);
+ }
+
try {
SearchAction searchAction = new SearchAction(this);
if (context.isActionInProgress(null)) {
1
0
r649 - trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service
by kmorin@users.forge.codelutin.com 29 Sep '14
by kmorin@users.forge.codelutin.com 29 Sep '14
29 Sep '14
Author: kmorin
Date: 2014-09-29 14:15:22 +0200 (Mon, 29 Sep 2014)
New Revision: 649
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/649
Log:
correction mise a jour clients
Modified:
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ClientServiceImpl.java
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ClientServiceImpl.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ClientServiceImpl.java 2014-09-29 11:39:04 UTC (rev 648)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ClientServiceImpl.java 2014-09-29 12:15:22 UTC (rev 649)
@@ -195,7 +195,7 @@
// save data
Client client = clientCache.get(code, company);
if (client == null) {
- client = clientDao.forCodeEquals(code).addEquals(Client.PROPERTY_COMPANY, company).findUnique();
+ client = clientDao.forCodeEquals(code).addEquals(Client.PROPERTY_COMPANY, company).findUniqueOrNull();
if (client == null) {
client = new ClientImpl();
client.setCode(code);
1
0
29 Sep '14
Author: kmorin
Date: 2014-09-29 13:39:04 +0200 (Mon, 29 Sep 2014)
New Revision: 648
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/648
Log:
ajout des infos manquantes lors de l'impression des ?\195?\169l?\195?\169ments
Added:
trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailImpl.java
Modified:
trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java
trunk/faxtomail-service/src/main/resources/pdf/demande.mustache
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/demandgroup/ButtonEmailGroup.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/HistoryListUIHandler.java
Added: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailImpl.java
===================================================================
--- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailImpl.java (rev 0)
+++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/EmailImpl.java 2014-09-29 11:39:04 UTC (rev 648)
@@ -0,0 +1,177 @@
+package com.franciaflex.faxtomail.persistence.entities;
+
+import com.google.common.base.Function;
+import com.google.common.base.Predicate;
+import com.google.common.collect.Collections2;
+import org.apache.commons.lang3.StringUtils;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * @author Kevin Morin (Code Lutin)
+ */
+public class EmailImpl extends EmailAbstract {
+
+ protected History firstOpeningHistory;
+
+ protected History lastModificationHistory;
+
+ protected History lastAttachmentOpeningInFolderHistory;
+
+ public void findFirstOpeningHistory() {
+ History result = null;
+ Date date = null;
+ Collection<History> histories = getHistory();
+ if (histories != null) {
+ for (History history : histories) {
+ if (HistoryType.OPENING.equals(history.getType())) {
+ if (date == null || date.after(history.getModificationDate())) {
+ date = history.getModificationDate();
+ result = history;
+ }
+ }
+ }
+ }
+ firstOpeningHistory = result;
+ }
+
+ public void findLastModificationHistory() {
+ History result = null;
+ Date date = null;
+ Collection<History> histories = getHistory();
+ if (histories != null) {
+ for (History history : histories) {
+ if (history.getType().isConsideredAsModification()) {
+ if (date == null || date.before(history.getModificationDate())) {
+ date = history.getModificationDate();
+ result = history;
+ }
+ }
+ }
+ }
+ lastModificationHistory = result;
+ }
+
+ public void findLastAttachmentOpeningInFolderHistory() {
+ History result = null;
+ Collection<History> histories = getHistory();
+
+ if (histories != null) {
+ History transmissionHistory = null;
+ for (History history : histories) {
+ Date modificationDate = history.getModificationDate();
+ if (HistoryType.ATTACHMENT_OPENING.equals(history.getType())) {
+ if ((transmissionHistory == null
+ || transmissionHistory.getModificationDate().before(modificationDate))
+ && (result == null
+ || result.getModificationDate().before(modificationDate))) {
+ result = history;
+ }
+
+ } else if (HistoryType.TRANSMISSION.equals(history.getType())) {
+ if (transmissionHistory == null
+ || transmissionHistory.getModificationDate().before(modificationDate)) {
+
+ transmissionHistory = history;
+ if (result != null && result.getModificationDate().before(transmissionHistory.getModificationDate())) {
+ result = null;
+ }
+ }
+ }
+ }
+ }
+ lastAttachmentOpeningInFolderHistory = result;
+ }
+
+ protected History getFirstOpeningHistory() {
+ if (firstOpeningHistory == null) {
+ findFirstOpeningHistory();
+ }
+ return firstOpeningHistory;
+ }
+
+ @Override
+ public FaxToMailUser getFirstOpeningUser() {
+ History history = getFirstOpeningHistory();
+ return history != null ? history.getFaxToMailUser() : null;
+ }
+
+ @Override
+ public Date getFirstOpeningDate() {
+ History history = getFirstOpeningHistory();
+ return history != null ? history.getModificationDate() : null;
+ }
+
+ protected History getLastModificationHistory() {
+ if (lastModificationHistory == null) {
+ findLastModificationHistory();
+ }
+ return lastModificationHistory;
+ }
+
+ @Override
+ public FaxToMailUser getLastModificationUser() {
+ History history = getLastModificationHistory();
+ return history != null ? history.getFaxToMailUser() : null;
+ }
+
+ @Override
+ public Date getLastModificationDate() {
+ History history = getLastModificationHistory();
+ return history != null ? history.getModificationDate() : null;
+ }
+
+ protected History getLastAttachmentOpeningInThisFolderHistory() {
+ if (lastAttachmentOpeningInFolderHistory == null) {
+ findLastAttachmentOpeningInFolderHistory();
+ }
+ return lastAttachmentOpeningInFolderHistory;
+ }
+
+ @Override
+ public FaxToMailUser getLastAttachmentOpeningInFolderUser() {
+ History history = getLastAttachmentOpeningInThisFolderHistory();
+ return history != null ? history.getFaxToMailUser() : null;
+ }
+
+ @Override
+ public Date getLastAttachmentOpeningInFolderDate() {
+ History history = getLastAttachmentOpeningInThisFolderHistory();
+ return history != null ? history.getModificationDate() : null;
+ }
+
+ @Override
+ public void setHistory(List<History> history) {
+ firstOpeningHistory = null;
+ lastModificationHistory = null;
+ lastAttachmentOpeningInFolderHistory = null;
+ super.setHistory(history);
+ }
+
+ public String getReference() {
+ List<String> reference = new ArrayList<String>();
+ if (StringUtils.isNotBlank(getCompanyReference())) {
+ reference.add(getCompanyReference());
+ }
+ Collection<RangeRow> rangeRow = getRangeRow();
+ if (rangeRow != null) {
+ Collection<String> commandNumbers = Collections2.transform(rangeRow, new Function<RangeRow, String>() {
+ @Override
+ public String apply(RangeRow input) {
+ return input != null ? input.getCommandNumber() : "";
+ }
+ });
+ Collections2.filter(commandNumbers, new Predicate<String>() {
+ @Override
+ public boolean apply(String input) {
+ return StringUtils.isNotBlank(input);
+ }
+ });
+ reference.addAll(commandNumbers);
+ }
+ return StringUtils.join(reference, ", ");
+ }
+}
Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo
===================================================================
(Binary files differ)
Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java
===================================================================
--- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java 2014-09-29 09:34:03 UTC (rev 647)
+++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/EmailServiceImpl.java 2014-09-29 11:39:04 UTC (rev 648)
@@ -75,6 +75,7 @@
import org.hibernate.Hibernate;
import org.nuiton.csv.Import;
import org.nuiton.csv.ImportRuntimeException;
+import org.nuiton.decorator.Decorator;
import org.nuiton.jaxx.application.ApplicationTechnicalException;
import org.nuiton.topia.persistence.TopiaEntities;
import org.nuiton.topia.persistence.support.TopiaSqlSupport;
@@ -1332,20 +1333,49 @@
}
protected String getEmailDetailAsHtml(Email email) {
+ Decorator<FaxToMailUser> userDecorator = getDecoratorService().getDecoratorByType(FaxToMailUser.class);
+
Map<String, Object> scopes = new HashMap<String, Object>();
- scopes.put("receivedDate", DateFormatUtils.format(email.getReceptionDate(), "dd/MM/yyyy"));
+
+ String result = email.getObject();
+ String ref = email.getReference();
+ if (!ref.isEmpty()) {
+ result = ref + " - " + result;
+ }
+
+ scopes.put("title", result);
+ scopes.put("receivedDate", DateFormatUtils.format(email.getReceptionDate(), "dd/MM/yyyy HH:mm"));
scopes.put("sender", email.getSender());
scopes.put("object", email.getObject());
- scopes.put("clientCode", email.getClient() == null ? "" : email.getClient().getCode());
- scopes.put("demandType", email.getDemandType() == null ? "" : email.getDemandType().getLabel());
- scopes.put("priority", email.getPriority() == null ? "" : email.getPriority().getLabel());
+ scopes.put("client", email.getClient());
+ scopes.put("demandType", email.getDemandType());
+ scopes.put("priority", email.getPriority());
scopes.put("projectReference", email.getProjectReference());
scopes.put("companyReference", email.getCompanyReference());
- scopes.put("waitingState", email.getWaitingState() == null ? "" : email.getWaitingState().getLabel());
- scopes.put("status", email.getDemandStatus() == null ? "" : email.getDemandStatus().getLabel());
- scopes.put("takenBy", email.getTakenBy() == null ? "" : (email.getTakenBy().getLogin() + " " + email.getTakenBy().getFirstName() + " " + email.getTakenBy().getLastName()));
- scopes.put("date", DateFormatUtils.format(serviceContext.getNow(), "dd/MM/yyyy"));
+ scopes.put("waitingState", email.getWaitingState());
+ scopes.put("status", email.getDemandStatus());
+ scopes.put("takenBy", email.getTakenBy() == null ? "" : userDecorator.toString(email.getTakenBy()));
+ scopes.put("message", email.getComment());
+ scopes.put("date", DateFormatUtils.format(serviceContext.getNow(), "dd/MM/yyyy HH:mm"));
+ scopes.put("firstOpeningUser", email.getFirstOpeningUser() == null ?
+ "" : userDecorator.toString(email.getFirstOpeningUser()));
+ scopes.put("firstOpeningDate", email.getFirstOpeningDate() == null ?
+ "" : DateFormatUtils.format(email.getFirstOpeningDate(), "dd/MM/yyyy HH:mm"));
+
+ scopes.put("lastModificationUser", email.getLastModificationUser() == null ?
+ "" : userDecorator.toString(email.getLastModificationUser()));
+ scopes.put("lastModificationDate", email.getLastModificationDate() == null ?
+ "" : DateFormatUtils.format(email.getLastModificationDate(), "dd/MM/yyyy HH:mm"));
+
+ scopes.put("lastAttachmentOpeningInFolderUser", email.getLastAttachmentOpeningInFolderUser() == null ?
+ "" : userDecorator.toString(email.getLastAttachmentOpeningInFolderUser()));
+ scopes.put("lastAttachmentOpeningInFolderDate", email.getLastAttachmentOpeningInFolderDate() == null ?
+ "" : DateFormatUtils.format(email.getLastAttachmentOpeningInFolderDate(), "dd/MM/yyyy HH:mm"));
+
+ scopes.put("hasRangeRows", email.sizeRangeRow() > 0);
+ scopes.put("rangeRows", email.getRangeRow());
+
// find template
InputStream is = EmailServiceImpl.class.getResourceAsStream("/pdf/demande.mustache");
MustacheFactory mf = new DefaultMustacheFactory();
Modified: trunk/faxtomail-service/src/main/resources/pdf/demande.mustache
===================================================================
--- trunk/faxtomail-service/src/main/resources/pdf/demande.mustache 2014-09-29 09:34:03 UTC (rev 647)
+++ trunk/faxtomail-service/src/main/resources/pdf/demande.mustache 2014-09-29 11:39:04 UTC (rev 648)
@@ -8,60 +8,111 @@
position: running(footer);
font-size: small;
}
+ table {
+ margin-bottom: 20px;
+ }
@page {
@bottom-center { content: element(footer) }
}
</style>
</head>
<body>
- <h1 class="title">Détail de la demande</h1>
+ <h1 class="title">Détail de l'élément {{title}}</h1>
<table>
<tr>
- <td>Objet :</td>
- <td>{{object}}</td>
+ <td>Reçu le :</td>
+ <td colspan="3">{{receivedDate}}</td>
</tr>
<tr>
- <td>Reçue le :</td>
- <td>{{receivedDate}}</td>
+ <td>Emetteur :</td>
+ <td colspan="3">{{sender}}</td>
</tr>
<tr>
- <td>Emetteur :</td>
- <td>{{sender}}</td>
+ <td>Objet :</td>
+ <td colspan="3">{{object}}</td>
</tr>
<tr>
<td>Client :</td>
- <td>{{client}}</td>
+ <td colspan="3">{{#client}}{{client.code}} ({{client.brand}}){{/client}}</td>
</tr>
<tr>
<td>Type :</td>
- <td>{{demandType}}</td>
+ <td colspan="3">{{demandType.label}}</td>
</tr>
<tr>
<td>Priorité :</td>
- <td>{{priority}}</td>
+ <td colspan="3">{{priority.label}}</td>
</tr>
<tr>
<td>Référence chantier :</td>
- <td>{{projectReference}}</td>
+ <td colspan="3">{{projectReference}}</td>
</tr>
<tr>
<td>Notre référence :</td>
- <td>{{companyReference}}</td>
+ <td colspan="3">{{companyReference}}</td>
</tr>
<tr>
<td>Etat d'attente :</td>
- <td>{{waitingState}}</td>
+ <td colspan="3">{{waitingState.label}}</td>
</tr>
<tr>
<td>Statut :</td>
- <td>{{status}}</td>
+ <td colspan="3">{{status.label}}</td>
</tr>
<tr>
<td>Pris par :</td>
- <td>{{takenBy}}</td>
+ <td colspan="3">{{takenBy}}</td>
</tr>
+ <tr>
+ <td>Première ouverture par :</td>
+ <td>{{firstOpeningUser}}</td>
+ <td>le :</td>
+ <td>{{firstOpeningDate}}</td>
+ </tr>
+ <tr>
+ <td>Dernière modification par :</td>
+ <td>{{lastModificationUser}}</td>
+ <td>le :</td>
+ <td>{{lastModificationDate}}</td>
+ </tr>
+ <tr>
+ <td>Dernière ouverture de pièce jointe par :</td>
+ <td>{{lastAttachmentOpeningInFolderUser}}</td>
+ <td>le :</td>
+ <td>{{lastAttachmentOpeningInFolderDate}}</td>
+ </tr>
+ <tr>
+ <td>Message :</td>
+ <td colspan="3">{{message}}</td>
+ </tr>
</table>
+
+ {{#hasRangeRows}}
+ <table>
+ <caption></caption>
+ <thead>
+ <tr>
+ <th>Gammes</th>
+ <th>N° commande/devis</th>
+ <th>Quantitié de devis</th>
+ <th>Quantitié de PF</th>
+ <th>Quantitié de SAV</th>
+ </tr>
+ </thead>
+ <tbody>
+ {{#rangeRows}}
+ <tr>
+ <td>{{range.label}}</td>
+ <td>{{commandNumber}}</td>
+ <td>{{quotationQuantity}}</td>
+ <td>{{productQuantity}}</td>
+ <td>{{savQuantity}}</td>
+ </tr>
+ {{/rangeRows}}
+ </tbody>
+ </table>
+ {{/hasRangeRows}}
<div class="footer">
Date d'impression : {{date}}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css 2014-09-29 09:34:03 UTC (rev 647)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css 2014-09-29 11:39:04 UTC (rev 648)
@@ -254,7 +254,7 @@
}
#lastAttachmentOpeningPanel {
- visible: { model.getLastAttachmentOpeningInThisFolderUser() != null };
+ visible: { model.getLastAttachmentOpeningInFolderUser() != null };
}
#lastAttachmentOpeningLabel {
@@ -266,7 +266,7 @@
}
#lastAttachmentOpenedByField {
- text: { handler.decorateUser(model.getLastAttachmentOpeningInThisFolderUser(), true) };
+ text: { handler.decorateUser(model.getLastAttachmentOpeningInFolderUser(), true) };
}
#lastAttachmentOpeningDateLabel {
@@ -274,7 +274,7 @@
}
#lastAttachmentOpeningDateField {
- text: { handler.decorate(model.getLastAttachmentOpeningInThisFolderDate()) };
+ text: { handler.decorate(model.getLastAttachmentOpeningInFolderDate()) };
}
#leftVerticalSplitPanel {
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java 2014-09-29 09:34:03 UTC (rev 647)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIModel.java 2014-09-29 11:39:04 UTC (rev 648)
@@ -107,12 +107,6 @@
protected final List<RangeRowModel> validRangeRowModels = new ArrayList<RangeRowModel>();
- protected History firstOpeningHistory;
-
- protected History lastModificationHistory;
-
- protected History lastAttachmentOpeningInThisFolderHistory;
-
protected int quotationNb;
protected int pfNb;
@@ -151,14 +145,14 @@
public DemandeUIModel() {
super(fromBeanBinder, toBeanBinder);
- addPropertyChangeListener(Email.PROPERTY_HISTORY, new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- findFirstOpeningHistory();
- findLastModificationHistory();
- findLastAttachmentOpeningInThisFolderHistory();
- }
- });
+// addPropertyChangeListener(Email.PROPERTY_HISTORY, new PropertyChangeListener() {
+// @Override
+// public void propertyChange(PropertyChangeEvent evt) {
+// findFirstOpeningHistory();
+// findLastModificationHistory();
+// findLastAttachmentOpeningInThisFolderHistory();
+// }
+// });
addPropertyChangeListener(Email.PROPERTY_RANGE_ROW, new PropertyChangeListener() {
@Override
@@ -504,27 +498,7 @@
}
public String getReference() {
- List<String> reference = new ArrayList<String>();
- if (StringUtils.isNotBlank(getCompanyReference())) {
- reference.add(getCompanyReference());
- }
- Collection<RangeRow> rangeRow = getRangeRow();
- if (rangeRow != null) {
- Collection<String> commandNumbers = Collections2.transform(rangeRow, new Function<RangeRow, String>() {
- @Override
- public String apply(RangeRow input) {
- return input != null ? input.getCommandNumber() : "";
- }
- });
- Collections2.filter(commandNumbers, new Predicate<String>() {
- @Override
- public boolean apply(String input) {
- return StringUtils.isNotBlank(input);
- }
- });
- reference.addAll(commandNumbers);
- }
- return StringUtils.join(reference, ", ");
+ return editObject.getReference();
}
public void setHistory(List<History> history) {
@@ -540,103 +514,22 @@
return editObject.sizeHistory();
}
- public void findFirstOpeningHistory() {
- History result = null;
- Date date = null;
- Collection<History> histories = getHistory();
- if (histories != null) {
- for (History history : histories) {
- if (HistoryType.OPENING.equals(history.getType())) {
- if (date == null || date.after(history.getModificationDate())) {
- date = history.getModificationDate();
- result = history;
- }
- }
- }
- }
- firstOpeningHistory = result;
- }
-
- public void findLastModificationHistory() {
- History result = null;
- Date date = null;
- Collection<History> histories = getHistory();
- if (histories != null) {
- for (History history : histories) {
- if (history.getType().isConsideredAsModification()) {
- if (date == null || date.before(history.getModificationDate())) {
- date = history.getModificationDate();
- result = history;
- }
- }
- }
- }
- lastModificationHistory = result;
- }
-
- public void findLastAttachmentOpeningInThisFolderHistory() {
- History result = null;
- Collection<History> histories = getHistory();
-
- if (histories != null) {
- History transmissionHistory = null;
- for (History history : histories) {
- Date modificationDate = history.getModificationDate();
- if (HistoryType.ATTACHMENT_OPENING.equals(history.getType())) {
- if ((transmissionHistory == null
- || transmissionHistory.getModificationDate().before(modificationDate))
- && (result == null
- || result.getModificationDate().before(modificationDate))) {
- result = history;
- }
-
- } else if (HistoryType.TRANSMISSION.equals(history.getType())) {
- if (transmissionHistory == null
- || transmissionHistory.getModificationDate().before(modificationDate)) {
-
- transmissionHistory = history;
- if (result != null && result.getModificationDate().before(transmissionHistory.getModificationDate())) {
- result = null;
- }
- }
- }
- }
- }
- lastAttachmentOpeningInThisFolderHistory = result;
- }
-
- public History getFirstOpeningHistory() {
- return firstOpeningHistory;
- }
-
public FaxToMailUser getFirstOpeningUser() {
- History history = getFirstOpeningHistory();
- return history != null ? history.getFaxToMailUser() : null;
+ return editObject.getFirstOpeningUser();
}
public Date getFirstOpeningDate() {
- History history = getFirstOpeningHistory();
- return history != null ? history.getModificationDate() : null;
+ return editObject.getFirstOpeningDate();
}
- public History getLastModificationHistory() {
- return lastModificationHistory;
- }
-
public FaxToMailUser getLastModificationUser() {
- History history = getLastModificationHistory();
- return history != null ? history.getFaxToMailUser() : null;
+ return editObject.getLastModificationUser();
}
public Date getLastModificationDate() {
- History history = getLastModificationHistory();
- return history != null ? history.getModificationDate() : null;
+ return editObject.getLastModificationDate();
}
- public History getLastAttachmentOpeningInThisFolderHistory() {
- return lastAttachmentOpeningInThisFolderHistory;
- }
-
/**
* Utilisé depuis la liste des mails seulement pour des raisons de performances sans charger
* l'historique.
@@ -653,14 +546,12 @@
editObject.setLastAttachmentOpener(lastAttachmentOpener);
}
- public FaxToMailUser getLastAttachmentOpeningInThisFolderUser() {
- History history = getLastAttachmentOpeningInThisFolderHistory();
- return history != null ? history.getFaxToMailUser() : null;
+ public FaxToMailUser getLastAttachmentOpeningInFolderUser() {
+ return editObject.getLastAttachmentOpeningInFolderUser();
}
- public Date getLastAttachmentOpeningInThisFolderDate() {
- History history = getLastAttachmentOpeningInThisFolderHistory();
- return history != null ? history.getModificationDate() : null;
+ public Date getLastAttachmentOpeningInFolderDate() {
+ return editObject.getLastAttachmentOpeningInFolderDate();
}
@Override
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/demandgroup/ButtonEmailGroup.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/demandgroup/ButtonEmailGroup.java 2014-09-29 09:34:03 UTC (rev 647)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/demandgroup/ButtonEmailGroup.java 2014-09-29 11:39:04 UTC (rev 648)
@@ -43,7 +43,7 @@
public ButtonEmailGroup() {
setToolTipText(t("faxtomail.demandGroup.action.tip"));
- int demandNb = popup.getModel().sizeGroupedDemandes() + 1;
+ int demandNb = popup.getModel().sizeGroupedDemandes();
setText(t("faxtomail.demandGroup.text", demandNb));
popup.getModel().addPropertyChangeListener(DemandeUIModel.PROPERTY_GROUPED_DEMANDES, new PropertyChangeListener() {
@@ -52,7 +52,7 @@
Collection<DemandeUIModel> demands = (Collection<DemandeUIModel>) evt.getNewValue();
if (demands != null) {
int size = demands.size();
- setText(t("faxtomail.demandGroup.text", size + 1));
+ setText(t("faxtomail.demandGroup.text", size));
}
}
});
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/HistoryListUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/HistoryListUIHandler.java 2014-09-29 09:34:03 UTC (rev 647)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/HistoryListUIHandler.java 2014-09-29 11:39:04 UTC (rev 648)
@@ -62,7 +62,7 @@
static {
n("faxtomail.demande.receptionDate.label");
- n("faxtomail.demande.ediCodeNumber.label");
+ n("faxtomail.demande.ediError.label");
n("faxtomail.demande.projectReference.label");
n("faxtomail.demande.sender.label");
n("faxtomail.demande.fax.label");
1
0
r647 - in trunk: . faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util
by kmorin@users.forge.codelutin.com 29 Sep '14
by kmorin@users.forge.codelutin.com 29 Sep '14
29 Sep '14
Author: kmorin
Date: 2014-09-29 11:34:03 +0200 (Mon, 29 Sep 2014)
New Revision: 647
Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/647
Log:
- correction plusieurs popup de sauvegarde quand on quitte l'editeur de pdf
- agrandissement de la taille des popups de filtre
- correction libell?\195?\169 action "null" quand on quitte un ?\195?\169l?\195?\169ment
Modified:
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/LoadFolderEmailsAction.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListTableFilter.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUI.css
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/HistoryListUIHandler.java
trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
trunk/pom.xml
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/LoadFolderEmailsAction.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/LoadFolderEmailsAction.java 2014-09-26 17:17:17 UTC (rev 646)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/actions/LoadFolderEmailsAction.java 2014-09-29 09:34:03 UTC (rev 647)
@@ -71,7 +71,6 @@
@Override
public boolean prepareAction() throws Exception {
-
DemandeListUIModel model = getModel();
MailFolder folder = model.getSelectedFolder();
final JXTable dataTable = getUI().getDataTable();
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListTableFilter.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListTableFilter.java 2014-09-26 17:17:17 UTC (rev 646)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListTableFilter.java 2014-09-29 09:34:03 UTC (rev 647)
@@ -58,6 +58,8 @@
import java.util.HashSet;
import java.util.Set;
+import static org.nuiton.i18n.I18n.t;
+
/**
* @author Kevin Morin (Code Lutin)
* @since x.x
@@ -216,6 +218,7 @@
case Email.PROPERTY_ATTACHMENT:
case Email.PROPERTY_REPLIES:
+ case Email.PROPERTY_EMAIL_GROUP:
return null;
default:
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-09-26 17:17:17 UTC (rev 646)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java 2014-09-29 09:34:03 UTC (rev 647)
@@ -333,6 +333,7 @@
.searchable(true)
.searchDecorator(decorator)
.useTableRenderers(true)
+ .setPopupDefaultSize(new Dimension(250, 290))
.apply();
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUI.css
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUI.css 2014-09-26 17:17:17 UTC (rev 646)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUI.css 2014-09-29 09:34:03 UTC (rev 647)
@@ -30,6 +30,7 @@
#backButton {
text: "faxtomail.demande.back.button.label";
actionIcon: cancel;
+ toolTipText: "faxtomail.action.goto.previousScreen.tip";
_applicationAction: { com.franciaflex.faxtomail.ui.swing.actions.GoToPreviousScreenAction.class };
}
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIHandler.java 2014-09-26 17:17:17 UTC (rev 646)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandesUIHandler.java 2014-09-29 09:34:03 UTC (rev 647)
@@ -32,6 +32,7 @@
import javax.swing.JComponent;
import javax.swing.JTabbedPane;
+import com.franciaflex.faxtomail.ui.swing.actions.GoToPreviousScreenAction;
import com.franciaflex.faxtomail.ui.swing.actions.SaveAndOpenChooseAttachmentToPrintAction;
import com.franciaflex.faxtomail.ui.swing.actions.SaveAndOpenMailFolderChooserAction;
import com.franciaflex.faxtomail.ui.swing.actions.SaveAndOpenReplyFormAction;
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/HistoryListUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/HistoryListUIHandler.java 2014-09-26 17:17:17 UTC (rev 646)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/history/HistoryListUIHandler.java 2014-09-29 09:34:03 UTC (rev 647)
@@ -163,6 +163,7 @@
sendAction.putValue(Action.LARGE_ICON_KEY, actionIcon);
sendAction.putValue(Action.NAME, "send");
sendAction.putValue(Action.SHORT_DESCRIPTION, t("faxtomail.demande.history.action.send.tip"));
+
JButton sendButton = new JButton(sendAction);
sendButton.setText(null);
sendButton.setFocusPainted(false);
Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java
===================================================================
--- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-09-26 17:17:17 UTC (rev 646)
+++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/util/AbstractFaxToMailUIHandler.java 2014-09-29 09:34:03 UTC (rev 647)
@@ -33,6 +33,7 @@
import java.awt.event.KeyEvent;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
+import java.awt.event.WindowListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.io.Serializable;
@@ -239,12 +240,9 @@
public void openFrame(ApplicationUI dialogContent,
String title, Dimension dim) {
- JFrame result = getContext().getSecondaryFrame();
- if (result == null) {
- result = new JFrame();
- result.setResizable(true);
- getContext().setSecondaryFrame(result);
- }
+ JFrame result = new JFrame();
+ result.setResizable(true);
+ getContext().setSecondaryFrame(result);
result.setTitle(title);
result.setContentPane((Container) dialogContent);
@@ -279,12 +277,9 @@
* Open frame and disable parent frame
*/
public JFrame openModalFrame(final ApplicationUI dialogContent, String title, Dimension dim) {
- JFrame result = getContext().getSecondaryFrame();
- if (result == null) {
- result = new JFrame();
- result.setResizable(true);
- getContext().setSecondaryFrame(result);
- }
+ JFrame result = new JFrame();
+ result.setResizable(true);
+ getContext().setSecondaryFrame(result);
final JFrame parentContainer = getParentContainer(JFrame.class);
parentContainer.setEnabled(false);
@@ -309,7 +304,7 @@
@Override
public void actionPerformed(ActionEvent e) {
- ((org.nuiton.jaxx.application.swing.util.Cancelable) handler).cancel();
+ ((Cancelable) handler).cancel();
}
});
}
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2014-09-26 17:17:17 UTC (rev 646)
+++ trunk/pom.xml 2014-09-29 09:34:03 UTC (rev 647)
@@ -110,7 +110,7 @@
<h2Version>1.3.176</h2Version>
<guavaVersion>18.0</guavaVersion>
- <jaxxVersion>2.13-SNAPSHOT</jaxxVersion>
+ <jaxxVersion>2.14-SNAPSHOT</jaxxVersion>
<!-- do not upgrade to 1.6.5-1 -->
<swingXVersion>1.6.4</swingXVersion>
<xworkVersion>2.3.16.3</xworkVersion>
1
0