Changeset 5892
- Timestamp:
- 2003-11-19T14:02:42+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/gui/CreatePane.java
r5872 r5892 107 107 /** The button for stopping the building processes. */ 108 108 private JButton cancel_button = null; 109 /** The button for viewing the collection. */ 110 private JButton preview_button = null; 109 111 /** The label displaying the number of documents in this collection. */ 110 112 private JLabel document_count = null; … … 131 133 /** An array used to pass arguments with dictionary calls. */ 132 134 private String args[] = null; 135 /** The homepage address of the current collection */ 136 private String homepage = null; 133 137 /** The size of the buttons at the bottom of the screen. */ 134 static private Dimension BUTTON_SIZE = new Dimension (386, 50);138 static private Dimension BUTTON_SIZE = new Dimension (256, 50);//(386, 50); 135 139 /** The size of the labels on the progress pane. */ 136 140 static private Dimension LABEL_SIZE = new Dimension(140, 25); … … 209 213 cancel_button.setPreferredSize(BUTTON_SIZE); 210 214 Dictionary.registerBoth(cancel_button, "CreatePane.Cancel_Build", "CreatePane.Cancel_Build_Tooltip"); 215 216 preview_button = new JButton(); 217 preview_button.addActionListener(new PreviewButtonListener()); 218 preview_button.setEnabled(false); 219 preview_button.setPreferredSize(BUTTON_SIZE); 220 Dictionary.registerBoth(preview_button, "CreatePane.Preview_Collection", "CreatePane.Preview_Collection_Tooltip"); 211 221 } 212 222 … … 220 230 public void collectionChanged(boolean ready) { 221 231 ///ystem.err.println("Collection changed... "); 222 if(Gatherer.c_man != null && ready) { 223 Collection current_collection = Gatherer.c_man.getCollection(); 224 if (current_collection != previous_collection) { 225 this.options_pane = new OptionsPane(current_collection.build_options); 226 previous_collection = current_collection; 227 } 228 tree.valueChanged(null); 232 if(Gatherer.c_man == null || !ready) { 233 return; 234 } 235 Collection current_collection = Gatherer.c_man.getCollection(); 236 if (current_collection != previous_collection) { 237 this.options_pane = new OptionsPane(current_collection.build_options); 238 previous_collection = current_collection; 239 } 240 tree.valueChanged(null); 241 242 // now do the preview stuff 243 if (!Gatherer.c_man.built()) { 244 preview_button.setEnabled(false); 245 } else if (Gatherer.config.exec_address == null) { 246 preview_button.setEnabled(false); 247 } else { 248 // set up the home page for the current collection 249 String extra_args = ""; 250 String build_type = current_collection.getCollectionType(); 251 if (build_type.equals("mgpp")) { 252 // we need some more args on the url 253 String search_types = current_collection.getSearchTypes(); 254 if (search_types.equals("")) { 255 extra_args = "&ct=1&qt=0&qto=3"; 256 } else if (search_types.equals("plain")) { 257 extra_args = "&ct=1&qt=0&qto=1"; 258 } else if (search_types.equals("form")) { 259 extra_args = "&ct=1&qt=1&qto=2"; 260 } else if (search_types.equals("plain,form")) { 261 extra_args = "&ct=1&qt=0&qto=3"; 262 } else if (search_types.equals("form,plain")) { 263 extra_args = "&ct=1&qt=1&qto=3"; 264 } 265 } 266 267 homepage = Gatherer.config.exec_address.toString() + "?a=p&p=about&c=" + current_collection.getName()+extra_args; 268 preview_button.setEnabled(true); 229 269 } 230 270 } … … 293 333 button_pane.add(build_button); 294 334 button_pane.add(cancel_button); 335 button_pane.add(preview_button); 295 336 296 337 this.setLayout(new BorderLayout()); … … 367 408 cancel_button.setEnabled(false); 368 409 build_button.setEnabled(true); 410 preview_button.setEnabled(true); 369 411 int status = event.getStatus(); 370 412 document.setSpecialCharacter(OptionsPane.SUCCESSFUL); … … 378 420 cancel_button.setEnabled(false); 379 421 build_button.setEnabled(true); 422 preview_button.setEnabled(false); 380 423 document.setSpecialCharacter(OptionsPane.UNSUCCESSFUL); 381 424 options_pane.resetFileEntry(); … … 400 443 build_button.setEnabled(false); 401 444 cancel_button.setEnabled(true); 445 preview_button.setEnabled(false); 402 446 // Create a new log document and assign it to the two textareas 403 447 document = options_pane.createNewLogDocument(); … … 432 476 build_button.setEnabled(true); 433 477 cancel_button.setEnabled(false); 478 preview_button.setEnabled(false); 434 479 processing = false; 435 480 document.setSpecialCharacter(OptionsPane.CANCELLED); … … 445 490 } 446 491 } 492 493 private class PreviewButtonListener 494 implements ActionListener { 495 496 public void actionPerformed(ActionEvent event) { 497 Gatherer.self.spawnBrowser(homepage); 498 499 } 500 } 501 447 502 /** The OptionTree is simply a tree structure that has a root node labelled "Options" and then has a child node for each available options screen. These screens are either combinations of the available import and build arguments, or a message log detailing the shell processes progress. */ 448 503 private class OptionTree
Note:
See TracChangeset
for help on using the changeset viewer.