branch feature/7421 updated (fbe4783 -> b6b6713)
This is an automated email from the git hooks/post-receive script. New change to branch feature/7421 in repository faxtomail. See http://git.codelutin.com/faxtomail.git discards fbe4783 ajout d'un bouton pour cacher ou afficher les pj moins importantes (refs #7421) adds 02c1513 modification du modèle pour configurer les tmapons par utilisateur et groupe ldap (refs #7492) adds 7fe4e3f ajout de la conf par ldap des tampons dans l'admin (refs #7492) adds a1e24dc récupération des tampons pour l'utilisateur (refs #7492) adds 72ad43b fix NPE adds f25551a fixes #7492 Configurer les tampons par utilisateur/groupe LDAP, pas par dossier adds 730fcb7 [jgitflow-maven-plugin]updating poms for 1.6-SNAPSHOT development adds 572ee05 [jgitflow-maven-plugin]updating develop poms to master versions to avoid merge conflicts adds 20b2200 Fix release adds 6e49208 [jgitflow-maven-plugin]updating poms for branch'release/1.5' with non-snapshot versions adds afc64fc [jgitflow-maven-plugin]merging 'release/1.5' into 'master' adds 4b7614e [jgitflow-maven-plugin]merging 'master' into 'develop' adds a6a9df8 [jgitflow-maven-plugin]Updating develop poms back to pre merge state new 3781652 ajout d'un bouton pour cacher ou afficher les pj moins importantes (refs #7421) new 171e9e2 ajout des attributs sur les attachments pour marquer les pj internes à l'email et les pj moins importantes pour l'utilisateur (refs #7421) new 55ff993 migration #7421 new 7ab85c3 ui pour marque les pj comme non importantes (refs #7421) new b6b6713 Affichage des pj inline dans une liste séparée, affcihée ou non grâce à un bouton (refs #7421) This update added new revisions after undoing existing revisions. That is to say, some revisions that were in the old version of the branch are not in the new version. This situation occurs when a user --force pushes a change and generates a repository containing something like this: * -- * -- B -- O -- O -- O (fbe4783) \ N -- N -- N refs/heads/feature/7421 (b6b6713) You should already have received notification emails for all of the O revisions, and so the following emails describe only the N revisions from the common base, B. Any revisions marked "omits" are not gone; other references still refer to them. Any revisions marked "discards" are gone forever. The 5 revisions listed above as "new" are entirely new to this repository and will be described in separate emails. The revisions listed as "adds" were already present in the repository and have only been added to this reference. Detailed log of new commits: commit b6b6713a243f59b48dc138a315d2e7324d611d05 Author: Kevin Morin <morin@codelutin.com> Date: Mon Aug 31 18:12:36 2015 +0200 Affichage des pj inline dans une liste séparée, affcihée ou non grâce à un bouton (refs #7421) commit 7ab85c3f2fe50e8905afa478d6d3e81f32a5c43a Author: Kevin Morin <morin@codelutin.com> Date: Mon Aug 31 17:08:07 2015 +0200 ui pour marque les pj comme non importantes (refs #7421) commit 55ff99356243391cef694189cf60b907069922da Author: Kevin Morin <morin@codelutin.com> Date: Mon Aug 31 17:07:53 2015 +0200 migration #7421 commit 171e9e27b9de7824857b7436f6ac3ac57d037d28 Author: Kevin Morin <morin@codelutin.com> Date: Mon Aug 31 10:51:08 2015 +0200 ajout des attributs sur les attachments pour marquer les pj internes à l'email et les pj moins importantes pour l'utilisateur (refs #7421) commit 3781652a643c2062f755b1f1468444c4023e2507 Author: Kevin Morin <morin@codelutin.com> Date: Fri Aug 28 13:32:38 2015 +0200 ajout d'un bouton pour cacher ou afficher les pj moins importantes (refs #7421) Summary of changes: faxtomail-persistence/pom.xml | 2 +- ...sionCommandTopiaDao.java => StampTopiaDao.java} | 33 ++++--- faxtomail-persistence/src/main/xmi/faxtomail.zargo | Bin 32540 -> 32762 bytes faxtomail-service/pom.xml | 2 +- .../services/service/ConfigurationServiceImpl.java | 2 + .../services/service/MailFolderService.java | 2 - .../services/service/MailFolderServiceImpl.java | 19 ---- .../faxtomail/services/service/UserService.java | 3 + .../services/service/UserServiceImpl.java | 11 +++ .../h2/V1_5_0_150828__configure_stamps_by_ldap.sql | 41 ++++++++ ...d_attributes_for_less_important_attachments.sql | 5 + .../V1_5_0_150828__configure_stamps_by_ldap.sql | 59 ++++++++++++ ...d_attributes_for_less_important_attachments.sql | 6 ++ faxtomail-ui-swing/pom.xml | 2 +- .../content/attachment/AttachmentEditorUI.css | 31 ++++++ .../content/attachment/AttachmentEditorUI.jaxx | 18 +++- .../attachment/AttachmentEditorUIHandler.java | 52 +++++++++- .../attachment/AttachmentEditorUIModel.java | 81 +++++++++++++++- .../ui/swing/content/attachment/AttachmentItem.css | 1 + .../swing/content/attachment/AttachmentItem.jaxx | 3 + .../attachment/actions/EditAttachmentAction.java | 11 ++- .../ui/swing/util/AbstractToolbarPopupButton.java | 8 +- .../i18n/faxtomail-ui-swing_fr_FR.properties | 8 ++ .../src/main/resources/icons/action-important.png | Bin 0 -> 672 bytes .../main/resources/icons/action-not-important.png | Bin 0 -> 671 bytes faxtomail-ui-web/pom.xml | 2 +- .../WEB-INF/content/admin/configuration-input.jsp | 106 ++++++++++++--------- .../src/main/webapp/js/configuration.js | 70 +++++++------- pom.xml | 2 +- 29 files changed, 445 insertions(+), 135 deletions(-) copy faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/{ExtensionCommandTopiaDao.java => StampTopiaDao.java} (54%) create mode 100644 faxtomail-service/src/main/resources/db/migration/h2/V1_5_0_150828__configure_stamps_by_ldap.sql create mode 100644 faxtomail-service/src/main/resources/db/migration/h2/V1_6_0_150831__add_attributes_for_less_important_attachments.sql create mode 100644 faxtomail-service/src/main/resources/db/migration/sqlserver/V1_5_0_150828__configure_stamps_by_ldap.sql create mode 100644 faxtomail-service/src/main/resources/db/migration/sqlserver/V1_6_0_150831__add_attributes_for_less_important_attachments.sql create mode 100644 faxtomail-ui-swing/src/main/resources/icons/action-important.png create mode 100644 faxtomail-ui-swing/src/main/resources/icons/action-not-important.png -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/7421 in repository faxtomail. See http://git.codelutin.com/faxtomail.git commit 3781652a643c2062f755b1f1468444c4023e2507 Author: Kevin Morin <morin@codelutin.com> Date: Fri Aug 28 13:32:38 2015 +0200 ajout d'un bouton pour cacher ou afficher les pj moins importantes (refs #7421) --- .../content/attachment/AttachmentEditorUI.jaxx | 26 +++++++++++++++++++++- pom.xml | 2 +- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUI.jaxx b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUI.jaxx index 4c81313..a575b86 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUI.jaxx +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUI.jaxx @@ -29,6 +29,7 @@ com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext com.franciaflex.faxtomail.persistence.entities.Attachment + jaxx.runtime.swing.HidorButton jaxx.runtime.swing.editor.FileEditor jaxx.runtime.swing.model.JaxxDefaultListModel @@ -54,7 +55,30 @@ <JLabel id='noAttachmentsLabel' constraints="BorderLayout.NORTH"/> - <JXTable id='attachments' constraints="BorderLayout.CENTER"/> + <Table fill="both" + constraints="BorderLayout.CENTER"> + + <row> + <cell weightx="1.0"> + <JXTable id='attachments'/> + </cell> + </row> + + <row> + <cell> + <HidorButton id='junkAttachmentsLabel' + target="{junkAttachments}" + targetVisible="false"/> + </cell> + </row> + + <row> + <cell> + <JXTable id='junkAttachments'/> + </cell> + </row> + + </Table> <Table id="formPanel" constraints="BorderLayout.SOUTH"> <row fill='both'> diff --git a/pom.xml b/pom.xml index fb6dd56..3f007e3 100644 --- a/pom.xml +++ b/pom.xml @@ -111,7 +111,7 @@ <h2Version>1.3.176</h2Version> <guavaVersion>18.0</guavaVersion> - <jaxxVersion>2.24</jaxxVersion> + <jaxxVersion>2.25</jaxxVersion> <!-- do not upgrade to 1.6.5-1 --> <swingXVersion>1.6.4</swingXVersion> <xworkVersion>2.3.16.3</xworkVersion> -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/7421 in repository faxtomail. See http://git.codelutin.com/faxtomail.git commit 171e9e27b9de7824857b7436f6ac3ac57d037d28 Author: Kevin Morin <morin@codelutin.com> Date: Mon Aug 31 10:51:08 2015 +0200 ajout des attributs sur les attachments pour marquer les pj internes à l'email et les pj moins importantes pour l'utilisateur (refs #7421) --- faxtomail-persistence/src/main/xmi/faxtomail.zargo | Bin 32674 -> 32762 bytes .../services/service/ConfigurationServiceImpl.java | 2 ++ 2 files changed, 2 insertions(+) diff --git a/faxtomail-persistence/src/main/xmi/faxtomail.zargo b/faxtomail-persistence/src/main/xmi/faxtomail.zargo index 0247562..ea071eb 100644 Binary files a/faxtomail-persistence/src/main/xmi/faxtomail.zargo and b/faxtomail-persistence/src/main/xmi/faxtomail.zargo differ diff --git a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationServiceImpl.java b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationServiceImpl.java index 78b5ab3..1f787cc 100644 --- a/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationServiceImpl.java +++ b/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/ConfigurationServiceImpl.java @@ -187,6 +187,8 @@ public class ConfigurationServiceImpl extends FaxToMailServiceSupport implements Stamp currentStamp; if (StringUtils.isBlank(stamp.getTopiaId()) || stamp.getTopiaId().startsWith("new_")) { currentStamp = new StampImpl(); + currentStamp.setSigning(false); + } else { currentStamp = allStampsIndex.remove(stamp.getTopiaId()); } -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/7421 in repository faxtomail. See http://git.codelutin.com/faxtomail.git commit 55ff99356243391cef694189cf60b907069922da Author: Kevin Morin <morin@codelutin.com> Date: Mon Aug 31 17:07:53 2015 +0200 migration #7421 --- ...V1_6_0_150831__add_attributes_for_less_important_attachments.sql | 5 +++++ ...V1_6_0_150831__add_attributes_for_less_important_attachments.sql | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/faxtomail-service/src/main/resources/db/migration/h2/V1_6_0_150831__add_attributes_for_less_important_attachments.sql b/faxtomail-service/src/main/resources/db/migration/h2/V1_6_0_150831__add_attributes_for_less_important_attachments.sql new file mode 100644 index 0000000..097ae91 --- /dev/null +++ b/faxtomail-service/src/main/resources/db/migration/h2/V1_6_0_150831__add_attributes_for_less_important_attachments.sql @@ -0,0 +1,5 @@ +alter table attachment add inlineAttachment boolean; +alter table attachment add lessImportant boolean; + +update attachment set inlineAttachment = 'f'; +update attachment set lessImportant = 'f'; \ No newline at end of file diff --git a/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_6_0_150831__add_attributes_for_less_important_attachments.sql b/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_6_0_150831__add_attributes_for_less_important_attachments.sql new file mode 100644 index 0000000..be4417c --- /dev/null +++ b/faxtomail-service/src/main/resources/db/migration/sqlserver/V1_6_0_150831__add_attributes_for_less_important_attachments.sql @@ -0,0 +1,6 @@ +alter table attachment add inlineAttachment bit; +alter table attachment add lessImportant bit; +GO + +update attachment set inlineAttachment = 0; +update attachment set lessImportant = 0; \ No newline at end of file -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/7421 in repository faxtomail. See http://git.codelutin.com/faxtomail.git commit 7ab85c3f2fe50e8905afa478d6d3e81f32a5c43a Author: Kevin Morin <morin@codelutin.com> Date: Mon Aug 31 17:08:07 2015 +0200 ui pour marque les pj comme non importantes (refs #7421) --- .../content/attachment/AttachmentEditorUI.css | 15 +++++++ .../content/attachment/AttachmentEditorUI.jaxx | 12 +++++- .../attachment/AttachmentEditorUIHandler.java | 31 +++++++++++++ .../attachment/AttachmentEditorUIModel.java | 48 ++++++++++++++++++++- .../ui/swing/content/attachment/AttachmentItem.css | 1 + .../swing/content/attachment/AttachmentItem.jaxx | 3 ++ .../i18n/faxtomail-ui-swing_fr_FR.properties | 4 ++ .../src/main/resources/icons/action-important.png | Bin 0 -> 672 bytes .../main/resources/icons/action-not-important.png | Bin 0 -> 671 bytes 9 files changed, 112 insertions(+), 2 deletions(-) diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUI.css b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUI.css index 565279d..e1522bc 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUI.css +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUI.css @@ -25,6 +25,20 @@ minimumSize: { new java.awt.Dimension(250, 0) }; } +#markItemAsLessImportantMenu { + actionIcon: not-important; + text: "faxtomail.attachmentEditor.action.markItemAsLessImportant"; + toolTipText: "faxtomail.attachmentEditor.action.markItemAsLessImportant.tip"; + visible: { !model.getSelectedAttachment().isLessImportant() }; +} + +#unmarkItemAsLessImportantMenu { + actionIcon: important; + text: "faxtomail.attachmentEditor.action.unmarkItemAsLessImportant"; + toolTipText: "faxtomail.attachmentEditor.action.unmarkItemAsLessImportant.tip"; + visible: { model.getSelectedAttachment().isLessImportant() }; +} + #body { title: "faxtomail.attachmentEditor.title"; } @@ -39,6 +53,7 @@ #attachments { editable: true; visible: { !model.getAttachment().isEmpty() }; + selectionMode: { ListSelectionModel.SINGLE_SELECTION }; } #formPanel { diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUI.jaxx b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUI.jaxx index a575b86..4702a90 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUI.jaxx +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUI.jaxx @@ -35,7 +35,9 @@ org.jdesktop.swingx.JXTable org.jdesktop.swingx.JXTitledPanel + javax.swing.JComponent + javax.swing.ListSelectionModel </import> <script><![CDATA[ @@ -49,6 +51,13 @@ <AttachmentEditorUIModel id='model' initializer='new AttachmentEditorUIModel()'/> + <JPopupMenu id='attachmentsPopup'> + <JMenuItem id='markItemAsLessImportantMenu' + onActionPerformed='handler.markItemAsLessImportant()'/> + <JMenuItem id='unmarkItemAsLessImportantMenu' + onActionPerformed='handler.unmarkItemAsLessImportant()'/> + </JPopupMenu> + <JXTitledPanel id='body'> <JScrollPane id='attachmentBodyScrollPane'> <JPanel id='mainPanel' layout="{new BorderLayout()}"> @@ -60,7 +69,8 @@ <row> <cell weightx="1.0"> - <JXTable id='attachments'/> + <JXTable id='attachments' + onMouseClicked='handler.autoSelectRowInTable(event, attachmentsPopup)'/> </cell> </row> diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIHandler.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIHandler.java index 7c4f642..3ef6f6f 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIHandler.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIHandler.java @@ -33,6 +33,8 @@ import com.google.common.collect.Iterables; import jaxx.runtime.SwingUtil; import jaxx.runtime.validator.swing.SwingValidator; import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.jdesktop.swingx.JXTable; import org.jdesktop.swingx.decorator.HighlighterFactory; @@ -59,6 +61,11 @@ import static org.nuiton.i18n.I18n.t; */ public class AttachmentEditorUIHandler extends AbstractToolbarPopupHandler<AttachmentEditorUIModel, AttachmentEditorUI> { + /** + * Logger. + */ + private static final Log log = LogFactory.getLog(AttachmentEditorUIHandler.class); + @Override public void afterInit(AttachmentEditorUI ui) { @@ -186,6 +193,30 @@ public class AttachmentEditorUIHandler extends AbstractToolbarPopupHandler<Attac return attachment != null && attachment.getTopiaId() == null; } + @Override + protected void beforeOpenPopup(int modelRowIndex, int modelColumnIndex) { + super.beforeOpenPopup(modelRowIndex, modelColumnIndex); + AttachmentEditorUIModel model = getModel(); + Attachment attachment = model.getAttachment().get(modelRowIndex); + model.setSelectedAttachment(attachment); + } + + public void markItemAsLessImportant() { + setSelectedAttachmentLessImportant(true); + } + + public void unmarkItemAsLessImportant() { + setSelectedAttachmentLessImportant(false); + } + + protected void setSelectedAttachmentLessImportant(boolean lessImportant) { + AttachmentEditorUIModel model = getModel(); + Attachment selectedAttachment = model.getSelectedAttachment(); + selectedAttachment.setLessImportant(lessImportant); + model.sortAttachments(); + model.setSelectedAttachment(null); + } + protected class AttachmentItemRenderer extends AttachmentItem implements TableCellRenderer { public AttachmentItemRenderer() { diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIModel.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIModel.java index 4fda891..dd6c583 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIModel.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIModel.java @@ -26,10 +26,14 @@ package com.franciaflex.faxtomail.ui.swing.content.attachment; import com.franciaflex.faxtomail.persistence.entities.Attachment; import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailBeanUIModel; +import org.apache.commons.lang3.ObjectUtils; +import org.apache.commons.lang3.StringUtils; import org.nuiton.util.beans.Binder; import org.nuiton.util.beans.BinderFactory; import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; import java.util.List; /** @@ -40,12 +44,39 @@ public class AttachmentEditorUIModel extends AbstractFaxToMailBeanUIModel<Attach //public static final String PROPERTY_FILE = "file"; public static final String PROPERTY_EDITABLE = "editable"; + public static final String PROPERTY_SELECTED_ATTACHMENT = "selectedAttachment"; + + public static final Comparator<Attachment> ATTACHMENT_COMPARATOR = new Comparator<Attachment>() { + @Override + public int compare(Attachment o1, Attachment o2) { + if (o1 == null) { + + if (o2 == null) { + return 0; + } + + return o2 == null ? 0 : -1; + } + if (o2 == null) { + return 1; + } + + if (o1.isLessImportant() ^ o2.isLessImportant()) { + return o1.isLessImportant() ? 1 : -1; + } + + return ObjectUtils.compare(StringUtils.lowerCase(o1.getOriginalFileName()), + StringUtils.lowerCase(o2.getOriginalFileName())); + } + }; //protected File file; protected boolean editable = true; protected final List<Attachment> attachments = new ArrayList<Attachment>(); + protected Attachment selectedAttachment; + protected List<AttachmentListener> openingListeners = new ArrayList<AttachmentListener>(); protected static Binder<AttachmentEditorUIModel, AttachmentModelAware> toBeanBinder = @@ -92,14 +123,29 @@ public class AttachmentEditorUIModel extends AbstractFaxToMailBeanUIModel<Attach } public void setAttachment(List<Attachment> attachments) { - Object oldValue = new ArrayList<Attachment>(getAttachment()); + Object oldValue = new ArrayList<>(getAttachment()); this.attachments.clear(); if (attachments != null) { this.attachments.addAll(attachments); + sortAttachments(); } firePropertyChange(AttachmentModelAware.PROPERTY_ATTACHMENT, oldValue, this.attachments); } + public void sortAttachments() { + Collections.sort(this.attachments, ATTACHMENT_COMPARATOR); + } + + public Attachment getSelectedAttachment() { + return selectedAttachment; + } + + public void setSelectedAttachment(Attachment selectedAttachment) { + Object oldValue = getSelectedAttachment(); + this.selectedAttachment = selectedAttachment; + firePropertyChange(PROPERTY_SELECTED_ATTACHMENT, oldValue, selectedAttachment); + } + @Override protected AttachmentModelAware newEntity() { return null; diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentItem.css b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentItem.css index 29a6dc4..55f6209 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentItem.css +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentItem.css @@ -27,6 +27,7 @@ #attachmentNameLabel { text: { attachment != null ? getAttachment().getOriginalFileName() : null }; + foreground: { attachment != null && getAttachment().isLessImportant() ? Color.LIGHT_GRAY : Color.BLACK }; } #toolbar { diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentItem.jaxx b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentItem.jaxx index b2477b1..2362bf0 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentItem.jaxx +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentItem.jaxx @@ -25,6 +25,9 @@ <import> com.franciaflex.faxtomail.persistence.entities.Attachment + + java.awt.Color + static org.nuiton.i18n.I18n.t static jaxx.runtime.JAXXUtil.getStringValue </import> diff --git a/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties b/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties index 7ca77d6..dffb827 100644 --- a/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties +++ b/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties @@ -57,10 +57,14 @@ faxtomail.attachmentCellRenderer.text=(%s) faxtomail.attachmentEditor.action.add.tip=Ajouter une pièce jointe faxtomail.attachmentEditor.action.closeAttachment.tip=Fermer la fenêtre des pièces-jointes faxtomail.attachmentEditor.action.edit.tip=Editer la pièce jointe +faxtomail.attachmentEditor.action.markItemAsLessImportant=Non important +faxtomail.attachmentEditor.action.markItemAsLessImportant.tip=Marquer la pièce jointe comme non important faxtomail.attachmentEditor.action.open.tip=Ouvrir la pièce jointe faxtomail.attachmentEditor.action.openedited.tip=Ouvrir la pièce jointe éditée faxtomail.attachmentEditor.action.remove.tip=Supprimer la pièce jointe faxtomail.attachmentEditor.action.tip=Pièces jointes +faxtomail.attachmentEditor.action.unmarkItemAsLessImportant=Important +faxtomail.attachmentEditor.action.unmarkItemAsLessImportant.tip=Marquer la pièce jointe comme importante faxtomail.attachmentEditor.attachments.empty=Aucune pièce jointe faxtomail.attachmentEditor.deleteAttachment.message=Êtes-vous sûr de vouloir supprimer la pièce-jointe %s ? faxtomail.attachmentEditor.deleteAttachment.title=Suppression de pièce-jointe diff --git a/faxtomail-ui-swing/src/main/resources/icons/action-important.png b/faxtomail-ui-swing/src/main/resources/icons/action-important.png new file mode 100644 index 0000000..e4bc611 Binary files /dev/null and b/faxtomail-ui-swing/src/main/resources/icons/action-important.png differ diff --git a/faxtomail-ui-swing/src/main/resources/icons/action-not-important.png b/faxtomail-ui-swing/src/main/resources/icons/action-not-important.png new file mode 100644 index 0000000..14c89a5 Binary files /dev/null and b/faxtomail-ui-swing/src/main/resources/icons/action-not-important.png differ -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
This is an automated email from the git hooks/post-receive script. New commit to branch feature/7421 in repository faxtomail. See http://git.codelutin.com/faxtomail.git commit b6b6713a243f59b48dc138a315d2e7324d611d05 Author: Kevin Morin <morin@codelutin.com> Date: Mon Aug 31 18:12:36 2015 +0200 Affichage des pj inline dans une liste séparée, affcihée ou non grâce à un bouton (refs #7421) --- .../content/attachment/AttachmentEditorUI.css | 16 ++++++++++ .../content/attachment/AttachmentEditorUI.jaxx | 6 ++-- .../attachment/AttachmentEditorUIHandler.java | 21 ++++++++++--- .../attachment/AttachmentEditorUIModel.java | 35 ++++++++++++++++++++-- .../i18n/faxtomail-ui-swing_fr_FR.properties | 4 +++ 5 files changed, 71 insertions(+), 11 deletions(-) diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUI.css b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUI.css index e1522bc..d17f400 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUI.css +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUI.css @@ -56,6 +56,22 @@ selectionMode: { ListSelectionModel.SINGLE_SELECTION }; } +#inlineAttachmentsHidor { + hideText: { t("faxtomail.attachmentEditor.inlineAttachments.hidor.hideText", model.getInlineAttachments().size()) }; + hideTip: { t("faxtomail.attachmentEditor.inlineAttachments.hidor.hideTip", model.getInlineAttachments().size()) }; + showText: { t("faxtomail.attachmentEditor.inlineAttachments.hidor.showText", model.getInlineAttachments().size()) }; + showTip: { t("faxtomail.attachmentEditor.inlineAttachments.hidor.showTip", model.getInlineAttachments().size()) }; + target: { inlineAttachments }; + targetVisible: false; + visible: { !model.getInlineAttachments().isEmpty() }; +} + +#inlineAttachments { + editable: true; + visible: false; + selectionMode: { ListSelectionModel.SINGLE_SELECTION }; +} + #formPanel { visible: { model.isEditable() }; } diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUI.jaxx b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUI.jaxx index 4702a90..b355c84 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUI.jaxx +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUI.jaxx @@ -76,15 +76,13 @@ <row> <cell> - <HidorButton id='junkAttachmentsLabel' - target="{junkAttachments}" - targetVisible="false"/> + <HidorButton id='inlineAttachmentsHidor'/> </cell> </row> <row> <cell> - <JXTable id='junkAttachments'/> + <JXTable id='inlineAttachments'/> </cell> </row> diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIHandler.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIHandler.java index 3ef6f6f..4b1811b 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIHandler.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIHandler.java @@ -31,6 +31,7 @@ import com.franciaflex.faxtomail.ui.swing.util.AbstractToolbarPopupHandler; import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil; import com.google.common.collect.Iterables; import jaxx.runtime.SwingUtil; +import jaxx.runtime.swing.HidorButton; import jaxx.runtime.validator.swing.SwingValidator; import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.logging.Log; @@ -53,6 +54,7 @@ import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.beans.PropertyChangeEvent; import java.beans.PropertyChangeListener; +import java.util.Collection; import static org.nuiton.i18n.I18n.t; @@ -72,23 +74,34 @@ public class AttachmentEditorUIHandler extends AbstractToolbarPopupHandler<Attac ui.getFile().setDialogOwner(ui); super.afterInit(ui); - initTable(ui.getAttachments()); + initTable(ui.getAttachments(), getModel().getAttachment()); + initTable(ui.getInlineAttachments(), getModel().getInlineAttachments()); + + ui.getInlineAttachmentsHidor().addPropertyChangeListener(HidorButton.PROPERTY_TARGET_VISIBLE, new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + getUI().pack(); + } + }); getModel().addPropertyChangeListener(AttachmentModelAware.PROPERTY_ATTACHMENT, new PropertyChangeListener() { @Override public void propertyChange(PropertyChangeEvent evt) { AbstractTableModel tableModel = (AbstractTableModel) getUI().getAttachments().getModel(); tableModel.fireTableDataChanged(); + tableModel = (AbstractTableModel) getUI().getInlineAttachments().getModel(); + tableModel.fireTableDataChanged(); } }); + } - protected void initTable(JXTable table) { + protected void initTable(JXTable table, final Collection<Attachment> attachmentList) { TableModel attachmentTableModel = new AbstractTableModel() { @Override public int getRowCount() { - return CollectionUtils.size(getModel().getAttachment()); + return CollectionUtils.size(attachmentList); } @Override @@ -98,7 +111,7 @@ public class AttachmentEditorUIHandler extends AbstractToolbarPopupHandler<Attac @Override public Object getValueAt(int rowIndex, int columnIndex) { - return Iterables.get(getModel().getAttachment(), rowIndex); + return Iterables.get(attachmentList, rowIndex); } @Override diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIModel.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIModel.java index dd6c583..7aabb5c 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIModel.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/attachment/AttachmentEditorUIModel.java @@ -26,6 +26,8 @@ package com.franciaflex.faxtomail.ui.swing.content.attachment; import com.franciaflex.faxtomail.persistence.entities.Attachment; import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailBeanUIModel; +import com.google.common.base.Predicate; +import com.google.common.collect.Collections2; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; import org.nuiton.util.beans.Binder; @@ -44,6 +46,7 @@ public class AttachmentEditorUIModel extends AbstractFaxToMailBeanUIModel<Attach //public static final String PROPERTY_FILE = "file"; public static final String PROPERTY_EDITABLE = "editable"; + public static final String PROPERTY_INLINE_ATTACHMENTS = "inlineAttachments"; public static final String PROPERTY_SELECTED_ATTACHMENT = "selectedAttachment"; public static final Comparator<Attachment> ATTACHMENT_COMPARATOR = new Comparator<Attachment>() { @@ -74,6 +77,7 @@ public class AttachmentEditorUIModel extends AbstractFaxToMailBeanUIModel<Attach protected boolean editable = true; protected final List<Attachment> attachments = new ArrayList<Attachment>(); + protected final List<Attachment> inlineAttachments = new ArrayList<Attachment>(); protected Attachment selectedAttachment; @@ -117,23 +121,48 @@ public class AttachmentEditorUIModel extends AbstractFaxToMailBeanUIModel<Attach } public void removeAttachment(Attachment attachment) { - Object oldValue = new ArrayList<Attachment>(getAttachment()); + Object oldValue = new ArrayList<>(getAttachment()); attachments.remove(attachment); firePropertyChange(AttachmentModelAware.PROPERTY_ATTACHMENT, oldValue, attachments); } public void setAttachment(List<Attachment> attachments) { - Object oldValue = new ArrayList<>(getAttachment()); + Object oldAttachmentsValue = new ArrayList<>(getAttachment()); + Object oldInlineAttachmentsValue = new ArrayList<>(getInlineAttachments()); this.attachments.clear(); + this.inlineAttachments.clear(); + if (attachments != null) { + + inlineAttachments.addAll(Collections2.filter(attachments, new Predicate<Attachment>() { + @Override + public boolean apply(Attachment input) { + return input.isInlineAttachment(); + } + })); + this.attachments.addAll(attachments); + + if (inlineAttachments.size() > 1) { + this.attachments.removeAll(inlineAttachments); + + } else { + inlineAttachments.clear(); + } + sortAttachments(); } - firePropertyChange(AttachmentModelAware.PROPERTY_ATTACHMENT, oldValue, this.attachments); + firePropertyChange(AttachmentModelAware.PROPERTY_ATTACHMENT, oldAttachmentsValue, this.attachments); + firePropertyChange(PROPERTY_INLINE_ATTACHMENTS, oldInlineAttachmentsValue, this.inlineAttachments); + } + + public List<Attachment> getInlineAttachments() { + return inlineAttachments; } public void sortAttachments() { Collections.sort(this.attachments, ATTACHMENT_COMPARATOR); + Collections.sort(this.inlineAttachments, ATTACHMENT_COMPARATOR); } public Attachment getSelectedAttachment() { diff --git a/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties b/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties index dffb827..120785f 100644 --- a/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties +++ b/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties @@ -69,6 +69,10 @@ faxtomail.attachmentEditor.attachments.empty=Aucune pièce jointe faxtomail.attachmentEditor.deleteAttachment.message=Êtes-vous sûr de vouloir supprimer la pièce-jointe %s ? faxtomail.attachmentEditor.deleteAttachment.title=Suppression de pièce-jointe faxtomail.attachmentEditor.field.file=Fichier +faxtomail.attachmentEditor.inlineAttachments.hidor.hideText=Divers (%s) +faxtomail.attachmentEditor.inlineAttachments.hidor.hideTip=Cacher les fichiers divers (%s) +faxtomail.attachmentEditor.inlineAttachments.hidor.showText=Divers (%s) +faxtomail.attachmentEditor.inlineAttachments.hidor.showTip=Afficher les fichiers divers (%s) faxtomail.attachmentEditor.none.tip=Aucune pièce-jointe faxtomail.attachmentEditor.text=Pièces jointes (%s) faxtomail.attachmentEditor.title=Pièces jointes -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm