Changeset 34286
- Timestamp:
- 2020-07-23T21:07:18+12:00 (4 years ago)
- Location:
- main/trunk/gli/src/org/greenstone/gatherer
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/gli/src/org/greenstone/gatherer/collection/CollectionManager.java
r34247 r34286 129 129 * this will be the local bin/script folder. */ 130 130 static private String scriptPath = ""; 131 131 132 private Boolean canPreview = null; 133 132 134 /** Constructor. */ 133 135 public CollectionManager() { … … 394 396 } 395 397 398 /** Calling c_man.built() is expensive in isGsdlRemote case. If you don't need built status recalculated 399 * call this method to get the last built() result, 400 * as the private canPreview variable stores the recalculated result after each call to built(). 401 * For example, this method should especially be used by the FormatPane for determining if the Preview 402 * button should be available as queried after every character has been input. The Preview Button should 403 * be available in such cases if the collection's last-known status indicated that an index folder from 404 * the most recent or prior build process was available. 405 * @return A boolean indicating the last known built status of the collection. 406 */ 407 public boolean previewAvailable() { 408 if(canPreview == null) { 409 built(); // this will set the variable canPreview, if not already set by CreatePane's calls to built() 410 } 411 return this.canPreview.booleanValue(); 412 } 413 396 414 /** Used to determine whether the currently active collection has been built. 397 415 * @return A boolean indicating the built status of the collection. 398 416 */ 399 417 public boolean built() { 418 boolean been_built = false; 419 400 420 if(collection != null) { 401 421 // Determine if the collection has been built by looking for the build.cfg (gs2) … … 420 440 421 441 if(Gatherer.isGsdlRemote) { 422 returnGatherer.remoteGreenstoneServer.exists(collection.getGroupQualifiedName(false), test_file);442 been_built = Gatherer.remoteGreenstoneServer.exists(collection.getGroupQualifiedName(false), test_file); 423 443 } else { 424 return test_file.exists(); 425 } 426 } 427 return false; 444 been_built = test_file.exists(); 445 } 446 } 447 448 // store recalculated result 449 this.canPreview = been_built ? Boolean.FALSE : Boolean.TRUE; 450 451 return been_built; //or: this.canPreview.booleanValue(); 428 452 } 429 453 -
main/trunk/gli/src/org/greenstone/gatherer/gui/FormatPane.java
r24424 r34286 123 123 // unbuilt (as could happen when someone clicks on a format statement before 124 124 // building the collection), then shouldn't enable previewing. 125 if(ready_to_preview && !Gatherer.c_man.built()) {125 if(ready_to_preview && Gatherer.c_man.previewAvailable()) { 126 126 ready_to_preview = false; 127 127 }
Note:
See TracChangeset
for help on using the changeset viewer.