|
|
@ -16,8 +16,6 @@ import com.fr.general.Inter; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
import com.fr.stable.StringUtils; |
|
|
|
|
|
|
|
|
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.*; |
|
|
|
import javax.swing.event.DocumentEvent; |
|
|
|
|
|
|
|
import javax.swing.event.DocumentListener; |
|
|
|
|
|
|
|
import java.awt.*; |
|
|
|
import java.awt.*; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionEvent; |
|
|
|
import java.awt.event.ActionListener; |
|
|
|
import java.awt.event.ActionListener; |
|
|
@ -55,7 +53,6 @@ public class RegPane extends BasicPane { |
|
|
|
private RegPhonePane regPhonePane; |
|
|
|
private RegPhonePane regPhonePane; |
|
|
|
private DefaultRegPane defaultRegPane; |
|
|
|
private DefaultRegPane defaultRegPane; |
|
|
|
private CustomRegRexPane customRegRexPane; |
|
|
|
private CustomRegRexPane customRegRexPane; |
|
|
|
protected RegErrorMsgPane regErrorMsgPane; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public UIComboBox getRegComboBox() { |
|
|
|
public UIComboBox getRegComboBox() { |
|
|
@ -72,20 +69,24 @@ public class RegPane extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void initComponents() { |
|
|
|
private void initComponents() { |
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
JPanel contentPane = FRGUIPaneFactory.createBoxFlowInnerContainer_S_Pane(); |
|
|
|
|
|
|
|
this.setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5)); |
|
|
|
|
|
|
|
this.add(contentPane, BorderLayout.NORTH); |
|
|
|
|
|
|
|
contentPane.add(new UILabel(Inter.getLocText("FR-Designer_Input_Rule"))); |
|
|
|
|
|
|
|
regComboBox = new UIComboBox(regType); |
|
|
|
regComboBox = new UIComboBox(regType); |
|
|
|
regComboBox.setPreferredSize(new Dimension(140, 20)); |
|
|
|
|
|
|
|
regComboBox.setRenderer(listCellRender); |
|
|
|
regComboBox.setRenderer(listCellRender); |
|
|
|
UILabel uiLabel = new UILabel(); |
|
|
|
|
|
|
|
uiLabel.setPreferredSize(new Dimension(20, 20)); |
|
|
|
|
|
|
|
contentPane.add(uiLabel); |
|
|
|
|
|
|
|
contentPane.add(regComboBox); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
regErrorMsgPane = new RegErrorMsgPane(); |
|
|
|
double f = TableLayout.FILL; |
|
|
|
|
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Input_Rule") + " "), regComboBox}, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
double[] rowSize = {p}; |
|
|
|
|
|
|
|
double[] columnSize = {p, f}; |
|
|
|
|
|
|
|
int[][] rowCount = {{1, 1}}; |
|
|
|
|
|
|
|
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_LARGE, LayoutConstants.VGAP_LARGE); |
|
|
|
|
|
|
|
panel.setBorder(BorderFactory.createEmptyBorder(8, 0, 0, 0)); |
|
|
|
|
|
|
|
this.add(panel, BorderLayout.NORTH); |
|
|
|
|
|
|
|
|
|
|
|
final JPanel cardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); |
|
|
|
final JPanel cardPane = FRGUIPaneFactory.createCardLayout_S_Pane(); |
|
|
|
detailedCardLayout = new CardLayout(); |
|
|
|
detailedCardLayout = new CardLayout(); |
|
|
|
cardPane.setLayout(detailedCardLayout); |
|
|
|
cardPane.setLayout(detailedCardLayout); |
|
|
@ -93,35 +94,26 @@ public class RegPane extends BasicPane { |
|
|
|
cardPane.add((regLengthPane = new RegLengthPane()), "Length"); |
|
|
|
cardPane.add((regLengthPane = new RegLengthPane()), "Length"); |
|
|
|
cardPane.add((regPhonePane = new RegPhonePane()), "Phone"); |
|
|
|
cardPane.add((regPhonePane = new RegPhonePane()), "Phone"); |
|
|
|
cardPane.add((customRegRexPane = new CustomRegRexPane()), "Custom"); |
|
|
|
cardPane.add((customRegRexPane = new CustomRegRexPane()), "Custom"); |
|
|
|
|
|
|
|
cardPane.setBorder(BorderFactory.createEmptyBorder(8, 12, 0, 0)); |
|
|
|
this.add(cardPane, BorderLayout.CENTER); |
|
|
|
this.add(cardPane, BorderLayout.CENTER); |
|
|
|
this.add(regErrorMsgPane, BorderLayout.SOUTH); |
|
|
|
|
|
|
|
regComboBox.addActionListener(new ActionListener() { |
|
|
|
regComboBox.addActionListener(new ActionListener() { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
RegExp regExp = (RegExp) regComboBox.getSelectedItem(); |
|
|
|
RegExp regExp = (RegExp) regComboBox.getSelectedItem(); |
|
|
|
if (regExp instanceof PhoneReg) { |
|
|
|
if (regExp instanceof PhoneReg) { |
|
|
|
cardPane.setPreferredSize(new Dimension(220, 30)); |
|
|
|
|
|
|
|
Object selectItem = regPhonePane.dataTypeComboBox.getSelectedItem(); |
|
|
|
Object selectItem = regPhonePane.dataTypeComboBox.getSelectedItem(); |
|
|
|
String regString = selectItem == null ? StringUtils.EMPTY : selectItem.toString(); |
|
|
|
String regString = selectItem == null ? StringUtils.EMPTY : selectItem.toString(); |
|
|
|
firePhoneRegAction(regString); |
|
|
|
firePhoneRegAction(regString); |
|
|
|
detailedCardLayout.show(cardPane, "Phone"); |
|
|
|
detailedCardLayout.show(cardPane, "Phone"); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
if (regExp instanceof LengthReg) { |
|
|
|
if (regExp instanceof LengthReg) { |
|
|
|
cardPane.setPreferredSize(new Dimension(220, 60)); |
|
|
|
|
|
|
|
detailedCardLayout.show(cardPane, "Length"); |
|
|
|
detailedCardLayout.show(cardPane, "Length"); |
|
|
|
} else if (regExp instanceof CustomReg) { |
|
|
|
} else if (regExp instanceof CustomReg) { |
|
|
|
cardPane.setPreferredSize(new Dimension(220, 30)); |
|
|
|
|
|
|
|
detailedCardLayout.show(cardPane, "Custom"); |
|
|
|
detailedCardLayout.show(cardPane, "Custom"); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
cardPane.setPreferredSize(new Dimension(0,0 )); |
|
|
|
|
|
|
|
detailedCardLayout.show(cardPane, "Default"); |
|
|
|
detailedCardLayout.show(cardPane, "Default"); |
|
|
|
} |
|
|
|
} |
|
|
|
fireRegChangeAction(); |
|
|
|
fireRegChangeAction(); |
|
|
|
} |
|
|
|
} |
|
|
|
if(regExp instanceof NoneReg){ |
|
|
|
|
|
|
|
regErrorMsgPane.setVisible(false); |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
regErrorMsgPane.setVisible(true); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
@ -154,12 +146,11 @@ public class RegPane extends BasicPane { |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
defaultRegPane.populate(regex); |
|
|
|
defaultRegPane.populate(regex); |
|
|
|
} |
|
|
|
} |
|
|
|
regErrorMsgPane.populate(regex); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public RegExp update() { |
|
|
|
public RegExp update() { |
|
|
|
RegExp regExp = (RegExp) regComboBox.getSelectedItem(); |
|
|
|
RegExp regExp = (RegExp) regComboBox.getSelectedItem(); |
|
|
|
regErrorMsgPane.update(); |
|
|
|
|
|
|
|
if (regExp instanceof LengthReg) { |
|
|
|
if (regExp instanceof LengthReg) { |
|
|
|
return regLengthPane.update(); |
|
|
|
return regLengthPane.update(); |
|
|
|
} else if (regExp instanceof PhoneReg) { |
|
|
|
} else if (regExp instanceof PhoneReg) { |
|
|
@ -167,8 +158,7 @@ public class RegPane extends BasicPane { |
|
|
|
} else if (regExp instanceof NoneReg || regExp instanceof MailReg || regExp instanceof IDCardReg |
|
|
|
} else if (regExp instanceof NoneReg || regExp instanceof MailReg || regExp instanceof IDCardReg |
|
|
|
|| regExp instanceof PostCardReg || regExp instanceof PhoneReg || regExp instanceof MobileReg) { |
|
|
|
|| regExp instanceof PostCardReg || regExp instanceof PhoneReg || regExp instanceof MobileReg) { |
|
|
|
return regExp; |
|
|
|
return regExp; |
|
|
|
} |
|
|
|
} else if (regExp instanceof CustomReg) { |
|
|
|
else if (regExp instanceof CustomReg){ |
|
|
|
|
|
|
|
if (customRegRexPane.isEmpty()) { |
|
|
|
if (customRegRexPane.isEmpty()) { |
|
|
|
return new NoneReg(); |
|
|
|
return new NoneReg(); |
|
|
|
} |
|
|
|
} |
|
|
@ -213,10 +203,7 @@ public class RegPane extends BasicPane { |
|
|
|
* 添加电话规则监听器 |
|
|
|
* 添加电话规则监听器 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param listener 监听器 |
|
|
|
* @param listener 监听器 |
|
|
|
* |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @date 2014-12-3-下午7:30:55 |
|
|
|
* @date 2014-12-3-下午7:30:55 |
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void addPhoneRegListener(PhoneRegListener listener) { |
|
|
|
public void addPhoneRegListener(PhoneRegListener listener) { |
|
|
|
this.listenerList.add(PhoneRegListener.class, listener); |
|
|
|
this.listenerList.add(PhoneRegListener.class, listener); |
|
|
@ -226,10 +213,7 @@ public class RegPane extends BasicPane { |
|
|
|
* 移除电话规则监听器 |
|
|
|
* 移除电话规则监听器 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param listener 监听器 |
|
|
|
* @param listener 监听器 |
|
|
|
* |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @date 2014-12-3-下午7:30:55 |
|
|
|
* @date 2014-12-3-下午7:30:55 |
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void removePhoneRegListener(PhoneRegListener listener) { |
|
|
|
public void removePhoneRegListener(PhoneRegListener listener) { |
|
|
|
this.listenerList.remove(PhoneRegListener.class, listener); |
|
|
|
this.listenerList.remove(PhoneRegListener.class, listener); |
|
|
@ -239,10 +223,7 @@ public class RegPane extends BasicPane { |
|
|
|
* 添加正则监听器 |
|
|
|
* 添加正则监听器 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param listener 监听器 |
|
|
|
* @param listener 监听器 |
|
|
|
* |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @date 2014-12-3-下午7:29:48 |
|
|
|
* @date 2014-12-3-下午7:29:48 |
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void addRegChangeListener(RegChangeListener listener) { |
|
|
|
public void addRegChangeListener(RegChangeListener listener) { |
|
|
|
this.listenerList.add(RegChangeListener.class, listener); |
|
|
|
this.listenerList.add(RegChangeListener.class, listener); |
|
|
@ -252,10 +233,7 @@ public class RegPane extends BasicPane { |
|
|
|
* 移除正则监听器 |
|
|
|
* 移除正则监听器 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param listener 监听器 |
|
|
|
* @param listener 监听器 |
|
|
|
* |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @date 2014-12-3-下午7:29:48 |
|
|
|
* @date 2014-12-3-下午7:29:48 |
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public void removeRegChangeListener(RegChangeListener listener) { |
|
|
|
public void removeRegChangeListener(RegChangeListener listener) { |
|
|
|
this.listenerList.remove(RegChangeListener.class, listener); |
|
|
|
this.listenerList.remove(RegChangeListener.class, listener); |
|
|
@ -263,26 +241,33 @@ public class RegPane extends BasicPane { |
|
|
|
|
|
|
|
|
|
|
|
public class PhoneRegEvent extends EventObject { |
|
|
|
public class PhoneRegEvent extends EventObject { |
|
|
|
private String phoneRegString; |
|
|
|
private String phoneRegString; |
|
|
|
|
|
|
|
|
|
|
|
public PhoneRegEvent(Object source, String phoneRegString) { |
|
|
|
public PhoneRegEvent(Object source, String phoneRegString) { |
|
|
|
super(source); |
|
|
|
super(source); |
|
|
|
this.setPhoneRegString(phoneRegString); |
|
|
|
this.setPhoneRegString(phoneRegString); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setPhoneRegString(String phoneRegString) { |
|
|
|
public void setPhoneRegString(String phoneRegString) { |
|
|
|
this.phoneRegString = phoneRegString; |
|
|
|
this.phoneRegString = phoneRegString; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getPhoneRegString() { |
|
|
|
public String getPhoneRegString() { |
|
|
|
return phoneRegString; |
|
|
|
return phoneRegString; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public class RegChangeEvent extends EventObject { |
|
|
|
public class RegChangeEvent extends EventObject { |
|
|
|
private String regString; |
|
|
|
private String regString; |
|
|
|
|
|
|
|
|
|
|
|
public RegChangeEvent(Object source, String regString) { |
|
|
|
public RegChangeEvent(Object source, String regString) { |
|
|
|
super(source); |
|
|
|
super(source); |
|
|
|
this.setRegString(regString); |
|
|
|
this.setRegString(regString); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void setRegString(String regString) { |
|
|
|
public void setRegString(String regString) { |
|
|
|
this.regString = regString; |
|
|
|
this.regString = regString; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public String getRegString() { |
|
|
|
public String getRegString() { |
|
|
|
return regString; |
|
|
|
return regString; |
|
|
|
} |
|
|
|
} |
|
|
@ -294,10 +279,7 @@ public class RegPane extends BasicPane { |
|
|
|
* 电话规则变化监听 |
|
|
|
* 电话规则变化监听 |
|
|
|
* |
|
|
|
* |
|
|
|
* @param e 变化事件 |
|
|
|
* @param e 变化事件 |
|
|
|
* |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @date 2014-12-3-下午7:29:01 |
|
|
|
* @date 2014-12-3-下午7:29:01 |
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void phoneRegChangeAction(PhoneRegEvent e); |
|
|
|
void phoneRegChangeAction(PhoneRegEvent e); |
|
|
|
|
|
|
|
|
|
|
@ -308,12 +290,11 @@ public class RegPane extends BasicPane { |
|
|
|
/** |
|
|
|
/** |
|
|
|
* 正则表达规则变化监听 |
|
|
|
* 正则表达规则变化监听 |
|
|
|
* |
|
|
|
* |
|
|
|
* |
|
|
|
|
|
|
|
* @date 2014-12-3-下午7:29:01 |
|
|
|
* @date 2014-12-3-下午7:29:01 |
|
|
|
* |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
void regChangeAction(); |
|
|
|
void regChangeAction(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void firePhoneRegAction(String phoneReg) { |
|
|
|
protected void firePhoneRegAction(String phoneReg) { |
|
|
|
Object[] listeners = listenerList.getListenerList(); |
|
|
|
Object[] listeners = listenerList.getListenerList(); |
|
|
|
for (int i = listeners.length - 2; i >= 0; i -= 2) { |
|
|
|
for (int i = listeners.length - 2; i >= 0; i -= 2) { |
|
|
@ -322,6 +303,7 @@ public class RegPane extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
protected void fireRegChangeAction() { |
|
|
|
protected void fireRegChangeAction() { |
|
|
|
Object[] listeners = listenerList.getListenerList(); |
|
|
|
Object[] listeners = listenerList.getListenerList(); |
|
|
|
for (int i = listeners.length - 2; i >= 0; i -= 2) { |
|
|
|
for (int i = listeners.length - 2; i >= 0; i -= 2) { |
|
|
@ -330,6 +312,7 @@ public class RegPane extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private class RegPhonePane extends DisplayPane { |
|
|
|
private class RegPhonePane extends DisplayPane { |
|
|
|
private static final String EMB_REG1 = "025-85679591"; |
|
|
|
private static final String EMB_REG1 = "025-85679591"; |
|
|
|
private static final String EMB_REG2 = "02585679591"; |
|
|
|
private static final String EMB_REG2 = "02585679591"; |
|
|
@ -340,8 +323,8 @@ public class RegPane extends BasicPane { |
|
|
|
private UIComboBox dataTypeComboBox; |
|
|
|
private UIComboBox dataTypeComboBox; |
|
|
|
private final String[] dataType = {EMB_REG1, EMB_REG2, EMB_REG3, Inter.getLocText("FR-Designer_Custom")}; |
|
|
|
private final String[] dataType = {EMB_REG1, EMB_REG2, EMB_REG3, Inter.getLocText("FR-Designer_Custom")}; |
|
|
|
DefaultComboBoxModel DefaultComboBoxModel = new DefaultComboBoxModel(dataType); |
|
|
|
DefaultComboBoxModel DefaultComboBoxModel = new DefaultComboBoxModel(dataType); |
|
|
|
|
|
|
|
|
|
|
|
public RegPhonePane() { |
|
|
|
public RegPhonePane() { |
|
|
|
this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5)); |
|
|
|
|
|
|
|
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); |
|
|
|
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); |
|
|
|
this.add(new UILabel(Inter.getLocText("FR-Designer_Data_Type") + ":")); |
|
|
|
this.add(new UILabel(Inter.getLocText("FR-Designer_Data_Type") + ":")); |
|
|
|
dataTypeComboBox = new UIComboBox(DefaultComboBoxModel); |
|
|
|
dataTypeComboBox = new UIComboBox(DefaultComboBoxModel); |
|
|
@ -366,6 +349,7 @@ public class RegPane extends BasicPane { |
|
|
|
firePhoneRegAction(dataTypeComboBox.getSelectedItem().toString()); |
|
|
|
firePhoneRegAction(dataTypeComboBox.getSelectedItem().toString()); |
|
|
|
this.add(dataTypeComboBox); |
|
|
|
this.add(dataTypeComboBox); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
protected String title4PopupWindow() { |
|
|
|
protected String title4PopupWindow() { |
|
|
|
return "PHONE"; |
|
|
|
return "PHONE"; |
|
|
@ -402,30 +386,21 @@ public class RegPane extends BasicPane { |
|
|
|
private UISpinner maxLenSpinner; |
|
|
|
private UISpinner maxLenSpinner; |
|
|
|
|
|
|
|
|
|
|
|
public RegLengthPane() { |
|
|
|
public RegLengthPane() { |
|
|
|
this.setLayout(FRGUIPaneFactory.createBorderLayout()); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5)); |
|
|
|
|
|
|
|
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[][]{ |
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Min_Length") + ":"), minLenSpinner }, |
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Min_Length")), minLenSpinner}, |
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Max_Length") + ":"), maxLenSpinner}, |
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Max_Length")), maxLenSpinner}, |
|
|
|
}; |
|
|
|
}; |
|
|
|
double[] rowSize = {p, p}; |
|
|
|
double[] rowSize = {p, p}; |
|
|
|
double[] columnSize = {p, f}; |
|
|
|
double[] columnSize = {p, f}; |
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}}; |
|
|
|
int[][] rowCount = {{1, 1}, {1, 1}}; |
|
|
|
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, LayoutConstants.VGAP_SMALL, LayoutConstants.VGAP_MEDIUM); |
|
|
|
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 8, 5); |
|
|
|
this.add(panel); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.add(panel, BorderLayout.CENTER); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -461,11 +436,19 @@ public class RegPane extends BasicPane { |
|
|
|
private UITextField regTextField; |
|
|
|
private UITextField regTextField; |
|
|
|
|
|
|
|
|
|
|
|
public CustomRegRexPane() { |
|
|
|
public CustomRegRexPane() { |
|
|
|
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); |
|
|
|
this.setLayout(new BorderLayout()); |
|
|
|
this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5)); |
|
|
|
regTextField = new UITextField(12); |
|
|
|
this.add(new UILabel(Inter.getLocText("FR-Designer_Reg_Expressions") + ":")); |
|
|
|
|
|
|
|
regTextField = new UITextField(10); |
|
|
|
double f = TableLayout.FILL; |
|
|
|
this.add(regTextField); |
|
|
|
double p = TableLayout.PREFERRED; |
|
|
|
|
|
|
|
Component[][] components = new Component[][]{ |
|
|
|
|
|
|
|
new Component[]{new UILabel(Inter.getLocText("FR-Designer_Reg_Expressions")), regTextField}, |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
double[] rowSize = {p}; |
|
|
|
|
|
|
|
double[] columnSize = {p, f}; |
|
|
|
|
|
|
|
int[][] rowCount = {{1, 1}}; |
|
|
|
|
|
|
|
JPanel panel = TableLayoutHelper.createGapTableLayoutPane(components, rowSize, columnSize, rowCount, 2, 1); |
|
|
|
|
|
|
|
this.add(panel); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
@ -491,58 +474,6 @@ public class RegPane extends BasicPane { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static class RegErrorMsgPane extends DisplayPane{ |
|
|
|
|
|
|
|
private UITextField regErrorMsgField; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public RegErrorMsgPane(){ |
|
|
|
|
|
|
|
this.setLayout(FRGUIPaneFactory.createLabelFlowLayout()); |
|
|
|
|
|
|
|
initRegErrorMsgField(); |
|
|
|
|
|
|
|
// this.setBorder(BorderFactory.createEmptyBorder(5, 10, 5, 5));
|
|
|
|
|
|
|
|
this.add(new UILabel(Inter.getLocText("FR-Designer_Widget_Error_Tip") + ":")); |
|
|
|
|
|
|
|
regErrorMsgField = new UITextField(10); |
|
|
|
|
|
|
|
this.add(regErrorMsgField); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void initRegErrorMsgField(){ |
|
|
|
|
|
|
|
regErrorMsgField = new UITextField(13); |
|
|
|
|
|
|
|
regErrorMsgField.getDocument().addDocumentListener(new DocumentListener() { |
|
|
|
|
|
|
|
public void changedUpdate(DocumentEvent e) { |
|
|
|
|
|
|
|
regErrorMsgField.setToolTipText(regErrorMsgField.getText()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void insertUpdate(DocumentEvent e) { |
|
|
|
|
|
|
|
regErrorMsgField.setToolTipText(regErrorMsgField.getText()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void removeUpdate(DocumentEvent e) { |
|
|
|
|
|
|
|
regErrorMsgField.setToolTipText(regErrorMsgField.getText()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
protected String title4PopupWindow() { |
|
|
|
|
|
|
|
return "CUSTOM"; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public void populate(RegExp regRex) { |
|
|
|
|
|
|
|
if (!(regRex instanceof CustomReg)){ |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
regErrorMsgField.setText(regRex.toRegText()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public RegExp update() { |
|
|
|
|
|
|
|
return new CustomReg(regErrorMsgField.getText()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public boolean isEmpty() { |
|
|
|
|
|
|
|
return StringUtils.isEmpty(regErrorMsgField.getText()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ListCellRenderer listCellRender = new UIComboBoxRenderer() { |
|
|
|
ListCellRenderer listCellRender = new UIComboBoxRenderer() { |
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Component getListCellRendererComponent(JList list, Object value, |
|
|
|
public Component getListCellRendererComponent(JList list, Object value, |
|
|
|