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