r38 - in trunk: faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities faxtomail-persistence/src/main/xmi faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content 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/print faxtomail-ui-swing/src/main/java/com/fran
Author: kmorin Date: 2014-04-22 18:52:11 +0200 (Tue, 22 Apr 2014) New Revision: 38 Url: http://forge.codelutin.com/projects/faxtomail/repository/revisions/38 Log: refs #4655 [ECRAN] D?\195?\169tail d'un mail / fax Affichage ou non des gammes en fonction du type d'?\195?\169l?\195?\169ment Ecran d'impression des pi?\195?\168ces-jointes Added: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/Action.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/print/ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/print/AttachmentToPrintChooserUI.css trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/print/AttachmentToPrintChooserUI.jaxx trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/print/AttachmentToPrintChooserUIHandler.java Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 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.jaxx trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUI.css trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUI.jaxx trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties Added: trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/Action.java =================================================================== --- trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/Action.java (rev 0) +++ trunk/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/Action.java 2014-04-22 16:52:11 UTC (rev 38) @@ -0,0 +1,16 @@ +package com.franciaflex.faxtomail.persistence.entities; + +/** + * @author Kevin Morin (Code Lutin) + * @since x.x + */ +public enum Action { + + SAVE, + TRANSMIT, + PRINT, + ARCHIVE, + REPLY, + GROUP + +} Modified: trunk/faxtomail-persistence/src/main/xmi/faxtomail.zargo =================================================================== (Binary files differ) Modified: trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java =================================================================== --- trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-04-18 13:48:06 UTC (rev 37) +++ trunk/faxtomail-service/src/main/java/com/franciaflex/faxtomail/services/service/InitFaxToMailService.java 2014-04-22 16:52:11 UTC (rev 38) @@ -151,33 +151,34 @@ if (count == 0) { List<DemandType> types = Lists.newArrayList( - demandTypeDao.create(DemandType.PROPERTY_LABEL, "Commande"), - demandTypeDao.create(DemandType.PROPERTY_LABEL, "Commande Réponse"), - demandTypeDao.create(DemandType.PROPERTY_LABEL, "Commande Annulation/Modification"), - demandTypeDao.create(DemandType.PROPERTY_LABEL, "Devis Diffus"), - demandTypeDao.create(DemandType.PROPERTY_LABEL, "Devis Chantier"), - demandTypeDao.create(DemandType.PROPERTY_LABEL, "Devis Gros Chantier"), - demandTypeDao.create(DemandType.PROPERTY_LABEL, "Devis Réponse/Modification"), - demandTypeDao.create(DemandType.PROPERTY_LABEL, "Réclamation"), - demandTypeDao.create(DemandType.PROPERTY_LABEL, "Autres") + demandTypeDao.create(DemandType.PROPERTY_LABEL, "Commande", DemandType.PROPERTY_RANGE_NEEDED, true), + demandTypeDao.create(DemandType.PROPERTY_LABEL, "Commande Réponse", DemandType.PROPERTY_RANGE_NEEDED, false), + demandTypeDao.create(DemandType.PROPERTY_LABEL, "Commande Annulation/Modification", DemandType.PROPERTY_RANGE_NEEDED, false), + demandTypeDao.create(DemandType.PROPERTY_LABEL, "Devis Diffus", DemandType.PROPERTY_RANGE_NEEDED, true), + demandTypeDao.create(DemandType.PROPERTY_LABEL, "Devis Chantier", DemandType.PROPERTY_RANGE_NEEDED, true), + demandTypeDao.create(DemandType.PROPERTY_LABEL, "Devis Gros Chantier", DemandType.PROPERTY_RANGE_NEEDED, true), + demandTypeDao.create(DemandType.PROPERTY_LABEL, "Devis Réponse/Modification", DemandType.PROPERTY_RANGE_NEEDED, false), + demandTypeDao.create(DemandType.PROPERTY_LABEL, "Réclamation", DemandType.PROPERTY_RANGE_NEEDED, false), + demandTypeDao.create(DemandType.PROPERTY_LABEL, "Autres", DemandType.PROPERTY_RANGE_NEEDED, false) ); EtatAttenteTopiaDao etatAttenteDao = getPersistenceContext().getEtatAttenteDao(); List<EtatAttente> etatAttentes = Lists.newArrayList( - etatAttenteDao.create(Range.PROPERTY_LABEL, "BAT attente retour BAT lettrage-logo"), - etatAttenteDao.create(Range.PROPERTY_LABEL, "CLT attente réponse client"), - etatAttenteDao.create(Range.PROPERTY_LABEL, "DAC attente pour assistance chantier"), - etatAttenteDao.create(Range.PROPERTY_LABEL, "DAV attente analyse avoir"), - etatAttenteDao.create(Range.PROPERTY_LABEL, "EXP attente expertise"), - etatAttenteDao.create(Range.PROPERTY_LABEL, "GAB attente reception gabarit"), - etatAttenteDao.create(Range.PROPERTY_LABEL, "GRA attente accord gratuit"), - etatAttenteDao.create(Range.PROPERTY_LABEL, "ODC attente Ouverture de Compte"), - etatAttenteDao.create(Range.PROPERTY_LABEL, "PPC attente chiffrage BEI PPC"), - etatAttenteDao.create(Range.PROPERTY_LABEL, "PROFORMA attente paiement proforma"), - etatAttenteDao.create(Range.PROPERTY_LABEL, "PROTO attente accord proto"), - etatAttenteDao.create(Range.PROPERTY_LABEL, "REM Attente Remise-accord expo"), - etatAttenteDao.create(Range.PROPERTY_LABEL, "RET attente retour materiel"), - etatAttenteDao.create(Range.PROPERTY_LABEL, "SIGN attente réponse BEI signature") + etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "BAT attente retour BAT lettrage-logo"), + etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "CLT attente réponse client"), + etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "DAC attente pour assistance chantier"), + etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "DAV attente analyse avoir"), + etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "EXP attente expertise"), + etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "GAB attente reception gabarit"), + etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "GRA attente accord gratuit"), + etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "ODC attente Ouverture de Compte"), + etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "PPC attente chiffrage BEI PPC"), + etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "PROFORMA attente paiement proforma"), + etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "PROTO attente accord proto"), + etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "REM Attente Remise-accord expo"), + etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "RET attente retour materiel"), + etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "SIGN attente réponse BEI signature"), + etatAttenteDao.create(EtatAttente.PROPERTY_LABEL, "SPAM") ); PriorityTopiaDao priorityDao = getPersistenceContext().getPriorityDao(); 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-04-18 13:48:06 UTC (rev 37) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.css 2014-04-22 16:52:11 UTC (rev 38) @@ -156,6 +156,10 @@ editable: false; } +.text-row { + layout: { new FlowLayout(FlowLayout.LEADING) }; +} + #takenByLabel { text: "faxtomail.demande.takenBy.label"; } @@ -204,6 +208,10 @@ text: { handler.decorate(model.getLastModificationDate()) }; } +#lastAttachmentOpeningPanel { + visible: { model.getLastAttachmentOpeningUser() != null }; +} + #lastAttachmentOpeningLabel { text: "faxtomail.demande.lastAttachmentOpening.label"; } @@ -224,6 +232,14 @@ text: { handler.decorate(model.getLastAttachmentOpeningDate()) }; } +#leftVerticalSplitPanel { + dividerSize : { Boolean.TRUE.equals(model.getDemandType().getRangeNeeded()) ? 10 : 0 }; +} + +#rangePanel { + visible: { Boolean.TRUE.equals(model.getDemandType().getRangeNeeded()) }; +} + #ediCodeNumberLabel { text: "faxtomail.demande.ediCodeNumber.label"; visible: { model.getEdiCodeNumber() != null }; Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx 2014-04-18 13:48:06 UTC (rev 37) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUI.jaxx 2014-04-22 16:52:11 UTC (rev 38) @@ -82,7 +82,8 @@ <JSplitPane constraints='BorderLayout.CENTER' orientation="{JSplitPane.HORIZONTAL_SPLIT}"> - <JSplitPane orientation="{JSplitPane.VERTICAL_SPLIT}"> + <JSplitPane orientation="{JSplitPane.VERTICAL_SPLIT}" + id="leftVerticalSplitPanel"> <JScrollPane> @@ -184,7 +185,6 @@ <JLabel id='statusField'/> </cell> </row> - <row> <cell> <JLabel id="takenByLabel"/> @@ -193,69 +193,47 @@ <JLabel id="takenByField"/> </cell> </row> + <row> - <cell columns='4'> - <JLabel id="firstOpenedLabel"/> + <cell columns="4" insets="10"> + <JSeparator/> </cell> </row> + <row> - <cell> - <JLabel id="firstOpenedByLabel"/> + <cell columns='4'> + <JPanel styleClass="text-row"> + <JLabel id="firstOpenedLabel"/> + <JLabel id="firstOpenedByLabel"/> + <JLabel id="firstOpenedByField"/> + <JLabel id="firstOpeningDateLabel"/> + <JLabel id="firstOpeningDateField"/> + </JPanel> </cell> - <cell columns="3"> - <JLabel id="firstOpenedByField"/> - </cell> </row> <row> - <cell> - <JLabel id="firstOpeningDateLabel"/> - </cell> - <cell weightx='1' columns="3"> - <JLabel id="firstOpeningDateField"/> - </cell> - </row> - <row> <cell columns='4'> - <JLabel id="lastModifiedLabel"/> + <JPanel styleClass="text-row"> + <JLabel id="lastModifiedLabel"/> + <JLabel id="lastModifiedByLabel"/> + <JLabel id="lastModifiedByField"/> + <JLabel id="lastModificationDateLabel"/> + <JLabel id="lastModificationDateField"/> + </JPanel> </cell> </row> <row> - <cell> - <JLabel id="lastModifiedByLabel"/> - </cell> - <cell columns="3"> - <JLabel id="lastModifiedByField"/> - </cell> - </row> - <row> - <cell> - <JLabel id="lastModificationDateLabel"/> - </cell> - <cell weightx='1' columns="3"> - <JLabel id="lastModificationDateField"/> - </cell> - </row> - <row> <cell columns='4'> - <JLabel id="lastAttachmentOpeningLabel"/> + <JPanel id="lastAttachmentOpeningPanel" + styleClass="text-row"> + <JLabel id="lastAttachmentOpeningLabel"/> + <JLabel id="lastAttachmentOpenedByLabel"/> + <JLabel id="lastAttachmentOpenedByField"/> + <JLabel id="lastAttachmentOpeningDateLabel"/> + <JLabel id="lastAttachmentOpeningDateField"/> + </JPanel> </cell> </row> - <row> - <cell> - <JLabel id="lastAttachmentOpenedByLabel"/> - </cell> - <cell columns="3"> - <JLabel id="lastAttachmentOpenedByField"/> - </cell> - </row> - <row> - <cell> - <JLabel id="lastAttachmentOpeningDateLabel"/> - </cell> - <cell weightx='1' columns="3"> - <JLabel id="lastAttachmentOpeningDateField"/> - </cell> - </row> <row> <cell> @@ -271,7 +249,7 @@ </JScrollPane> - <JPanel layout="{new BorderLayout()}"> + <JPanel layout="{new BorderLayout()}" id="rangePanel"> <JPanel layout="{new FlowLayout(FlowLayout.LEADING)}" constraints='BorderLayout.NORTH'> <JLabel id="quotationNbLabel"/> <JLabel id="quotationNbField"/> @@ -289,7 +267,8 @@ </JSplitPane> - <JSplitPane orientation="{JSplitPane.VERTICAL_SPLIT}"> + <JSplitPane orientation="{JSplitPane.VERTICAL_SPLIT}" + id="rightVerticalSplitPanel"> <JPanel layout="{new BorderLayout()}"> <JLabel id='mailBodyLabel' constraints="BorderLayout.NORTH"/> Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-04-18 13:48:06 UTC (rev 37) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeUIHandler.java 2014-04-22 16:52:11 UTC (rev 38) @@ -24,6 +24,7 @@ import com.franciaflex.faxtomail.persistence.entities.Attachment; +import com.franciaflex.faxtomail.persistence.entities.DemandType; import com.franciaflex.faxtomail.persistence.entities.Email; import com.franciaflex.faxtomail.persistence.entities.EtatAttente; import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser; @@ -34,6 +35,7 @@ import com.franciaflex.faxtomail.services.service.EmailService; import com.franciaflex.faxtomail.services.service.ReferentielService; import com.franciaflex.faxtomail.ui.swing.actions.SaveDemandeAction; +import com.franciaflex.faxtomail.ui.swing.content.print.AttachmentToPrintChooserUI; import com.franciaflex.faxtomail.ui.swing.content.reply.ReplyFormUI; import com.franciaflex.faxtomail.ui.swing.content.reply.ReplyFormUIModel; import com.franciaflex.faxtomail.ui.swing.content.search.SearchToGroupUI; @@ -81,6 +83,7 @@ import java.util.Date; import java.util.List; import java.util.Map; +import java.util.Objects; import java.util.Set; import static org.nuiton.i18n.I18n.t; @@ -117,6 +120,32 @@ monitor.setBean(model); this.ui.setContextValue(model); + + model.addPropertyChangeListener(Email.PROPERTY_DEMAND_TYPE, new PropertyChangeListener() { + + private int dividerLocation = -1; + + @Override + public void propertyChange(PropertyChangeEvent evt) { + DemandType newType = (DemandType) evt.getNewValue(); + DemandType oldType = (DemandType) evt.getOldValue(); + + if (oldType == null || + newType != null && !Objects.equals(oldType.getRangeNeeded(), newType.getRangeNeeded())) { + JSplitPane leftVerticalSplitPanel = getUI().getLeftVerticalSplitPanel(); + + if (Boolean.TRUE.equals(newType.getRangeNeeded())) { + if (dividerLocation < 0) { + dividerLocation = leftVerticalSplitPanel.getLeftComponent().getPreferredSize().height + 10; + } + leftVerticalSplitPanel.setDividerLocation(dividerLocation); + + } else { + dividerLocation = leftVerticalSplitPanel.getDividerLocation(); + } + } + } + }); } @Override @@ -344,6 +373,7 @@ } ); + } @Override @@ -422,22 +452,24 @@ closeButtonPopups(); saveBeforeAction(); - for (Attachment attachment : getModel().getAttachment()) { -// try { - File editedFile = attachment.getEditedFile(); - if (editedFile == null) { - editedFile = attachment.getOriginalFile(); - } - log.info("print " + editedFile.getAbsolutePath()); -// Desktop.getDesktop().print(editedFile); - - -// } catch (IOException e) { -// if (log.isErrorEnabled()) { -// log.error("", e); +// for (Attachment attachment : getModel().getAttachment()) { +//// try { +// File editedFile = attachment.getEditedFile(); +// if (editedFile == null) { +// editedFile = attachment.getOriginalFile(); // } -// } - } +// log.info("print " + editedFile.getAbsolutePath()); +//// Desktop.getDesktop().print(editedFile); +// +// +//// } catch (IOException e) { +//// if (log.isErrorEnabled()) { +//// log.error("", e); +//// } +//// } +// } + AttachmentToPrintChooserUI dialogContent = new AttachmentToPrintChooserUI(ui, getModel()); + openDialog(dialogContent, t("faxtomail.chooseAttachmentToPrint.title"), new Dimension(350, 500)); } public void reply() { Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/print/AttachmentToPrintChooserUI.css (from rev 35, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUI.css) =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/print/AttachmentToPrintChooserUI.css (rev 0) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/print/AttachmentToPrintChooserUI.css 2014-04-22 16:52:11 UTC (rev 38) @@ -0,0 +1,18 @@ +#message { + text: "faxtomail.chooseAttachmentToPrint.message"; + border: { javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5) }; +} + +#cancelButton { + actionIcon: cancel; + text: "faxtomail.chooseAttachmentToPrint.action.cancel"; + toolTipText: "faxtomail.chooseAttachmentToPrint.action.cancel.tip"; +} + +#validateButton { + actionIcon: validate; + text: "faxtomail.chooseAttachmentToPrint.action.validate"; + toolTipText: "faxtomail.chooseAttachmentToPrint.action.validate.tip"; + //_applicationAction: {com.franciaflex.faxtomail.ui.swing.actions.TransmitAction.class}; + enabled: { model.getMailFolder() != null }; +} \ No newline at end of file Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/print/AttachmentToPrintChooserUI.jaxx (from rev 35, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUI.jaxx) =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/print/AttachmentToPrintChooserUI.jaxx (rev 0) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/print/AttachmentToPrintChooserUI.jaxx 2014-04-22 16:52:11 UTC (rev 38) @@ -0,0 +1,37 @@ +<JPanel id='attachmentToPrintChooser' layout='{new BorderLayout()}' + implements='com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI<com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel, AttachmentToPrintChooserUIHandler>'> + + <import> + com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel + + com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI + com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil + + javax.swing.BoxLayout + + </import> + + <script><![CDATA[ + + public AttachmentToPrintChooserUI(FaxToMailUI parentUI, DemandeUIModel model) { + FaxToMailUIUtil.setParentUI(this, parentUI); + setContextValue(model); + } + + ]]></script> + + <DemandeUIModel id='model' javaBean='getContextValue(DemandeUIModel.class)'/> + + <JLabel id="message" constraints='BorderLayout.NORTH'/> + + <JScrollPane constraints='BorderLayout.CENTER'> + <JPanel id="attachmentPanel" + layout="{ new BoxLayout(attachmentPanel, BoxLayout.Y_AXIS) }"/> + </JScrollPane> + + <JPanel layout='{ new GridLayout(1, 0) }' constraints='BorderLayout.SOUTH'> + <JButton id='cancelButton' onActionPerformed='handler.cancel()'/> + <JButton id='validateButton'/> + </JPanel> + +</JPanel> \ No newline at end of file Copied: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/print/AttachmentToPrintChooserUIHandler.java (from rev 35, trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUIHandler.java) =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/print/AttachmentToPrintChooserUIHandler.java (rev 0) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/print/AttachmentToPrintChooserUIHandler.java 2014-04-22 16:52:11 UTC (rev 38) @@ -0,0 +1,67 @@ +package com.franciaflex.faxtomail.ui.swing.content.print; + +import com.franciaflex.faxtomail.persistence.entities.Attachment; +import com.franciaflex.faxtomail.persistence.entities.Company; +import com.franciaflex.faxtomail.persistence.entities.EtatAttente; +import com.franciaflex.faxtomail.persistence.entities.MailFolder; +import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel; +import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler; +import com.franciaflex.faxtomail.ui.swing.util.Cancelable; +import com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil; +import com.franciaflex.faxtomail.ui.swing.util.FolderTreeNode; +import jaxx.runtime.validator.swing.SwingValidator; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; + +import javax.swing.*; +import javax.swing.event.TreeSelectionEvent; +import javax.swing.event.TreeSelectionListener; +import javax.swing.tree.DefaultMutableTreeNode; +import javax.swing.tree.DefaultTreeCellRenderer; +import java.awt.*; +import java.util.Collection; +import java.util.HashSet; +import java.util.Map; + +/** + * @author Kevin Morin (Code Lutin) + * @since x.x + */ +public class AttachmentToPrintChooserUIHandler extends AbstractFaxToMailUIHandler<DemandeUIModel, AttachmentToPrintChooserUI> + implements Cancelable { + + private static final Log log = LogFactory.getLog(AttachmentToPrintChooserUIHandler.class); + + @Override + public void afterInit(AttachmentToPrintChooserUI attachmentToPrintChooserUI) { + initUI(attachmentToPrintChooserUI); + + DemandeUIModel model = getModel(); + + JPanel attachmentPanel = ui.getAttachmentPanel(); + for (Attachment attachment : model.getAttachment()) { + JCheckBox checkBox = new JCheckBox(attachment.getOriginalFile().getName(), true); + attachmentPanel.add(checkBox); + } + } + + @Override + public void onCloseUI() { + } + + @Override + public SwingValidator<DemandeUIModel> getValidator() { + return null; + } + + @Override + public void cancel() { + closeDialog(); + } + + @Override + protected JComponent getComponentToFocus() { + return ui.getAttachmentPanel(); + } + +} Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUI.css =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUI.css 2014-04-18 13:48:06 UTC (rev 37) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUI.css 2014-04-22 16:52:11 UTC (rev 38) @@ -1,3 +1,8 @@ +#message { + text: "faxtomail.chooseMailFolder.message"; + border: { javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5) }; +} + #navigationTree { font-size: "11"; rootVisible: false; Modified: trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUI.jaxx =================================================================== --- trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUI.jaxx 2014-04-18 13:48:06 UTC (rev 37) +++ trunk/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/transmit/MailFolderChooserUI.jaxx 2014-04-22 16:52:11 UTC (rev 38) @@ -21,6 +21,8 @@ <DemandeUIModel id='model' javaBean='getContextValue(DemandeUIModel.class)'/> + <JLabel id="message" constraints='BorderLayout.NORTH'/> + <JScrollPane constraints='BorderLayout.CENTER'> <JTree id="navigationTree"/> </JScrollPane> Modified: trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties =================================================================== --- trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties 2014-04-18 13:48:06 UTC (rev 37) +++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_en_GB.properties 2014-04-22 16:52:11 UTC (rev 38) @@ -50,12 +50,18 @@ faxtomail.attachmentEditor.text= faxtomail.attachmentEditor.title= faxtomail.back.button.label= +faxtomail.chooseAttachmentToPrint.action.cancel= +faxtomail.chooseAttachmentToPrint.action.cancel.tip= +faxtomail.chooseAttachmentToPrint.action.validate= +faxtomail.chooseAttachmentToPrint.action.validate.tip= +faxtomail.chooseAttachmentToPrint.message= faxtomail.chooseMailFolder.action.cancel= faxtomail.chooseMailFolder.action.cancel.mnemonic= faxtomail.chooseMailFolder.action.cancel.tip= faxtomail.chooseMailFolder.action.validate= faxtomail.chooseMailFolder.action.validate.mnemonic= faxtomail.chooseMailFolder.action.validate.tip= +faxtomail.chooseMailFolder.message= faxtomail.chooseMailFolder.title= faxtomail.common.askBeforeDelete.help= faxtomail.common.askCancelEditBeforeLeaving.help= 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-04-18 13:48:06 UTC (rev 37) +++ trunk/faxtomail-ui-swing/src/main/resources/i18n/faxtomail-ui-swing_fr_FR.properties 2014-04-22 16:52:11 UTC (rev 38) @@ -32,11 +32,17 @@ faxtomail.attachmentEditor.saveAttachment.title=Enregistrer la pièce-jointe faxtomail.attachmentEditor.text=Pièces jointes (%s) faxtomail.attachmentEditor.title=Pièces jointes +faxtomail.chooseAttachmentToPrint.action.cancel=Annuler +faxtomail.chooseAttachmentToPrint.action.cancel.tip=Annuler et fermer la popup +faxtomail.chooseAttachmentToPrint.action.validate=Valider +faxtomail.chooseAttachmentToPrint.action.validate.tip=Valider et imprimer les pièces-jointes +faxtomail.chooseAttachmentToPrint.message=Choisissez les pièces-jointes à imprimer \: faxtomail.chooseMailFolder.action.cancel=Annuler faxtomail.chooseMailFolder.action.cancel.tip=Annuler et fermer la popup faxtomail.chooseMailFolder.action.validate=Valider faxtomail.chooseMailFolder.action.validate.tip=Valider et transférer l'élément -faxtomail.chooseMailFolder.title=Choisissez le dossier où transférer l'élément +faxtomail.chooseMailFolder.message=Choisissez le dossier où transférer l'élément \: +faxtomail.chooseMailFolder.title=Dossier de destination faxtomail.common.by.label=par faxtomail.common.on.label=le faxtomail.config.application=
participants (1)
-
kmorin@users.forge.codelutin.com