diff --git a/designer/src/com/fr/design/webattr/PageWebSettingPane.java b/designer/src/com/fr/design/webattr/PageWebSettingPane.java index 203ace1af..ee415da68 100644 --- a/designer/src/com/fr/design/webattr/PageWebSettingPane.java +++ b/designer/src/com/fr/design/webattr/PageWebSettingPane.java @@ -45,15 +45,15 @@ public class PageWebSettingPane extends WebSettingPane { JPanel buttonpane = new JPanel(FRGUIPaneFactory.createBoxFlowLayout()); buttonpane.add(centerRadioButton); buttonpane.add(leftRadioButton); - isShowAsImageBox = new UICheckBox(Inter.getLocText("Is_Paint_Page")); - isAutoScaleBox = new UICheckBox(Inter.getLocText("IS_Auto_Scale")); - isTDHeavyBox = new UICheckBox(Inter.getLocText("IS_TD_HEAVY_EXPORT"), false); + isShowAsImageBox = new UICheckBox(Inter.getLocText("FR-Designer_Is_Paint_Page")); + isAutoScaleBox = new UICheckBox(Inter.getLocText("FR-Designer_IS_Auto_Scale")); + isTDHeavyBox = new UICheckBox(Inter.getLocText("FR-Designer_IS_TD_HEAVY_EXPORT"), false); double p = TableLayout.PREFERRED; double[] columnSize = { p,p,p}; double[] rowSize = { p, p,p,p }; Component[][] components = new Component[][]{ - new Component[]{new UILabel(Inter.getLocText("Report_Show_Location") + ":", UILabel.RIGHT), buttonpane,null}, - new Component[]{new UILabel(Inter.getLocText("PageSetup-Page") + ":", UILabel.RIGHT), isShowAsImageBox, isAutoScaleBox}, + new Component[]{new UILabel(Inter.getLocText("FR-Designer_Report_Show_Location") + ":", UILabel.RIGHT), buttonpane,null}, + new Component[]{new UILabel(Inter.getLocText("FR-Designer_PageSetup_Page") + ":", UILabel.RIGHT), isShowAsImageBox, isAutoScaleBox}, new Component[]{null, isTDHeavyBox, null} }; diff --git a/designer/src/com/fr/design/widget/ui/CustomWritableRepeatEditorPane.java b/designer/src/com/fr/design/widget/ui/CustomWritableRepeatEditorPane.java index 3ff1fc23c..64e854601 100644 --- a/designer/src/com/fr/design/widget/ui/CustomWritableRepeatEditorPane.java +++ b/designer/src/com/fr/design/widget/ui/CustomWritableRepeatEditorPane.java @@ -1 +1 @@ -package com.fr.design.widget.ui; import com.fr.base.GraphHelper; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : Shockway * Date: 13-9-18 * Time: 下午2:17 */ public abstract class CustomWritableRepeatEditorPane extends WritableRepeatEditorPane { private UICheckBox customDataCheckBox; public CustomWritableRepeatEditorPane() { this.initComponents(); } @Override protected JPanel setThirdContentPane() { JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false); this.customDataCheckBox.setPreferredSize( new Dimension(GraphHelper.getLocTextWidth("Form-Allow_CustomData") + 30, 30)); getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); JPanel otherContentPane = this.setForthContentPane(); if (otherContentPane != null) { contentPane.add(otherContentPane,BorderLayout.CENTER); } return contentPane; } protected abstract JPanel setForthContentPane(); protected void populateSubWritableRepeatEditorBean(T e) { this.customDataCheckBox.setSelected(e.isCustomData()); populateSubCustomWritableRepeatEditorBean(e); } protected abstract void populateSubCustomWritableRepeatEditorBean(T e); protected T updateSubWritableRepeatEditorBean() { T e = updateSubCustomWritableRepeatEditorBean(); e.setCustomData(this.customDataCheckBox.isSelected()); return e; } protected abstract T updateSubCustomWritableRepeatEditorBean(); } \ No newline at end of file +package com.fr.design.widget.ui; import com.fr.base.GraphHelper; import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.utils.gui.GUICoreUtils; import com.fr.form.ui.CustomWriteAbleRepeatEditor; import com.fr.general.Inter; import javax.swing.*; import java.awt.*; /** * Author : Shockway * Date: 13-9-18 * Time: 下午2:17 */ public abstract class CustomWritableRepeatEditorPane extends WritableRepeatEditorPane { private UICheckBox customDataCheckBox; private static final int CUSTOM_DATA_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("Form-Allow_CustomData") + 30; private static final int CUSTOM_DATA_CHECK_BOX_HEIGHT = 30; public CustomWritableRepeatEditorPane() { this.initComponents(); } @Override protected JPanel setThirdContentPane() { JPanel contentPane = FRGUIPaneFactory.createBorderLayout_L_Pane(); contentPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); this.customDataCheckBox = new UICheckBox(Inter.getLocText("Form-Allow_CustomData"), false); this.customDataCheckBox.setPreferredSize( new Dimension(CUSTOM_DATA_CHECK_BOX_WIDTH, CUSTOM_DATA_CHECK_BOX_HEIGHT)); getValidatePane().add(GUICoreUtils.createFlowPane(new JComponent[]{this.customDataCheckBox}, FlowLayout.LEFT, 5)); JPanel otherContentPane = this.setForthContentPane(); if (otherContentPane != null) { contentPane.add(otherContentPane,BorderLayout.CENTER); } return contentPane; } protected abstract JPanel setForthContentPane(); protected void populateSubWritableRepeatEditorBean(T e) { this.customDataCheckBox.setSelected(e.isCustomData()); populateSubCustomWritableRepeatEditorBean(e); } protected abstract void populateSubCustomWritableRepeatEditorBean(T e); protected T updateSubWritableRepeatEditorBean() { T e = updateSubCustomWritableRepeatEditorBean(); e.setCustomData(this.customDataCheckBox.isSelected()); return e; } protected abstract T updateSubCustomWritableRepeatEditorBean(); } \ No newline at end of file diff --git a/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java b/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java index 47b87898a..34c355f51 100644 --- a/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java +++ b/designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java @@ -20,6 +20,8 @@ import com.fr.form.ui.FieldEditor; import com.fr.general.Inter; public abstract class FieldEditorDefinePane extends AbstractDataModify { + private static final int ALLOW_BLANK_CHECK_BOX_WIDTH = GraphHelper.getLocTextWidth("FR-Designer_Allow_Blank") + 30; + private static final int ALLOW_BLANK_CHECK_BOX_HEIGHT = 30; private UICheckBox allowBlankCheckBox; // richer:错误信息,是所有控件共有的属性,所以放到这里来 private UITextField errorMsgTextField; @@ -33,6 +35,24 @@ public abstract class FieldEditorDefinePane extends Abstr protected void initComponents() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8)); + + initRegErrorMsgTextField(); + + //JPanel firstPanel = FRGUIPaneFactory.createBorderLayout_M_Pane(); + allowBlankCheckBox = new UICheckBox(Inter.getLocText("FR-Designer_Allow_Blank")); + allowBlankCheckBox.setPreferredSize(new Dimension(ALLOW_BLANK_CHECK_BOX_WIDTH, ALLOW_BLANK_CHECK_BOX_HEIGHT)); + allowBlankCheckBox.addItemListener(new ItemListener() { + + @Override + public void itemStateChanged(ItemEvent e) { + errorMsgTextField.setEnabled(!allowBlankCheckBox.isSelected()); + } + }); + + initErrorMsgPane(); + } + + protected void initRegErrorMsgTextField() { regErrorMsgTextField = new UITextField(16); regErrorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { public void changedUpdate(DocumentEvent e) { @@ -47,18 +67,9 @@ public abstract class FieldEditorDefinePane extends Abstr regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText()); } }); + } - //JPanel firstPanel = FRGUIPaneFactory.createBorderLayout_M_Pane(); - allowBlankCheckBox = new UICheckBox(Inter.getLocText("Allow_Blank")); - allowBlankCheckBox.setPreferredSize(new Dimension(GraphHelper.getLocTextWidth("Allow_Blank") + 30, 30)); - allowBlankCheckBox.addItemListener(new ItemListener() { - - @Override - public void itemStateChanged(ItemEvent e) { - errorMsgTextField.setEnabled(!allowBlankCheckBox.isSelected()); - } - }); - + protected void initErrorMsgPane() { // 错误信息 JPanel errorMsgPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); errorMsgPane.add(new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":")); diff --git a/designer_base/src/com/fr/design/actions/help/AboutPane.java b/designer_base/src/com/fr/design/actions/help/AboutPane.java index d15bc0186..4249b2634 100644 --- a/designer_base/src/com/fr/design/actions/help/AboutPane.java +++ b/designer_base/src/com/fr/design/actions/help/AboutPane.java @@ -73,7 +73,7 @@ public class AboutPane extends JPanel { // do nothing } else { if(ComparatorUtils.equals(ProductConstants.APP_NAME,FINEREPORT)){ - boxCenterAlignmentPane = new BoxCenterAligmentPane(Inter.getLocText("Service_Phone") + ProductConstants.COMPARE_TELEPHONE); + boxCenterAlignmentPane = new BoxCenterAligmentPane(Inter.getLocText("FR-Designer_Service_Phone") + ProductConstants.COMPARE_TELEPHONE); contentPane.add(boxCenterAlignmentPane); } boxCenterAlignmentPane = new BoxCenterAligmentPane("QQ:" + SiteCenter.getInstance().acquireUrlByKind("help.qq")); @@ -110,12 +110,12 @@ public class AboutPane extends JPanel { } private String getCopyRight(){ - return append(Inter.getLocText("About-CopyRight"), COPYRIGHT_LABEL, + return append(Inter.getLocText("FR-Designer_About_CopyRight"), COPYRIGHT_LABEL, ProductConstants.HISTORY, StringUtils.BLANK, ProductConstants.COMPANY_NAME); } private String getBuildTitle() { - return append(ProductConstants.APP_NAME, Inter.getLocText("About-Version"), + return append(ProductConstants.APP_NAME, Inter.getLocText("FR-Designer_About_Version"), StringUtils.BLANK, ProductConstants.RELEASE_VERSION, BUILD_PREFIX); } diff --git a/designer_base/src/com/fr/design/gui/ibutton/UIColorButton.java b/designer_base/src/com/fr/design/gui/ibutton/UIColorButton.java index 283b2e112..dcc44f630 100644 --- a/designer_base/src/com/fr/design/gui/ibutton/UIColorButton.java +++ b/designer_base/src/com/fr/design/gui/ibutton/UIColorButton.java @@ -30,6 +30,7 @@ public class UIColorButton extends UIButton implements PopupHider, UIObserver, G private static final int SIZE_2 = 2; private static final int SIZE_4 = 4; private static final int SIZE_6 = 6; + private static final int POPUP_MENU_SHIFT = -70; private Color color = Color.BLACK; private ColorControlWindow popupWin; private EventListenerList colorChangeListenerList = new EventListenerList(); @@ -126,7 +127,7 @@ public class UIColorButton extends UIButton implements PopupHider, UIObserver, G popupWin = this.getColorControlWindow(); - GUICoreUtils.showPopupMenu(popupWin, this, -70, this.getSize().height); + GUICoreUtils.showPopupMenu(popupWin, this, POPUP_MENU_SHIFT, this.getSize().height); } /** diff --git a/designer_base/src/com/fr/design/locale/designer.properties b/designer_base/src/com/fr/design/locale/designer.properties index e7671b67f..3f809fb4a 100644 --- a/designer_base/src/com/fr/design/locale/designer.properties +++ b/designer_base/src/com/fr/design/locale/designer.properties @@ -530,4 +530,12 @@ FR-Designer_setCarousel= FR-Designer_carouselInterval= FR-Designer_Initial_Background_Tips= FR-Designer_Mouse_Move_Tips= -FR-Designer_Mouse_Click_Tips= \ No newline at end of file +FR-Designer_Mouse_Click_Tips= +FR-Designer_About_Version=Version +FR-Designer_About_CopyRight=Copy Right +FR-Designer_Service_Phone=Service Phone +FR-Designer_Allow_Blank=Allow Blank +FR-Designer_PageSetup_Page=Page +FR-Designer_Custom_Job_Description=Description +FR-Designer_Property=Property +FR-Designer_ClassName=Class Name \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_en_US.properties b/designer_base/src/com/fr/design/locale/designer_en_US.properties index 3b8631587..30db869a2 100644 --- a/designer_base/src/com/fr/design/locale/designer_en_US.properties +++ b/designer_base/src/com/fr/design/locale/designer_en_US.properties @@ -531,3 +531,11 @@ FR-Designer_carouselInterval= FR-Designer_Initial_Background_Tips=Initial background of the button FR-Designer_Mouse_Move_Tips=Move the mouse to the button on the background, in the absence of not changing the background FR-Designer_Mouse_Click_Tips=The background of the mouse to click the button, in the absence of not changing the background +FR-Designer_About_Version=Version +FR-Designer_About_CopyRight=Copy Right +FR-Designer_Service_Phone=Service Phone +FR-Designer_Allow_Blank=Allow Null +FR-Designer_PageSetup_Page=Page +FR-Designer_Custom_Job_Description=Description +FR-Designer_Property=Property +FR-Designer_ClassName=Class Name diff --git a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties index b1df09da5..ba6114955 100644 --- a/designer_base/src/com/fr/design/locale/designer_ja_JP.properties +++ b/designer_base/src/com/fr/design/locale/designer_ja_JP.properties @@ -510,3 +510,11 @@ FR-Designer_carouselInterval= FR-Designer_Initial_Background_Tips= FR-Designer_Mouse_Move_Tips= FR-Designer_Mouse_Click_Tips= +FR-Designer_About_Version=\u30D0\u30FC\u30B8\u30E7\u30F3 +FR-Designer_About_CopyRight=\u8457\u4F5C\u6A29\u6240\u6709 +FR-Designer_Service_Phone=\u30B5\u30FC\u30D3\u30B9\u96FB\u8A71\uFF1A +FR-Designer_Allow_Blank=\u7A7A\u6B04\u3042\u308A +FR-Designer_PageSetup_Page=\u30DA\u30FC\u30B8 +FR-Designer_Custom_Job_Description=\u8A18\u8FF0 +FR-Designer_Property=\u5C5E\u6027 +FR-Designer_ClassName=\u985E\u540D diff --git a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties index 2a227f806..9d540cd01 100644 --- a/designer_base/src/com/fr/design/locale/designer_ko_KR.properties +++ b/designer_base/src/com/fr/design/locale/designer_ko_KR.properties @@ -504,4 +504,12 @@ FR-Designer_setCarousel= FR-Designer_carouselInterval= FR-Designer_Initial_Background_Tips= FR-Designer_Mouse_Move_Tips= -FR-Designer_Mouse_Click_Tips= \ No newline at end of file +FR-Designer_Mouse_Click_Tips= +FR-Designer_About_Version=\uBC84\uC804 +FR-Designer_About_CopyRight=\uD310\uAD8C\uC18C\uC720 +FR-Designer_Service_Phone=\uC11C\uBE44\uC2A4\uC804\uD654\uFF1A +FR-Designer_Allow_Blank=\uBE48\uCE78\uD5C8\uC6A9 +FR-Designer_PageSetup_Page=\uC6F9\uD398\uC774\uC9C0 +FR-Designer_Custom_Job_Description=\uC124\uBA85 +FR-Designer_Property=\uC18D\uC131 +FR-Designer_ClassName=\uD074\uB798\uC2A4\uB124\uC784 \ No newline at end of file diff --git a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties index 424367a4b..54f0ac177 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_CN.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_CN.properties @@ -535,4 +535,12 @@ FR-Designer_carouselInterval=\u8F6E\u64AD\u95F4\u9694 FR-Designer_Initial_Background_Tips=\u6309\u94AE\u7684\u521D\u59CB\u80CC\u666F FR-Designer_Mouse_Move_Tips=\u9F20\u6807\u79FB\u52A8\u5230\u6309\u94AE\u4E0A\u7684\u80CC\u666F\uFF0C\u82E5\u65E0\u5219\u4E0D\u6539\u53D8\u80CC\u666F FR-Designer_Mouse_Click_Tips=\u9F20\u6807\u70B9\u51FB\u6309\u94AE\u65F6\u80CC\u666F\uFF0C\u82E5\u65E0\u5219\u4E0D\u6539\u53D8\u80CC\u666F +FR-Designer_About_Version=\u7248\u672C +FR-Designer_About_CopyRight=\u7248\u6743\u6240\u6709 +FR-Designer_Service_Phone=\u670D\u52A1\u7535\u8BDD\uFF1A +FR-Designer_Allow_Blank=\u5141\u8BB8\u4E3A\u7A7A +FR-Designer_PageSetup_Page=\u9875\u9762 +FR-Designer_Custom_Job_Description=\u63CF\u8FF0 +FR-Designer_Property=\u5C5E\u6027 +FR-Designer_ClassName=\u7C7B\u540D diff --git a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties index 0d8c6327a..271150729 100644 --- a/designer_base/src/com/fr/design/locale/designer_zh_TW.properties +++ b/designer_base/src/com/fr/design/locale/designer_zh_TW.properties @@ -523,3 +523,11 @@ FR-Designer_carouselInterval= FR-Designer_Initial_Background_Tips= FR-Designer_Mouse_Move_Tips= FR-Designer_Mouse_Click_Tips= +FR-Designer_About_Version=\u7248\u672C +FR-Designer_About_CopyRight=\u7248\u6B0A\u6240\u6709 +FR-Designer_Service_Phone=\u670D\u52D9\u96FB\u8A71\uFF1A +FR-Designer_Allow_Blank=\u5141\u8A31\u70BA\u7A7A\u767D +FR-Designer_PageSetup_Page=\u9801\u9762 +FR-Designer_Custom_Job_Description=\u63CF\u8FF0 +FR-Designer_Property=\u5C6C\u6027 +FR-Designer_ClassName=\u985E\u540D diff --git a/designer_base/src/com/fr/design/style/color/PickColorButtonFactory.java b/designer_base/src/com/fr/design/style/color/PickColorButtonFactory.java index e393609b9..19d0c86ee 100644 --- a/designer_base/src/com/fr/design/style/color/PickColorButtonFactory.java +++ b/designer_base/src/com/fr/design/style/color/PickColorButtonFactory.java @@ -13,6 +13,8 @@ import java.awt.event.*; */ public class PickColorButtonFactory { private static int iconSize; + private static final int SIZE_16 = 16; + private static final int SIZE_18 = 18; private static IconType iconType; private static Image iconImage; @@ -26,10 +28,10 @@ public class PickColorButtonFactory { if (iconType == IconType.ICON16) { iconImage = BaseUtils.readImage("/com/fr/design/images/gui/colorPicker/colorPicker16.png"); - iconSize = 16; + iconSize = SIZE_16; } else { iconImage = BaseUtils.readImage("/com/fr/design/images/gui/colorPicker/colorPicker18.png"); - iconSize = 18; + iconSize = SIZE_18; pickColorButton.setBorderPainted(false); } pickColorButton.setPreferredSize(new Dimension(iconSize, iconSize)); diff --git a/designer_base/src/com/fr/design/write/submit/CustomJobPane.java b/designer_base/src/com/fr/design/write/submit/CustomJobPane.java index 4a6e3be9f..d9368d87d 100644 --- a/designer_base/src/com/fr/design/write/submit/CustomJobPane.java +++ b/designer_base/src/com/fr/design/write/submit/CustomJobPane.java @@ -1 +1 @@ -package com.fr.design.write.submit; import com.fr.base.GraphHelper; import com.fr.data.AbstractClassJob; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import com.fr.design.beans.BasicBeanPane; import com.fr.design.formula.JavaEditorPane; import com.fr.design.gui.frpane.ObjectProperiesPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.general.Inter; import com.fr.stable.StringUtils; import com.fr.design.utils.gui.GUICoreUtils; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; /** * Author : Shockway * Date: 13-7-29 * Time: 下午6:48 */ public abstract class CustomJobPane extends BasicBeanPane { protected UITextField classNameTextField; protected ObjectProperiesPane objectProperiesPane; public static final int DEFAULT_LENGTH = 30; public CustomJobPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel reportletNamePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); classNameTextField = new UITextField(getLengthOfTextField()); reportletNamePane.add(classNameTextField); UIButton browserButton = new UIButton(Inter.getLocText("Select")); browserButton.setPreferredSize(new Dimension( GraphHelper.getLocTextWidth("Select") + 20, classNameTextField.getPreferredSize().height)); UIButton editButton = new UIButton(Inter.getLocText("Edit")); editButton.setPreferredSize(new Dimension( GraphHelper.getLocTextWidth("Edit") + 20, classNameTextField.getPreferredSize().height)); reportletNamePane.add(browserButton); reportletNamePane.add(editButton); browserButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { final ClassNameSelectPane bPane = new ClassNameSelectPane(); bPane.setClassPath(classNameTextField.getText()); bPane.showWindow( SwingUtilities.getWindowAncestor(getWindowAncestor()), new DialogActionAdapter() { public void doOk() { classNameTextField.setText(bPane.getClassPath()); checkAddButtonEnable(); } }).setVisible(true); } }); editButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final JavaEditorPane javaEditorPane = new JavaEditorPane(classNameTextField.getText(), JavaEditorPane.DEFAULT_SUBMIT_JOB); final BasicDialog dlg = javaEditorPane.showMediumWindow(SwingUtilities.getWindowAncestor(CustomJobPane.this), new DialogActionAdapter() { public void doOk() { classNameTextField.setText(javaEditorPane.getClassText()); checkAddButtonEnable(); } }); javaEditorPane.addSaveActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { dlg.doOK(); } }); dlg.setVisible(true); } }); reportletNamePane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("ClassName"), null)); this.add(reportletNamePane, BorderLayout.NORTH); objectProperiesPane = new ObjectProperiesPane(); objectProperiesPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Property"), null)); this.add(objectProperiesPane, BorderLayout.CENTER); UITextArea area = new UITextArea(2, 1); area.setText(Inter.getLocText(new String[]{"Come_True", "Interface"}) + ":com.fr.data.SubmitJob"); JPanel dsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); dsPane.add(area); dsPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("Description"), null)); this.add(dsPane, BorderLayout.SOUTH); checkAddButtonEnable(); } public int getLengthOfTextField() { return DEFAULT_LENGTH; } protected String title4PopupWindow() { return "CustomJob"; } protected Component getWindowAncestor() { return this; } @Override public void populateBean(Object ob) { if (ob instanceof AbstractClassJob) { AbstractClassJob cj = (AbstractClassJob) ob; this.classNameTextField.setText(cj.getClassName()); this.objectProperiesPane.populateBean(cj.getPropertyMap()); checkAddButtonEnable(); } } /** * 添加按钮可用 */ public void checkAddButtonEnable() { objectProperiesPane.enableAddButton(!StringUtils.isEmpty(classNameTextField.getText())); } /** * 重置 */ public void reset() { this.classNameTextField.setText(null); this.checkAddButtonEnable(); } } \ No newline at end of file +package com.fr.design.write.submit; import com.fr.base.GraphHelper; import com.fr.data.AbstractClassJob; import com.fr.design.data.tabledata.tabledatapane.ClassNameSelectPane; import com.fr.design.beans.BasicBeanPane; import com.fr.design.formula.JavaEditorPane; import com.fr.design.gui.frpane.ObjectProperiesPane; import com.fr.design.gui.ibutton.UIButton; import com.fr.design.gui.itextarea.UITextArea; import com.fr.design.gui.itextfield.UITextField; import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.dialog.BasicDialog; import com.fr.design.dialog.DialogActionAdapter; import com.fr.general.Inter; import com.fr.stable.StringUtils; import com.fr.design.utils.gui.GUICoreUtils; import javax.swing.*; import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; /** * Author : Shockway * Date: 13-7-29 * Time: 下午6:48 */ public abstract class CustomJobPane extends BasicBeanPane { protected UITextField classNameTextField; protected ObjectProperiesPane objectProperiesPane; public static final int DEFAULT_LENGTH = 30; public CustomJobPane() { this.setLayout(FRGUIPaneFactory.createBorderLayout()); JPanel reportletNamePane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); classNameTextField = new UITextField(getLengthOfTextField()); reportletNamePane.add(classNameTextField); UIButton browserButton = new UIButton(Inter.getLocText("FR-Designer_Select")); browserButton.setPreferredSize(new Dimension( GraphHelper.getLocTextWidth("FR-Designer_Select") + 20, classNameTextField.getPreferredSize().height)); UIButton editButton = new UIButton(Inter.getLocText("FR-Designer_Edit")); editButton.setPreferredSize(new Dimension( GraphHelper.getLocTextWidth("FR-Designer_Edit") + 20, classNameTextField.getPreferredSize().height)); reportletNamePane.add(browserButton); reportletNamePane.add(editButton); browserButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent evt) { final ClassNameSelectPane bPane = new ClassNameSelectPane(); bPane.setClassPath(classNameTextField.getText()); bPane.showWindow( SwingUtilities.getWindowAncestor(getWindowAncestor()), new DialogActionAdapter() { public void doOk() { classNameTextField.setText(bPane.getClassPath()); checkAddButtonEnable(); } }).setVisible(true); } }); editButton.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { final JavaEditorPane javaEditorPane = new JavaEditorPane(classNameTextField.getText(), JavaEditorPane.DEFAULT_SUBMIT_JOB); final BasicDialog dlg = javaEditorPane.showMediumWindow(SwingUtilities.getWindowAncestor(CustomJobPane.this), new DialogActionAdapter() { public void doOk() { classNameTextField.setText(javaEditorPane.getClassText()); checkAddButtonEnable(); } }); javaEditorPane.addSaveActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { dlg.doOK(); } }); dlg.setVisible(true); } }); reportletNamePane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_ClassName"), null)); this.add(reportletNamePane, BorderLayout.NORTH); objectProperiesPane = new ObjectProperiesPane(); objectProperiesPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_Property"), null)); this.add(objectProperiesPane, BorderLayout.CENTER); UITextArea area = new UITextArea(2, 1); area.setText(Inter.getLocText(new String[]{"Come_True", "Interface"}) + ":com.fr.data.SubmitJob"); JPanel dsPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); dsPane.add(area); dsPane.setBorder(GUICoreUtils.createTitledBorder(Inter.getLocText("FR-Designer_Custom_Job_Description"), null)); this.add(dsPane, BorderLayout.SOUTH); checkAddButtonEnable(); } public int getLengthOfTextField() { return DEFAULT_LENGTH; } protected String title4PopupWindow() { return "CustomJob"; } protected Component getWindowAncestor() { return this; } @Override public void populateBean(Object ob) { if (ob instanceof AbstractClassJob) { AbstractClassJob cj = (AbstractClassJob) ob; this.classNameTextField.setText(cj.getClassName()); this.objectProperiesPane.populateBean(cj.getPropertyMap()); checkAddButtonEnable(); } } /** * 添加按钮可用 */ public void checkAddButtonEnable() { objectProperiesPane.enableAddButton(StringUtils.isNotEmpty(classNameTextField.getText())); } /** * 重置 */ public void reset() { this.classNameTextField.setText(null); this.checkAddButtonEnable(); } } \ No newline at end of file