branch feature/9526 updated (cc3b9e56 -> 017a85cc)
This is an automated email from the git hooks/post-receive script. New change to branch feature/9526 in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git from cc3b9e56 refs #9526 - Pris par sur le clic droit des demandes sélectionnées : - Ajout de l'option dans le modèle - Ajout de la migration associée - Ajout de l'option dans la configuration new a676570a refs #9526 - Pris par sur le clic droit des demandes sélectionnées new 017a85cc refs #9526 - Pris par sur le clic droit des demandes sélectionnées : - Ajout du formulaire de sélection des personnes (modèle non rempli) The 2 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 017a85ccddd8fb406935ee9c8a3ba3aafa42d5ab Author: Jean Couteau <jean.couteau@gmail.com> Date: Wed Nov 29 17:36:02 2017 +0100 refs #9526 - Pris par sur le clic droit des demandes sélectionnées : - Ajout du formulaire de sélection des personnes (modèle non rempli) commit a676570a2717d60d1aabfd932e815cc4fdd6984c Author: Jean Couteau <jean.couteau@gmail.com> Date: Wed Nov 29 09:19:38 2017 +0100 refs #9526 - Pris par sur le clic droit des demandes sélectionnées - Ajout de l'entrée de menu au clic droit (toujours visible pour le moment) Summary of changes: .../faxtomail/persistence/entities/MailAction.java | 3 +- .../ui/swing/content/demande/DemandeListUI.css | 7 ++ .../ui/swing/content/demande/DemandeListUI.jaxx | 1 + .../content/demande/DemandeListUIHandler.java | 4 + .../swing/content/demande/DemandeListUIModel.java | 13 +++ .../TakenByFormUI.css} | 28 ++++--- .../ui/swing/content/demande/TakenByFormUI.jaxx | 92 ++++++++++++++++++++++ .../content/demande/TakenByFormUIHandler.java | 68 ++++++++++++++++ .../swing/content/demande/TakenByFormUIModel.java | 23 ++++++ ...dFormAction.java => OpenTakenByFormAction.java} | 61 ++++---------- .../i18n/faxtomail-ui-swing_fr_FR.properties | 6 ++ 11 files changed, 249 insertions(+), 57 deletions(-) copy faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/{print/AttachmentToPrintChooserUI.css => demande/TakenByFormUI.css} (63%) create mode 100644 faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/TakenByFormUI.jaxx create mode 100644 faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/TakenByFormUIHandler.java create mode 100644 faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/TakenByFormUIModel.java copy faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/{OpenForwardFormAction.java => OpenTakenByFormAction.java} (59%) -- 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/9526 in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git commit a676570a2717d60d1aabfd932e815cc4fdd6984c Author: Jean Couteau <jean.couteau@gmail.com> Date: Wed Nov 29 09:19:38 2017 +0100 refs #9526 - Pris par sur le clic droit des demandes sélectionnées - Ajout de l'entrée de menu au clic droit (toujours visible pour le moment) --- .../faxtomail/persistence/entities/MailAction.java | 3 ++- .../faxtomail/ui/swing/content/demande/DemandeListUI.css | 7 +++++++ .../faxtomail/ui/swing/content/demande/DemandeListUI.jaxx | 1 + .../ui/swing/content/demande/DemandeListUIHandler.java | 4 ++++ .../ui/swing/content/demande/DemandeListUIModel.java | 13 +++++++++++++ .../main/resources/i18n/faxtomail-ui-swing_fr_FR.properties | 2 ++ 6 files changed, 29 insertions(+), 1 deletion(-) diff --git a/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailAction.java b/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailAction.java index a6bfc542..24071735 100644 --- a/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailAction.java +++ b/faxtomail-persistence/src/main/java/com/franciaflex/faxtomail/persistence/entities/MailAction.java @@ -34,5 +34,6 @@ public enum MailAction { ARCHIVE, REPLY, FORWARD, - GROUP + GROUP, + TAKENBY } diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css index 12cb8247..5185c3ae 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css @@ -118,6 +118,13 @@ _applicationAction: { com.franciaflex.faxtomail.ui.swing.content.demande.actions.OpenForwardFormAction.class }; } +#takenByMenu { + text: "faxtomail.demandeList.action.takenBy"; + toolTipText: "faxtomail.demandeList.action.takenBy.tip"; + enabled: { model.isTakenByEnabled() }; +/* _applicationAction: { com.franciaflex.faxtomail.ui.swing.content.demande.actions.OpenTakenByFormAction.class };*/ +} + #archiveMenu { actionIcon: archive; text: "faxtomail.demandeList.action.archive"; diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx index 6f516731..235adf4a 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.jaxx @@ -64,6 +64,7 @@ <JMenuItem id='forwardMenu'/> <JMenuItem id='archiveMenu'/> <JMenuItem id='moveMenu'/> + <JMenuItem id='takenByMenu'/> </JPopupMenu> <JSplitPane constraints='BorderLayout.CENTER' id="mainSplitPane" name="demandeListUIMainSplitPane"> diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java index 201b9074..d781ca57 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIHandler.java @@ -778,6 +778,10 @@ public class DemandeListUIHandler extends AbstractFaxToMailDemandListHandler<Dem && model.getSelectedEmails().get(0).isEditable() && isActionEnabled(model.getSelectedEmails().get(0), MailAction.FORWARD)); + model.setTakenByEnabled(selectedRowCount == 1 + && model.getSelectedEmails().get(0).isEditable() + && isActionEnabled(model.getSelectedEmails().get(0), MailAction.TAKENBY)); + model.setArchiveEnabled(selectedRowCount > 0); model.setTransmitEnabled(selectedRowCount > 0); model.setPrintEnabled(selectedRowCount > 0); diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java index c38cee47..22471232 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUIModel.java @@ -53,6 +53,7 @@ public class DemandeListUIModel extends AbstractSerializableBean { public static final String PROPERTY_REPLY_ENABLED = "replyEnabled"; public static final String PROPERTY_FORWARD_ACTIVATED = "forwardActivated"; public static final String PROPERTY_FORWARD_ENABLED = "forwardEnabled"; + public static final String PROPERTY_TAKENBY_ENABLED = "takenByEnabled"; public static final String PROPERTY_ARCHIVE_ENABLED = "archiveEnabled"; public static final String PROPERTY_TRANSMIT_ENABLED = "transmitEnabled"; public static final String PROPERTY_PRINT_ENABLED = "printEnabled"; @@ -97,6 +98,8 @@ public class DemandeListUIModel extends AbstractSerializableBean { protected boolean forwardEnabled; + protected boolean takenByEnabled; + protected boolean archiveEnabled; protected boolean transmitEnabled; @@ -264,6 +267,16 @@ public class DemandeListUIModel extends AbstractSerializableBean { firePropertyChange(PROPERTY_FORWARD_ENABLED, oldValue, forwardEnabled); } + public boolean isTakenByEnabled() { + return takenByEnabled; + } + + public void setTakenByEnabled(boolean takenByEnabled) { + Object oldValue = isTakenByEnabled(); + this.takenByEnabled = takenByEnabled; + firePropertyChange(PROPERTY_TAKENBY_ENABLED, oldValue, takenByEnabled); + } + public boolean isArchiveEnabled() { return archiveEnabled; } 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 19836555..59e4fc5d 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 @@ -172,6 +172,8 @@ faxtomail.demandeList.action.print=Imprimer faxtomail.demandeList.action.print.tip=Imprimer faxtomail.demandeList.action.reply=Répondre faxtomail.demandeList.action.reply.tip=Répondre +faxtomail.demandeList.action.takenBy=Pris par +faxtomail.demandeList.action.takenBy.tip=Modifier la personne prenant l'élément faxtomail.demandeList.action.transmit=Déplacer faxtomail.demandeList.action.transmit.tip=Déplacer faxtomail.demandeList.demandNbLabel=Nombre de demandes -- 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/9526 in repository faxtomail. See https://gitlab.nuiton.org/codelutin/faxtomail.git commit 017a85ccddd8fb406935ee9c8a3ba3aafa42d5ab Author: Jean Couteau <jean.couteau@gmail.com> Date: Wed Nov 29 17:36:02 2017 +0100 refs #9526 - Pris par sur le clic droit des demandes sélectionnées : - Ajout du formulaire de sélection des personnes (modèle non rempli) --- .../ui/swing/content/demande/DemandeListUI.css | 2 +- .../ui/swing/content/demande/TakenByFormUI.css | 46 +++++++++++ .../ui/swing/content/demande/TakenByFormUI.jaxx | 92 ++++++++++++++++++++++ .../content/demande/TakenByFormUIHandler.java | 68 ++++++++++++++++ .../swing/content/demande/TakenByFormUIModel.java | 23 ++++++ .../demande/actions/OpenTakenByFormAction.java | 85 ++++++++++++++++++++ .../i18n/faxtomail-ui-swing_fr_FR.properties | 4 + 7 files changed, 319 insertions(+), 1 deletion(-) diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css index 5185c3ae..0f3a813e 100644 --- a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/DemandeListUI.css @@ -122,7 +122,7 @@ text: "faxtomail.demandeList.action.takenBy"; toolTipText: "faxtomail.demandeList.action.takenBy.tip"; enabled: { model.isTakenByEnabled() }; -/* _applicationAction: { com.franciaflex.faxtomail.ui.swing.content.demande.actions.OpenTakenByFormAction.class };*/ + _applicationAction: { com.franciaflex.faxtomail.ui.swing.content.demande.actions.OpenTakenByFormAction.class }; } #archiveMenu { diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/TakenByFormUI.css b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/TakenByFormUI.css new file mode 100644 index 00000000..cbce996c --- /dev/null +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/TakenByFormUI.css @@ -0,0 +1,46 @@ +/* + * #%L + * FaxToMail :: UI + * $Id$ + * $HeadURL$ + * %% + * Copyright (C) 2014 Mac-Groupe, 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% + */ +#takenByListLabel { + text: "faxtomail.takenby.label.takenby"; +} + +#takenByComboBox { + showReset: true; + showDecorator: false; + bean: {model}; + property: takenby; + selectedItem: { model.getTakenBy() }; +} + +#cancelButton { + actionIcon: cancel; + text: "faxtomail.reply.action.cancel"; + toolTipText: "faxtomail.reply.action.cancel.tip"; +} + +#validateButton { + actionIcon: reply; + text: "faxtomail.takenby.action.validate"; + toolTipText: "faxtomail.takenby.action.validate.tip"; +} diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/TakenByFormUI.jaxx b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/TakenByFormUI.jaxx new file mode 100644 index 00000000..4f771441 --- /dev/null +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/TakenByFormUI.jaxx @@ -0,0 +1,92 @@ +<!-- + #%L + FaxToMail :: UI + %% + Copyright (C) 2014-2017 Mac-Groupe, 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% + --> +<JPanel id='takenByPanel' layout='{new BorderLayout()}' + implements='com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI<TakenByFormUIModel, TakenByFormUIHandler>'> + + <import> + com.franciaflex.faxtomail.persistence.entities.FaxToMailUser; + com.franciaflex.faxtomail.ui.swing.util.FaxToMailUI + com.franciaflex.faxtomail.ui.swing.util.FaxToMailUIUtil + com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler + + + java.awt.CardLayout + java.awt.Color + java.awt.FlowLayout + + jaxx.runtime.swing.CardLayout2Ext + jaxx.runtime.swing.editor.bean.BeanFilterableComboBox + jaxx.runtime.swing.editor.bean.BeanComboBox + + static org.nuiton.i18n.I18n.t + </import> + + <script><![CDATA[ + + public TakenByFormUI(FaxToMailUI parentUI) { + FaxToMailUIUtil.setParentUI(this, parentUI); + } + + ]]></script> + + <BeanValidator id='validator' bean='model' + uiClass='jaxx.runtime.validator.swing.ui.ImageValidationUI'> + </BeanValidator> + + <TakenByFormUIModel id='model' + initializer='getContextValue(TakenByFormUIModel.class)'/> + + <CardLayout2Ext id='fromPanelLayout' + constructorParams='this, "fromPanel"'/> + + <Table constraints='BorderLayout.NORTH' + fill='both'> + <row> + <cell> + <JLabel id="takenByListLabel"/> + </cell> + <cell weightx='1' columns="4"> + <JPanel id="takenByListPanel" + layout="{ fromPanelLayout }"> + <BeanFilterableComboBox id="takenByComboBox" + constructorParams='this' + genericType="FaxToMailUser" + constraints='"false"'/> + </JPanel> + </cell> + </row> + </Table> + + <Table id="buttonPanel" + fill="both" insets="0" + constraints='BorderLayout.SOUTH'> + <row> + <cell insets="0" weightx="1"> + <JButton id='cancelButton' onActionPerformed='handler.cancel()'/> + </cell> + <cell insets="0" weightx="1"> + <JButton id='validateButton' onActionPerformed='handler.validate()'/> + </cell> + </row> + </Table> + +</JPanel> diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/TakenByFormUIHandler.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/TakenByFormUIHandler.java new file mode 100644 index 00000000..8278c26e --- /dev/null +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/TakenByFormUIHandler.java @@ -0,0 +1,68 @@ +package com.franciaflex.faxtomail.ui.swing.content.demande; + +import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser; +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.reply.actions.AddAttachmentToReplyAction; +import com.franciaflex.faxtomail.ui.swing.content.reply.actions.SenderChangedAction; +import com.franciaflex.faxtomail.ui.swing.util.AbstractFaxToMailUIHandler; +import jaxx.runtime.validator.swing.SwingValidator; +import org.nuiton.jaxx.application.swing.util.Cancelable; + +import javax.swing.*; +import java.awt.*; + +import java.util.ArrayList; +import java.util.List; + +public class TakenByFormUIHandler extends AbstractFaxToMailUIHandler<TakenByFormUIModel, TakenByFormUI> implements Cancelable { + + @Override + public void beforeInit(TakenByFormUI ui) { + super.beforeInit(ui); + + TakenByFormUIModel model = new TakenByFormUIModel(); + + this.ui.setContextValue(model); + } + + @Override + public void afterInit(TakenByFormUI takenByFormUI) { + initUI(ui); + + List<FaxToMailUser> users = new ArrayList<>(); + + // users + initBeanFilterableComboBox(ui.getTakenByComboBox(), users, null); + } + + @Override + public void cancel() { + closeFrame(); + } + + @Override + public void onCloseUI() { + } + + @Override + public SwingValidator<TakenByFormUIModel> getValidator() { + return getUI().getValidator(); + } + + @Override + protected JComponent getComponentToFocus() { + //TODO JC focus on list + return getUI(); + } + + @Override + public Component getTopestUI() { + return getParentContainer(Window.class); + } + + public void validate(){ + + } + +} diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/TakenByFormUIModel.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/TakenByFormUIModel.java new file mode 100644 index 00000000..b2b7ea76 --- /dev/null +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/TakenByFormUIModel.java @@ -0,0 +1,23 @@ +package com.franciaflex.faxtomail.ui.swing.content.demande; + + +import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser; +import org.jdesktop.beans.AbstractSerializableBean; + +public class TakenByFormUIModel extends AbstractSerializableBean { + + public static final String PROPERTY_TAKENBY = "takenBy"; + + protected FaxToMailUser user; + + protected FaxToMailUser takenBy; + + protected FaxToMailUser getTakenBy() { + return this.takenBy; + } + + public void setTakenBy(FaxToMailUser takenBy){ + this.takenBy = takenBy; + } + +} diff --git a/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/OpenTakenByFormAction.java b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/OpenTakenByFormAction.java new file mode 100644 index 00000000..401833aa --- /dev/null +++ b/faxtomail-ui-swing/src/main/java/com/franciaflex/faxtomail/ui/swing/content/demande/actions/OpenTakenByFormAction.java @@ -0,0 +1,85 @@ +package com.franciaflex.faxtomail.ui.swing.content.demande.actions; + +import com.franciaflex.faxtomail.persistence.entities.Email; +import com.franciaflex.faxtomail.persistence.entities.FaxToMailUser; +import com.franciaflex.faxtomail.persistence.entities.SigningForDomain; +import com.franciaflex.faxtomail.services.FaxToMailServiceContext; +import com.franciaflex.faxtomail.ui.swing.FaxToMailUIContext; +import com.franciaflex.faxtomail.ui.swing.actions.AbstractFaxToMailAction; +import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeListUI; +import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeListUIHandler; +import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeListUIModel; +import com.franciaflex.faxtomail.ui.swing.content.demande.DemandeUIModel; +import com.franciaflex.faxtomail.ui.swing.content.demande.TakenByFormUI; +import com.franciaflex.faxtomail.ui.swing.content.demande.TakenByFormUIModel; +import com.franciaflex.faxtomail.ui.swing.content.reply.ReplyFormUI; +import com.franciaflex.faxtomail.ui.swing.content.reply.ReplyFormUIModel; +import org.apache.commons.lang3.StringUtils; + +import javax.swing.*; +import java.awt.*; +import java.beans.PropertyChangeEvent; +import java.beans.PropertyChangeListener; + +import static org.nuiton.i18n.I18n.t; + +public class OpenTakenByFormAction extends AbstractFaxToMailAction<DemandeListUIModel, DemandeListUI, DemandeListUIHandler> { + + protected TakenByFormUI frameContent; + protected JFrame frame; + + public OpenTakenByFormAction(DemandeListUIHandler handler) { + super(handler, false); + } + + @Override + public void doAction() throws Exception { + + DemandeUIModel demand = getModel().getSelectedEmails().get(0); + + if (StringUtils.isNotBlank(demand.getTopiaId())) { + FaxToMailServiceContext serviceContext = getContext().newServiceContext(); + Email email = serviceContext.getEmailService().getFullEmailById(demand.getTopiaId(), getContext().getCurrentUser()); + demand.fromEntity(email); + + getContext().setCurrentEmail(demand); + + frameContent = new TakenByFormUI(getUI()); + TakenByFormUIModel model = frameContent.getModel(); + + FaxToMailUser takenBy = demand.getTakenBy(); + if (takenBy != null) { + model.setTakenBy(takenBy); + } + } + } + + @Override + public void postSuccessAction() { + super.postSuccessAction(); + frame = getHandler().openModalFrame(frameContent, + t("faxtomail.takenby.modalTitle"), + new Dimension(800, 600)); + + getContext().addPropertyChangeListener(FaxToMailUIContext.PROPERTY_BUSY, new PropertyChangeListener() { + @Override + public void propertyChange(PropertyChangeEvent evt) { + if (!getContext().isBusy()) { + SwingUtilities.invokeLater(new Runnable() { + @Override + public void run() { + + bringCurrentDemandToFront(); + if (frame != null) { + frame.toFront(); + frame = null; + } + } + }); + getContext().removePropertyChangeListener(FaxToMailUIContext.PROPERTY_BUSY, this); + } + } + }); + } + +} 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 59e4fc5d..e5534d98 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 @@ -345,6 +345,10 @@ faxtomail.searchToGroup.action.group=Grouper faxtomail.searchToGroup.action.group.tip=Grouper avec l'élément courant faxtomail.searchToGroup.title=Recherche de l'élément avec lequel grouper l'élément %s faxtomail.systemUser=Système +faxtomail.takenby.action.validate=Valider +faxtomail.takenby.action.validate.tip=Valider la personne prenant l'élément +faxtomail.takenby.label.takenby=Pris par +faxtomail.takenby.modalTitle=Modifier la personne prenant l'élément faxtomail.validator.error.email.client.required=Client requis faxtomail.validator.error.email.comment.required=Message requis faxtomail.validator.error.email.companyReference.required=Notre référence requis -- To stop receiving notification emails like this one, please contact codelutin.com SCM administrator <admin+scm@codelutin.com>.
participants (1)
-
codelutin.com scm