Changeset 6205
- Timestamp:
- 2003-12-10T16:37:07+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gli/src/org/greenstone/gatherer/file/FileQueue.java
r6175 r6205 56 56 /** A temporary mapping from currently existing FileNode folder to their equivelent FileNode folder within the undo managers tree. */ 57 57 private HashMap completed_folder_mappings = new HashMap(); 58 59 /** The button which controls the stopping of the file queue. */ 60 private JButton stop_button = null; 61 58 62 /** true to cause this file queue to return from run() as soon as there are no jobs left on the queue. Useful for undo jobs which must occur before a specific action. */ 59 63 private boolean return_immediately = false; … … 203 207 if (job != null) { 204 208 ///ystem.err.println("Found job: " + job); 209 // Enabled stop button 210 stop_button.setEnabled(true); 205 211 // The user can cancel this individual action at several places, so keep track if the state is 'ready' for the next step. 206 212 boolean ready = true; … … 595 601 } 596 602 else { 603 // Disable stop button 604 if(stop_button != null) { 605 stop_button.setEnabled(false); 606 } 597 607 synchronized(this) { 598 608 ///ystem.err.println("Queue size = " + queue.size()); … … 623 633 } 624 634 } 635 636 /** Register the button that will be responsible for stopping executing file actions. 637 * @param button a JButton 638 */ 639 public void registerStopButton(JButton stop_button) { 640 this.stop_button = stop_button; 641 } 642 625 643 /** A second lock is necessary to prevent the thread waiting, because its notify occured momentarily before it waited. If the flag is set then the thread can't wait, but loops around. This may chew processor time so should only be used if you are certain files are about to be placed on the queue. 626 644 * @param wait_allowed The new state of the wait_allowed flag, as a boolean.
Note:
See TracChangeset
for help on using the changeset viewer.