|
|
|
@ -7,6 +7,7 @@ import com.fr.design.fun.JavaScriptActionProvider;
|
|
|
|
|
import com.fr.design.gui.icombobox.UIComboBox; |
|
|
|
|
import com.fr.design.gui.ilable.UILabel; |
|
|
|
|
import com.fr.design.gui.itextfield.UITextField; |
|
|
|
|
import com.fr.design.i18n.Toolkit; |
|
|
|
|
import com.fr.design.layout.FRGUIPaneFactory; |
|
|
|
|
import com.fr.design.mainframe.DesignerContext; |
|
|
|
|
import com.fr.design.mainframe.JTemplate; |
|
|
|
@ -34,19 +35,10 @@ public class ListenerEditPane extends BasicBeanPane<Listener> {
|
|
|
|
|
private List<FurtherBasicBeanPane<? extends JavaScript>> cards; |
|
|
|
|
private JPanel hyperlinkPane; |
|
|
|
|
|
|
|
|
|
private JavaScriptImplPane javaScriptPane; |
|
|
|
|
private FormSubmitJavaScriptPane formSubmitScriptPane; |
|
|
|
|
private Commit2DBJavaScriptPane commit2DBJavaScriptPane; |
|
|
|
|
// 自定义事件
|
|
|
|
|
private CustomActionPane customActionPane; |
|
|
|
|
// 发送邮件
|
|
|
|
|
private EmailPane emailPane; |
|
|
|
|
|
|
|
|
|
private static final String JS = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JavaScript"); |
|
|
|
|
private static final String FORMSUBMIT = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JavaScript_Form_Submit"); |
|
|
|
|
private static final String DBCOMMIT = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JavaScript_Commit_To_Database"); |
|
|
|
|
private static final String CUSTOMACTION= com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JavaScript_Custom_Submit"); |
|
|
|
|
private static final String EMAIL = com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Email_Sent_Email"); |
|
|
|
|
private static final String JS = Toolkit.i18nText("Fine-Design_Report_JavaScript"); |
|
|
|
|
private static final String DBCOMMIT = Toolkit.i18nText("Fine-Design_Basic_JavaScript_Commit_To_Database"); |
|
|
|
|
private static final String CUSTOMACTION = Toolkit.i18nText("Fine-Design_Report_Submit_Type_Custom"); |
|
|
|
|
private static final String EMAIL = Toolkit.i18nText("Fine-Design_Report_Email_Sent_Email"); |
|
|
|
|
|
|
|
|
|
private Listener listener; |
|
|
|
|
|
|
|
|
@ -60,37 +52,43 @@ public class ListenerEditPane extends BasicBeanPane<Listener> {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 初始化各个组件 |
|
|
|
|
* |
|
|
|
|
* @param defaultArgs 初始化参数 |
|
|
|
|
*/ |
|
|
|
|
public void initComponents(String[] defaultArgs) { |
|
|
|
|
cards = new ArrayList<FurtherBasicBeanPane<? extends JavaScript>>(); |
|
|
|
|
cards = new ArrayList<>(); |
|
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
|
JPanel namePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); |
|
|
|
|
nameText = new UITextField(8); |
|
|
|
|
nameText.setEditable(false); |
|
|
|
|
namePane.add(nameText, BorderLayout.WEST); |
|
|
|
|
String[] style = {JS, DBCOMMIT, CUSTOMACTION,EMAIL}; |
|
|
|
|
final String[] style = {JS, DBCOMMIT, CUSTOMACTION, EMAIL}; |
|
|
|
|
styleBox = new UIComboBox(style); |
|
|
|
|
namePane.add(styleBox); |
|
|
|
|
namePane = GUICoreUtils.createFlowPane(new Component[]{new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Name") + ":"), nameText, new UILabel(" " + com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Type") + ":"), styleBox}, FlowLayout.LEFT); |
|
|
|
|
namePane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Name_Type"))); |
|
|
|
|
namePane = GUICoreUtils.createFlowPane(new Component[]{ |
|
|
|
|
new UILabel(" " + Toolkit.i18nText("Fine-Design_Report_Event_Name") + ":"), |
|
|
|
|
nameText, |
|
|
|
|
new UILabel(" " + Toolkit.i18nText("Fine-Design_Report_Event_Type") + ":"), |
|
|
|
|
styleBox}, |
|
|
|
|
FlowLayout.LEFT); |
|
|
|
|
namePane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Report_Event_Name_Type"))); |
|
|
|
|
this.add(namePane, BorderLayout.NORTH); |
|
|
|
|
card = new CardLayout(); |
|
|
|
|
hyperlinkPane = FRGUIPaneFactory.createCardLayout_S_Pane(); |
|
|
|
|
hyperlinkPane.setLayout(card); |
|
|
|
|
javaScriptPane = new JavaScriptImplPane(defaultArgs); |
|
|
|
|
JavaScriptImplPane javaScriptPane = new JavaScriptImplPane(defaultArgs); |
|
|
|
|
hyperlinkPane.add(JS, javaScriptPane); |
|
|
|
|
// 提交入库
|
|
|
|
|
List dbmaniList = new ArrayList(); |
|
|
|
|
dbmaniList.add(autoCreateDBManipulationPane()); |
|
|
|
|
commit2DBJavaScriptPane = new Commit2DBJavaScriptPane(JavaScriptActionPane.defaultJavaScriptActionPane, |
|
|
|
|
dbmaniList); |
|
|
|
|
List dbManiList = new ArrayList(); |
|
|
|
|
dbManiList.add(autoCreateDBManipulationPane()); |
|
|
|
|
Commit2DBJavaScriptPane commit2DBJavaScriptPane = new Commit2DBJavaScriptPane(JavaScriptActionPane.defaultJavaScriptActionPane, |
|
|
|
|
dbManiList); |
|
|
|
|
hyperlinkPane.add(DBCOMMIT, commit2DBJavaScriptPane); |
|
|
|
|
// 自定义事件
|
|
|
|
|
customActionPane = new CustomActionPane(); |
|
|
|
|
CustomActionPane customActionPane = new CustomActionPane(); |
|
|
|
|
hyperlinkPane.add(CUSTOMACTION, customActionPane); |
|
|
|
|
// 发送邮件
|
|
|
|
|
emailPane = new EmailPane(); |
|
|
|
|
EmailPane emailPane = new EmailPane(); |
|
|
|
|
hyperlinkPane.add(EMAIL, emailPane); |
|
|
|
|
cards.add(javaScriptPane); |
|
|
|
|
cards.add(commit2DBJavaScriptPane); |
|
|
|
@ -98,11 +96,16 @@ public class ListenerEditPane extends BasicBeanPane<Listener> {
|
|
|
|
|
cards.add(emailPane); |
|
|
|
|
//其他事件
|
|
|
|
|
addOtherEvent(); |
|
|
|
|
hyperlinkPane.setBorder(BorderFactory.createTitledBorder(com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_JavaScript_Set"))); |
|
|
|
|
hyperlinkPane.setBorder(BorderFactory.createTitledBorder(Toolkit.i18nText("Fine-Design_Report_JavaScript_Set"))); |
|
|
|
|
this.add(hyperlinkPane); |
|
|
|
|
styleBox.addItemListener(new ItemListener() { |
|
|
|
|
@Override |
|
|
|
|
public void itemStateChanged(ItemEvent e) { |
|
|
|
|
card.show(hyperlinkPane, styleBox.getSelectedItem().toString()); |
|
|
|
|
Object selected = styleBox.getSelectedItem(); |
|
|
|
|
if (selected == null) { |
|
|
|
|
return; |
|
|
|
|
} |
|
|
|
|
card.show(hyperlinkPane, selected.toString()); |
|
|
|
|
} |
|
|
|
|
}); |
|
|
|
|
} |
|
|
|
@ -122,6 +125,7 @@ public class ListenerEditPane extends BasicBeanPane<Listener> {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* 根据有无单元格创建 DBManipulationPane |
|
|
|
|
* |
|
|
|
|
* @return 有单元格。有智能添加单元格等按钮,返回 SmartInsertDBManipulationPane |
|
|
|
|
*/ |
|
|
|
|
private DBManipulationPane autoCreateDBManipulationPane() { |
|
|
|
@ -131,7 +135,7 @@ public class ListenerEditPane extends BasicBeanPane<Listener> {
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
protected String title4PopupWindow() { |
|
|
|
|
return com.fr.design.i18n.Toolkit.i18nText("Fine-Design_Report_Event_Set"); |
|
|
|
|
return Toolkit.i18nText("Fine-Design_Report_Event_Set"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|