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>.