Browse Source

Merge pull request #587 in DESIGN/design from ~ALEX.SUNG/design:feature/10.0 to feature/10.0

REPORT-11737 工具栏中邮件发送改进

* commit '9cd1ac9230d1e130e490384e6ae3953744a930a9':
  代码质量
  REPORT-11737 工具栏中邮件发送改进
research/10.0
Alex.Sung 6 years ago
parent
commit
8221beab10
  1. 87
      designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java

87
designer-realize/src/main/java/com/fr/design/webattr/EditToolBar.java

@ -30,6 +30,7 @@ import com.fr.form.ui.Widget;
import com.fr.form.ui.WidgetInfoConfig;
import com.fr.general.Background;
import com.fr.report.web.button.Email;
import com.fr.report.web.button.Export;
import com.fr.report.web.button.write.AppendColumnRow;
import com.fr.report.web.button.write.Submit;
@ -64,6 +65,14 @@ import java.util.Set;
public class EditToolBar extends BasicPane {
private static final String EMAIL = "email";
private static final String CUSTOM = "custom";
private static final String EXPORT = "export";
private static final String NONE = "none";
private static final String EDIT_EXCEL = "editexcel";
private static final String APPEND_COUNT = "appendcount";
private static final String SUBMIT = "submit";
private JWorkBook jwb;
private JList list;
private DefaultListModel listModel;
@ -333,7 +342,8 @@ public class EditToolBar extends BasicPane {
private JPanel centerPane;
private UICheckBox icon, text, pdf, excelP, excelO, excelS, image, word,
isPopup, isVerify, failSubmit, isCurSheet, excelImClean,
excelImCover, excelImAppend, excelImCust;
excelImCover, excelImAppend, excelImCust,
customConsignee, consigneeByDepartment, consigneeByRole;
private UIBasicSpinner count;
private Widget widget;
private UITextField nameField;
@ -392,17 +402,17 @@ public class EditToolBar extends BasicPane {
centerPane = FRGUIPaneFactory.createCardLayout_S_Pane();
card = new CardLayout();
centerPane.setLayout(card);
centerPane.add("custom", getCustomPane());
centerPane.add("export", getExport());
centerPane.add("none", none);
// centerPane.add("editexcel", editExcel);
centerPane.add(getCpane(), "appendcount");
centerPane.add(getSubmitPane(), "submit");
Set<ExtraButtonToolBarProvider> extraButtonSet = ExtraDesignClassManager.getInstance().getArray(ExtraButtonToolBarProvider.XML_TAG);
for (ExtraButtonToolBarProvider provider : extraButtonSet) {
provider.updateCenterPane(centerPane);
}
centerPane.add(CUSTOM, getCustomPane());
centerPane.add(EXPORT, getExport());
centerPane.add(EMAIL, getEmail());
centerPane.add(NONE, none);
centerPane.add(getCpane(), APPEND_COUNT);
centerPane.add(getSubmitPane(), SUBMIT);
Set<ExtraButtonToolBarProvider> extraButtonSet = ExtraDesignClassManager.getInstance().getArray(ExtraButtonToolBarProvider.XML_TAG);
for (ExtraButtonToolBarProvider provider : extraButtonSet) {
provider.updateCenterPane(centerPane);
}
this.add(centerPane, BorderLayout.CENTER);
}
@ -446,6 +456,22 @@ public class EditToolBar extends BasicPane {
return export;
}
private JPanel getEmail() {
JPanel email = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
customConsignee = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Custom_Consignee"));
consigneeByDepartment = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Consignee_By_Department"));
consigneeByRole = new UICheckBox(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Consignee_By_Role"));
email.add(customConsignee);
email.add(Box.createVerticalStrut(2));
email.add(consigneeByDepartment);
email.add(Box.createVerticalStrut(2));
email.add(consigneeByRole);
email.add(Box.createVerticalStrut(2));
email.setBorder(GUICoreUtils.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Set_Form_Button_Property"), null));
return email;
}
private JPanel getCpane() {
JPanel appendCountPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_S_Pane();
count = new UIBasicSpinner(new SpinnerNumberModel(1, 0, Integer.MAX_VALUE, 1));
@ -514,13 +540,15 @@ public class EditToolBar extends BasicPane {
populateSubmit();
} else if (widget instanceof CustomToolBarButton) {
populateCustomToolBarButton();
} else if (widget instanceof Email) {
populateEmail();
}
Set<ExtraButtonToolBarProvider> extraButtonSet = ExtraDesignClassManager.getInstance().getArray(ExtraButtonToolBarProvider.XML_TAG);
for (ExtraButtonToolBarProvider provider : extraButtonSet) {
provider.populate(widget, card, centerPane);
}
}
Set<ExtraButtonToolBarProvider> extraButtonSet = ExtraDesignClassManager.getInstance().getArray(ExtraButtonToolBarProvider.XML_TAG);
for (ExtraButtonToolBarProvider provider : extraButtonSet) {
provider.populate(widget, card, centerPane);
}
}
private void populateAppendColumnRow(){
card.show(centerPane, "appendcount");
@ -543,6 +571,14 @@ public class EditToolBar extends BasicPane {
}
}
private void populateEmail(){
card.show(centerPane, EMAIL);
Email email = (Email) widget;
this.customConsignee.setSelected(email.isCustomConsignee());
this.consigneeByDepartment.setSelected(email.isConsigneeByDepartment());
this.consigneeByRole.setSelected(email.isConsigneeByRole());
}
private void populateCustomToolBarButton(){
card.show(centerPane, "custom");
CustomToolBarButton customToolBarButton = (CustomToolBarButton) widget;
@ -584,15 +620,17 @@ public class EditToolBar extends BasicPane {
updateSubmit();
} else if (widget instanceof CustomToolBarButton) {
((CustomToolBarButton) widget).setJSImpl(this.javaScriptPane.updateBean());
} else if (widget instanceof Email) {
updateEmail();
}
if (widget instanceof Button) {
updateDefault();
}
Set<ExtraButtonToolBarProvider> extraButtonSet = ExtraDesignClassManager.getInstance().getArray(ExtraButtonToolBarProvider.XML_TAG);
for (ExtraButtonToolBarProvider provider : extraButtonSet) {
provider.update(widget);
}
Set<ExtraButtonToolBarProvider> extraButtonSet = ExtraDesignClassManager.getInstance().getArray(ExtraButtonToolBarProvider.XML_TAG);
for (ExtraButtonToolBarProvider provider : extraButtonSet) {
provider.update(widget);
}
return widget;
}
@ -625,6 +663,13 @@ public class EditToolBar extends BasicPane {
}
}
}
private void updateEmail(){
Email email = ((Email) widget);
email.setCustomConsignee(this.customConsignee.isSelected());
email.setConsigneeByDepartment(this.consigneeByDepartment.isSelected());
email.setConsigneeByRole(this.consigneeByRole.isSelected());
}
}
}

Loading…
Cancel
Save