Browse Source

控件校验提示优化和控件属性整理

master
kerry 8 years ago
parent
commit
49d9558d66
  1. 7
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  2. 28
      designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java
  3. 59
      designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java
  4. 64
      designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java
  5. 185
      designer_base/src/com/fr/design/gui/frpane/RegPane.java
  6. 17
      designer_form/src/com/fr/design/designer/beans/adapters/component/CompositeComponentAdapter.java
  7. 3
      designer_form/src/com/fr/design/designer/creator/XButton.java
  8. 2
      designer_form/src/com/fr/design/designer/creator/XCheckBox.java
  9. 30
      designer_form/src/com/fr/design/designer/creator/XCheckBoxGroup.java
  10. 11
      designer_form/src/com/fr/design/designer/creator/XComboBox.java
  11. 16
      designer_form/src/com/fr/design/designer/creator/XComboCheckBox.java
  12. 2
      designer_form/src/com/fr/design/designer/creator/XCustomWriteAbleRepeatEditor.java
  13. 25
      designer_form/src/com/fr/design/designer/creator/XDateEditor.java
  14. 4
      designer_form/src/com/fr/design/designer/creator/XDirectWriteEditor.java
  15. 6
      designer_form/src/com/fr/design/designer/creator/XFieldEditor.java
  16. 2
      designer_form/src/com/fr/design/designer/creator/XLabel.java
  17. 31
      designer_form/src/com/fr/design/designer/creator/XNumberEditor.java
  18. 9
      designer_form/src/com/fr/design/designer/creator/XPassword.java
  19. 18
      designer_form/src/com/fr/design/designer/creator/XRadioGroup.java
  20. 13
      designer_form/src/com/fr/design/designer/creator/XTextArea.java
  21. 34
      designer_form/src/com/fr/design/designer/creator/XTextEditor.java
  22. 4
      designer_form/src/com/fr/design/designer/creator/XTreeComboBoxEditor.java
  23. 18
      designer_form/src/com/fr/design/designer/creator/XTreeEditor.java
  24. 1
      designer_form/src/com/fr/design/form/util/XCreatorConstants.java
  25. 5
      designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessiblePropertyEditor.java

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

@ -86,7 +86,12 @@ public class CellWidgetCardPane extends BasicPane {
attriPane.remove(widgetPropertyPane); attriPane.remove(widgetPropertyPane);
widgetPropertyPane = new BasicWidgetPropertySettingPane(); widgetPropertyPane = new BasicWidgetPropertySettingPane();
attriPane.add(widgetPropertyPane, BorderLayout.NORTH); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.setBorder(BorderFactory.createEmptyBorder(10, 8, 5, 8));
JPanel basic = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Form-Basic_Properties"));
northPane.add(basic);
basic.add(widgetPropertyPane);
attriPane.add(northPane, BorderLayout.NORTH);
WidgetDefinePaneFactory.RN rn = WidgetDefinePaneFactory.createWidgetDefinePane(cellWidget, new Operator() { WidgetDefinePaneFactory.RN rn = WidgetDefinePaneFactory.createWidgetDefinePane(cellWidget, new Operator() {
@Override @Override

28
designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java

@ -32,14 +32,10 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initComponents() { protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
JPanel northPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
this.add(northPane, BorderLayout.NORTH);
JPanel firstPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
firstPanel.setBorder(BorderFactory.createEmptyBorder(0, -2, 0, 0));
//JPanel firstPanel = FRGUIPaneFactory.createBorderLayout_M_Pane(); //JPanel firstPanel = FRGUIPaneFactory.createBorderLayout_M_Pane();
allowBlankCheckBox = new UICheckBox(Inter.getLocText("Allow_Blank")); allowBlankCheckBox = new UICheckBox(Inter.getLocText("Allow_Blank"));
// 是否允许为空
firstPanel.add(allowBlankCheckBox);
allowBlankCheckBox.addItemListener(new ItemListener() { allowBlankCheckBox.addItemListener(new ItemListener() {
@Override @Override
@ -50,8 +46,16 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
// 错误信息 // 错误信息
JPanel errorMsgPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); JPanel errorMsgPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
firstPanel.add(errorMsgPane); //目前只整改了文本、密码、文本域和数字四个控件
northPane.add(firstPanel); if(!(this instanceof TextFieldEditorDefinePane)&&!(this instanceof NumberEditorDefinePane)){
JPanel northPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
this.add(northPane, BorderLayout.NORTH);
JPanel firstPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
firstPanel.setBorder(BorderFactory.createEmptyBorder(0, -2, 0, 0));
firstPanel.add(allowBlankCheckBox);
firstPanel.add(errorMsgPane);
northPane.add(firstPanel);
}
errorMsgPane.add(new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":")); errorMsgPane.add(new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"));
errorMsgTextField = new UITextField(16); errorMsgTextField = new UITextField(16);
errorMsgPane.add(errorMsgTextField); errorMsgPane.add(errorMsgTextField);
@ -109,4 +113,12 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
public void checkValid() throws Exception { public void checkValid() throws Exception {
} }
public UICheckBox getAllowBlankCheckBox(){
return allowBlankCheckBox;
}
public UITextField getErrorMsgTextField(){
return errorMsgTextField;
}
} }

59
designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java

@ -14,10 +14,13 @@ import javax.swing.JPanel;
import javax.swing.SpinnerNumberModel; import javax.swing.SpinnerNumberModel;
import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener; import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.DefaultFormatter; import javax.swing.text.DefaultFormatter;
import com.fr.design.gui.icheckbox.UICheckBox; import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ispinner.UIBasicSpinner; import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.NumberEditor; import com.fr.form.ui.NumberEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
@ -39,6 +42,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
private com.fr.design.editor.editor.IntegerEditor decimalLength; private com.fr.design.editor.editor.IntegerEditor decimalLength;
private JPanel limitNumberPane; private JPanel limitNumberPane;
private WaterMarkDictPane waterMarkDictPane; private WaterMarkDictPane waterMarkDictPane;
private UITextField regErrorMsgTextField;
private ActionListener actionListener1 = new ActionListener() { private ActionListener actionListener1 = new ActionListener() {
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -121,9 +125,9 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
if (setMaxValueCheckBox.isSelected()) { if (setMaxValueCheckBox.isSelected()) {
if (setMinValueCheckBox.isSelected()) { if (setMinValueCheckBox.isSelected()) {
minValueModel.setMaximum(Double.parseDouble("" + maxValueSpinner.getValue())); minValueModel.setMaximum(Double.parseDouble("" + maxValueSpinner.getValue()));
} }
} }
} }
}; };
@ -133,9 +137,9 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
@Override @Override
public void stateChanged(ChangeEvent e) { public void stateChanged(ChangeEvent e) {
if (setMinValueCheckBox.isSelected()) { if (setMinValueCheckBox.isSelected()) {
if (setMaxValueCheckBox.isSelected()) { if (setMaxValueCheckBox.isSelected()) {
maxValueModel.setMinimum(Double.parseDouble("" + minValueSpinner.getValue())); maxValueModel.setMinimum(Double.parseDouble("" + minValueSpinner.getValue()));
} }
} }
} }
}; };
@ -153,26 +157,34 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel content = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); JPanel content = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
content.setBorder(BorderFactory.createEmptyBorder(0, 2, 0, 0)); content.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8));
content.setLayout(FRGUIPaneFactory.createBorderLayout()); content.setLayout(FRGUIPaneFactory.createBorderLayout());
// richer:数字的允许直接编辑没有意义 // richer:数字的允许直接编辑没有意义
JPanel northPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Advanced"));
content.add(northPane, BorderLayout.NORTH); content.add(northPane, BorderLayout.NORTH);
waterMarkDictPane = new WaterMarkDictPane(); waterMarkDictPane = new WaterMarkDictPane();
northPane.add(waterMarkDictPane); northPane.add(waterMarkDictPane);
JPanel centerPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Validate"));
JPanel validatePane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
validatePane.setPreferredSize(new Dimension(400,200));
centerPane.add(validatePane);
content.add(northPane, BorderLayout.NORTH);
content.add(centerPane, BorderLayout.CENTER);
validatePane.add(GUICoreUtils.createFlowPane(getAllowBlankCheckBox(), FlowLayout.LEFT));
validatePane.add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"),getErrorMsgTextField()}, FlowLayout.LEFT,24));
this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals")); this.allowDecimalsCheckBox = new UICheckBox(Inter.getLocText("Allow_Decimals"));
this.decimalLength = new com.fr.design.editor.editor.IntegerEditor(); this.decimalLength = new com.fr.design.editor.editor.IntegerEditor();
this.decimalLength.setColumns(4); this.decimalLength.setColumns(4);
limitNumberPane = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Double", "Numbers"}) + ":"), this.decimalLength}, limitNumberPane = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Double", "Numbers"}) + ":"), this.decimalLength},
FlowLayout.LEFT, 4); FlowLayout.LEFT, 4);
northPane.add(GUICoreUtils.createFlowPane(new JComponent[]{this.allowDecimalsCheckBox, limitNumberPane}, FlowLayout.LEFT, 4)); validatePane.add(GUICoreUtils.createFlowPane(new JComponent[]{this.allowDecimalsCheckBox, limitNumberPane}, FlowLayout.LEFT, 4));
this.allowDecimalsCheckBox.addActionListener(actionListener1); this.allowDecimalsCheckBox.addActionListener(actionListener1);
this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("Allow_Negative")); this.allowNegativeCheckBox = new UICheckBox(Inter.getLocText("Allow_Negative"));
northPane.add(GUICoreUtils.createFlowPane(new JComponent[]{this.allowNegativeCheckBox}, FlowLayout.LEFT, 4)); validatePane.add(GUICoreUtils.createFlowPane(new JComponent[]{this.allowNegativeCheckBox}, FlowLayout.LEFT, 4));
this.allowNegativeCheckBox.addActionListener(actionListener2); this.allowNegativeCheckBox.addActionListener(actionListener2);
this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("Need_Max_Value"), false); this.setMaxValueCheckBox = new UICheckBox(Inter.getLocText("Need_Max_Value"), false);
@ -180,7 +192,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); this.maxValueSpinner = new UIBasicSpinner(maxValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
maxValueSpinner.setPreferredSize(new Dimension(120, 20)); maxValueSpinner.setPreferredSize(new Dimension(120, 20));
setNotAllowsInvalid(this.maxValueSpinner); setNotAllowsInvalid(this.maxValueSpinner);
northPane.add(GUICoreUtils.createFlowPane(new JComponent[]{this.setMaxValueCheckBox, this.maxValueSpinner}, FlowLayout.LEFT, 4)); validatePane.add(GUICoreUtils.createFlowPane(new JComponent[]{this.setMaxValueCheckBox, this.maxValueSpinner}, FlowLayout.LEFT, 4));
this.maxValueSpinner.setVisible(false); this.maxValueSpinner.setVisible(false);
this.setMaxValueCheckBox.addActionListener(actionListener3); this.setMaxValueCheckBox.addActionListener(actionListener3);
this.maxValueSpinner.addChangeListener(changeListener1); this.maxValueSpinner.addChangeListener(changeListener1);
@ -189,10 +201,29 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D)); this.minValueSpinner = new UIBasicSpinner(minValueModel = new SpinnerNumberModel(0D, -Double.MAX_VALUE, Double.MAX_VALUE, 1D));
minValueSpinner.setPreferredSize(new Dimension(120, 20)); minValueSpinner.setPreferredSize(new Dimension(120, 20));
setNotAllowsInvalid(this.minValueSpinner); setNotAllowsInvalid(this.minValueSpinner);
northPane.add(GUICoreUtils.createFlowPane(new JComponent[]{this.setMinValueCheckBox, this.minValueSpinner}, FlowLayout.LEFT, 4)); validatePane.add(GUICoreUtils.createFlowPane(new JComponent[]{this.setMinValueCheckBox, this.minValueSpinner}, FlowLayout.LEFT, 4));
this.minValueSpinner.setVisible(false); this.minValueSpinner.setVisible(false);
this.setMinValueCheckBox.addActionListener(actionListener4); this.setMinValueCheckBox.addActionListener(actionListener4);
this.minValueSpinner.addChangeListener(changeListener2); this.minValueSpinner.addChangeListener(changeListener2);
regErrorMsgTextField = new UITextField(16);
validatePane.add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"),regErrorMsgTextField}, FlowLayout.LEFT,24));
regErrorMsgTextField.getDocument().addDocumentListener(new DocumentListener() {
public void changedUpdate(DocumentEvent e) {
regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText());
}
public void insertUpdate(DocumentEvent e) {
regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText());
}
public void removeUpdate(DocumentEvent e) {
regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText());
}
});
return content; return content;
} }
@ -227,7 +258,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
minValueSpinner.setVisible(true); minValueSpinner.setVisible(true);
minValueSpinner.setValue(new Double(e.getMinValue())); minValueSpinner.setValue(new Double(e.getMinValue()));
} }
this.regErrorMsgTextField.setText(e.getRegErrorMessage());
this.waterMarkDictPane.populate(e); this.waterMarkDictPane.populate(e);
} }
@ -255,6 +286,8 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
this.waterMarkDictPane.update(ob); this.waterMarkDictPane.update(ob);
ob.setRegErrorMessage(this.regErrorMsgTextField.getText());
return ob; return ob;
} }

64
designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java

@ -1,19 +1,29 @@
package com.fr.design.widget.ui; package com.fr.design.widget.ui;
import com.fr.design.gui.frpane.RegPane; import com.fr.design.gui.frpane.RegPane;
import com.fr.design.gui.ilable.UILabel;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.utils.gui.GUICoreUtils;
import com.fr.form.ui.TextEditor; import com.fr.form.ui.TextEditor;
import com.fr.form.ui.reg.NoneReg;
import com.fr.form.ui.reg.RegExp;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.StringUtils; import com.fr.stable.StringUtils;
import javax.swing.*; import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*; import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter; import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor> { public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor> {
protected RegPane regPane; protected RegPane regPane;
private WaterMarkDictPane waterMarkDictPane; private WaterMarkDictPane waterMarkDictPane;
private UITextField regErrorMsgTextField;
public TextFieldEditorDefinePane() { public TextFieldEditorDefinePane() {
this.initComponents(); this.initComponents();
@ -22,10 +32,28 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
@Override @Override
protected JPanel setFirstContentPane() { protected JPanel setFirstContentPane() {
JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel attrPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0)); attrPane.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
JPanel contenter = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel contenter = FRGUIPaneFactory.createBorderLayout_S_Pane();
contenter.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0)); contenter.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
attrPane.add(contenter, BorderLayout.NORTH); attrPane.add(contenter);
JPanel regErrorMsgPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
regErrorMsgTextField = new UITextField(16);
regErrorMsgPane.add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"),regErrorMsgTextField}, FlowLayout.LEFT,24));
regErrorMsgTextField.getDocument().addDocumentListener(new DocumentListener() {
public void changedUpdate(DocumentEvent e) {
regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText());
}
public void insertUpdate(DocumentEvent e) {
regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText());
}
public void removeUpdate(DocumentEvent e) {
regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText());
}
});
regPane = createRegPane(); regPane = createRegPane();
final RegPane.RegChangeListener rl = new RegPane.RegChangeListener() { final RegPane.RegChangeListener rl = new RegPane.RegChangeListener() {
@ -45,7 +73,15 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
} }
}; };
regPane.addPhoneRegListener(pl); regPane.addPhoneRegListener(pl);
JPanel spp1 = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Validate"));
JPanel validateContent = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
getAllowBlankCheckBox().setPreferredSize(new Dimension(444,40));
validateContent.add(GUICoreUtils.createFlowPane(getAllowBlankCheckBox(), FlowLayout.LEFT));
validateContent.add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"),getErrorMsgTextField()}, FlowLayout.LEFT,24));
validateContent.add(GUICoreUtils.createFlowPane(regPane, FlowLayout.LEFT));
validateContent.add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"),regErrorMsgTextField}, FlowLayout.LEFT,24));
spp1.add(validateContent);
JPanel spp2 = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Advanced"));
waterMarkDictPane = new WaterMarkDictPane(); waterMarkDictPane = new WaterMarkDictPane();
waterMarkDictPane.addInputKeyListener(new KeyAdapter() { waterMarkDictPane.addInputKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) { public void keyTyped(KeyEvent e) {
@ -54,8 +90,21 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
waterMarkDictPane.removeInputKeyListener(this); waterMarkDictPane.removeInputKeyListener(this);
} }
}); });
contenter.add(regPane, BorderLayout.NORTH); //监听填写规则下拉框的值的变化
contenter.add(waterMarkDictPane, BorderLayout.CENTER); regPane.getRegComboBox().addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) {
RegExp regExp = (RegExp)regPane.getRegComboBox().getSelectedItem();
if(regExp instanceof NoneReg){
regErrorMsgTextField.setEnabled(false);
}else{
regErrorMsgTextField.setEnabled(true);
}
}
});
spp2.add(waterMarkDictPane);
contenter.add(spp2, BorderLayout.NORTH);
contenter.add(spp1, BorderLayout.CENTER);
return attrPane; return attrPane;
} }
@ -71,13 +120,14 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
@Override @Override
protected void populateSubFieldEditorBean(TextEditor e) { protected void populateSubFieldEditorBean(TextEditor e) {
this.regPane.populate(e.getRegex()); this.regPane.populate(e.getRegex());
regErrorMsgTextField.setText(e.getRegErrorMessage());
waterMarkDictPane.populate(e); waterMarkDictPane.populate(e);
} }
@Override @Override
protected TextEditor updateSubFieldEditorBean() { protected TextEditor updateSubFieldEditorBean() {
TextEditor ob = newTextEditorInstance(); TextEditor ob = newTextEditorInstance();
ob.setRegErrorMessage(this.regErrorMsgTextField.getText());
ob.setRegex(this.regPane.update()); ob.setRegex(this.regPane.update());
waterMarkDictPane.update(ob); waterMarkDictPane.update(ob);

185
designer_base/src/com/fr/design/gui/frpane/RegPane.java

@ -48,15 +48,15 @@ public class RegPane extends BasicPane {
new MobileReg(), new MobileReg(),
new CustomReg() new CustomReg()
}; };
public static final RegExp[] TEXTAREA_REG_TYPE = { public static final RegExp[] TEXTAREA_REG_TYPE = {
new NoneReg(), new NoneReg(),
new LengthReg(), new LengthReg(),
new CustomReg() new CustomReg()
}; };
public static final RegExp[] PASSWORD_REG_TYPE = TEXTAREA_REG_TYPE; public static final RegExp[] PASSWORD_REG_TYPE = TEXTAREA_REG_TYPE;
private RegExp[] regType; private RegExp[] regType;
private UIComboBox regComboBox; private UIComboBox regComboBox;
private CardLayout detailedCardLayout; private CardLayout detailedCardLayout;
@ -64,16 +64,21 @@ public class RegPane extends BasicPane {
private RegPhonePane regPhonePane; private RegPhonePane regPhonePane;
private DefaultRegPane defaultRegPane; private DefaultRegPane defaultRegPane;
private CustomRegRexPane customRegRexPane; private CustomRegRexPane customRegRexPane;
public UIComboBox getRegComboBox(){
return regComboBox;
}
public RegPane() { public RegPane() {
this(ALL_REG_TYPE); this(ALL_REG_TYPE);
} }
public RegPane(RegExp[] types) { public RegPane(RegExp[] types) {
this.regType = types; this.regType = types;
this.initComponents(); this.initComponents();
} }
private void initComponents(){ private void initComponents(){
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); this.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
JPanel contentPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); JPanel contentPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane();
@ -82,7 +87,7 @@ public class RegPane extends BasicPane {
regComboBox = new UIComboBox(regType); regComboBox = new UIComboBox(regType);
regComboBox.setRenderer(listCellRender); regComboBox.setRenderer(listCellRender);
contentPane.add(regComboBox); contentPane.add(regComboBox);
final JPanel cardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); final JPanel cardPane = FRGUIPaneFactory.createCardLayout_S_Pane();
detailedCardLayout = new CardLayout(); detailedCardLayout = new CardLayout();
cardPane.setLayout(detailedCardLayout); cardPane.setLayout(detailedCardLayout);
@ -90,7 +95,7 @@ public class RegPane extends BasicPane {
cardPane.add((regLengthPane = new RegLengthPane()), "Length"); cardPane.add((regLengthPane = new RegLengthPane()), "Length");
cardPane.add((regPhonePane = new RegPhonePane()), "Phone"); cardPane.add((regPhonePane = new RegPhonePane()), "Phone");
cardPane.add((customRegRexPane = new CustomRegRexPane()), "Custom"); cardPane.add((customRegRexPane = new CustomRegRexPane()), "Custom");
this.add(cardPane); this.add(cardPane);
regComboBox.addActionListener(new ActionListener(){ regComboBox.addActionListener(new ActionListener(){
public void actionPerformed(ActionEvent e) { public void actionPerformed(ActionEvent e) {
@ -111,15 +116,15 @@ public class RegPane extends BasicPane {
} }
fireRegChangeAction(); fireRegChangeAction();
} }
} }
}); });
} }
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return Inter.getLocText("FR-Designer_Input_Rule"); return Inter.getLocText("FR-Designer_Input_Rule");
} }
private int getRegTypeIndex(RegExp regex) { private int getRegTypeIndex(RegExp regex) {
if (regex != null) { if (regex != null) {
for (int i = 0; i < regType.length; i++) { for (int i = 0; i < regType.length; i++) {
@ -131,7 +136,7 @@ public class RegPane extends BasicPane {
return 0; return 0;
} }
public void populate(RegExp regex) { public void populate(RegExp regex) {
regComboBox.setSelectedIndex(getRegTypeIndex(regex)); regComboBox.setSelectedIndex(getRegTypeIndex(regex));
if (regex instanceof LengthReg) { if (regex instanceof LengthReg) {
@ -144,111 +149,111 @@ public class RegPane extends BasicPane {
defaultRegPane.populate(regex); defaultRegPane.populate(regex);
} }
} }
public RegExp update(){ public RegExp update(){
RegExp regExp = (RegExp)regComboBox.getSelectedItem(); RegExp regExp = (RegExp)regComboBox.getSelectedItem();
if (regExp instanceof LengthReg){ if (regExp instanceof LengthReg){
return regLengthPane.update(); return regLengthPane.update();
} else if(regExp instanceof PhoneReg) { } else if(regExp instanceof PhoneReg) {
return regPhonePane.update(); return regPhonePane.update();
} else if(regExp instanceof NoneReg || regExp instanceof MailReg || regExp instanceof IDCardReg } else if(regExp instanceof NoneReg || regExp instanceof MailReg || regExp instanceof IDCardReg
|| regExp instanceof PostCardReg || regExp instanceof PhoneReg || regExp instanceof MobileReg) { || regExp instanceof PostCardReg || regExp instanceof PhoneReg || regExp instanceof MobileReg) {
return regExp; return regExp;
} }
else if (regExp instanceof CustomReg){ else if (regExp instanceof CustomReg){
if (customRegRexPane.isEmpty()) { if (customRegRexPane.isEmpty()) {
return new NoneReg(); return new NoneReg();
} }
return customRegRexPane.update(); return customRegRexPane.update();
} else { } else {
return defaultRegPane.update(); return defaultRegPane.update();
} }
} }
private static abstract class DisplayPane extends BasicPane { private static abstract class DisplayPane extends BasicPane {
public abstract void populate(RegExp regRex); public abstract void populate(RegExp regRex);
public abstract RegExp update(); public abstract RegExp update();
} }
private static class DefaultRegPane extends DisplayPane { private static class DefaultRegPane extends DisplayPane {
public RegExp regRex; public RegExp regRex;
public DefaultRegPane(){ public DefaultRegPane(){
} }
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return "Default"; return "Default";
} }
@Override @Override
public void populate(RegExp regRex) { public void populate(RegExp regRex) {
} }
@Override @Override
public RegExp update() { public RegExp update() {
return this.regRex; return this.regRex;
} }
} }
/** /**
* 添加电话规则监听器 * 添加电话规则监听器
* *
* @param listener 监听器 * @param listener 监听器
* *
* *
* @date 2014-12-3-下午7:30:55 * @date 2014-12-3-下午7:30:55
* *
*/ */
public void addPhoneRegListener(PhoneRegListener listener) { public void addPhoneRegListener(PhoneRegListener listener) {
this.listenerList.add(PhoneRegListener.class, listener); this.listenerList.add(PhoneRegListener.class, listener);
} }
/** /**
* 移除电话规则监听器 * 移除电话规则监听器
* *
* @param listener 监听器 * @param listener 监听器
* *
* *
* @date 2014-12-3-下午7:30:55 * @date 2014-12-3-下午7:30:55
* *
*/ */
public void removePhoneRegListener(PhoneRegListener listener) { public void removePhoneRegListener(PhoneRegListener listener) {
this.listenerList.remove(PhoneRegListener.class, listener); this.listenerList.remove(PhoneRegListener.class, listener);
} }
/** /**
* 添加正则监听器 * 添加正则监听器
* *
* @param listener 监听器 * @param listener 监听器
* *
* *
* @date 2014-12-3-下午7:29:48 * @date 2014-12-3-下午7:29:48
* *
*/ */
public void addRegChangeListener(RegChangeListener listener) { public void addRegChangeListener(RegChangeListener listener) {
this.listenerList.add(RegChangeListener.class, listener); this.listenerList.add(RegChangeListener.class, listener);
} }
/** /**
* 移除正则监听器 * 移除正则监听器
* *
* @param listener 监听器 * @param listener 监听器
* *
* *
* @date 2014-12-3-下午7:29:48 * @date 2014-12-3-下午7:29:48
* *
*/ */
public void removeRegChangeListener(RegChangeListener listener) { public void removeRegChangeListener(RegChangeListener listener) {
this.listenerList.remove(RegChangeListener.class, listener); this.listenerList.remove(RegChangeListener.class, listener);
} }
public class PhoneRegEvent extends EventObject { public class PhoneRegEvent extends EventObject {
private String phoneRegString; private String phoneRegString;
public PhoneRegEvent(Object source, String phoneRegString) { public PhoneRegEvent(Object source, String phoneRegString) {
@ -275,48 +280,48 @@ public class RegPane extends BasicPane {
return regString; return regString;
} }
} }
public interface PhoneRegListener extends EventListener{ public interface PhoneRegListener extends EventListener{
/** /**
* 电话规则变化监听 * 电话规则变化监听
* *
* @param e 变化事件 * @param e 变化事件
* *
* *
* @date 2014-12-3-下午7:29:01 * @date 2014-12-3-下午7:29:01
* *
*/ */
void phoneRegChangeAction(PhoneRegEvent e); void phoneRegChangeAction(PhoneRegEvent e);
} }
public interface RegChangeListener extends EventListener { public interface RegChangeListener extends EventListener {
/** /**
* 正则表达规则变化监听 * 正则表达规则变化监听
* *
* *
* @date 2014-12-3-下午7:29:01 * @date 2014-12-3-下午7:29:01
* *
*/ */
void regChangeAction(); void regChangeAction();
} }
protected void firePhoneRegAction(String phoneReg) { protected void firePhoneRegAction(String phoneReg) {
Object[] listeners = listenerList.getListenerList(); Object[] listeners = listenerList.getListenerList();
for (int i = listeners.length-2; i>=0; i-=2) { for (int i = listeners.length-2; i>=0; i-=2) {
if (listeners[i]==PhoneRegListener.class) { if (listeners[i]==PhoneRegListener.class) {
((PhoneRegListener)listeners[i+1]).phoneRegChangeAction(new PhoneRegEvent(this , phoneReg)); ((PhoneRegListener)listeners[i+1]).phoneRegChangeAction(new PhoneRegEvent(this , phoneReg));
} }
} }
} }
protected void fireRegChangeAction() { protected void fireRegChangeAction() {
Object[] listeners = listenerList.getListenerList(); Object[] listeners = listenerList.getListenerList();
for (int i = listeners.length-2; i>=0; i-=2) { for (int i = listeners.length-2; i>=0; i-=2) {
if (listeners[i]==RegChangeListener.class) { if (listeners[i]==RegChangeListener.class) {
((RegChangeListener)listeners[i+1]).regChangeAction(); ((RegChangeListener)listeners[i+1]).regChangeAction();
} }
} }
} }
private class RegPhonePane extends DisplayPane { private class RegPhonePane extends DisplayPane {
private static final String EMB_REG1 = "025-85679591"; private static final String EMB_REG1 = "025-85679591";
@ -324,7 +329,7 @@ public class RegPane extends BasicPane {
private static final String EMB_REG3 = "025 85679591"; private static final String EMB_REG3 = "025 85679591";
private static final int LIMIT_LENGTH = 20; private static final int LIMIT_LENGTH = 20;
private static final String REG_PATTERN = "0123456789-*# "; private static final String REG_PATTERN = "0123456789-*# ";
private UIComboBox dataTypeComboBox; private UIComboBox dataTypeComboBox;
private final String[] dataType = {EMB_REG1, EMB_REG2, EMB_REG3, Inter.getLocText("FR-Designer_Custom")}; private final String[] dataType = {EMB_REG1, EMB_REG2, EMB_REG3, Inter.getLocText("FR-Designer_Custom")};
DefaultComboBoxModel DefaultComboBoxModel= new DefaultComboBoxModel(dataType); DefaultComboBoxModel DefaultComboBoxModel= new DefaultComboBoxModel(dataType);
@ -357,7 +362,7 @@ public class RegPane extends BasicPane {
protected String title4PopupWindow() { protected String title4PopupWindow() {
return "PHONE"; return "PHONE";
} }
@Override @Override
public void populate(RegExp regRex) { public void populate(RegExp regRex) {
if(!(regRex instanceof PhoneReg)) { if(!(regRex instanceof PhoneReg)) {
@ -369,13 +374,13 @@ public class RegPane extends BasicPane {
} }
dataTypeComboBox.setSelectedItem(((PhoneReg)regRex).getRegString()); dataTypeComboBox.setSelectedItem(((PhoneReg)regRex).getRegString());
} }
private boolean checkEmbedded(String regstr){ private boolean checkEmbedded(String regstr){
return !ComparatorUtils.equals(EMB_REG1, regstr) && return !ComparatorUtils.equals(EMB_REG1, regstr) &&
!ComparatorUtils.equals(EMB_REG2, regstr) && !ComparatorUtils.equals(EMB_REG2, regstr) &&
!ComparatorUtils.equals(EMB_REG3, regstr); !ComparatorUtils.equals(EMB_REG3, regstr);
} }
@Override @Override
public RegExp update() { public RegExp update() {
PhoneReg regRex = new PhoneReg(); PhoneReg regRex = new PhoneReg();
@ -383,11 +388,11 @@ public class RegPane extends BasicPane {
return regRex; return regRex;
} }
} }
private static class RegLengthPane extends DisplayPane { private static class RegLengthPane extends DisplayPane {
private UISpinner minLenSpinner; private UISpinner minLenSpinner;
private UISpinner maxLenSpinner; private UISpinner maxLenSpinner;
public RegLengthPane(){ public RegLengthPane(){
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); this.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
this.add(new UILabel(Inter.getLocText("FR-Designer_Reg_Min_Length") + ":")); this.add(new UILabel(Inter.getLocText("FR-Designer_Reg_Min_Length") + ":"));
@ -395,9 +400,9 @@ public class RegPane extends BasicPane {
this.add(minLenSpinner); this.add(minLenSpinner);
this.add(new UILabel(Inter.getLocText("FR-Designer_Reg_Max_Length") + ":")); this.add(new UILabel(Inter.getLocText("FR-Designer_Reg_Max_Length") + ":"));
maxLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0); maxLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
this.add(maxLenSpinner); this.add(maxLenSpinner);
} }
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return "LENGTH"; return "LENGTH";
@ -408,11 +413,11 @@ public class RegPane extends BasicPane {
if (!(regRex instanceof LengthReg)){ if (!(regRex instanceof LengthReg)){
return; return;
} }
int minLength = ((LengthReg)regRex).getMinLen(); int minLength = ((LengthReg)regRex).getMinLen();
int maxLength = ((LengthReg)regRex).getMaxLen(); int maxLength = ((LengthReg)regRex).getMaxLen();
minLenSpinner.setValue(minLength); minLenSpinner.setValue(minLength);
maxLenSpinner.setValue(maxLength); maxLenSpinner.setValue(maxLength);
} }
@Override @Override
@ -422,21 +427,21 @@ public class RegPane extends BasicPane {
LengthReg regRex = new LengthReg(); LengthReg regRex = new LengthReg();
regRex.setMinLen(startLength); regRex.setMinLen(startLength);
regRex.setMaxLen(endLength); regRex.setMaxLen(endLength);
return regRex; return regRex;
} }
} }
private static class CustomRegRexPane extends DisplayPane{ private static class CustomRegRexPane extends DisplayPane{
private UITextField regTextField; private UITextField regTextField;
public CustomRegRexPane(){ public CustomRegRexPane(){
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); this.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
this.add(new UILabel(Inter.getLocText("FR-Designer_Reg_Expressions") + ":")); this.add(new UILabel(Inter.getLocText("FR-Designer_Reg_Expressions") + ":"));
regTextField = new UITextField(20); regTextField = new UITextField(20);
this.add(regTextField); this.add(regTextField);
} }
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
return "CUSTOM"; return "CUSTOM";
@ -451,19 +456,19 @@ public class RegPane extends BasicPane {
} }
@Override @Override
public RegExp update() { public RegExp update() {
return new CustomReg(regTextField.getText()); return new CustomReg(regTextField.getText());
} }
public boolean isEmpty() { public boolean isEmpty() {
return StringUtils.isEmpty(regTextField.getText()); return StringUtils.isEmpty(regTextField.getText());
} }
} }
ListCellRenderer listCellRender = new UIComboBoxRenderer(){ ListCellRenderer listCellRender = new UIComboBoxRenderer(){
@Override @Override
public Component getListCellRendererComponent(JList list, Object value, public Component getListCellRendererComponent(JList list, Object value,
int index, boolean isSelected, boolean cellHasFocus) { int index, boolean isSelected, boolean cellHasFocus) {
super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
if (value instanceof NoneReg){ if (value instanceof NoneReg){
this.setText(Inter.getLocText("FR-Designer_None")); this.setText(Inter.getLocText("FR-Designer_None"));
@ -484,6 +489,6 @@ public class RegPane extends BasicPane {
} }
return this; return this;
} }
}; };
} }

17
designer_form/src/com/fr/design/designer/beans/adapters/component/CompositeComponentAdapter.java

@ -100,7 +100,10 @@ public class CompositeComponentAdapter implements ComponentAdapter {
for (CRPropertyDescriptor property : properties) { for (CRPropertyDescriptor property : properties) {
String groupName = (String) property.getValue(XCreatorConstants.PROPERTY_CATEGORY); String groupName = (String) property.getValue(XCreatorConstants.PROPERTY_CATEGORY);
if (StringUtils.isEmpty(groupName)) { if (StringUtils.isEmpty(groupName)) {
groupName = XCreatorConstants.DEFAULT_GROUP_NAME; groupName = (String) property.getValue(XCreatorConstants.PROPERTY_VALIDATE);
if(StringUtils.isEmpty(groupName)){
groupName = XCreatorConstants.DEFAULT_GROUP_NAME;
}
} }
ArrayList<CRPropertyDescriptor> groupProperties = maps.get(groupName); ArrayList<CRPropertyDescriptor> groupProperties = maps.get(groupName);
if (groupProperties == null) { if (groupProperties == null) {
@ -110,6 +113,7 @@ public class CompositeComponentAdapter implements ComponentAdapter {
} }
groupProperties.add(property); groupProperties.add(property);
} }
adjustGroupNamesPosition(groupNames);
ArrayList<PropertyGroupModel> groups = new ArrayList<PropertyGroupModel>(); ArrayList<PropertyGroupModel> groups = new ArrayList<PropertyGroupModel>();
for (String groupName : groupNames) { for (String groupName : groupNames) {
ArrayList<CRPropertyDescriptor> groupProperties = maps.get(groupName); ArrayList<CRPropertyDescriptor> groupProperties = maps.get(groupName);
@ -120,6 +124,15 @@ public class CompositeComponentAdapter implements ComponentAdapter {
return groups; return groups;
} }
public void adjustGroupNamesPosition(ArrayList<String> groupNames){
for(String groupName : groupNames){
if(groupName.equals("Form-Basic_Properties")){
groupNames.remove(groupName);
groupNames.add(0,groupName);
break;
}
}
}
@Override @Override
public ArrayList<GroupModel> getXCreatorPropertyModel() { public ArrayList<GroupModel> getXCreatorPropertyModel() {
ArrayList<GroupModel> groupModels = new ArrayList<GroupModel>(); ArrayList<GroupModel> groupModels = new ArrayList<GroupModel>();
@ -130,7 +143,7 @@ public class CompositeComponentAdapter implements ComponentAdapter {
groupModels.addAll(groups); groupModels.addAll(groups);
return groupModels; return groupModels;
} }
/** /**
* 自适应布局中放置文本框等用的scaleLayout和报表块图表块支持的标题控件用的titleLayout时 * 自适应布局中放置文本框等用的scaleLayout和报表块图表块支持的标题控件用的titleLayout时
* 控件树处只显示父容器但是控件属性还是为自身的 * 控件树处只显示父容器但是控件属性还是为自身的

3
designer_form/src/com/fr/design/designer/creator/XButton.java

@ -91,7 +91,7 @@ public class XButton extends XWidgetCreator {
protected CRPropertyDescriptor creatNonListenerStyle(int i) throws IntrospectionException{ protected CRPropertyDescriptor creatNonListenerStyle(int i) throws IntrospectionException{
CRPropertyDescriptor[] crPropertyDescriptors = { CRPropertyDescriptor[] crPropertyDescriptors = {
new CRPropertyDescriptor("text", this.data.getClass()).setI18NName( new CRPropertyDescriptor("text", this.data.getClass()).setI18NName(
Inter.getLocText(new String[] {"Form-Button", "Name"})), Inter.getLocText(new String[] {"Form-Button", "Name"})).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("customStyle", this.data.getClass()).setI18NName( new CRPropertyDescriptor("customStyle", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"Form-Button", "Style"})).setEditorClass( Inter.getLocText(new String[]{"Form-Button", "Style"})).setEditorClass(
ButtonTypeEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), ButtonTypeEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
@ -164,6 +164,7 @@ public class XButton extends XWidgetCreator {
return new CRPropertyDescriptor[]{ return new CRPropertyDescriptor[]{
new CRPropertyDescriptor("text", this.data.getClass()) new CRPropertyDescriptor("text", this.data.getClass())
.setI18NName(Inter.getLocText(new String[] {"Form-Button", "Name"})) .setI18NName(Inter.getLocText(new String[] {"Form-Button", "Name"}))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
.setPropertyChangeListener(new PropertyChangeAdapter() { .setPropertyChangeListener(new PropertyChangeAdapter() {
@Override @Override

2
designer_form/src/com/fr/design/designer/creator/XCheckBox.java

@ -32,6 +32,7 @@ public class XCheckBox extends XWidgetCreator {
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), new CRPropertyDescriptor[] { return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), new CRPropertyDescriptor[] {
new CRPropertyDescriptor("text", this.data.getClass()).setI18NName(Inter.getLocText("Text")) new CRPropertyDescriptor("text", this.data.getClass()).setI18NName(Inter.getLocText("Text"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
.setPropertyChangeListener(new PropertyChangeAdapter() { .setPropertyChangeListener(new PropertyChangeAdapter() {
@Override @Override
@ -41,6 +42,7 @@ public class XCheckBox extends XWidgetCreator {
}), }),
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName( new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass(WidgetValueEditor.class) Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass(WidgetValueEditor.class)
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
.setPropertyChangeListener(new PropertyChangeAdapter() { .setPropertyChangeListener(new PropertyChangeAdapter() {
@Override @Override

30
designer_form/src/com/fr/design/designer/creator/XCheckBoxGroup.java

@ -34,35 +34,35 @@ public class XCheckBoxGroup extends XFieldEditor {
@Override @Override
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), getCRPropertyDescriptor()); CRPropertyDescriptor [] sup = (CRPropertyDescriptor[]) ArrayUtils.addAll(new CRPropertyDescriptor[] {
}
private CRPropertyDescriptor[] getCRPropertyDescriptor() throws IntrospectionException {
CRPropertyDescriptor[] crp = new CRPropertyDescriptor[] {
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName( new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass(WidgetValueEditor.class), Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass(WidgetValueEditor.class)
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("dictionary", this.data.getClass()).setI18NName( new CRPropertyDescriptor("dictionary", this.data.getClass()).setI18NName(
Inter.getLocText("DS-Dictionary")).setEditorClass(DictionaryEditor.class).setRendererClass( Inter.getLocText("DS-Dictionary")).setEditorClass(DictionaryEditor.class).setRendererClass(
DictionaryRenderer.class), DictionaryRenderer.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")},super.supportedDescriptor());
CRPropertyDescriptor [] properties = (CRPropertyDescriptor[]) ArrayUtils.addAll(sup,getCRPropertyDescriptor());
return properties;
}
private CRPropertyDescriptor[] getCRPropertyDescriptor() throws IntrospectionException {
CRPropertyDescriptor[] crp = new CRPropertyDescriptor[] {
new CRPropertyDescriptor("adaptive", this.data.getClass()).setI18NName(Inter.getLocText("Adaptive")) new CRPropertyDescriptor("adaptive", this.data.getClass()).setI18NName(Inter.getLocText("Adaptive"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced").setEditorClass(InChangeBooleanEditor.class), .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced").setEditorClass(InChangeBooleanEditor.class),
new CRPropertyDescriptor("chooseAll", this.data.getClass()).setI18NName( new CRPropertyDescriptor("chooseAll", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"Provide", "Choose_All"})).putKeyValue( Inter.getLocText(new String[]{"Provide", "Choose_All"})).putKeyValue(
XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("returnString", this.data.getClass()).setI18NName( new CRPropertyDescriptor("returnString", this.data.getClass()).setI18NName(
Inter.getLocText("Return-String")).setEditorClass(InChangeBooleanEditor.class).putKeyValue( Inter.getLocText("Return-String")).setEditorClass(InChangeBooleanEditor.class)
XCreatorConstants.PROPERTY_CATEGORY, "Return-Value") }; .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") };
if (((CheckBoxGroup) this.toData()).isReturnString()) { if (((CheckBoxGroup) this.toData()).isReturnString()) {
crp = (CRPropertyDescriptor[]) ArrayUtils.addAll(crp, new CRPropertyDescriptor[] { crp = (CRPropertyDescriptor[]) ArrayUtils.addAll(crp, new CRPropertyDescriptor[] {
new CRPropertyDescriptor("delimiter", this.data.getClass()).setI18NName( new CRPropertyDescriptor("delimiter", this.data.getClass()).setI18NName(
Inter.getLocText("Form-Delimiter")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("Form-Delimiter")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
"Return-Value"),
new CRPropertyDescriptor("startSymbol", this.data.getClass()).setI18NName( new CRPropertyDescriptor("startSymbol", this.data.getClass()).setI18NName(
Inter.getLocText("ComboCheckBox-Start_Symbol")).putKeyValue( Inter.getLocText("ComboCheckBox-Start_Symbol")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
XCreatorConstants.PROPERTY_CATEGORY, "Return-Value"),
new CRPropertyDescriptor("endSymbol", this.data.getClass()).setI18NName( new CRPropertyDescriptor("endSymbol", this.data.getClass()).setI18NName(
Inter.getLocText("ComboCheckBox-End_Symbol")).putKeyValue( Inter.getLocText("ComboCheckBox-End_Symbol")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") });
XCreatorConstants.PROPERTY_CATEGORY, "Return-Value") });
} }
if (!((CheckBoxGroup) this.toData()).isAdaptive()) { if (!((CheckBoxGroup) this.toData()).isAdaptive()) {
crp = (CRPropertyDescriptor[]) ArrayUtils.add(crp, new CRPropertyDescriptor("columnsInRow", this.data crp = (CRPropertyDescriptor[]) ArrayUtils.add(crp, new CRPropertyDescriptor("columnsInRow", this.data

11
designer_form/src/com/fr/design/designer/creator/XComboBox.java

@ -10,6 +10,7 @@ import java.beans.IntrospectionException;
import javax.swing.JComponent; import javax.swing.JComponent;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.design.gui.itextfield.UITextField; import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory; import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.design.mainframe.widget.editors.DictionaryEditor; import com.fr.design.mainframe.widget.editors.DictionaryEditor;
@ -38,11 +39,11 @@ public class XComboBox extends XCustomWriteAbleRepeatEditor {
@Override @Override
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
return (CRPropertyDescriptor[]) ArrayUtils.addAll( return (CRPropertyDescriptor[]) ArrayUtils.addAll(
super.supportedDescriptor(), new CRPropertyDescriptor[]{
new CRPropertyDescriptor[]{ new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass(WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass(WidgetValueEditor.class), new CRPropertyDescriptor("dictionary", this.data.getClass()).setI18NName(Inter.getLocText("FR-Designer_DS-Dictionary")).setEditorClass(DictionaryEditor.class).setRendererClass(DictionaryRenderer.class)
new CRPropertyDescriptor("dictionary", this.data.getClass()).setI18NName(Inter.getLocText("FR-Designer_DS-Dictionary")).setEditorClass(DictionaryEditor.class).setRendererClass(DictionaryRenderer.class) .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
}); }, super.supportedDescriptor());
} }
@Override @Override

16
designer_form/src/com/fr/design/designer/creator/XComboCheckBox.java

@ -32,20 +32,20 @@ public class XComboCheckBox extends XComboBox {
Inter.getLocText("Form-Delimiter")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("Form-Delimiter")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced"), "Advanced"),
new CRPropertyDescriptor("returnString", this.data.getClass()).setEditorClass( new CRPropertyDescriptor("returnString", this.data.getClass()).setEditorClass(
InChangeBooleanEditor.class).setI18NName(Inter.getLocText("Return-String")).putKeyValue( InChangeBooleanEditor.class).setI18NName(Inter.getLocText("Return-String"))
XCreatorConstants.PROPERTY_CATEGORY, "Return-Value") } : new CRPropertyDescriptor[] { .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") } : new CRPropertyDescriptor[] {
new CRPropertyDescriptor("delimiter", this.data.getClass()).setI18NName( new CRPropertyDescriptor("delimiter", this.data.getClass()).setI18NName(
Inter.getLocText("Form-Delimiter")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("Form-Delimiter")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced"), "Advanced"),
new CRPropertyDescriptor("returnString", this.data.getClass()).setI18NName( new CRPropertyDescriptor("returnString", this.data.getClass()).setI18NName(
Inter.getLocText("Return-String")).setEditorClass(InChangeBooleanEditor.class).putKeyValue( Inter.getLocText("Return-String")).setEditorClass(InChangeBooleanEditor.class)
XCreatorConstants.PROPERTY_CATEGORY, "Return-Value"), .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("startSymbol", this.data.getClass()).setI18NName( new CRPropertyDescriptor("startSymbol", this.data.getClass()).setI18NName(
Inter.getLocText("ComboCheckBox-Start_Symbol")).putKeyValue( Inter.getLocText("ComboCheckBox-Start_Symbol"))
XCreatorConstants.PROPERTY_CATEGORY, "Return-Value"), .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("endSymbol", this.data.getClass()).setI18NName( new CRPropertyDescriptor("endSymbol", this.data.getClass()).setI18NName(
Inter.getLocText("ComboCheckBox-End_Symbol")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("ComboCheckBox-End_Symbol"))
"Return-Value") }); .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") });
} }
@Override @Override

2
designer_form/src/com/fr/design/designer/creator/XCustomWriteAbleRepeatEditor.java

@ -1 +1 @@
package com.fr.design.designer.creator; import com.fr.form.ui.WriteAbleRepeatEditor; import com.fr.general.Inter; import com.fr.stable.ArrayUtils; import java.awt.*; import java.beans.IntrospectionException; /** * Author : Shockway * Date: 13-9-22 * Time: 上午10:40 */ public abstract class XCustomWriteAbleRepeatEditor extends XWriteAbleRepeatEditor { public XCustomWriteAbleRepeatEditor(WriteAbleRepeatEditor widget, Dimension initSize) { super(widget, initSize); } public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), new CRPropertyDescriptor[] { new CRPropertyDescriptor("customData", this.data.getClass()).setI18NName(Inter.getLocText("Form-Allow_CustomData"))}); } } package com.fr.design.designer.creator; import com.fr.design.form.util.XCreatorConstants; import com.fr.form.ui.WriteAbleRepeatEditor; import com.fr.general.Inter; import com.fr.stable.ArrayUtils; import java.awt.*; import java.beans.IntrospectionException; /** * Author : Shockway * Date: 13-9-22 * Time: 上午10:40 */ public abstract class XCustomWriteAbleRepeatEditor extends XWriteAbleRepeatEditor { public XCustomWriteAbleRepeatEditor(WriteAbleRepeatEditor widget, Dimension initSize) { super(widget, initSize); } public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), new CRPropertyDescriptor[] { new CRPropertyDescriptor("customData", this.data.getClass()).setI18NName(Inter.getLocText("Form-Allow_CustomData")) .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate")}); } }

25
designer_form/src/com/fr/design/designer/creator/XDateEditor.java

@ -46,17 +46,20 @@ public class XDateEditor extends XDirectWriteEditor {
*/ */
@Override @Override
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), CRPropertyDescriptor [] tempt=(CRPropertyDescriptor[]) ArrayUtils.addAll(
new CRPropertyDescriptor[] { new CRPropertyDescriptor[] {
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName( new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass( Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass(
WidgetValueEditor.class).setPropertyChangeListener(new PropertyChangeAdapter() { WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced").setPropertyChangeListener(new PropertyChangeAdapter() {
@Override
public void propertyChange() { @Override
initFieldText(); public void propertyChange() {
} initFieldText();
}), }
})},super.supportedDescriptor());
return (CRPropertyDescriptor[]) ArrayUtils.addAll(tempt,
new CRPropertyDescriptor[] {
new CRPropertyDescriptor("formatText", this.data.getClass()).setI18NName( new CRPropertyDescriptor("formatText", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Engine_Format")).setEditorClass(formatClass()).setRendererClass( Inter.getLocText("FR-Engine_Format")).setEditorClass(formatClass()).setRendererClass(
DateCellRenderer.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), DateCellRenderer.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
@ -66,11 +69,11 @@ public class XDateEditor extends XDirectWriteEditor {
new CRPropertyDescriptor("endDate", this.data.getClass()).setI18NName( new CRPropertyDescriptor("endDate", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_End-Date")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_End-Date")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced").setEditorClass(DateRangeEditor.class), "Advanced").setEditorClass(DateRangeEditor.class),
new CRPropertyDescriptor("returnDate", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_Return-Date")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Return-Value"),
new CRPropertyDescriptor("waterMark", this.data.getClass()).setI18NName( new CRPropertyDescriptor("waterMark", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_WaterMark")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("FR-Designer_WaterMark")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced"),
new CRPropertyDescriptor("returnDate", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_Return-Date")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced") "Advanced")
}); });
} }

4
designer_form/src/com/fr/design/designer/creator/XDirectWriteEditor.java

@ -6,6 +6,7 @@ package com.fr.design.designer.creator;
import java.awt.Dimension; import java.awt.Dimension;
import java.beans.IntrospectionException; import java.beans.IntrospectionException;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.form.ui.DirectWriteEditor; import com.fr.form.ui.DirectWriteEditor;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
@ -24,6 +25,7 @@ public abstract class XDirectWriteEditor extends XFieldEditor {
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(),
new CRPropertyDescriptor[] { new CRPropertyDescriptor("directEdit", this.data.getClass()) new CRPropertyDescriptor[] { new CRPropertyDescriptor("directEdit", this.data.getClass())
.setI18NName(Inter.getLocText("Form-Allow_Edit")) }); .setI18NName(Inter.getLocText("Form-Allow_Edit")).putKeyValue(
XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate") });
} }
} }

6
designer_form/src/com/fr/design/designer/creator/XFieldEditor.java

@ -6,6 +6,8 @@ package com.fr.design.designer.creator;
import java.awt.Color; import java.awt.Color;
import java.awt.Dimension; import java.awt.Dimension;
import java.beans.IntrospectionException; import java.beans.IntrospectionException;
import java.util.ArrayList;
import java.util.List;
import javax.swing.BorderFactory; import javax.swing.BorderFactory;
import javax.swing.border.Border; import javax.swing.border.Border;
@ -38,10 +40,10 @@ public abstract class XFieldEditor extends XWidgetCreator {
private CRPropertyDescriptor[] getCRPropertyDescriptor() throws IntrospectionException { private CRPropertyDescriptor[] getCRPropertyDescriptor() throws IntrospectionException {
CRPropertyDescriptor allowBlank = new CRPropertyDescriptor("allowBlank", this.data.getClass()).setI18NName( CRPropertyDescriptor allowBlank = new CRPropertyDescriptor("allowBlank", this.data.getClass()).setI18NName(
Inter.getLocText("Allow_Blank")).setEditorClass(InChangeBooleanEditor.class).putKeyValue( Inter.getLocText("Allow_Blank")).setEditorClass(InChangeBooleanEditor.class).putKeyValue(
XCreatorConstants.PROPERTY_CATEGORY, "Advanced"); XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate");
CRPropertyDescriptor blankErrorMsg = new CRPropertyDescriptor("errorMessage", this.data.getClass()).setI18NName( CRPropertyDescriptor blankErrorMsg = new CRPropertyDescriptor("errorMessage", this.data.getClass()).setI18NName(
Inter.getLocText("Verify-Message")) Inter.getLocText("Verify-Message"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"); .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate");
CRPropertyDescriptor fontSize = new CRPropertyDescriptor("fontSize", this.data.getClass(), "getFontSize", "setFontSize") CRPropertyDescriptor fontSize = new CRPropertyDescriptor("fontSize", this.data.getClass(), "getFontSize", "setFontSize")
.setI18NName(Inter.getLocText(new String[]{"FRFont", "FRFont-Size"})) .setI18NName(Inter.getLocText(new String[]{"FRFont", "FRFont-Size"}))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"); .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced");

2
designer_form/src/com/fr/design/designer/creator/XLabel.java

@ -59,7 +59,7 @@ public class XLabel extends XWidgetCreator {
new CRPropertyDescriptor[] { new CRPropertyDescriptor[] {
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName( new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"FR-Designer_Widget", "Value"})).setEditorClass( Inter.getLocText(new String[]{"FR-Designer_Widget", "Value"})).setEditorClass(
WidgetValueEditor.class), WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("wrap", this.data.getClass()).setI18NName( new CRPropertyDescriptor("wrap", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_StyleAlignment-Wrap_Text")).putKeyValue( Inter.getLocText("FR-Designer_StyleAlignment-Wrap_Text")).putKeyValue(
XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),

31
designer_form/src/com/fr/design/designer/creator/XNumberEditor.java

@ -41,31 +41,42 @@ public class XNumberEditor extends XWrapperedFieldEditor {
*/ */
@Override @Override
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
CRPropertyDescriptor[] sup = super.supportedDescriptor(); CRPropertyDescriptor[] sup =(CRPropertyDescriptor[]) ArrayUtils.addAll(
new CRPropertyDescriptor[] {
new CRPropertyDescriptor("widgetValue", this.data.getClass())
.setI18NName(Inter.getLocText(new String[]{"Widget", "Value"}))
.setEditorClass(WidgetValueEditor.class)
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")}
,super.supportedDescriptor());
CRPropertyDescriptor allowDecimal = new CRPropertyDescriptor("allowDecimals", this.data.getClass()) CRPropertyDescriptor allowDecimal = new CRPropertyDescriptor("allowDecimals", this.data.getClass())
.setEditorClass(InChangeBooleanEditor.class) .setEditorClass(InChangeBooleanEditor.class)
.setI18NName(Inter.getLocText("FR-Designer_Allow_Decimals")); .setI18NName(Inter.getLocText("FR-Designer_Allow_Decimals"))
.putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate");
CRPropertyDescriptor decimalLength = new CRPropertyDescriptor("maxDecimalLength", this.data.getClass()) CRPropertyDescriptor decimalLength = new CRPropertyDescriptor("maxDecimalLength", this.data.getClass())
.setI18NName(Inter.getLocText(new String[]{"Double", "Numbers"})); .setI18NName(Inter.getLocText(new String[]{"Double", "Numbers"}))
.putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate");
sup = (CRPropertyDescriptor[]) ArrayUtils.addAll(sup, ((NumberEditor)this.data).isAllowDecimals() ? sup = (CRPropertyDescriptor[]) ArrayUtils.addAll(sup, ((NumberEditor)this.data).isAllowDecimals() ?
new CRPropertyDescriptor[] {allowDecimal, decimalLength} : new CRPropertyDescriptor[] {allowDecimal}); new CRPropertyDescriptor[] {allowDecimal, decimalLength} : new CRPropertyDescriptor[] {allowDecimal});
return (CRPropertyDescriptor[]) ArrayUtils.addAll(sup, return (CRPropertyDescriptor[]) ArrayUtils.addAll(sup,
new CRPropertyDescriptor[] { new CRPropertyDescriptor[] {
new CRPropertyDescriptor("allowNegative", this.data.getClass()) new CRPropertyDescriptor("allowNegative", this.data.getClass())
.setI18NName(Inter.getLocText("FR-Designer_Allow_Negative")) .setI18NName(Inter.getLocText("FR-Designer_Allow_Negative"))
.setEditorClass(InChangeBooleanEditor.class), .setEditorClass(InChangeBooleanEditor.class)
.putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"),
new CRPropertyDescriptor("minValue", this.data.getClass()) new CRPropertyDescriptor("minValue", this.data.getClass())
.setI18NName(Inter.getLocText("FR-Designer_Min_Value")) .setI18NName(Inter.getLocText("FR-Designer_Min_Value"))
.setEditorClass(SpinnerMinNumberEditor.class), .setEditorClass(SpinnerMinNumberEditor.class)
.putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"),
new CRPropertyDescriptor("maxValue", this.data.getClass()) new CRPropertyDescriptor("maxValue", this.data.getClass())
.setI18NName(Inter.getLocText("FR-Designer_Max_Value")) .setI18NName(Inter.getLocText("FR-Designer_Max_Value"))
.setEditorClass(SpinnerMaxNumberEditor.class), .setEditorClass(SpinnerMaxNumberEditor.class)
new CRPropertyDescriptor("widgetValue", this.data.getClass()) .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"),
.setI18NName(Inter.getLocText(new String[]{"Widget", "Value"}))
.setEditorClass(WidgetValueEditor.class),
new CRPropertyDescriptor("waterMark", this.data.getClass()) new CRPropertyDescriptor("waterMark", this.data.getClass())
.setI18NName(Inter.getLocText("FR-Designer_WaterMark")) .setI18NName(Inter.getLocText("FR-Designer_WaterMark"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("regErrorMessage", this.data.getClass())
.setI18NName(Inter.getLocText("Verify-Message"))
.putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate")
}); });
} }

9
designer_form/src/com/fr/design/designer/creator/XPassword.java

@ -47,16 +47,19 @@ public class XPassword extends XWrapperedFieldEditor {
*/ */
@Override @Override
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), CRPropertyDescriptor[] sup = (CRPropertyDescriptor[]) ArrayUtils.addAll(
new CRPropertyDescriptor[] { new CRPropertyDescriptor[] {
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName( new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass( Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass(
WidgetValueEditor.class), WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")}
, super.supportedDescriptor());
return (CRPropertyDescriptor[]) ArrayUtils.addAll(sup,
new CRPropertyDescriptor[] {
new CRPropertyDescriptor("regex", this.data.getClass()) new CRPropertyDescriptor("regex", this.data.getClass())
.setI18NName(Inter.getLocText("FR-Designer_Input_Rule")) .setI18NName(Inter.getLocText("FR-Designer_Input_Rule"))
.setEditorClass(RegexEditor.RegexEditor4TextArea.class) .setEditorClass(RegexEditor.RegexEditor4TextArea.class)
.putKeyValue("renderer", RegexCellRencerer.class) .putKeyValue("renderer", RegexCellRencerer.class)
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"),
new CRPropertyDescriptor("waterMark", this.data.getClass()) new CRPropertyDescriptor("waterMark", this.data.getClass())
.setI18NName(Inter.getLocText("FR-Designer_WaterMark")) .setI18NName(Inter.getLocText("FR-Designer_WaterMark"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")

18
designer_form/src/com/fr/design/designer/creator/XRadioGroup.java

@ -19,6 +19,7 @@ import com.fr.design.mainframe.widget.editors.WidgetValueEditor;
import com.fr.design.mainframe.widget.renderer.DictionaryRenderer; import com.fr.design.mainframe.widget.renderer.DictionaryRenderer;
import com.fr.form.ui.RadioGroup; import com.fr.form.ui.RadioGroup;
import com.fr.design.form.util.XCreatorConstants; import com.fr.design.form.util.XCreatorConstants;
import com.fr.function.ARRAY;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
@ -39,16 +40,19 @@ public class XRadioGroup extends XFieldEditor {
@Override @Override
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(),getCRPropertyDescriptor()); CRPropertyDescriptor [] sup = (CRPropertyDescriptor[]) ArrayUtils.addAll(new CRPropertyDescriptor[] {
}
private CRPropertyDescriptor[] getCRPropertyDescriptor() throws IntrospectionException {
CRPropertyDescriptor[] crp = new CRPropertyDescriptor[] {
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName( new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass(WidgetValueEditor.class), Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass(WidgetValueEditor.class)
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("dictionary", this.data.getClass()).setI18NName( new CRPropertyDescriptor("dictionary", this.data.getClass()).setI18NName(
Inter.getLocText("DS-Dictionary")).setEditorClass(DictionaryEditor.class).setRendererClass( Inter.getLocText("DS-Dictionary")).setEditorClass(DictionaryEditor.class).setRendererClass(
DictionaryRenderer.class), DictionaryRenderer.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")},super.supportedDescriptor());
CRPropertyDescriptor [] properties = (CRPropertyDescriptor[]) ArrayUtils.addAll(sup,getCRPropertyDescriptor());
return properties;
}
private CRPropertyDescriptor[] getCRPropertyDescriptor() throws IntrospectionException {
CRPropertyDescriptor[] crp = new CRPropertyDescriptor[] {
new CRPropertyDescriptor("adaptive", this.data.getClass()).setI18NName(Inter.getLocText("Adaptive")) new CRPropertyDescriptor("adaptive", this.data.getClass()).setI18NName(Inter.getLocText("Adaptive"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced").setEditorClass(InChangeBooleanEditor.class)}; .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced").setEditorClass(InChangeBooleanEditor.class)};
if (!toData().isAdaptive()) { if (!toData().isAdaptive()) {

13
designer_form/src/com/fr/design/designer/creator/XTextArea.java

@ -36,15 +36,16 @@ public class XTextArea extends XFieldEditor {
@Override @Override
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), CRPropertyDescriptor[] sup=(CRPropertyDescriptor[]) ArrayUtils.addAll(
new CRPropertyDescriptor[] {
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass(
WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")},super.supportedDescriptor());
return (CRPropertyDescriptor[]) ArrayUtils.addAll(sup,
new CRPropertyDescriptor[] { new CRPropertyDescriptor[] {
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass(
WidgetValueEditor.class),
new CRPropertyDescriptor("regex", this.data.getClass()).setI18NName( new CRPropertyDescriptor("regex", this.data.getClass()).setI18NName(
Inter.getLocText("Input_Rule")).setEditorClass(RegexEditor.RegexEditor4TextArea.class) Inter.getLocText("Input_Rule")).setEditorClass(RegexEditor.RegexEditor4TextArea.class)
.putKeyValue("renderer", RegexCellRencerer.class).putKeyValue( .putKeyValue("renderer", RegexCellRencerer.class).putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"),
XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("waterMark", this.data.getClass()).setI18NName( new CRPropertyDescriptor("waterMark", this.data.getClass()).setI18NName(
Inter.getLocText("WaterMark")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("WaterMark")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced"), }); "Advanced"), });

34
designer_form/src/com/fr/design/designer/creator/XTextEditor.java

@ -18,6 +18,7 @@ import com.fr.design.mainframe.widget.editors.RegexEditor;
import com.fr.design.mainframe.widget.editors.WidgetValueEditor; import com.fr.design.mainframe.widget.editors.WidgetValueEditor;
import com.fr.design.mainframe.widget.renderer.RegexCellRencerer; import com.fr.design.mainframe.widget.renderer.RegexCellRencerer;
import com.fr.form.ui.TextEditor; import com.fr.form.ui.TextEditor;
import com.fr.form.ui.reg.NoneReg;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
@ -40,18 +41,27 @@ public class XTextEditor extends XWrapperedFieldEditor {
*/ */
@Override @Override
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException { public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), CRPropertyDescriptor widgetValue=new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
new CRPropertyDescriptor[] { Inter.getLocText(new String[]{"FR-Designer_Widget", "Value"})).setEditorClass(
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName( WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced");
Inter.getLocText(new String[]{"FR-Designer_Widget", "Value"})).setEditorClass( CRPropertyDescriptor regex= new CRPropertyDescriptor("regex", this.data.getClass()).setI18NName(
WidgetValueEditor.class), Inter.getLocText("FR-Designer_Input_Rule")).setEditorClass(RegexEditor.class).putKeyValue(
new CRPropertyDescriptor("regex", this.data.getClass()).setI18NName( "renderer", RegexCellRencerer.class).putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate");
Inter.getLocText("FR-Designer_Input_Rule")).setEditorClass(RegexEditor.class).putKeyValue( CRPropertyDescriptor regErrorMessage=new CRPropertyDescriptor("regErrorMessage", this.data.getClass()).setI18NName(
"renderer", RegexCellRencerer.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("Verify-Message")).putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate");
"Advanced"), CRPropertyDescriptor waterMark= new CRPropertyDescriptor("waterMark", this.data.getClass()).setI18NName(
new CRPropertyDescriptor("waterMark", this.data.getClass()).setI18NName( Inter.getLocText("FR-Designer_WaterMark")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
Inter.getLocText("FR-Designer_WaterMark")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced");
"Advanced"), }); CRPropertyDescriptor[] sup=(CRPropertyDescriptor[]) ArrayUtils.addAll(new CRPropertyDescriptor[] {widgetValue},super.supportedDescriptor());
Boolean displayRegField = false;
if((((TextEditor) toData()).getRegex() instanceof NoneReg) || ((TextEditor) toData()).getRegex()==null){
displayRegField = false;
}else{
displayRegField = true;
}
return displayRegField? (CRPropertyDescriptor[]) ArrayUtils.addAll(sup,
new CRPropertyDescriptor[] {regex, regErrorMessage, waterMark} ):
(CRPropertyDescriptor[]) ArrayUtils.addAll(sup,new CRPropertyDescriptor[] {regex, waterMark});
} }
@Override @Override

4
designer_form/src/com/fr/design/designer/creator/XTreeComboBoxEditor.java

@ -53,13 +53,13 @@ public class XTreeComboBoxEditor extends XTreeEditor {
protected CRPropertyDescriptor[] addAllowEdit(CRPropertyDescriptor[] crp) throws IntrospectionException{ protected CRPropertyDescriptor[] addAllowEdit(CRPropertyDescriptor[] crp) throws IntrospectionException{
return (CRPropertyDescriptor[])ArrayUtils.add(crp, new CRPropertyDescriptor("directEdit", this.data.getClass()) return (CRPropertyDescriptor[])ArrayUtils.add(crp, new CRPropertyDescriptor("directEdit", this.data.getClass())
.setI18NName(Inter.getLocText("Form-Allow_Edit")).putKeyValue( .setI18NName(Inter.getLocText("Form-Allow_Edit")).putKeyValue(
XCreatorConstants.PROPERTY_CATEGORY, "Advanced")); XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"));
} }
protected CRPropertyDescriptor[] addCustomData(CRPropertyDescriptor[] crp) throws IntrospectionException{ protected CRPropertyDescriptor[] addCustomData(CRPropertyDescriptor[] crp) throws IntrospectionException{
return (CRPropertyDescriptor[])ArrayUtils.add(crp, new CRPropertyDescriptor("customData", this.data.getClass()) return (CRPropertyDescriptor[])ArrayUtils.add(crp, new CRPropertyDescriptor("customData", this.data.getClass())
.setI18NName(Inter.getLocText("Form-Allow_CustomData")).putKeyValue( .setI18NName(Inter.getLocText("Form-Allow_CustomData")).putKeyValue(
XCreatorConstants.PROPERTY_CATEGORY, "Advanced")); XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"));
} }
@Override @Override

18
designer_form/src/com/fr/design/designer/creator/XTreeEditor.java

@ -41,26 +41,28 @@ public class XTreeEditor extends XWidgetCreator {
CRPropertyDescriptor[] crp = !((FieldEditor) toData()).isAllowBlank() ? CRPropertyDescriptor[] crp = !((FieldEditor) toData()).isAllowBlank() ?
new CRPropertyDescriptor[]{ new CRPropertyDescriptor[]{
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName( new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"FR-Designer_Widget", "Value"})).setEditorClass(WidgetValueEditor.class), Inter.getLocText(new String[]{"FR-Designer_Widget", "Value"})).setEditorClass(WidgetValueEditor.class)
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("model", this.data.getClass(), "getNodeOrDict", "setNodeOrDict").setI18NName( new CRPropertyDescriptor("model", this.data.getClass(), "getNodeOrDict", "setNodeOrDict").setI18NName(
Inter.getLocText("FR-Designer_DS-Dictionary")).setEditorClass(TreeModelEditor.class).setRendererClass( Inter.getLocText("FR-Designer_DS-Dictionary")).setEditorClass(TreeModelEditor.class).setRendererClass(
TreeModelRenderer.class), TreeModelRenderer.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("allowBlank", this.data.getClass()).setI18NName( new CRPropertyDescriptor("allowBlank", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_Allow_Blank")).setEditorClass(InChangeBooleanEditor.class).putKeyValue( Inter.getLocText("FR-Designer_Allow_Blank")).setEditorClass(InChangeBooleanEditor.class)
XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"),
new CRPropertyDescriptor("errorMessage", this.data.getClass()).setI18NName( new CRPropertyDescriptor("errorMessage", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_Verify-Message")) Inter.getLocText("FR-Designer_Verify-Message"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"), .putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"),
} }
: new CRPropertyDescriptor[]{ : new CRPropertyDescriptor[]{
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName( new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"FR-Designer_Widget", "Value"})).setEditorClass(WidgetValueEditor.class), Inter.getLocText(new String[]{"FR-Designer_Widget", "Value"})).setEditorClass(WidgetValueEditor.class)
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("model", this.data.getClass(), "getNodeOrDict", "setNodeOrDict").setI18NName( new CRPropertyDescriptor("model", this.data.getClass(), "getNodeOrDict", "setNodeOrDict").setI18NName(
Inter.getLocText("FR-Designer_DS-Dictionary")).setEditorClass(TreeModelEditor.class).setRendererClass( Inter.getLocText("FR-Designer_DS-Dictionary")).setEditorClass(TreeModelEditor.class).setRendererClass(
TreeModelRenderer.class), TreeModelRenderer.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("allowBlank", this.data.getClass()).setI18NName( new CRPropertyDescriptor("allowBlank", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_Allow_Blank")).setEditorClass(InChangeBooleanEditor.class).putKeyValue( Inter.getLocText("FR-Designer_Allow_Blank")).setEditorClass(InChangeBooleanEditor.class).putKeyValue(
XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),}; XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"),};
crp = this.addWaterMark(crp); crp = this.addWaterMark(crp);
crp = (CRPropertyDescriptor[]) ArrayUtils.add(crp, crp = (CRPropertyDescriptor[]) ArrayUtils.add(crp,

1
designer_form/src/com/fr/design/form/util/XCreatorConstants.java

@ -21,6 +21,7 @@ public class XCreatorConstants {
// 描述属性的分类 // 描述属性的分类
public static final String PROPERTY_CATEGORY = "category"; public static final String PROPERTY_CATEGORY = "category";
public static final String DEFAULT_GROUP_NAME = "Form-Basic_Properties"; public static final String DEFAULT_GROUP_NAME = "Form-Basic_Properties";
public static final String PROPERTY_VALIDATE = "validate";
public static final Color FORM_BG = new Color(252, 252, 254); public static final Color FORM_BG = new Color(252, 252, 254);
// 拖拽标识块的大小 // 拖拽标识块的大小
public static final int RESIZE_BOX_SIZ = 5; public static final int RESIZE_BOX_SIZ = 5;

5
designer_form/src/com/fr/design/mainframe/widget/accessibles/AccessiblePropertyEditor.java

@ -33,6 +33,11 @@ public class AccessiblePropertyEditor extends AbstractPropertyEditor {
editor.setValue(value); editor.setValue(value);
} }
@Override
public boolean refreshInTime() {
return true;
}
@Override @Override
public Object getValue() { public Object getValue() {
return editor.getValue(); return editor.getValue();

Loading…
Cancel
Save