Browse Source

Merge pull request #610 in BA/design from ~KERRY/design:dev to dev

* commit '993abf5ab5a543cf47338c2249559af0dba17b19':
  修改PMD中的问题
  REPORT-1138 模板消息事件
master
superman 8 years ago
parent
commit
6612dc8862
  1. 110
      designer/src/com/fr/design/javascript/ListenerEditPane.java
  2. 11
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  3. 7
      designer_base/src/com/fr/design/gui/frpane/ListenerUpdatePane.java
  4. 6
      designer_base/src/com/fr/design/gui/frpane/UIComboBoxPane.java
  5. 23
      designer_base/src/com/fr/design/javascript/JavaScriptActionPane.java
  6. 15
      designer_base/src/com/fr/design/locale/designer.properties
  7. 16
      designer_base/src/com/fr/design/locale/designer_en_US.properties
  8. 17
      designer_base/src/com/fr/design/locale/designer_ja_JP.properties
  9. 17
      designer_base/src/com/fr/design/locale/designer_ko_KR.properties
  10. 15
      designer_base/src/com/fr/design/locale/designer_zh_CN.properties
  11. 17
      designer_base/src/com/fr/design/locale/designer_zh_TW.properties

110
designer/src/com/fr/design/javascript/ListenerEditPane.java

@ -6,13 +6,15 @@ import java.awt.Component;
import java.awt.FlowLayout;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.util.ArrayList;
import java.util.List;
import java.util.*;
import javax.swing.BorderFactory;
import javax.swing.JPanel;
import com.fr.design.ExtraDesignClassManager;
import com.fr.design.beans.BasicBeanPane;
import com.fr.design.beans.FurtherBasicBeanPane;
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;
@ -22,19 +24,14 @@ import com.fr.design.mainframe.JTemplate;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.design.write.submit.DBManipulationPane;
import com.fr.form.event.Listener;
import com.fr.general.ComparatorUtils;
import com.fr.general.Inter;
import com.fr.js.Commit2DBJavaScript;
import com.fr.js.CustomActionJavaScript;
import com.fr.js.EmailJavaScript;
import com.fr.js.FormSubmitJavaScript;
import com.fr.js.JavaScript;
import com.fr.js.JavaScriptImpl;
public class ListenerEditPane extends BasicBeanPane<Listener> {
private UITextField nameText;
private UIComboBox styleBox;
private CardLayout card;
private List<FurtherBasicBeanPane<? extends JavaScript>> cards;
private JPanel hyperlinkPane;
private JavaScriptImplPane javaScriptPane;
@ -45,11 +42,11 @@ public class ListenerEditPane extends BasicBeanPane<Listener> {
// 发送邮件
private EmailPane emailPane;
private static final String JS = Inter.getLocText("JavaScript");
private static final String FORMSUBMIT = Inter.getLocText("JavaScript-Form_Submit");
private static final String DBCOMMIT = Inter.getLocText("JavaScript-Commit_to_Database");
private static final String CUSTOMACTION= Inter.getLocText(new String[]{"Custom", "RWA-Submit"});
private static final String EMAIL = Inter.getLocText("Email_sentEmail");
private static final String JS = Inter.getLocText("FR-Designer_JavaScript");
private static final String FORMSUBMIT = Inter.getLocText("FR-Designer_JavaScript_Form_Submit");
private static final String DBCOMMIT = Inter.getLocText("FR-Designer_JavaScript_Commit_to_Database");
private static final String CUSTOMACTION= Inter.getLocText(new String[]{"FR-Designer_JavaScript_Custom", "FR-Designer_RWA_Submit"});
private static final String EMAIL = Inter.getLocText("FR-Designer_Email_sentEmail");
private Listener listener;
@ -66,6 +63,7 @@ public class ListenerEditPane extends BasicBeanPane<Listener> {
* @param defaultArgs 初始化参数
*/
public void initComponents(String[] defaultArgs) {
cards = new ArrayList<FurtherBasicBeanPane<? extends JavaScript>>();
this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel namePane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
nameText = new UITextField(8);
@ -74,19 +72,14 @@ public class ListenerEditPane extends BasicBeanPane<Listener> {
String[] style = {JS, DBCOMMIT, CUSTOMACTION,EMAIL};
styleBox = new UIComboBox(style);
namePane.add(styleBox);
namePane = GUICoreUtils.createFlowPane(new Component[]{new UILabel(" " + Inter.getLocText("Event_Name") + ":"), nameText, new UILabel(" " + Inter.getLocText("Event_Type") + ":"), styleBox}, FlowLayout.LEFT);
namePane.setBorder(BorderFactory.createTitledBorder(Inter.getLocText("Event_Name_Type")));
namePane = GUICoreUtils.createFlowPane(new Component[]{new UILabel(" " + Inter.getLocText("FR-Designer_Event_Name") + ":"), nameText, new UILabel(" " + Inter.getLocText("FR-Designer_Event_Type") + ":"), styleBox}, FlowLayout.LEFT);
namePane.setBorder(BorderFactory.createTitledBorder(Inter.getLocText("FR-Designer_Event_Name_Type")));
this.add(namePane, BorderLayout.NORTH);
card = new CardLayout();
hyperlinkPane = FRGUIPaneFactory.createCardLayout_S_Pane();
hyperlinkPane.setLayout(card);
// js
javaScriptPane = new JavaScriptImplPane(defaultArgs);
hyperlinkPane.add(JS, javaScriptPane);
// formSubmitScriptPane = new FormSubmitJavaScriptPane(JavaScriptActionPane.defaultJavaScriptActionPane
// .createCallButton());
// hyperlinkPane.add(FORMSUBMIT, formSubmitScriptPane);
// 提交入库
List dbmaniList = new ArrayList();
dbmaniList.add(autoCreateDBManipulationPane());
@ -96,21 +89,37 @@ public class ListenerEditPane extends BasicBeanPane<Listener> {
// 自定义事件
customActionPane = new CustomActionPane();
hyperlinkPane.add(CUSTOMACTION, customActionPane);
// 发送邮件
emailPane = new EmailPane();
hyperlinkPane.add(EMAIL,emailPane);
hyperlinkPane.setBorder(BorderFactory.createTitledBorder(Inter.getLocText("JavaScript_Set")));
cards.add(javaScriptPane);
cards.add(commit2DBJavaScriptPane);
cards.add(customActionPane);
cards.add(emailPane);
//其他事件
addOtherEvent();
hyperlinkPane.setBorder(BorderFactory.createTitledBorder(Inter.getLocText("FR-Designer_JavaScript_Set")));
this.add(hyperlinkPane);
styleBox.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
card.show(hyperlinkPane, styleBox.getSelectedItem().toString());
}
});
}
private void addOtherEvent(){
Set<JavaScriptActionProvider> javaScriptActionProviders = ExtraDesignClassManager.getInstance().getArray(JavaScriptActionProvider.XML_TAG);
if (javaScriptActionProviders != null) {
for (JavaScriptActionProvider jsp : javaScriptActionProviders) {
FurtherBasicBeanPane pane = jsp.getJavaScriptActionPane();
String title = pane.title4PopupWindow();
styleBox.addItem(title);
hyperlinkPane.add(title, pane);
cards.add(pane);
}
}
}
/**
* 根据有无单元格创建 DBManipulationPane
* @return 有单元格有智能添加单元格等按钮返回 SmartInsertDBManipulationPane
@ -122,7 +131,7 @@ public class ListenerEditPane extends BasicBeanPane<Listener> {
@Override
protected String title4PopupWindow() {
return Inter.getLocText("Event_Set");
return Inter.getLocText("FR-Designer_Event_Set");
}
@Override
@ -131,47 +140,28 @@ public class ListenerEditPane extends BasicBeanPane<Listener> {
if (this.listener == null) {
this.listener = new Listener();
}
this.nameText.setText(listener.getEventName());
JavaScript js = listener.getAction();
if (js instanceof JavaScriptImpl) {
styleBox.setSelectedItem(JS);
card.show(hyperlinkPane, JS);
javaScriptPane.populateBean((JavaScriptImpl)js);
} else if (js instanceof FormSubmitJavaScript){
styleBox.setSelectedItem(FORMSUBMIT);
card.show(hyperlinkPane, FORMSUBMIT);
formSubmitScriptPane.populateBean((FormSubmitJavaScript)js);
} else if (js instanceof Commit2DBJavaScript) {
styleBox.setSelectedItem(DBCOMMIT);
card.show(hyperlinkPane, DBCOMMIT);
commit2DBJavaScriptPane.populateBean((Commit2DBJavaScript)js);
} else if (js instanceof EmailJavaScript){
styleBox.setSelectedItem(EMAIL);
card.show(hyperlinkPane, EMAIL);
emailPane.populateBean((EmailJavaScript)js);
} else if (js instanceof CustomActionJavaScript){
styleBox.setSelectedItem(CUSTOMACTION);
card.show(hyperlinkPane, CUSTOMACTION);
customActionPane.populateBean((CustomActionJavaScript) js);
for (int i = 0; i < this.cards.size(); i++) {
FurtherBasicBeanPane pane = cards.get(i);
if (pane.accept(js)) {
styleBox.setSelectedItem(pane.title4PopupWindow());
card.show(hyperlinkPane, pane.title4PopupWindow());
pane.populateBean(js);
return;
}
}
}
public void checkValid() throws Exception{
this.cards.get(this.styleBox.getSelectedIndex()).checkValid();
}
@Override
public Listener updateBean(){
this.listener.setEventName(this.nameText.getText());
if (ComparatorUtils.equals(styleBox.getSelectedItem(), JS)) {
this.listener.setAction(javaScriptPane.updateBean());
} else if (ComparatorUtils.equals(styleBox.getSelectedItem(), FORMSUBMIT)) {
this.listener.setAction(formSubmitScriptPane.updateBean());
} else if (ComparatorUtils.equals(styleBox.getSelectedItem(), DBCOMMIT)) {
this.listener.setAction(commit2DBJavaScriptPane.updateBean());
} else if (ComparatorUtils.equals(styleBox.getSelectedItem(),EMAIL)){
this.listener.setAction(emailPane.updateBean());
} else if (ComparatorUtils.equals(styleBox.getSelectedItem(), CUSTOMACTION)){
this.listener.setAction(customActionPane.updateBean());
}
FurtherBasicBeanPane<? extends JavaScript> pane = this.cards.get(this.styleBox.getSelectedIndex());
this.listener.setAction(pane.updateBean());
return this.listener;
}
}

11
designer/src/com/fr/design/widget/CellWidgetCardPane.java

@ -51,8 +51,8 @@ public class CellWidgetCardPane extends BasicPane {
formPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
eventTabPane = new WidgetEventPane(pane);
formPane.add(eventTabPane, BorderLayout.CENTER);
tabbedPane.add(Inter.getLocText("Attribute"), attriPane);
tabbedPane.add(Inter.getLocText("Form-Editing_Listeners"), formPane);
tabbedPane.add(Inter.getLocText("FR-Designer_Attribute"), attriPane);
tabbedPane.add(Inter.getLocText("FR-Designer_Form_Editing_Listeners"), formPane);
presPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
cardPaneForPresent = FRGUIPaneFactory.createCardLayout_S_Pane();
@ -88,7 +88,7 @@ public class CellWidgetCardPane extends BasicPane {
widgetPropertyPane = new BasicWidgetPropertySettingPane();
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.setBorder(BorderFactory.createEmptyBorder(5, 8, 0, 8));
JPanel basic = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Form-Basic_Properties"));
JPanel basic = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Form_Basic_Properties"));
northPane.add(basic);
basic.add(widgetPropertyPane);
attriPane.add(northPane, BorderLayout.NORTH);
@ -155,13 +155,14 @@ public class CellWidgetCardPane extends BasicPane {
*/
public void checkValid() throws Exception {
currentEditorDefinePane.checkValid();
eventTabPane.checkValid();
}
//:jackie 如果选择的项有形态,则将形态面板加入tab面板
private void addPresPane(boolean add) {
if (add) {
tabbedPane.add(this.presPane, 1);
tabbedPane.setTitleAt(1, Inter.getLocText("DS-Dictionary"));
tabbedPane.setTitleAt(1, Inter.getLocText("FR-Designer_DS_Dictionary"));
} else {
tabbedPane.remove(presPane);
}
@ -170,7 +171,7 @@ public class CellWidgetCardPane extends BasicPane {
private void addTreeSettingPane(boolean add) {
if (add) {
tabbedPane.add(this.cardPaneForTreeSetting, 1);
tabbedPane.setTitleAt(1, Inter.getLocText("Create_Tree"));
tabbedPane.setTitleAt(1, Inter.getLocText("FR-Designer_Create_Tree"));
} else {
tabbedPane.remove(this.cardPaneForTreeSetting);
}

7
designer_base/src/com/fr/design/gui/frpane/ListenerUpdatePane.java

@ -29,7 +29,7 @@ public abstract class ListenerUpdatePane extends BasicBeanPane<Listener> {
@Override
protected String title4PopupWindow() {
return Inter.getLocText("Event");
return Inter.getLocText("FR-Designer_Event");
}
@Override
@ -45,4 +45,9 @@ public abstract class ListenerUpdatePane extends BasicBeanPane<Listener> {
return editing;
}
@Override
public void checkValid() throws Exception{
actionPane.checkValid();
}
}

6
designer_base/src/com/fr/design/gui/frpane/UIComboBoxPane.java

@ -133,6 +133,12 @@ public abstract class UIComboBoxPane<T> extends BasicBeanPane<T> {
return cards.get(jcb.getSelectedIndex()).updateBean();
}
@Override
public void checkValid() throws Exception {
cards.get(jcb.getSelectedIndex()).checkValid();
}
public int getSelectedIndex() {
return jcb.getSelectedIndex();
}

23
designer_base/src/com/fr/design/javascript/JavaScriptActionPane.java

@ -43,15 +43,6 @@ public abstract class JavaScriptActionPane extends UIComboBoxPane<JavaScript> {
contentDBManiPane = new ArrayList();
contentDBManiPane.add(createDBManipulationPane());
paneList.add(new Commit2DBJavaScriptPane(this, contentDBManiPane));
paneList.add(new ProcessJSImplPane() {
private static final long serialVersionUID = 1;
@Override
protected Editor[] getCorrespondEditors() {
return isForm() ? ValueEditorPaneFactory.formEditors() : ValueEditorPaneFactory.extendedEditors();
}
}
);
paneList.add(initEmaiPane());
Set<JavaScriptActionProvider> javaScriptActionProviders = ExtraDesignClassManager.getInstance().getArray(JavaScriptActionProvider.XML_TAG);
if (javaScriptActionProviders != null) {
@ -84,14 +75,14 @@ public abstract class JavaScriptActionPane extends UIComboBoxPane<JavaScript> {
* @return 返回按钮对象
*/
public UIButton createCallButton() {
UIButton callButton = new UIButton(Inter.getLocText("Set_Callback_Function"));
UIButton callButton = new UIButton(Inter.getLocText("FR-Designer_Set_Callback_Function"));
callButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
final JavaScriptActionPane callPane = new JavaScriptActionPane() {
@Override
protected String title4PopupWindow() {
return Inter.getLocText("Set_Callback_Function");
return Inter.getLocText("FR-Designer_Set_Callback_Function");
}
@Override
@ -162,7 +153,7 @@ public abstract class JavaScriptActionPane extends UIComboBoxPane<JavaScript> {
@Override
protected String title4PopupWindow() {
return Inter.getLocText("Set_Callback_Function");
return Inter.getLocText("FR-Designer_Set_Callback_Function");
}
@Override
@ -179,10 +170,10 @@ public abstract class JavaScriptActionPane extends UIComboBoxPane<JavaScript> {
* 生成界面默认的组建
*
* @return 返回生成的面板
*/
public static JavaScriptActionPane createDefault() {
return new JavaScriptActionPane() {
*/
public static JavaScriptActionPane createDefault() {
return new JavaScriptActionPane() {
@Override
public DBManipulationPane createDBManipulationPane() {
return new DBManipulationPane();
@ -190,7 +181,7 @@ public abstract class JavaScriptActionPane extends UIComboBoxPane<JavaScript> {
@Override
protected String title4PopupWindow() {
return Inter.getLocText("Set_Callback_Function");
return Inter.getLocText("FR-Designer_Set_Callback_Function");
}
@Override

15
designer_base/src/com/fr/design/locale/designer.properties

@ -493,3 +493,18 @@ FR-Designer_Exporting=Exporting
FR-Designer_Export-PDF=PDF
FR-Designer_Button_OK=OK
FR-Designer_Button_Cancel=Cancel
FR-Designer_JavaScript=
FR-Designer_JavaScript_Form_Submit=
FR-Designer_JavaScript_Commit_to_Database=
FR-Designer_JavaScript_Custom=
FR-Designer_RWA_Submit=
FR-Designer_Event_Name=
FR-Designer_Event_Type=
FR-Designer_Event_Name_Type=
FR-Designer_JavaScript_Set=
FR-Designer_Attribute=
FR-Designer_Form_Editing_Listeners=
FR-Designer_Form_Basic_Properties=
FR-Designer_DS_Dictionary=
FR-Designer_Create_Tree=
FR-Designer_Set_Callback_Function=

16
designer_base/src/com/fr/design/locale/designer_en_US.properties

@ -493,3 +493,19 @@ FR-Designer_Export-PDF=PDF
FR-Designer_Properties_Mobile=MobileProperties
FR-Designer_Button_OK=OK
FR-Designer_Button_Cancel=Cancel
FR-Designer_JavaScript=JavaScript
FR-Designer_JavaScript_Form_Submit=Form Submit
FR-Designer_JavaScript_Commit_to_Database=Commit to DB
FR-Designer_JavaScript_Custom=Custom
FR-Designer_RWA_Submit=Submit
FR-Designer_Event_Name=Event Name
FR-Designer_Event_Type=Event Type
FR-Designer_Event_Name_Type=Event Name and Type
FR-Designer_JavaScript_Set=JavaScript Set
FR-Designer_Attribute=Attribute
FR-Designer_Form_Editing_Listeners=Event editing
FR-Designer_Form_Basic_Properties=Basic Property
FR-Designer_DS_Dictionary=Data Dictionary
FR-Designer_Create_Tree=Build Tree
FR-Designer_Set_Callback_Function=Set Callback Function

17
designer_base/src/com/fr/design/locale/designer_ja_JP.properties

@ -471,4 +471,19 @@ FR-Designer_Exported_successfully=\u5C0E\u51FA\u6210\u529F
FR-Designer_Exporting=\u5C0E\u51FA\u3057\u3066\u3044\u307E\u3059
FR-Designer_Export-PDF=PDF\u30D5\u30A9\u30FC\u30DE\u30C3\u30C8FR-Designer_Button_OK=FR-Designer_Button_OK=\u78BA\u5B9A
FR-Designer_Button_Cancel=\u30AD\u30E3\u30F3\u30BB\u30EB
\
\uFFFD
FR-Designer_JavaScript=
FR-Designer_JavaScript_Form_Submit=
FR-Designer_JavaScript_Commit_to_Database=
FR-Designer_JavaScript_Custom=
FR-Designer_RWA_Submit=
FR-Designer_Event_Name=
FR-Designer_Event_Type=
FR-Designer_Event_Name_Type=
FR-Designer_JavaScript_Set=
FR-Designer_Attribute=
FR-Designer_Form_Editing_Listeners=
FR-Designer_Form_Basic_Properties=
FR-Designer_DS_Dictionary=
FR-Designer_Create_Tree=
FR-Designer_Set_Callback_Function=

17
designer_base/src/com/fr/design/locale/designer_ko_KR.properties

@ -466,4 +466,19 @@ FR-Designer_Exported_successfully=\uB0B4\uBCF4\uB0B4\uAE30\uC131\uACF5
FR-Designer_Exporting=\uB0B4\uBCF4\uB0B4\uAE30\uC911
FR-Designer_Export-PDF=PDF\uC11C\uC2DDFR-Designer_Properties=\uFFFD
FR-Designer_Button_OK=\uD655\uC778FR-Designer_Button_Cancel=\uCDE8\uC18C
\
\uFFFD
FR-Designer_JavaScript=
FR-Designer_JavaScript_Form_Submit=
FR-Designer_JavaScript_Commit_to_Database=
FR-Designer_JavaScript_Custom=
FR-Designer_RWA_Submit=
FR-Designer_Event_Name=
FR-Designer_Event_Type=
FR-Designer_Event_Name_Type=
FR-Designer_JavaScript_Set=
FR-Designer_Attribute=
FR-Designer_Form_Editing_Listeners=
FR-Designer_Form_Basic_Properties=
FR-Designer_DS_Dictionary=
FR-Designer_Create_Tree=
FR-Designer_Set_Callback_Function=

15
designer_base/src/com/fr/design/locale/designer_zh_CN.properties

@ -497,3 +497,18 @@ FR-Designer_Export-PDF=PDF\u683C\u5F0F
FR-Designer_Properties_Mobile=\u624B\u673A\u5C5E\u6027
FR-Designer_Button_OK=\u786E\u5B9A
FR-Designer_Button_Cancel=\u53D6\u6D88
FR-Designer_JavaScript=JavaScript\u811A\u672C
FR-Designer_JavaScript_Form_Submit=\u8868\u5355\u63D0\u4EA4
FR-Designer_JavaScript_Commit_to_Database=\u63D0\u4EA4\u5165\u5E93
FR-Designer_JavaScript_Custom=\u81EA\u5B9A\u4E49
FR-Designer_RWA_Submit=\u63D0\u4EA4
FR-Designer_Event_Name=\u4E8B\u4EF6\u540D
FR-Designer_Event_Type=\u4E8B\u4EF6\u7C7B\u578B
FR-Designer_Event_Name_Type=\u4E8B\u4EF6\u540D\u5B57\u548C\u7C7B\u578B
FR-Designer_JavaScript_Set=JS\u8BBE\u7F6E
FR-Designer_Attribute=\u5C5E\u6027
FR-Designer_Form_Editing_Listeners=\u4E8B\u4EF6\u7F16\u8F91
FR-Designer_Form_Basic_Properties=\u57FA\u672C\u5C5E\u6027
FR-Designer_DS_Dictionary=\u6570\u636E\u5B57\u5178
FR-Designer_Create_Tree=\u6784\u5EFA\u6811
FR-Designer_Set_Callback_Function=\u8BBE\u7F6E\u56DE\u8C03\u51FD\u6570

17
designer_base/src/com/fr/design/locale/designer_zh_TW.properties

@ -484,4 +484,19 @@ FR-Designer_Exporting=\u6B63\u5728\u532F\u51FA...
FR-Designer_Export-PDF=PDF\u683C\u5F0F
FR-Designer_Properties_Mobile=\u624B\u6A5F\u5C6C\u6027
FR-Designer_Button_OK=\u78BA\u5B9A
FR-Designer_Button_Cancel=\u53D6\u6D88
FR-Designer_Button_Cancel=\u53D6\u6D88
FR-Designer_JavaScript=
FR-Designer_JavaScript_Form_Submit=
FR-Designer_JavaScript_Commit_to_Database=
FR-Designer_JavaScript_Custom=
FR-Designer_RWA_Submit=
FR-Designer_Event_Name=
FR-Designer_Event_Type=
FR-Designer_Event_Name_Type=
FR-Designer_JavaScript_Set=
FR-Designer_Attribute=
FR-Designer_Form_Editing_Listeners=
FR-Designer_Form_Basic_Properties=
FR-Designer_DS_Dictionary=
FR-Designer_Create_Tree=
FR-Designer_Set_Callback_Function=
Loading…
Cancel
Save