Browse Source

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

* commit '95b199b57ed52ef65c319401056793bfd72a9a9b':
  控件校验完善
  控件校验完善
  控件校验完善
  控件校验完善
  控件校验提示优化和控件属性整理
master
superman 8 years ago
parent
commit
81b7b7e227
  1. 7
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  2. 209
      designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java
  3. 45
      designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java
  4. 187
      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. 74
      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

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

@ -8,6 +8,7 @@ import javax.swing.BorderFactory;
import com.fr.design.gui.frpane.TreeSettingPane; import com.fr.design.gui.frpane.TreeSettingPane;
import com.fr.design.gui.ilable.UILabel; import com.fr.design.gui.ilable.UILabel;
import javax.swing.JPanel; import javax.swing.JPanel;
import javax.swing.event.DocumentEvent; import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener; import javax.swing.event.DocumentListener;
@ -22,91 +23,125 @@ import com.fr.general.Inter;
import com.fr.design.widget.DataModify; import com.fr.design.widget.DataModify;
public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> { public abstract class FieldEditorDefinePane<T extends FieldEditor> extends AbstractDataModify<T> {
private UICheckBox allowBlankCheckBox; private UICheckBox allowBlankCheckBox;
// richer:错误信息,是所有控件共有的属性,所以放到这里来 // richer:错误信息,是所有控件共有的属性,所以放到这里来
private UITextField errorMsgTextField; private UITextField errorMsgTextField;
private UITextField regErrorMsgTextField;
public FieldEditorDefinePane() {
this.initComponents(); public FieldEditorDefinePane() {
} this.initComponents();
}
protected void initComponents() {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); protected void initComponents() {
JPanel northPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane(); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.add(northPane, BorderLayout.NORTH); regErrorMsgTextField = new UITextField(16);
JPanel firstPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); regErrorMsgTextField.getDocument().addDocumentListener(new DocumentListener() {
firstPanel.setBorder(BorderFactory.createEmptyBorder(0, -2, 0, 0)); public void changedUpdate(DocumentEvent e) {
//JPanel firstPanel = FRGUIPaneFactory.createBorderLayout_M_Pane(); regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText());
allowBlankCheckBox = new UICheckBox(Inter.getLocText("Allow_Blank")); }
// 是否允许为空
firstPanel.add(allowBlankCheckBox); public void insertUpdate(DocumentEvent e) {
allowBlankCheckBox.addItemListener(new ItemListener() { regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText());
}
@Override
public void itemStateChanged(ItemEvent e) { public void removeUpdate(DocumentEvent e) {
errorMsgTextField.setEnabled(!allowBlankCheckBox.isSelected()); regErrorMsgTextField.setToolTipText(regErrorMsgTextField.getText());
} }
}); });
// 错误信息 //JPanel firstPanel = FRGUIPaneFactory.createBorderLayout_M_Pane();
JPanel errorMsgPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane(); allowBlankCheckBox = new UICheckBox(Inter.getLocText("Allow_Blank"));
firstPanel.add(errorMsgPane);
northPane.add(firstPanel); allowBlankCheckBox.addItemListener(new ItemListener() {
errorMsgPane.add(new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"));
errorMsgTextField = new UITextField(16); @Override
errorMsgPane.add(errorMsgTextField); public void itemStateChanged(ItemEvent e) {
errorMsgTextField.setEnabled(!allowBlankCheckBox.isSelected());
// richer:主要为了方便查看比较长的错误信息 }
errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() { });
public void changedUpdate(DocumentEvent e) { // 错误信息
errorMsgTextField.setToolTipText(errorMsgTextField.getText()); JPanel errorMsgPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
} //目前只整改了文本、密码、文本域和数字四个控件
this.addAllowBlankPane(allowBlankCheckBox, errorMsgPane);
public void insertUpdate(DocumentEvent e) { errorMsgPane.add(new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"));
errorMsgTextField.setToolTipText(errorMsgTextField.getText()); errorMsgTextField = new UITextField(16);
} errorMsgPane.add(errorMsgTextField);
public void removeUpdate(DocumentEvent e) { // richer:主要为了方便查看比较长的错误信息
errorMsgTextField.setToolTipText(errorMsgTextField.getText()); errorMsgTextField.getDocument().addDocumentListener(new DocumentListener() {
}
}); public void changedUpdate(DocumentEvent e) {
JPanel contentPane = this.setFirstContentPane(); errorMsgTextField.setToolTipText(errorMsgTextField.getText());
if (contentPane != null) { }
//contentPane.add(firstPanel);
this.add(contentPane, BorderLayout.CENTER); public void insertUpdate(DocumentEvent e) {
} else { errorMsgTextField.setToolTipText(errorMsgTextField.getText());
//this.add(firstPanel, BorderLayout.CENTER); }
}
} public void removeUpdate(DocumentEvent e) {
errorMsgTextField.setToolTipText(errorMsgTextField.getText());
@Override }
public void populateBean(T ob) { });
this.allowBlankCheckBox.setSelected(ob.isAllowBlank()); JPanel contentPane = this.setFirstContentPane();
errorMsgTextField.setEnabled(!allowBlankCheckBox.isSelected()); if (contentPane != null) {
this.errorMsgTextField.setText(ob.getErrorMessage()); //contentPane.add(firstPanel);
this.add(contentPane, BorderLayout.CENTER);
populateSubFieldEditorBean(ob); } else {
} //this.add(firstPanel, BorderLayout.CENTER);
}
protected abstract void populateSubFieldEditorBean(T ob); }
@Override @Override
public T updateBean() { public void populateBean(T ob) {
T e = updateSubFieldEditorBean(); this.allowBlankCheckBox.setSelected(ob.isAllowBlank());
errorMsgTextField.setEnabled(!allowBlankCheckBox.isSelected());
e.setAllowBlank(this.allowBlankCheckBox.isSelected()); this.errorMsgTextField.setText(ob.getErrorMessage());
e.setErrorMessage(this.errorMsgTextField.getText());
populateSubFieldEditorBean(ob);
return e; }
}
protected abstract void populateSubFieldEditorBean(T ob);
protected abstract T updateSubFieldEditorBean();
@Override
protected abstract JPanel setFirstContentPane(); public T updateBean() {
T e = updateSubFieldEditorBean();
@Override
public void checkValid() throws Exception { e.setAllowBlank(this.allowBlankCheckBox.isSelected());
e.setErrorMessage(this.errorMsgTextField.getText());
}
return e;
}
protected abstract T updateSubFieldEditorBean();
protected abstract JPanel setFirstContentPane();
@Override
public void checkValid() throws Exception {
}
public void addAllowBlankPane(UICheckBox allowBlankCheckBox, JPanel errorMsgPane) {
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);
}
public UICheckBox getAllowBlankCheckBox() {
return allowBlankCheckBox;
}
public UITextField getErrorMsgTextField() {
return errorMsgTextField;
}
public UITextField getRegErrorMsgTextField() {
return regErrorMsgTextField;
}
} }

45
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;
@ -121,9 +124,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 +136,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 +156,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 +191,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 +200,12 @@ 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);
validatePane.add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), getRegErrorMsgTextField()}, FlowLayout.LEFT, 24));
return content; return content;
} }
@ -227,7 +240,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.getRegErrorMsgTextField().setText(e.getRegErrorMessage());
this.waterMarkDictPane.populate(e); this.waterMarkDictPane.populate(e);
} }
@ -255,6 +268,8 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
this.waterMarkDictPane.update(ob); this.waterMarkDictPane.update(ob);
ob.setRegErrorMessage(this.getRegErrorMsgTextField().getText());
return ob; return ob;
} }
@ -283,4 +298,8 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
} }
} }
@Override
public void addAllowBlankPane(UICheckBox allowBlankCheckBox, JPanel errorMsgPane) {
}
} }

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

@ -1,91 +1,128 @@
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.icheckbox.UICheckBox;
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;
public TextFieldEditorDefinePane() { public TextFieldEditorDefinePane() {
this.initComponents(); this.initComponents();
} }
@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);
regPane = createRegPane(); regPane = createRegPane();
final RegPane.RegChangeListener rl = new RegPane.RegChangeListener() { final RegPane.RegChangeListener rl = new RegPane.RegChangeListener() {
@Override @Override
public void regChangeAction() { public void regChangeAction() {
waterMarkDictPane.setWaterMark(""); waterMarkDictPane.setWaterMark("");
regPane.removeRegChangeListener(this); regPane.removeRegChangeListener(this);
} }
}; };
final RegPane.PhoneRegListener pl = new RegPane.PhoneRegListener() { final RegPane.PhoneRegListener pl = new RegPane.PhoneRegListener() {
public void phoneRegChangeAction(RegPane.PhoneRegEvent e) { public void phoneRegChangeAction(RegPane.PhoneRegEvent e) {
if (StringUtils.isNotEmpty(e.getPhoneRegString()) if (StringUtils.isNotEmpty(e.getPhoneRegString())
&& StringUtils.isEmpty(waterMarkDictPane.getWaterMark())) { && StringUtils.isEmpty(waterMarkDictPane.getWaterMark())) {
waterMarkDictPane.setWaterMark(Inter.getLocText("Example") + ":" + e.getPhoneRegString()); waterMarkDictPane.setWaterMark(Inter.getLocText("Example") + ":" + e.getPhoneRegString());
regPane.addRegChangeListener(rl); regPane.addRegChangeListener(rl);
} }
} }
}; };
regPane.addPhoneRegListener(pl); regPane.addPhoneRegListener(pl);
JPanel basicPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("FR-Designer_Validate"));
waterMarkDictPane = new WaterMarkDictPane(); JPanel validateContent = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
waterMarkDictPane.addInputKeyListener(new KeyAdapter() { getAllowBlankCheckBox().setPreferredSize(new Dimension(444, 40));
public void keyTyped(KeyEvent e) { validateContent.add(GUICoreUtils.createFlowPane(getAllowBlankCheckBox(), FlowLayout.LEFT));
regPane.removePhoneRegListener(pl); validateContent.add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), getErrorMsgTextField()}, FlowLayout.LEFT, 24));
regPane.removeRegChangeListener(rl); validateContent.add(GUICoreUtils.createFlowPane(regPane, FlowLayout.LEFT));
waterMarkDictPane.removeInputKeyListener(this); validateContent.add(GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"), getRegErrorMsgTextField()}, FlowLayout.LEFT, 24));
} basicPane.add(validateContent);
}); JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Advanced"));
contenter.add(regPane, BorderLayout.NORTH); waterMarkDictPane = new WaterMarkDictPane();
contenter.add(waterMarkDictPane, BorderLayout.CENTER); waterMarkDictPane.addInputKeyListener(new KeyAdapter() {
return attrPane; public void keyTyped(KeyEvent e) {
} regPane.removePhoneRegListener(pl);
regPane.removeRegChangeListener(rl);
protected RegPane createRegPane() { waterMarkDictPane.removeInputKeyListener(this);
return new RegPane(); }
} });
//监听填写规则下拉框的值的变化
@Override regPane.getRegComboBox().addActionListener(new ActionListener() {
protected String title4PopupWindow() { public void actionPerformed(ActionEvent e) {
return "text"; RegExp regExp = (RegExp) regPane.getRegComboBox().getSelectedItem();
} if (!StringUtils.isNotEmpty(regExp.toRegText())) {
getRegErrorMsgTextField().setEnabled(false);
@Override } else {
protected void populateSubFieldEditorBean(TextEditor e) { getRegErrorMsgTextField().setEnabled(true);
this.regPane.populate(e.getRegex()); }
waterMarkDictPane.populate(e);
} }
});
@Override advancedPane.add(waterMarkDictPane);
protected TextEditor updateSubFieldEditorBean() { contenter.add(advancedPane, BorderLayout.NORTH);
TextEditor ob = newTextEditorInstance(); contenter.add(basicPane, BorderLayout.CENTER);
return attrPane;
ob.setRegex(this.regPane.update()); }
waterMarkDictPane.update(ob);
protected RegPane createRegPane() {
return ob; return new RegPane();
} }
protected TextEditor newTextEditorInstance() { @Override
return new TextEditor(); protected String title4PopupWindow() {
} return "text";
}
@Override
protected void populateSubFieldEditorBean(TextEditor e) {
this.regPane.populate(e.getRegex());
getRegErrorMsgTextField().setText(e.getRegErrorMessage());
waterMarkDictPane.populate(e);
}
@Override
protected TextEditor updateSubFieldEditorBean() {
TextEditor ob = newTextEditorInstance();
ob.setRegErrorMessage(this.getRegErrorMsgTextField().getText());
ob.setRegex(this.regPane.update());
waterMarkDictPane.update(ob);
return ob;
}
protected TextEditor newTextEditorInstance() {
return new TextEditor();
}
@Override
public void addAllowBlankPane(UICheckBox allowBlankCheckBox, JPanel errorMsgPane) {
}
} }

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"), });

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

@ -18,10 +18,14 @@ 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.form.ui.reg.RegExp;
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;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
import jdk.nashorn.internal.runtime.regexp.joni.Regex;
/** /**
* @author richer * @author richer
@ -35,43 +39,53 @@ public class XTextEditor extends XWrapperedFieldEditor {
/** /**
* 控件的属性列表 * 控件的属性列表
*
* @return 此控件所用的属性列表 * @return 此控件所用的属性列表
* @throws IntrospectionException 异常 * @throws IntrospectionException 异常
*/ */
@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 = true;
RegExp reg = ((TextEditor) toData()).getRegex();
@Override if (reg == null || !StringUtils.isNotEmpty(reg.toRegText())) {
public void paintComponent(Graphics g) {
super.paintComponent(g);
TextEditor area = (TextEditor) data; displayRegField = false;
if (area.getWidgetValue() != null) { }
Graphics2D g2d = (Graphics2D) g.create(); return displayRegField ? (CRPropertyDescriptor[]) ArrayUtils.addAll(sup,
BaseUtils.drawStringStyleInRotation(g2d, this.getWidth(), this.getHeight(), area.getWidgetValue() new CRPropertyDescriptor[]{regex, regErrorMessage, waterMark}) :
.toString(), Style.getInstance(FRFont.getInstance()).deriveHorizontalAlignment(Constants.LEFT) (CRPropertyDescriptor[]) ArrayUtils.addAll(sup, new CRPropertyDescriptor[]{regex, waterMark});
.deriveTextStyle(Style.TEXTSTYLE_SINGLELINE), ScreenResolution.getScreenResolution()); }
}
} @Override
public void paintComponent(Graphics g) {
super.paintComponent(g);
TextEditor area = (TextEditor) data;
if (area.getWidgetValue() != null) {
Graphics2D g2d = (Graphics2D) g.create();
BaseUtils.drawStringStyleInRotation(g2d, this.getWidth(), this.getHeight(), area.getWidgetValue()
.toString(), Style.getInstance(FRFont.getInstance()).deriveHorizontalAlignment(Constants.LEFT)
.deriveTextStyle(Style.TEXTSTYLE_SINGLELINE), ScreenResolution.getScreenResolution());
}
}
@Override @Override
protected JComponent initEditor() { protected JComponent initEditor() {
setBorder(FIELDBORDER); setBorder(FIELDBORDER);
return this; return this;
} }
@Override @Override
protected String getIconName() { protected String getIconName() {

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