📄 stepadvancepanel.java
字号:
package com.jobcn.ui;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.io.File;
import javax.swing.*;
import com.jobcn.control.Constant;
/**
* <p>
* Title: 卓博营运支撑系统
* </p>
*
* <p>
* Description: 为本企业内部运作提供支撑,为企业資源的E化管理提供解決方案
* </p>
*
* <p>
* Copyright: Copyright (c) 2006
* </p>
*
* <p>
* Company: 卓博信息科技有限公司
* </p>
*
* @author Henry
* @version 1.0
*/
public class StepAdvancePanel extends JPanel {
/**
* Create the panel
*/
public StepAdvancePanel() {
super();
setLayout(null);
final JSeparator separator_3 = new JSeparator();
separator_3.setBounds(6, 344, 525, 1);
add(separator_3);
final JLabel successLabel = new JLabel();
successLabel.setFont(new Font("", Font.PLAIN, 12));
successLabel.setText("如果任务执行成功");
successLabel.setBounds(35, 31, 107, 22);
add(successLabel);
successAction = new JComboBox(Constant.stepSuccessAction);
successAction.setFont(new Font("", Font.PLAIN, 12));
successAction.setBounds(158, 30, 302, 21);
add(successAction);
final JLabel retestLabel = new JLabel();
retestLabel.setFont(new Font("", Font.PLAIN, 12));
retestLabel.setHorizontalAlignment(SwingConstants.CENTER);
retestLabel.setText("重试");
retestLabel.setBounds(31, 64, 107, 22);
add(retestLabel);
final JLabel failureLabel = new JLabel();
failureLabel.setFont(new Font("", Font.PLAIN, 12));
failureLabel.setText("如果任务执行失败");
failureLabel.setBounds(32, 93, 107, 22);
add(failureLabel);
failureAction = new JComboBox(Constant.stepFailureAction);
failureAction.setFont(new Font("", Font.PLAIN, 12));
failureAction.setBounds(157, 96, 307, 21);
add(failureAction);
final JLabel intevalLabel = new JLabel();
intevalLabel.setFont(new Font("", Font.PLAIN, 12));
intevalLabel.setHorizontalAlignment(SwingConstants.CENTER);
intevalLabel.setText("重试间隔");
intevalLabel.setBounds(261, 62, 107, 22);
add(intevalLabel);
retestSpinner = new JSpinner();
retestSpinner.setFont(new Font("", Font.PLAIN, 12));
retestSpinner.setBounds(158, 64, 77, 19);
add(retestSpinner);
invtvalSpinner = new JSpinner();
invtvalSpinner.setFont(new Font("", Font.PLAIN, 12));
invtvalSpinner.setBounds(387, 61, 77, 19);
add(invtvalSpinner);
final JLabel outputLabel = new JLabel();
outputLabel.setFont(new Font("", Font.PLAIN, 12));
outputLabel.setHorizontalAlignment(SwingConstants.CENTER);
outputLabel.setText("输出文件");
outputLabel.setBounds(30, 222, 107, 22);
add(outputLabel);
outputFile = new JTextField();
outputFile.setFont(new Font("", Font.PLAIN, 12));
outputFile.setBounds(152, 225, 252, 21);
add(outputFile);
final JButton openFile = new JButton();
openFile.setFont(new Font("", Font.PLAIN, 12));
openFile.setText("...");
openFile.setBounds(423, 224, 39, 23);
add(openFile);
fc = new JFileChooser();
fc.setDialogTitle("选择输出文件");
openFile.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
int returnVal = fc.showDialog(StepAdvancePanel.this, "选择");
if (returnVal == JFileChooser.APPROVE_OPTION) {
File file = fc.getSelectedFile();
outputFile.setText(file.getName());
}
}
});
final JSeparator sepMonitor = new JSeparator();
sepMonitor.setFont(new Font("", Font.PLAIN, 12));
sepMonitor.setName("任务执行监听");
sepMonitor.setBounds(85, 16, 445, 1);
add(sepMonitor);
final JLabel monitorLabel = new JLabel();
monitorLabel.setFont(new Font("", Font.PLAIN, 12));
monitorLabel.setHorizontalAlignment(SwingConstants.TRAILING);
monitorLabel.setBounds(4, 3, 83, 24);
add(monitorLabel);
monitorLabel.setText("任务执行监听");
final JSeparator sepLog = new JSeparator();
sepLog.setFont(new Font("", Font.PLAIN, 12));
sepLog.setName("任务执行监听");
sepLog.setBounds(60, 198, 470, 1);
add(sepLog);
final JLabel logLabel = new JLabel();
logLabel.setFont(new Font("", Font.PLAIN, 12));
logLabel.setHorizontalAlignment(SwingConstants.TRAILING);
logLabel.setText("记录日志");
logLabel.setBounds(1, 185, 58, 24);
add(logLabel);
}
private JTextField outputFile;
private JSpinner invtvalSpinner;
private JSpinner retestSpinner;
private JComboBox failureAction;
private JComboBox successAction;
private JFileChooser fc;
public JComboBox getFailureAction() {
return failureAction;
}
public void setFailureAction(JComboBox failureAction) {
this.failureAction = failureAction;
}
public JTextField getOutputFile() {
return outputFile;
}
public void setOutputFile(JTextField outputFile) {
this.outputFile = outputFile;
}
public JComboBox getSuccessAction() {
return successAction;
}
public void setSuccessAction(JComboBox successAction) {
this.successAction = successAction;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -