取消打开对话框或保存对话框后,主窗口仍在
//事件外部类写法,按钮实现转化程序都写在这里
public class ButtonSelectionListener extends SelectionAdapter{
@Override
public void widgetSelected(SelectionEvent e) {
//打开对话框
String[] openFileNames=OpenDialog.openSigOrMulFile();
if(openFileNames==null||openFileNames.length==0)
return; //因为取消了打开对话框,中断函数,有返回值的函数,返回值在调用处处理,主窗口仍在
//得到二维数组
MulPdfDataDealLast2 pd=new MulPdfDataDealLast2();
ArrayList<ArrayList<String>> laTemp=new ArrayList<ArrayList<String>>();
try {
laTemp=pd.dealMulPdf(openFileNames);
} catch (IOException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
//ArrayList<ArrayList<String>> laTemp=new ArrayList<ArrayList<String>>();
//得到输入文件名
String fileName=SaveDialog.open();
if(fileName==null||fileName.length()==0)
return; //因为取消了保存对话框,中断函数,有返回值的函数,返回值在调用处处理,主窗口仍在
//写进Excel
WriteExcel.writeExcel(fileName,"BlanketPO",laTemp);
}
}