📄 getenumvaluefromfileordb.java
字号:
}
private boolean isOK = false;
protected void onOK() {
isOK = true;
this.dispose();
}
/**
* This method initializes btnCancel
*
* @return com.testDataBuilder.ui.core.JTDButton
*/
private JTDButton getBtnCancel() {
if (btnCancel == null) {
btnCancel = new JTDButton();
btnCancel.setBounds(new Rectangle(354, 269, 65, 20));
btnCancel.setText(RM.R("label.info.btnCancel")); //$NON-NLS-1$
btnCancel.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
GetEnumValueFromFileOrDB.this.dispose();
}
});
}
return btnCancel;
}
/**
* This method initializes btnFromDB
*
* @return com.testDataBuilder.ui.core.JTDButton
*/
private JTDButton getBtnFromDB() {
if (btnFromDB == null) {
btnFromDB = new JTDButton();
btnFromDB.setBounds(new Rectangle(313, 44, 79, 22));
btnFromDB.setText(RM.R("label.GetEnumValueFromFileOrDB.btnFromDB")); //$NON-NLS-1$
btnFromDB.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
GetEnumValueFromFileOrDB.this.showFromDBPanel();
}
});
}
return btnFromDB;
}
protected void showFromDBPanel() {
this.getJTabbedPane().setSelectedIndex(2);
}
public EnumList getEnumList() {
return enumList;
}
public void setEnumList(EnumList enumList) {
this.enumList = enumList;
}
/**
* This method initializes btnClearAll
*
* @return com.testDataBuilder.ui.core.JTDButton
*/
private JTDButton getBtnClearAll() {
if (btnClearAll == null) {
btnClearAll = new JTDButton();
btnClearAll.setBounds(new Rectangle(317, 198, 73, 24));
btnClearAll.setText(RM.R("label.GetEnumValueFromFileOrDB.btnClear")); //$NON-NLS-1$
btnClearAll.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
GetEnumValueFromFileOrDB.this.clearAll();
}
});
}
return btnClearAll;
}
protected void clearAll() {
this.getJEnumTable().getData().clear();
this.getJEnumTable().updateUI();
}
/**
* This method initializes jInnerPanel1
*
* @return javax.swing.JPanel
*/
private JPanel getJInnerPanel1() {
if (jInnerPanel1 == null) {
jLabel = new JLabel();
jLabel.setBounds(new Rectangle(15, 12, 57, 23));
jLabel.setText(RM.R("label.GetEnumValueFromFileOrDB.file")); //$NON-NLS-1$
jInnerPanel1 = new JPanel();
jInnerPanel1.setLayout(null);
jInnerPanel1.setBounds(new Rectangle(12, 12, 408, 248));
jInnerPanel1.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));
jInnerPanel1.add(jLabel, null);
jInnerPanel1.add(getTxtFilePath(), null);
jInnerPanel1.add(getBtnSelFile(), null);
jInnerPanel1.add(getRadioLineFeed(), null);
jInnerPanel1.add(getRadioComma(), null);
jInnerPanel1.add(getRadioSemicolon(), null);
jInnerPanel1.add(getRadioOther(), null);
jInnerPanel1.add(getTxtOther(), null);
this.getRadioGroup().add(getRadioLineFeed());
this.getRadioGroup().add(getRadioComma());
this.getRadioGroup().add(getRadioSemicolon());
this.getRadioGroup().add(getRadioOther());
}
return jInnerPanel1;
}
/**
* This method initializes innerPanel2
*
* @return javax.swing.JPanel
*/
private JPanel getInnerPanel2() {
if (innerPanel2 == null) {
innerPanel2 = new JPanel();
innerPanel2.setLayout(new GridBagLayout());
innerPanel2.setBounds(new Rectangle(12, 12, 408, 248));
innerPanel2.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.RAISED));
}
return innerPanel2;
}
/**
* This method initializes txtFilePath
*
* @return javax.swing.JTextField
*/
private JTextField getTxtFilePath() {
if (txtFilePath == null) {
txtFilePath = new JTextField();
txtFilePath.setBounds(new Rectangle(76, 13, 291, 21));
}
return txtFilePath;
}
/**
* This method initializes btnSelFile
*
* @return com.testDataBuilder.ui.core.JTDButton
*/
private JTDButton getBtnSelFile() {
if (btnSelFile == null) {
btnSelFile = new JTDButton();
btnSelFile.setBounds(new Rectangle(376, 13, 21, 20));
btnSelFile.setText("..."); //$NON-NLS-1$
btnSelFile.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
GetEnumValueFromFileOrDB.this.selTxtFile();
}
});
}
return btnSelFile;
}
protected void selTxtFile() {
JFileChooser txtFileChooser = new JFileChooser(this.getTxtFilePath().getText());
FileFilter filter =
new FileFilter(){
@Override
public boolean accept(File f) {
return f.getAbsolutePath().endsWith(".txt"); //$NON-NLS-1$
}
@Override
public String getDescription() {
return RM.R("label.GetEnumValueFromFileOrDB.txtFile"); //$NON-NLS-1$
}
};
txtFileChooser.setFileFilter(filter);
txtFileChooser.setDialogTitle(RM.R("label.GetEnumValueFromFileOrDB.FileChooser.title")); //$NON-NLS-1$
txtFileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
if (txtFileChooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
String txtFile = txtFileChooser.getSelectedFile().getAbsolutePath();
this.getTxtFilePath().setText(txtFile);
}
}
/**
* This method initializes radioLineFeed
*
* @return javax.swing.JRadioButton
*/
private JRadioButton getRadioLineFeed() {
if (radioLineFeed == null) {
radioLineFeed = new JRadioButton();
radioLineFeed.setBounds(new Rectangle(12, 49, 106, 25));
radioLineFeed.setText(RM.R("label.GetEnumValueFromFileOrDB.enterOrNewLine")); //$NON-NLS-1$
radioLineFeed.setSelected(true);
}
return radioLineFeed;
}
private ButtonGroup getRadioGroup(){
if(radioGroup == null){
radioGroup = new ButtonGroup();
}
return radioGroup;
}
/**
* This method initializes radioComma
*
* @return javax.swing.JRadioButton
*/
private JRadioButton getRadioComma() {
if (radioComma == null) {
radioComma = new JRadioButton();
radioComma.setBounds(new Rectangle(125, 52, 97, 19));
radioComma.setText(RM.R("label.GetEnumValueFromFileOrDB.comma")); //$NON-NLS-1$
}
return radioComma;
}
/**
* This method initializes radioSemicolon
*
* @return javax.swing.JRadioButton
*/
private JRadioButton getRadioSemicolon() {
if (radioSemicolon == null) {
radioSemicolon = new JRadioButton();
radioSemicolon.setBounds(new Rectangle(226, 52, 130, 19));
radioSemicolon.setText(RM.R("label.GetEnumValueFromFileOrDB.semicolon")); //$NON-NLS-1$
}
return radioSemicolon;
}
/**
* This method initializes radioOther
*
* @return javax.swing.JRadioButton
*/
private JRadioButton getRadioOther() {
if (radioOther == null) {
radioOther = new JRadioButton();
radioOther.setBounds(new Rectangle(13, 74, 66, 25));
radioOther.setText(RM.R("label.GetEnumValueFromFileOrDB.other")); //$NON-NLS-1$
radioOther.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent e) {
GetEnumValueFromFileOrDB.this.onOtherRadio();
}
});
}
return radioOther;
}
protected void onOtherRadio() {
this.getTxtOther().setEnabled(this.getRadioOther().isSelected());
}
protected String getSep(){
String sep = null;
if(this.getRadioLineFeed().isSelected()){
sep = System.getProperty("line.separator"); //$NON-NLS-1$
}else if(this.getRadioComma().isSelected()){
sep = ","; //$NON-NLS-1$
}else if(this.getRadioSemicolon().isSelected()){
sep = ";"; //$NON-NLS-1$
}else if(this.getRadioOther().isSelected()){
sep = this.getTxtOther().getText();
}
return sep;
}
/**
* This method initializes txtOther
*
* @return javax.swing.JTextField
*/
private JTextField getTxtOther() {
if (txtOther == null) {
txtOther = new JTextField();
txtOther.setBounds(new Rectangle(106, 78, 170, 20));
txtOther.setEnabled(false);
}
return txtOther;
}
public boolean isOK() {
return isOK;
}
public void setOK(boolean isOK) {
this.isOK = isOK;
}
} // @jve:decl-index=0:visual-constraint="10,10"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -