package com.vci.client.workflow.template;
|
|
import javax.swing.JFileChooser;
|
|
import com.vci.client.LogonApplication;
|
import com.vci.client.ui.swing.components.VCIJDialog;
|
|
/**
|
* 导出模板文件
|
* @author liudi
|
*
|
* 2013-8-7
|
*/
|
public class FileChooseDiaog extends VCIJDialog {
|
|
private JFileChooser fileChooser = new JFileChooser();
|
private String filepath = "";
|
private String fileName = "";
|
private String flag = "";
|
|
public JFileChooser getFileChooser() {
|
return fileChooser;
|
}
|
|
public void setFileChooser(JFileChooser fileChooser) {
|
this.fileChooser = fileChooser;
|
}
|
|
public String getFileName() {
|
return fileName;
|
}
|
|
public void setFileName(String fileName) {
|
this.fileName = fileName;
|
}
|
|
public String getFilepath() {
|
return filepath;
|
}
|
|
public void setFilepath(String filepath) {
|
this.filepath = filepath;
|
}
|
|
public FileChooseDiaog(String flag){
|
super(LogonApplication.frame, true);
|
this.flag = flag;
|
init();
|
}
|
|
private void init(){
|
this.getContentPane().add(fileChooser);
|
if("export".equals(flag)){
|
fileChooser.setDialogType(JFileChooser.SAVE_DIALOG);
|
int result = fileChooser.showSaveDialog(this); // 打开"打开文件"对话框
|
if (result == JFileChooser.OPEN_DIALOG) {
|
filepath = fileChooser.getCurrentDirectory().toString();
|
fileName = fileChooser.getSelectedFile().getName();
|
System.out.println("filepath = " + filepath+":fileName = "+fileName);
|
}
|
}else if("import".equals(flag)){
|
int result = fileChooser.showOpenDialog(this); // 打开"打开文件"对话框
|
if (result == JFileChooser.OPEN_DIALOG) {
|
filepath = fileChooser.getCurrentDirectory().toString();
|
fileName = fileChooser.getSelectedFile().getName();
|
System.out.println("filepath = " + filepath+":fileName = "+fileName);
|
}
|
}
|
|
}
|
}
|