Browse Source

解决冲突

master
kerry 7 years ago
parent
commit
2bbe2d14fa
  1. 57
      designer_base/src/com/fr/design/gui/frpane/RegPane.java

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

@ -28,22 +28,22 @@ import java.util.EventObject;
public class RegPane extends BasicPane { public class RegPane extends BasicPane {
public static final RegExp[] ALL_REG_TYPE = { public static final RegExp[] ALL_REG_TYPE = {
new NoneReg(), new NoneReg(),
//new RequiredReg(), //new RequiredReg(),
new LengthReg(), new LengthReg(),
//new FloatReg(), //new FloatReg(),
new MailReg(), new MailReg(),
new IDCardReg(), new IDCardReg(),
new PostCardReg(), new PostCardReg(),
new PhoneReg(), new PhoneReg(),
new MobileReg(), new MobileReg(),
new CustomReg() new CustomReg()
}; };
public static final RegExp[] TEXTAREA_REG_TYPE = { public static final RegExp[] TEXTAREA_REG_TYPE = {
new NoneReg(), new NoneReg(),
new LengthReg(), new LengthReg(),
new CustomReg() new CustomReg()
}; };
public static final RegExp[] PASSWORD_REG_TYPE = TEXTAREA_REG_TYPE; public static final RegExp[] PASSWORD_REG_TYPE = TEXTAREA_REG_TYPE;
@ -342,11 +342,10 @@ public class RegPane extends BasicPane {
DefaultComboBoxModel DefaultComboBoxModel= new DefaultComboBoxModel(dataType); DefaultComboBoxModel DefaultComboBoxModel= new DefaultComboBoxModel(dataType);
public RegPhonePane() { public RegPhonePane() {
this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5)); this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5));
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
this.add(new UILabel(Inter.getLocText("FR-Designer_Data_Type") + ":"));
dataTypeComboBox = new UIComboBox(DefaultComboBoxModel); dataTypeComboBox = new UIComboBox(DefaultComboBoxModel);
JTextField editFiled = (JTextField)(dataTypeComboBox.getEditor().getEditorComponent()); JTextField editFiled = (JTextField)(dataTypeComboBox.getEditor().getEditorComponent());
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Data_Type")), dataTypeComboBox}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7);
this.add(panel);
editFiled.setDocument(new LimitedDocument(LIMIT_LENGTH, REG_PATTERN)); editFiled.setDocument(new LimitedDocument(LIMIT_LENGTH, REG_PATTERN));
dataTypeComboBox.addItemListener(new ItemListener() { dataTypeComboBox.addItemListener(new ItemListener() {
@Override @Override
@ -365,6 +364,7 @@ public class RegPane extends BasicPane {
}); });
dataTypeComboBox.setSelectedIndex(0); dataTypeComboBox.setSelectedIndex(0);
firePhoneRegAction(dataTypeComboBox.getSelectedItem().toString()); firePhoneRegAction(dataTypeComboBox.getSelectedItem().toString());
this.add(dataTypeComboBox);
} }
@Override @Override
protected String title4PopupWindow() { protected String title4PopupWindow() {
@ -405,8 +405,14 @@ public class RegPane extends BasicPane {
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createBorderLayout());
this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5)); this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5));
this.setPreferredSize(new Dimension(210, 56)); this.setPreferredSize(new Dimension(210, 56));
// this.add(new UILabel(Inter.getLocText("FR-Designer_Reg_Min_Length") + ":"));
minLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0); minLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
// this.add(minLenSpinner);
// this.add(new UILabel(Inter.getLocText("FR-Designer_Reg_Max_Length") + ":"));
maxLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0); maxLenSpinner = new UISpinner(0, Integer.MAX_VALUE, 1, 0);
// this.add(maxLenSpinner);
double f = TableLayout.FILL; double f = TableLayout.FILL;
double p = TableLayout.PREFERRED; double p = TableLayout.PREFERRED;
Component[][] components = new Component[][]{ Component[][] components = new Component[][]{
@ -455,11 +461,11 @@ public class RegPane extends BasicPane {
private UITextField regTextField; private UITextField regTextField;
public CustomRegRexPane(){ public CustomRegRexPane(){
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5)); this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5));
regTextField = new UITextField(); this.add(new UILabel(Inter.getLocText("FR-Designer_Reg_Expressions") + ":"));
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Expressions")), regTextField}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); regTextField = new UITextField(10);
this.add(panel); this.add(regTextField);
} }
@Override @Override
@ -489,15 +495,16 @@ public class RegPane extends BasicPane {
private UITextField regErrorMsgField; private UITextField regErrorMsgField;
public RegErrorMsgPane(){ public RegErrorMsgPane(){
this.setLayout(FRGUIPaneFactory.createBorderLayout()); this.setLayout(FRGUIPaneFactory.createLabelFlowLayout());
this.setBorder(BorderFactory.createEmptyBorder(5,0,0,0));
initRegErrorMsgField(); initRegErrorMsgField();
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(new Component[][]{new Component[]{new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip")), regErrorMsgField}}, TableLayoutHelper.FILL_LASTCOLUMN, 18, 7); // this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5));
this.add(panel); this.add(new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip") + ":"));
regErrorMsgField = new UITextField(10);
this.add(regErrorMsgField);
} }
private void initRegErrorMsgField(){ private void initRegErrorMsgField(){
regErrorMsgField = new UITextField(); regErrorMsgField = new UITextField(13);
regErrorMsgField.getDocument().addDocumentListener(new DocumentListener() { regErrorMsgField.getDocument().addDocumentListener(new DocumentListener() {
public void changedUpdate(DocumentEvent e) { public void changedUpdate(DocumentEvent e) {
regErrorMsgField.setToolTipText(regErrorMsgField.getText()); regErrorMsgField.setToolTipText(regErrorMsgField.getText());

Loading…
Cancel
Save