Browse Source

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

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

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

@ -86,7 +86,12 @@ public class CellWidgetCardPane extends BasicPane {
attriPane.remove(widgetPropertyPane);
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

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

@ -32,14 +32,10 @@ public abstract class FieldEditorDefinePane<T extends FieldEditor> extends Abstr
protected void initComponents() {
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();
firstPanel.add(errorMsgPane);
northPane.add(firstPanel);
//目前只整改了文本、密码、文本域和数字四个控件
if(!(this instanceof TextFieldEditorDefinePane)&&!(this instanceof NumberEditorDefinePane)){
JPanel northPane = FRGUIPaneFactory.createY_AXISBoxInnerContainer_L_Pane();
this.add(northPane, BorderLayout.NORTH);
JPanel firstPanel = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
firstPanel.setBorder(BorderFactory.createEmptyBorder(0, -2, 0, 0));
firstPanel.add(allowBlankCheckBox);
firstPanel.add(errorMsgPane);
northPane.add(firstPanel);
}
errorMsgPane.add(new UILabel(Inter.getLocText(new String[]{"Error", "Tooltips"}) + ":"));
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;
}
}

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

@ -14,10 +14,13 @@ import javax.swing.JPanel;
import javax.swing.SpinnerNumberModel;
import javax.swing.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) {
@ -121,9 +125,9 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
@Override
public void stateChanged(ChangeEvent e) {
if (setMaxValueCheckBox.isSelected()) {
if (setMinValueCheckBox.isSelected()) {
minValueModel.setMaximum(Double.parseDouble("" + maxValueSpinner.getValue()));
}
if (setMinValueCheckBox.isSelected()) {
minValueModel.setMaximum(Double.parseDouble("" + maxValueSpinner.getValue()));
}
}
}
};
@ -133,9 +137,9 @@ public class NumberEditorDefinePane extends FieldEditorDefinePane<NumberEditor>
@Override
public void stateChanged(ChangeEvent e) {
if (setMinValueCheckBox.isSelected()) {
if (setMaxValueCheckBox.isSelected()) {
maxValueModel.setMinimum(Double.parseDouble("" + minValueSpinner.getValue()));
}
if (setMaxValueCheckBox.isSelected()) {
maxValueModel.setMinimum(Double.parseDouble("" + minValueSpinner.getValue()));
}
}
}
};
@ -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);

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

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

30
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());
}
private CRPropertyDescriptor[] getCRPropertyDescriptor() throws IntrospectionException {
CRPropertyDescriptor[] crp = new CRPropertyDescriptor[] {
CRPropertyDescriptor [] sup = (CRPropertyDescriptor[]) ArrayUtils.addAll(new CRPropertyDescriptor[] {
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(
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"))
.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

11
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("dictionary", this.data.getClass()).setI18NName(Inter.getLocText("FR-Designer_DS-Dictionary")).setEditorClass(DictionaryEditor.class).setRendererClass(DictionaryRenderer.class)
});
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("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")}); } }

25
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() {
@Override
public void propertyChange() {
initFieldText();
}
}),
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")

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.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());
}
private CRPropertyDescriptor[] getCRPropertyDescriptor() throws IntrospectionException {
CRPropertyDescriptor[] crp = new CRPropertyDescriptor[] {
CRPropertyDescriptor [] sup = (CRPropertyDescriptor[]) ArrayUtils.addAll(new CRPropertyDescriptor[] {
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(
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"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced").setEditorClass(InChangeBooleanEditor.class)};
if (!toData().isAdaptive()) {

13
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).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced")},super.supportedDescriptor());
return (CRPropertyDescriptor[]) ArrayUtils.addAll(sup,
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(
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"), });

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

@ -18,6 +18,7 @@ import com.fr.design.mainframe.widget.editors.RegexEditor;
import com.fr.design.mainframe.widget.editors.WidgetValueEditor;
import com.fr.design.mainframe.widget.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(
Inter.getLocText(new String[]{"FR-Designer_Widget", "Value"})).setEditorClass(
WidgetValueEditor.class),
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(
Inter.getLocText("FR-Designer_WaterMark")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced"), });
CRPropertyDescriptor widgetValue=new CRPropertyDescriptor("widgetValue", this.data.getClass()).setI18NName(
Inter.getLocText(new String[]{"FR-Designer_Widget", "Value"})).setEditorClass(
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_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");
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