Changeset 15621


Ignore:
Timestamp:
05/21/08 21:33:20 (13 years ago)
Author:
ak19
Message:

BuildButtonListener implements DocumentListener now so that it it keeps the display log refreshed upon DocumentEvents fired when new lines have finally been added (no more funny squares in the log)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • gli/trunk/src/org/greenstone/gatherer/gui/CreatePane.java

    r13595 r15621  
    606606    }
    607607
    608     /** This class serves as the listener for actions on the build button. */
     608    /** This class serves as the listener for actions on the build button. It also ensures
     609     * that the log displayed is refreshed whenever the building progress display updates. */
    609610    private class BuildButtonListener
    610     implements ActionListener {
     611    implements ActionListener, DocumentListener {
    611612    /**
    612613     * This method checks to see what needs to be done for a build, and starts the process off.
     
    676677        document = options_pane.createNewLogDocument();
    677678        log_textarea.setDocument(document);
     679        // Add a document listener to listen to DocumentEvents emitted by the custom document.
     680        // It prevents the blocks that appear in the log textarea that look like they need a refresh
     681        document.addDocumentListener(this);
    678682        options_pane.log_textarea.setDocument(document);
    679683        // Change the view.
     
    687691        import_monitor.setStop(false);
    688692    }
    689     }
    690    
     693       
     694
     695    // Called whenever the custom Document object has been updated (it then fires a DocumentEvent, handled here)
     696    public void changedUpdate(DocumentEvent e) { refreshLog(); }
     697    public void insertUpdate(DocumentEvent e) { refreshLog(); }
     698    public void removeUpdate(DocumentEvent e) { refreshLog(); }
     699    public void refreshLog() { CreatePane.this.log_textarea.repaint(); }
     700    }
    691701   
    692702    /** This class serves as the listener for actions on the cancel button. */
Note: See TracChangeset for help on using the changeset viewer.