Saves the xml-formatted log records to a file selected with a chooser. @return the name of the file
()
| 687 | * @return the name of the file |
| 688 | */ |
| 689 | public String saveXMLAs() { |
| 690 | int result = getChooser().showSaveDialog(null); |
| 691 | if(result==JFileChooser.APPROVE_OPTION) { |
| 692 | File file = getChooser().getSelectedFile(); |
| 693 | // check to see if file already exists |
| 694 | if(file.exists()) { |
| 695 | int selected = JOptionPane.showConfirmDialog(frame, |
| 696 | ControlsRes.getString("OSPLog.ReplaceExisting_dialog_message") + file.getName() //$NON-NLS-1$ |
| 697 | + ControlsRes.getString("OSPLog.question_mark"), //$NON-NLS-1$ |
| 698 | ControlsRes.getString("OSPLog.ReplaceFile_dialog_title"), //$NON-NLS-1$ |
| 699 | JOptionPane.YES_NO_CANCEL_OPTION); |
| 700 | if(selected!=JOptionPane.YES_OPTION) { |
| 701 | return null; |
| 702 | } |
| 703 | } |
| 704 | logFileName = XML.getRelativePath(file.getAbsolutePath()); |
| 705 | return saveXML(logFileName); |
| 706 | } |
| 707 | return null; |
| 708 | } |
| 709 | |
| 710 | /** |
| 711 | * Opens a text file selected with a chooser and writes the contents to the log. |
no test coverage detected