Package javax.swing.text

Examples of javax.swing.text.Document.removeDocumentListener()


        // unregister old
        final Document oldDoc = (Document) pce.getOldValue();
        if( oldDoc != null ) {
          oldDoc.removeUndoableEditListener( TextView.this );
          for( int i = 0; i < collDocListeners.size(); i++ ) {
            oldDoc.removeDocumentListener( (DocumentListener) collDocListeners.get( i ));
//System.out.println( "remove " + collDocListeners.get( i ));
          }
          if( oldDoc instanceof AbstractDocument ) {
            final AbstractDocument adoc = (AbstractDocument) oldDoc;
            final DocumentEvent de =
View Full Code Here


     * Set the query string in the text field.
     * @param query the query string to use
     */
    public void setQuery(String query) {
        Document d = m_queryF.getDocument();
        d.removeDocumentListener(this);
        m_queryF.setText(query);
        if ( m_monitorKeys )
            d.addDocumentListener(this);
        searchUpdate();
    }
View Full Code Here

    // rest of stream down to InputStreamReader.
    UnicodeReader ur = new UnicodeReader(loc.getInputStream(), defaultEnc);

    // Remove listener so dirty flag doesn't get set when loading a file.
    Document doc = getDocument();
    doc.removeDocumentListener(this);
    BufferedReader r = new BufferedReader(ur);
    try {
      read(r, null);
    } finally {
      doc.addDocumentListener(this);
View Full Code Here

   */
  @Override
  public void setDocument(Document doc) {
    Document old = getDocument();
    if (old!=null) {
      old.removeDocumentListener(this);
    }
    super.setDocument(doc);
    doc.addDocumentListener(this);
  }

View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.