Browse Source

控件校验完善其余控件整改

master
kerry 8 years ago
parent
commit
e0f10af32b
  1. 10
      designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java
  2. 7
      designer/src/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java
  3. 40
      designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java
  4. 12
      designer_form/src/com/fr/design/designer/creator/XFieldEditor.java
  5. 8
      designer_form/src/com/fr/design/designer/creator/XPassword.java
  6. 8
      designer_form/src/com/fr/design/designer/creator/XTextArea.java
  7. 8
      designer_form/src/com/fr/design/designer/creator/XTextEditor.java

10
designer/src/com/fr/design/widget/ui/CheckBoxDefinePane.java

@ -21,16 +21,6 @@ public class CheckBoxDefinePane extends AbstractDataModify<CheckBox> {
} }
private void iniComoponents() { private void iniComoponents() {
// this.setLayout(FRGUIPaneFactory.createBorderLayout());
//
// UILabel infoLabel = new UILabel();
// FRFont frFont = FRContext.getDefaultValues().getFRFont();
// infoLabel.setFont(new Font(frFont.getFamily(), Font.BOLD, 24));
// infoLabel.setText(Inter.getLocText(
// "No_Editor_Property_Definition") + ".");
// infoLabel.setHorizontalAlignment(SwingConstants.CENTER);
//
// this.add(infoLabel, BorderLayout.CENTER);
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8)); this.setBorder(BorderFactory.createEmptyBorder(0, 8, 0, 8));
JPanel textPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane(); JPanel textPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();

7
designer/src/com/fr/design/widget/ui/CheckBoxGroupDefinePane.java

@ -43,13 +43,6 @@ public class CheckBoxGroupDefinePane extends FieldEditorDefinePane<CheckBoxGroup
attrPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); attrPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Advanced")); JPanel advancedPane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("Advanced"));
advancedPane.add(attrPane); advancedPane.add(attrPane);
// JPanel northPane = FRGUIPaneFactory.createNormalFlowInnerContainer_S_Pane();
// checkBoxDictPane = new CheckBoxDictPane();
// northPane.add(checkBoxDictPane);
// checkbox = new UICheckBox(Inter.getLocText(new String[]{"Provide", "Choose_All"}));
// northPane.add(checkbox);
// attrPane.add(northPane, BorderLayout.NORTH);
JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane(); JPanel northPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0)); northPane.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
checkBoxDictPane = new CheckBoxDictPane(); checkBoxDictPane = new CheckBoxDictPane();

40
designer/src/com/fr/design/widget/ui/DateEditorDefinePane.java

@ -36,8 +36,6 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
private UILabel sampleLabel;// preview private UILabel sampleLabel;// preview
// content // content
private UITextField patternTextField = null; private UITextField patternTextField = null;
// private JList patternList = null;
private ValueEditorPane startDv; private ValueEditorPane startDv;
private ValueEditorPane endDv; private ValueEditorPane endDv;
@ -68,9 +66,6 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
otherContentPane.add(firstPanel); otherContentPane.add(firstPanel);
// sample pane // sample pane
// JPanel samplePane = FRGUIPaneFactory.createTitledBorderPane(Inter.getLocText("StyleFormat-Sample"));
// otherContentPane.add(samplePane, BorderLayout.NORTH);
sampleLabel = new UILabel(""); sampleLabel = new UILabel("");
// samplePane.add(sampleLabel, BorderLayout.CENTER); // samplePane.add(sampleLabel, BorderLayout.CENTER);
sampleLabel.setBorder(BorderFactory.createEmptyBorder(2, 4, 4, 4)); sampleLabel.setBorder(BorderFactory.createEmptyBorder(2, 4, 4, 4));
@ -78,26 +73,10 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
sampleLabel.setFont(FRContext.getDefaultValues().getFRFont()); sampleLabel.setFont(FRContext.getDefaultValues().getFRFont());
// content pane // content pane
// JPanel contentPane = FRGUIPaneFactory.createBorderLayout_S_Pane();
// contentPane.setPreferredSize(new Dimension(400,100));
// otherContentPane.add(contentPane, BorderLayout.CENTER);
// contentPane.setBorder(BorderFactory.createEmptyBorder(4, 0, 2, 0));
patternTextField = new UITextField(); patternTextField = new UITextField();
// contentPane.add(patternTextField, BorderLayout.NORTH);
patternTextField.getDocument().addDocumentListener(patternTextDocumentListener); patternTextField.getDocument().addDocumentListener(patternTextDocumentListener);
// patternList = new JList(new DefaultListModel());
// DefaultListModel model = (DefaultListModel) patternList.getModel();
// model.removeAllElements();
String[] arr = getDateFormateArray(); String[] arr = getDateFormateArray();
// for (int i = 0; i < arr.length; i++) {
// model.addElement(arr[i]);
// }
// JScrollPane pScrollPane = new JScrollPane(patternList);
// pScrollPane.setPreferredSize(new Dimension(100, 120));
// contentPane.add(pScrollPane, BorderLayout.CENTER);
UIComboBox comboBox = new UIComboBox(arr); UIComboBox comboBox = new UIComboBox(arr);
comboBox.setPreferredSize(new Dimension(150,20)); comboBox.setPreferredSize(new Dimension(150,20));
comboBox.addActionListener(new ActionListener(){ comboBox.addActionListener(new ActionListener(){
@ -109,7 +88,6 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
JPanel secondPanel = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"),comboBox,sampleLabel}, FlowLayout.LEFT, 5); JPanel secondPanel = GUICoreUtils.createFlowPane(new JComponent[]{new UILabel(Inter.getLocText("FR-Engine_Format") + ":"),comboBox,sampleLabel}, FlowLayout.LEFT, 5);
secondPanel.setPreferredSize(new Dimension(220,30)); secondPanel.setPreferredSize(new Dimension(220,30));
otherContentPane.add(secondPanel); otherContentPane.add(secondPanel);
// patternList.addListSelectionListener(patternListSelectionListener);
otherContentPane.add(initStartEndDatePane(), BorderLayout.SOUTH); otherContentPane.add(initStartEndDatePane(), BorderLayout.SOUTH);
return otherContentPane; return otherContentPane;
} }
@ -166,12 +144,6 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
} }
} }
// private ListSelectionListener patternListSelectionListener = new ListSelectionListener() {
// public void valueChanged(ListSelectionEvent evt) {
// patternTextField.setText((String) patternList.getSelectedValue());
// }
// };
@Override @Override
protected void populateSubDirectWriteEditorBean(DateEditor e) { protected void populateSubDirectWriteEditorBean(DateEditor e) {
String formatText = e.getFormatText(); String formatText = e.getFormatText();
@ -180,18 +152,6 @@ public class DateEditorDefinePane extends DirectWriteEditorDefinePane<DateEditor
returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 1 : 0); returnTypeComboBox.setSelectedIndex(e.isReturnDate() ? 1 : 0);
populateStartEnd(e); populateStartEnd(e);
// DefaultListModel patternModel = (DefaultListModel) patternList.getModel();
// if ((formatText == null || formatText.length() <= 0)) {
// patternList.setSelectedIndex(0);
// } else {
// for (int i = 0; i < patternModel.size(); i++) {
// if (ComparatorUtils.equals(patternModel.getElementAt(i).toString(), formatText)) {
// patternList.setSelectedIndex(i);
// return;
// }
// }
// }
}; };
@Override @Override

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

@ -13,8 +13,11 @@ import javax.swing.border.Border;
import com.fr.design.mainframe.widget.editors.InChangeBooleanEditor; import com.fr.design.mainframe.widget.editors.InChangeBooleanEditor;
import com.fr.form.ui.FieldEditor; import com.fr.form.ui.FieldEditor;
import com.fr.design.form.util.XCreatorConstants; import com.fr.design.form.util.XCreatorConstants;
import com.fr.form.ui.TextEditor;
import com.fr.form.ui.reg.RegExp;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
/** /**
* @author richer * @author richer
@ -49,4 +52,13 @@ public abstract class XFieldEditor extends XWidgetCreator {
new CRPropertyDescriptor[]{allowBlank, blankErrorMsg, fontSize} new CRPropertyDescriptor[]{allowBlank, blankErrorMsg, fontSize}
: new CRPropertyDescriptor[]{allowBlank, fontSize}; : new CRPropertyDescriptor[]{allowBlank, fontSize};
} }
public Boolean isDisplayRegField(Boolean displayRegField) {
RegExp reg = ((TextEditor) toData()).getRegex();
if (reg == null || !StringUtils.isNotEmpty(reg.toRegText())) {
displayRegField = false;
}
return displayRegField;
}
} }

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

@ -14,11 +14,8 @@ import com.fr.design.mainframe.widget.editors.RegexEditor;
import com.fr.design.mainframe.widget.editors.WidgetValueEditor; import com.fr.design.mainframe.widget.editors.WidgetValueEditor;
import com.fr.design.mainframe.widget.renderer.RegexCellRencerer; import com.fr.design.mainframe.widget.renderer.RegexCellRencerer;
import com.fr.form.ui.Password; import com.fr.form.ui.Password;
import com.fr.form.ui.TextEditor;
import com.fr.form.ui.reg.RegExp;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.StringUtils;
/** /**
* @author richer * @author richer
@ -68,10 +65,7 @@ public class XPassword extends XWrapperedFieldEditor {
.setI18NName(Inter.getLocText("FR-Designer_WaterMark")) .setI18NName(Inter.getLocText("FR-Designer_WaterMark"))
.putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced"); .putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, "Advanced");
Boolean displayRegField = true; Boolean displayRegField = true;
RegExp reg = ((TextEditor) toData()).getRegex(); displayRegField = isDisplayRegField(displayRegField);
if (reg == null || !StringUtils.isNotEmpty(reg.toRegText())) {
displayRegField = false;
}
return displayRegField ? (CRPropertyDescriptor[]) ArrayUtils.addAll(sup, new CRPropertyDescriptor[]{regex, regErrorMessage, waterMark}) : return displayRegField ? (CRPropertyDescriptor[]) ArrayUtils.addAll(sup, new CRPropertyDescriptor[]{regex, regErrorMessage, waterMark}) :
(CRPropertyDescriptor[]) ArrayUtils.addAll(sup, new CRPropertyDescriptor[]{regex, waterMark}); (CRPropertyDescriptor[]) ArrayUtils.addAll(sup, new CRPropertyDescriptor[]{regex, waterMark});
} }

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

@ -19,13 +19,10 @@ import com.fr.design.mainframe.widget.editors.WidgetValueEditor;
import com.fr.design.mainframe.widget.renderer.RegexCellRencerer; import com.fr.design.mainframe.widget.renderer.RegexCellRencerer;
import com.fr.form.ui.TextArea; import com.fr.form.ui.TextArea;
import com.fr.design.form.util.XCreatorConstants; import com.fr.design.form.util.XCreatorConstants;
import com.fr.form.ui.TextEditor;
import com.fr.form.ui.reg.RegExp;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
/** /**
* @author richer * @author richer
@ -53,10 +50,7 @@ public class XTextArea extends XFieldEditor {
Inter.getLocText("WaterMark")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY, Inter.getLocText("WaterMark")).putKeyValue(XCreatorConstants.PROPERTY_CATEGORY,
"Advanced"); "Advanced");
Boolean displayRegField = true; Boolean displayRegField = true;
RegExp reg = ((TextEditor) toData()).getRegex(); displayRegField = isDisplayRegField(displayRegField);
if (reg == null || !StringUtils.isNotEmpty(reg.toRegText())) {
displayRegField = false;
}
return displayRegField ? (CRPropertyDescriptor[]) ArrayUtils.addAll(sup, new CRPropertyDescriptor[]{regex, regErrorMessage, waterMark}) : return displayRegField ? (CRPropertyDescriptor[]) ArrayUtils.addAll(sup, new CRPropertyDescriptor[]{regex, regErrorMessage, waterMark}) :
(CRPropertyDescriptor[]) ArrayUtils.addAll(sup, new CRPropertyDescriptor[]{regex, waterMark}); (CRPropertyDescriptor[]) ArrayUtils.addAll(sup, new CRPropertyDescriptor[]{regex, waterMark});
} }

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

@ -18,12 +18,10 @@ import com.fr.design.mainframe.widget.editors.RegexEditor;
import com.fr.design.mainframe.widget.editors.WidgetValueEditor; import com.fr.design.mainframe.widget.editors.WidgetValueEditor;
import com.fr.design.mainframe.widget.renderer.RegexCellRencerer; import com.fr.design.mainframe.widget.renderer.RegexCellRencerer;
import com.fr.form.ui.TextEditor; import com.fr.form.ui.TextEditor;
import com.fr.form.ui.reg.RegExp;
import com.fr.general.FRFont; import com.fr.general.FRFont;
import com.fr.general.Inter; import com.fr.general.Inter;
import com.fr.stable.ArrayUtils; import com.fr.stable.ArrayUtils;
import com.fr.stable.Constants; import com.fr.stable.Constants;
import com.fr.stable.StringUtils;
/** /**
* @author richer * @author richer
@ -56,11 +54,7 @@ public class XTextEditor extends XWrapperedFieldEditor {
"Advanced"); "Advanced");
CRPropertyDescriptor[] sup = (CRPropertyDescriptor[]) ArrayUtils.addAll(new CRPropertyDescriptor[]{widgetValue}, super.supportedDescriptor()); CRPropertyDescriptor[] sup = (CRPropertyDescriptor[]) ArrayUtils.addAll(new CRPropertyDescriptor[]{widgetValue}, super.supportedDescriptor());
Boolean displayRegField = true; Boolean displayRegField = true;
RegExp reg = ((TextEditor) toData()).getRegex(); displayRegField = isDisplayRegField(displayRegField);
if (reg == null || !StringUtils.isNotEmpty(reg.toRegText())) {
displayRegField = false;
}
return displayRegField ? (CRPropertyDescriptor[]) ArrayUtils.addAll(sup, return displayRegField ? (CRPropertyDescriptor[]) ArrayUtils.addAll(sup,
new CRPropertyDescriptor[]{regex, regErrorMessage, waterMark}) : new CRPropertyDescriptor[]{regex, regErrorMessage, waterMark}) :
(CRPropertyDescriptor[]) ArrayUtils.addAll(sup, new CRPropertyDescriptor[]{regex, waterMark}); (CRPropertyDescriptor[]) ArrayUtils.addAll(sup, new CRPropertyDescriptor[]{regex, waterMark});

Loading…
Cancel
Save