/** * DOCUMENT ME! * * @param ae DOCUMENT ME! */ public void actionPerformed(ActionEvent ae) { ReportDocument doc = getEditor().getDocument(); if (doc != null) { ReportChooser chooser = ReportChooser.getInstance(); File docFile = ReportDocument.getCachedFile(doc); if (docFile == null) { chooser.setSelectedFile(null); chooser.setDocument(doc); chooser.showSaveDialog(); docFile = ReportDocument.getCachedFile(doc); } else { try { ReportDocument.save(doc, docFile, false); } catch (Exception e) { MessageBox.error( Main.getInstance(), App.messages.getString("res.568") + Util.toString(e)); Util.debug("ZSaveAction", e); } } Main.getInstance().save(doc, docFile); } }
/** * DOCUMENT ME! * * @param doc DOCUMENT ME! * @param queryAsClosed DOCUMENT ME! * @return DOCUMENT ME! */ public static Frame newFrame(ReportDocument doc, boolean queryAsClosed) { Main mainFrame = new Main(); mainFrame.pack(); mainFrame.setExtendedState(JFrame.MAXIMIZED_BOTH); if (doc != null) { mainFrame.createEditor( doc, ReportDocument.getCachedFile(doc).getName(), ReportDocument.getCachedFile(doc).getAbsolutePath(), true); } return mainFrame; }