@Override
public void actionPerformed(final ActionEvent ae) {
final SaveDialog chooser = new SaveDialog(System.getProperty("user.dir"));
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
chooser.setFileFilter(new FileNameExtensionFilter("rif document", "rif","txt"));
if(chooser.showDialog(DocumentEditorPane.this.that, "Export") == SaveDialog.APPROVE_OPTION) {
String fileName = chooser.getSelectedFile().getAbsolutePath();
if(!fileName.endsWith(".rif")) {
fileName += ".rif";
}
DocumentEditorPane.this.visualRifEditor.getSaveLoader().export(fileName);
}
}
});
final JMenuItem importMI = new JMenuItem("Import Document");
importMI.addActionListener(new ActionListener() {
@Override
public void actionPerformed(final ActionEvent ae) {
final JFileChooser chooser = new JFileChooser(System.getProperty("user.dir"));
chooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
chooser.setFileFilter(new FileNameExtensionFilter("rif document", "rif","txt"));
if(chooser.showDialog(DocumentEditorPane.this.that, "Import") == JFileChooser.APPROVE_OPTION) {
final String fileName = chooser.getSelectedFile().getAbsolutePath();
DocumentEditorPane.this.visualRifEditor.importNewDocument(FileHelper.fastReadFile(fileName));
}