Browse Source

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

master
kerry 8 years ago
parent
commit
49d9558d66
  1. 7
      designer/src/com/fr/design/widget/CellWidgetCardPane.java
  2. 24
      designer/src/com/fr/design/widget/ui/FieldEditorDefinePane.java
  3. 47
      designer/src/com/fr/design/widget/ui/NumberEditorDefinePane.java
  4. 64
      designer/src/com/fr/design/widget/ui/TextFieldEditorDefinePane.java
  5. 5
      designer_base/src/com/fr/design/gui/frpane/RegPane.java
  6. 13
      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. 28
      designer_form/src/com/fr/design/designer/creator/XCheckBoxGroup.java
  10. 7
      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. 15
      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. 16
      designer_form/src/com/fr/design/designer/creator/XRadioGroup.java
  20. 9
      designer_form/src/com/fr/design/designer/creator/XTextArea.java
  21. 28
      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);
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() {
@Override

24
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() {
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();
allowBlankCheckBox = new UICheckBox(Inter.getLocText("Allow_Blank"));
// 是否允许为空
firstPanel.add(allowBlankCheckBox);
allowBlankCheckBox.addItemListener(new ItemListener() {
@Override
@ -50,8 +46,16 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
// 错误信息
JPanel errorMsgPane = FRGUIPaneFactory.createLeftFlowZeroGapBorderPane();
//目前只整改了文本、密码、文本域和数字四个控件
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"}) + ":"));
errorMsgTextField = new UITextField(16);
errorMsgPane.add(errorMsgTextField);
@ -109,4 +113,12 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
public void checkValid() throws Exception {
}
public UICheckBox getAllowBlankCheckBox(){
return allowBlankCheckBox;
}
public UITextField getErrorMsgTextField(){
return errorMsgTextField;
}
}

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

@ -14,10 +14,13 @@ import javax.swing.JPanel;
import javax.swing.SpinnerNumberModel;
import javax.swing.event.ChangeEvent;
import javax.swing.event.ChangeListener;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import javax.swing.text.DefaultFormatter;
import com.fr.design.gui.icheckbox.UICheckBox;
import com.fr.design.gui.ispinner.UIBasicSpinner;
import com.fr.design.gui.itextfield.UITextField;
import com.fr.design.layout.FRGUIPaneFactory;
import com.fr.form.ui.NumberEditor;
import com.fr.general.Inter;
@ -39,6 +42,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
private com.fr.design.editor.editor.IntegerEditor decimalLength;
private JPanel limitNumberPane;
private WaterMarkDictPane waterMarkDictPane;
private UITextField regErrorMsgTextField;
private ActionListener actionListener1 = new ActionListener() {
public void actionPerformed(ActionEvent e) {
@ -153,26 +157,34 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
@Override
protected JPanel setFirstContentPane() {
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());
// richer:数字的允许直接编辑没有意义
JPanel northPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
JPanel northPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Advanced"));
content.add(northPane, BorderLayout.NORTH);
waterMarkDictPane = new 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.decimalLength = new com.fr.design.editor.editor.IntegerEditor();
this.decimalLength.setColumns(4);
limitNumberPane = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText(new String[]{"Double", "Numbers"}) + ":"), this.decimalLength},
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.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.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));
maxValueSpinner.setPreferredSize(new Dimension(120, 20));
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.setMaxValueCheckBox.addActionListener(actionListener3);
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));
minValueSpinner.setPreferredSize(new Dimension(120, 20));
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.setMinValueCheckBox.addActionListener(actionListener4);
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;
}
@ -227,7 +258,7 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
minValueSpinner.setVisible(true);
minValueSpinner.setValue(new Double(e.getMinValue()));
}
this.regErrorMsgTextField.setText(e.getRegErrorMessage());
this.waterMarkDictPane.populate(e);
}
@ -255,6 +286,8 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
this.waterMarkDictPane.update(ob);
ob.setRegErrorMessage(this.regErrorMsgTextField.getText());
return ob;
}

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

@ -1,19 +1,29 @@
package com.fr.design.widget.ui;
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.utils.gui.GUICoreUtils;
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.stable.StringUtils;
import javax.swing.*;
import javax.swing.event.DocumentEvent;
import javax.swing.event.DocumentListener;
import java.awt.*;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.KeyAdapter;
import java.awt.event.KeyEvent;
public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor> {
protected RegPane regPane;
private WaterMarkDictPane waterMarkDictPane;
private UITextField regErrorMsgTextField;
public TextFieldEditorDefinePane() {
this.initComponents();
@ -22,10 +32,28 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
@Override
protected JPanel setFirstContentPane() {
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();
contenter.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 0));
attrPane.add(contenter, BorderLayout.NORTH);
contenter.setBorder(BorderFactory.createEmptyBorder(0, 4, 0, 4));
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();
final RegPane.RegChangeListener rl = new RegPane.RegChangeListener() {
@ -45,7 +73,15 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
}
};
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.addInputKeyListener(new KeyAdapter() {
public void keyTyped(KeyEvent e) {
@ -54,8 +90,21 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
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;
}
@ -71,13 +120,14 @@ public class TextFieldEditorDefinePane extends FieldEditorDefinePane<TextEditor>
@Override
protected void populateSubFieldEditorBean(TextEditor e) {
this.regPane.populate(e.getRegex());
regErrorMsgTextField.setText(e.getRegErrorMessage());
waterMarkDictPane.populate(e);
}
@Override
protected TextEditor updateSubFieldEditorBean() {
TextEditor ob = newTextEditorInstance();
ob.setRegErrorMessage(this.regErrorMsgTextField.getText());
ob.setRegex(this.regPane.update());
waterMarkDictPane.update(ob);

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

@ -65,6 +65,11 @@ public class RegPane extends BasicPane {
private DefaultRegPane defaultRegPane;
private CustomRegRexPane customRegRexPane;
public UIComboBox getRegComboBox(){
return regComboBox;
}
public RegPane() {
this(ALL_REG_TYPE);
}

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

@ -100,8 +100,11 @@ public class CompositeComponentAdapter implements ComponentAdapter {
for (CRPropertyDescriptor property : properties) {
String groupName = (String) property.getValue(XCreatorConstants.PROPERTY_CATEGORY);
if (StringUtils.isEmpty(groupName)) {
groupName = (String) property.getValue(XCreatorConstants.PROPERTY_VALIDATE);
if(StringUtils.isEmpty(groupName)){
groupName = XCreatorConstants.DEFAULT_GROUP_NAME;
}
}
ArrayList<CRPropertyDescriptor> groupProperties = maps.get(groupName);
if (groupProperties == null) {
groupProperties = new ArrayList<CRPropertyDescriptor>();
@ -110,6 +113,7 @@ public class CompositeComponentAdapter implements ComponentAdapter {
}
groupProperties.add(property);
}
adjustGroupNamesPosition(groupNames);
ArrayList<PropertyGroupModel> groups = new ArrayList<PropertyGroupModel>();
for (String groupName : groupNames) {
ArrayList<CRPropertyDescriptor> groupProperties = maps.get(groupName);
@ -120,6 +124,15 @@ public class CompositeComponentAdapter implements ComponentAdapter {
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
public ArrayList<GroupModel> getXCreatorPropertyModel() {
ArrayList<GroupModel> groupModels = new ArrayList<GroupModel>();

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{
CRPropertyDescriptor[] crPropertyDescriptors = {
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(
Inter.getLocText(new String[]{"Form-Button", "Style"})).setEditorClass(
ButtonTypeEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
@ -164,6 +164,7 @@ public class XButton extends XWidgetCreator {
return new CRPropertyDescriptor[]{
new CRPropertyDescriptor("text", this.data.getClass())
.setI18NName(Inter.getLocText(new String[] {"Form-Button", "Name"}))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
.setPropertyChangeListener(new PropertyChangeAdapter() {
@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 {
return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(), new CRPropertyDescriptor[] {
new CRPropertyDescriptor("text", this.data.getClass()).setI18NName(Inter.getLocText("Text"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
.setPropertyChangeListener(new PropertyChangeAdapter() {
@Override
@ -41,6 +42,7 @@ public class XCheckBox extends XWidgetCreator {
}),
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"Widget", "Value"})).setEditorClass(WidgetValueEditor.class)
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")
.setPropertyChangeListener(new PropertyChangeAdapter() {
@Override

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

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

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

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

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,
"Advanced"),
new CRPropertyDescriptor("returnString", this.data.getClass()).setEditorClass(
InChangeBooleanEditor.class).setI18NName(Inter.getLocText("Return-String")).putKeyValue(
XCreatorConstants.PROPERTY_CATEGORY, "Return-Value") } : new CRPropertyDescriptor[] {
InChangeBooleanEditor.class).setI18NName(Inter.getLocText("Return-String"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") } : new CRPropertyDescriptor[] {
new CRPropertyDescriptor("delimiter", this.data.getClass()).setI18NName(
Inter.getLocText("Form-Delimiter")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced"),
new CRPropertyDescriptor("returnString", this.data.getClass()).setI18NName(
Inter.getLocText("Return-String")).setEditorClass(InChangeBooleanEditor.class).putKeyValue(
XCreatorConstants.PROPERTY_CATEGORY, "Return-Value"),
Inter.getLocText("Return-String")).setEditorClass(InChangeBooleanEditor.class)
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("startSymbol", this.data.getClass()).setI18NName(
Inter.getLocText("ComboCheckBox-Start_Symbol")).putKeyValue(
XCreatorConstants.PROPERTY_CATEGORY, "Return-Value"),
Inter.getLocText("ComboCheckBox-Start_Symbol"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
new CRPropertyDescriptor("endSymbol", this.data.getClass()).setI18NName(
Inter.getLocText("ComboCheckBox-End_Symbol")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Return-Value") });
Inter.getLocText("ComboCheckBox-End_Symbol"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced") });
}
@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")}); } }

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

@ -46,17 +46,20 @@ public class XDateEditor extends XDirectWriteEditor {
*/
@Override
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(),
CRPropertyDescriptor [] tempt=(CRPropertyDescriptor[]) ArrayUtils.addAll(
new CRPropertyDescriptor[] {
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
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() {
initFieldText();
}
}),
})},super.supportedDescriptor());
return (CRPropertyDescriptor[]) ArrayUtils.addAll(tempt,
new CRPropertyDescriptor[] {
new CRPropertyDescriptor("formatText", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Engine_Format")).setEditorClass(formatClass()).setRendererClass(
DateCellRenderer.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
@ -66,11 +69,11 @@ public class XDateEditor extends XDirectWriteEditor {
new CRPropertyDescriptor("endDate", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_End-Date")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"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(
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")
});
}

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.beans.IntrospectionException;
import com.fr.design.form.util.XCreatorConstants;
import com.fr.form.ui.DirectWriteEditor;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
@ -24,6 +25,7 @@ public abstract class XDirectWriteEditor extends XFieldEditor {
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(),
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.Dimension;
import java.beans.IntrospectionException;
import java.util.ArrayList;
import java.util.List;
import javax.swing.BorderFactory;
import javax.swing.border.Border;
@ -38,10 +40,10 @@ public abstract class XFieldEditor extends XWidgetCreator {
private CRPropertyDescriptor[] getCRPropertyDescriptor() throws IntrospectionException {
CRPropertyDescriptor allowBlank = new CRPropertyDescriptor("allowBlank", this.data.getClass()).setI18NName(
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(
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")
.setI18NName(Inter.getLocText(new String[]{"FRFont", "FRFont-Size"}))
.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("widgetValue", this.data.getClass()).setI18NName(
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(
Inter.getLocText("FR-Designer_StyleAlignment-Wrap_Text")).putKeyValue(
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
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())
.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())
.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() ?
new CRPropertyDescriptor[] {allowDecimal, decimalLength} : new CRPropertyDescriptor[] {allowDecimal});
return (CRPropertyDescriptor[]) ArrayUtils.addAll(sup,
new CRPropertyDescriptor[] {
new CRPropertyDescriptor("allowNegative", this.data.getClass())
.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())
.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())
.setI18NName(Inter.getLocText("FR-Designer_Max_Value"))
.setEditorClass(SpinnerMaxNumberEditor.class),
new CRPropertyDescriptor("widgetValue", this.data.getClass())
.setI18NName(Inter.getLocText(new String[]{"Widget", "Value"}))
.setEditorClass(WidgetValueEditor.class),
.setEditorClass(SpinnerMaxNumberEditor.class)
.putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"),
new CRPropertyDescriptor("waterMark", this.data.getClass())
.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
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),
WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")}
, super.supportedDescriptor());
return (CRPropertyDescriptor[]) ArrayUtils.addAll(sup,
new CRPropertyDescriptor[] {
new CRPropertyDescriptor("regex", this.data.getClass())
.setI18NName(Inter.getLocText("FR-Designer_Input_Rule"))
.setEditorClass(RegexEditor.RegexEditor4TextArea.class)
.putKeyValue("renderer", RegexCellRencerer.class)
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
.putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"),
new CRPropertyDescriptor("waterMark", this.data.getClass())
.setI18NName(Inter.getLocText("FR-Designer_WaterMark"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")

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

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

@ -36,15 +36,16 @@ public class XTextArea extends XFieldEditor {
@Override
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),
WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")},super.supportedDescriptor());
return (CRPropertyDescriptor[]) ArrayUtils.addAll(sup,
new CRPropertyDescriptor[] {
new CRPropertyDescriptor("regex", this.data.getClass()).setI18NName(
Inter.getLocText("Input_Rule")).setEditorClass(RegexEditor.RegexEditor4TextArea.class)
.putKeyValue("renderer", RegexCellRencerer.class).putKeyValue(
XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
.putKeyValue("renderer", RegexCellRencerer.class).putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"),
new CRPropertyDescriptor("waterMark", this.data.getClass()).setI18NName(
Inter.getLocText("WaterMark")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced"), });

28
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.renderer.RegexCellRencerer;
import com.fr.form.ui.TextEditor;
import com.fr.form.ui.reg.NoneReg;
import com.fr.general.FRFont;
import com.fr.general.Inter;
import com.fr.stable.ArrayUtils;
@ -40,18 +41,27 @@ public class XTextEditor extends XWrapperedFieldEditor {
*/
@Override
public CRPropertyDescriptor[] supportedDescriptor() throws IntrospectionException {
return (CRPropertyDescriptor[]) ArrayUtils.addAll(super.supportedDescriptor(),
new CRPropertyDescriptor[] {
new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
CRPropertyDescriptor widgetValue=new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"FR-Designer_Widget", "Value"})).setEditorClass(
WidgetValueEditor.class),
new CRPropertyDescriptor("regex", this.data.getClass()).setI18NName(
WidgetValueEditor.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced");
CRPropertyDescriptor regex= new CRPropertyDescriptor("regex", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_Input_Rule")).setEditorClass(RegexEditor.class).putKeyValue(
"renderer", RegexCellRencerer.class).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced"),
new CRPropertyDescriptor("waterMark", this.data.getClass()).setI18NName(
"renderer", RegexCellRencerer.class).putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate");
CRPropertyDescriptor regErrorMessage=new CRPropertyDescriptor("regErrorMessage", this.data.getClass()).setI18NName(
Inter.getLocText("Verify-Message")).putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate");
CRPropertyDescriptor waterMark= new CRPropertyDescriptor("waterMark", this.data.getClass()).setI18NName(
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

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{
return (CRPropertyDescriptor[])ArrayUtils.add(crp, new CRPropertyDescriptor("directEdit", this.data.getClass())
.setI18NName(Inter.getLocText("Form-Allow_Edit")).putKeyValue(
XCreatorConstants.PROPERTY_CATEGORY, "Advanced"));
XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"));
}
protected CRPropertyDescriptor[] addCustomData(CRPropertyDescriptor[] crp) throws IntrospectionException{
return (CRPropertyDescriptor[])ArrayUtils.add(crp, new CRPropertyDescriptor("customData", this.data.getClass())
.setI18NName(Inter.getLocText("Form-Allow_CustomData")).putKeyValue(
XCreatorConstants.PROPERTY_CATEGORY, "Advanced"));
XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"));
}
@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() ?
new CRPropertyDescriptor[]{
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(
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(
Inter.getLocText("FR-Designer_Allow_Blank")).setEditorClass(InChangeBooleanEditor.class).putKeyValue(
XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
Inter.getLocText("FR-Designer_Allow_Blank")).setEditorClass(InChangeBooleanEditor.class)
.putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"),
new CRPropertyDescriptor("errorMessage", this.data.getClass()).setI18NName(
Inter.getLocText("FR-Designer_Verify-Message"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"),
.putKeyValue(XCreatorConstants.PROPERTY_VALIDATE, "FR-Designer_Validate"),
}
: new CRPropertyDescriptor[]{
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(
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(
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 = (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 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 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);
}
@Override
public boolean refreshInTime() {
return true;
}
@Override
public Object getValue() {
return editor.getValue();

Loading…
Cancel
Save