return "Отчеты";
}
void saveFiles(int[] ids, boolean compiled){
for (int item : ids){
FileLocal file = (FileLocal)reportList.getModel().getElementAt(item);
ConfigGui cfg = ConfigGui.getInstance();
JFileChooser choser = new JFileChooser();
choser.setCurrentDirectory(cfg.getLastOpenDialogPath());
FileNameExtensionFilter filter = new FileNameExtensionFilter("Файлы JasperReport", JASPER_EXTENSIONS);
choser.addChoosableFileFilter(filter);
switch (file.getFileTypeID()){
case FileDetails.TYPE_JASPER_REPORT:
choser.setFileFilter(filter);
break;
default:
choser.setFileFilter(choser.getAcceptAllFileFilter());
break;
}
choser.setSelectedFile(new File(choser.getCurrentDirectory().getPath() + File.separator + file.getFileName()));
boolean fileSaved = false;
do{
int id = choser.showSaveDialog(this);
if (id == JFileChooser.APPROVE_OPTION){
cfg.setLastOpenDialogPath(choser.getCurrentDirectory());
File f = choser.getSelectedFile();
if (f.exists()) {
if (MessageBox.showConfirmYesNo(MessageBox.C_OVERWRITE_FILE, f.getName()) != MessageBox.ANSWER_YES) {
continue;
}
}
byte[] data;
try {
if (compiled) {
data = file.getFileCompiledData();
}
else {
data = file.getFileData();
}
} catch (ClipsException ex) {
MessageBox.showException(ex);
return;
}