* canceled out of the FileChooser
*/
private File selectFile(Component source) {
// create a save as dialog
final FileChooser fileChooser = new FileChooser();
fileChooser.setDialogTitle(bundle.getString("export_message"));
fileChooser.setApproveButtonText(bundle.getString("export_button"));
fileChooser.setFileSelectionMode(FileChooser.FILES_ONLY);
fileChooser.setFileFilter(new XMLFileFilter());
if (source == null)
return null;
int returnVal = fileChooser.showOpenDialog(source);
if (returnVal == FileChooser.APPROVE_OPTION) {
File file = fileChooser.getSelectedFile();
// check if the selected file ends with the extension
// if not then add it
String path = file.getAbsolutePath();
// TODO add .xml to bundle?