/** Handle the close action. Closes the import dialog. */ public void onCancel() { DBNode.restoreImportSettings(); setVisible(false); dispose(); }
/** Handle the import action request. */ public void onImport() { String finalFile = ""; // $NON-NLS-1$ if (file == null) { UIFileFilter filter = new UIFileFilter(new String[] {"xml"}, "XML Files"); // $NON-NLS-1$ //$NON-NLS-2$ UIFileChooser fileDialog = new UIFileChooser(); fileDialog.setDialogTitle( LanguageProperties.getString( LanguageProperties.DIALOGS_BUNDLE, "UIImportFlashMeetingXMLDialog.chooseFile2")); //$NON-NLS-1$ fileDialog.setFileFilter(filter); fileDialog.setApproveButtonText( LanguageProperties.getString( LanguageProperties.DIALOGS_BUNDLE, "UIImportFlashMeetingXMLDialog.importButton")); //$NON-NLS-1$ fileDialog.setRequiredExtension(".xml"); // $NON-NLS-1$ // FIX FOR MAC - NEEDS '/' ON END TO DENOTE A FOLDER if (!UIImportFlashMeetingXMLDialog.lastFileDialogDir.equals("")) { // $NON-NLS-1$ File file = new File(UIImportFlashMeetingXMLDialog.lastFileDialogDir + ProjectCompendium.sFS); if (file.exists()) { fileDialog.setCurrentDirectory(file); } } UIUtilities.centerComponent(fileDialog, ProjectCompendium.APP); int retval = fileDialog.showOpenDialog(ProjectCompendium.APP); if (retval == JFileChooser.APPROVE_OPTION) { if ((fileDialog.getSelectedFile()) != null) { String fileName = fileDialog.getSelectedFile().getAbsolutePath(); File fileDir = fileDialog.getCurrentDirectory(); String dir = fileDir.getPath(); if (fileName != null) { UIImportFlashMeetingXMLDialog.lastFileDialogDir = dir; finalFile = fileName; } } } } else { finalFile = file.getAbsolutePath(); } if (finalFile != null) { if ((new File(finalFile)).exists()) { setVisible(false); Vector choices = new Vector(); if (cbIncludeKeywords.isSelected()) { choices.addElement(FlashMeetingXMLImport.KEYWORDS_LABEL); } if (cbIncludeAttendees.isSelected()) { choices.addElement(FlashMeetingXMLImport.ATTENDEE_LABEL); } if (cbIncludePlayList.isSelected()) { choices.addElement(FlashMeetingXMLImport.PLAYLIST_LABEL); } if (cbIncludeURLs.isSelected()) { choices.addElement(FlashMeetingXMLImport.URL_LABEL); } if (cbIncludeChats.isSelected()) { choices.addElement(FlashMeetingXMLImport.CHAT_LABEL); } if (cbIncludeWhiteboard.isSelected()) { choices.addElement(FlashMeetingXMLImport.WHITEBOARD_LABEL); } if (cbIncludeFileData.isSelected()) { choices.addElement(FlashMeetingXMLImport.FILEDATA_LABEL); } if (cbIncludeAnnotations.isSelected()) { choices.addElement(FlashMeetingXMLImport.ANNOTATIONS_LABEL); } if (cbIncludeVotes.isSelected()) { choices.addElement(FlashMeetingXMLImport.VOTING_LABEL); } DBNode.setNodesMarkedSeen(cbMarkSeen.isSelected()); FlashMeetingXMLImport xmlImport = new FlashMeetingXMLImport(finalFile, ProjectCompendium.APP.getModel(), choices); xmlImport.start(); dispose(); ProjectCompendium.APP.setStatus(""); // $NON-NLS-1$ } } }