Changeset 13320
- Timestamp:
- 2006-11-24T10:03:34+13:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/ExportAsPrompt.java
r13195 r13320 114 114 private StringBuffer error_message = null; 115 115 /** The size of the export prompt screen. */ 116 public static final Dimension SIZE = new Dimension(500, 5 20);116 public static final Dimension SIZE = new Dimension(500, 540); 117 117 private GDefaultProgressMonitor progress_monitor; 118 118 … … 120 120 private JButton convert_xml_button2 = null; 121 121 private JButton convert_xml_button3 = null; 122 private JButton folder_button = null; 122 123 123 124 private JPanel instructions_pane = null; … … 238 239 title_field.setToolTipText(Dictionary.get("ExportAsPrompt.Export_Name_Tooltip")); 239 240 title_label = new JLabel(Dictionary.get("ExportAsPrompt.Export_Name")); 241 242 folder_button = new GLIButton(Dictionary.get("ExportAsPrompt.Browse"),Dictionary.get("ExportAsPrompt.Browse_Tooltip")); 243 folder_button.addActionListener(new FolderButtonListener()); 244 240 245 241 246 scanForCollections(); … … 301 306 title_pane.add(title_label, BorderLayout.WEST); 302 307 title_pane.add(title_field, BorderLayout.CENTER); 308 title_pane.add(folder_button, BorderLayout.EAST); 303 309 //apply xsl pane 304 310 … … 342 348 343 349 JPanel tmp_pane = new JPanel(new BorderLayout()); 344 tmp_pane.add(saveas_pane, BorderLayout. WEST);350 tmp_pane.add(saveas_pane, BorderLayout.NORTH); 345 351 tmp_pane.add(title_pane, BorderLayout.CENTER); 346 352 … … 407 413 if (num_collections == 0) return; 408 414 cd_title = title_field.getText(); 409 cd_title = cd_title.trim();410 cd_title = cd_title.replaceAll("\"", "");411 415 412 416 String export_type = (String) saveas_combobox.getSelectedItem(); … … 427 431 command_parts_list.add("-exportdir"); 428 432 String export_dir = LocalGreenstone.getTmpDirectoryPath(); 429 if (cd_title.equals("")) {430 433 if (cd_title.equals("")) { 434 export_dir += "exported_" + export_type; 431 435 } 432 436 else { 433 export_dir += cd_title.replaceAll("\\s", ""); 434 } 435 command_parts_list.add(export_dir); 437 File cd_file = new File(cd_title); 438 if (cd_file.isAbsolute()) 439 export_dir = cd_title + File.separator + "exported_" + export_type; 440 else{ 441 cd_title = cd_title.replaceAll("\\s+",""); 442 cd_title = cd_title.replaceAll("\\\\+","/"); 443 cd_title = cd_title.replaceAll("/+","/"); 444 export_dir +=cd_title; 445 } 446 } 447 448 command_parts_list.add(export_dir); 436 449 437 450 if (!export_type.equals("METS") && xsl_file1 !=null){ … … 520 533 521 534 args[0] = coll_names.toString(); 522 523 args[1] = LocalGreenstone.getTmpDirectoryPath(); 524 if(cd_title.equals("")) { 525 String export_type = (String)saveas_combobox.getSelectedItem(); 526 args[1] += "exported_" + export_type; 527 } else { 528 args[1] += "exported_"+cd_title.replaceAll("\\s",""); 529 } 535 536 String export_type = (String) saveas_combobox.getSelectedItem(); 537 args[1] = LocalGreenstone.getTmpDirectoryPath(); 538 if (cd_title.equals("")) { 539 args[1] += "exported_" + export_type; 540 } 541 else { 542 File cd_file = new File(cd_title); 543 if (cd_file.isAbsolute()) 544 args[1] = cd_title + File.separator + "exported_" + export_type; 545 else{ 546 cd_title = cd_title.replaceAll("\\s+",""); 547 cd_title = cd_title.replaceAll("\\\\+","/"); 548 cd_title = cd_title.replaceAll("/+","/"); 549 args[1] +=cd_title; 550 } 551 } 552 530 553 531 554 String title; … … 877 900 } 878 901 902 private class FolderButtonListener implements ActionListener { 903 public void actionPerformed(ActionEvent event) { 904 JFileChooser chooser = new JFileChooser(); 905 chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); 906 907 int returnVal = chooser.showOpenDialog(prompt); 908 909 if(returnVal == JFileChooser.APPROVE_OPTION) { 910 File folder_name = chooser.getSelectedFile(); 911 title_field.setText(folder_name.getPath()); 912 } 913 914 } 915 } 879 916 } 880 917 … … 882 919 883 920 921
Note:
See TracChangeset
for help on using the changeset viewer.