Package javax.swing.text

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


    public void propertyChange(final PropertyChangeEvent evt)
    {
      if (FormValidator.DOCUMENT_PROPERTY_NAME.equals(evt.getPropertyName()))
      {
        final Document olddoc = (Document) evt.getOldValue();
        olddoc.removeDocumentListener(this);
        final Document newdoc = (Document) evt.getOldValue();
        newdoc.addDocumentListener(this);
      }
    }
View Full Code Here


    @Override
    public void setDocument(Document doc) {
        Document document = getDocument();
        if (document != null && _listener != null) {
            document.removeDocumentListener(_listener);
        }
        super.setDocument(doc);
        if (doc != null) {
            if (_listener == null) {
                _listener = new ResizingDocumentListener();
View Full Code Here

    public void propertyChange(final PropertyChangeEvent evt)
    {
      if (FormValidator.DOCUMENT_PROPERTY_NAME.equals(evt.getPropertyName()))
      {
        final Document olddoc = (Document) evt.getOldValue();
        olddoc.removeDocumentListener(this);
        final Document newdoc = (Document) evt.getOldValue();
        newdoc.addDocumentListener(this);
      }
    }
View Full Code Here

                    layoutButtons();
                    updateButtons();
                } else if ("document".equals(prop)) {
                    Document doc = (Document) evt.getOldValue();
                    if (doc != null) {
                        doc.removeDocumentListener(this);
                    }
                    doc = (Document) evt.getNewValue();
                    if (doc != null) {
                        doc.addDocumentListener(this);
                    }
View Full Code Here

    }

    public void setDocument(final Document doc) {
        Document oldValue = getDocument();
        if (oldValue != null) {
            oldValue.removeDocumentListener(docListener);
        }
        if (doc != null) {
            initDocumentListener();
            doc.addDocumentListener(docListener);
        }
View Full Code Here

        @Override
        public void setDocument(Document doc) {
            Document oldDoc = getDocument();
            if (oldDoc != null)
                oldDoc.removeDocumentListener(docListener);

            super.setDocument(doc);

            if (doc != null) {
                doc.addDocumentListener(docListener);
View Full Code Here

    UnicodeReader ur = new UnicodeReader(loc.getInputStream(), defaultEnc);
    charSet = ur.getEncoding();

    // 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

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

View Full Code Here

        }

        if (this.editor != null) {
            Document oldDoc = this.editor.getDocument();

            oldDoc.removeDocumentListener(this);
            this.editor.removePropertyChangeListener(this);
            this.editor.removeCaretListener(this);
        }
        this.editor = editor;
        if (editor == null) {
View Full Code Here

    public void propertyChange (final PropertyChangeEvent evt)
    {
      if (DOCUMENT_PROPERTY_NAME.equals(evt.getPropertyName()))
      {
        final Document olddoc = (Document) evt.getOldValue();
        olddoc.removeDocumentListener(this);
        final Document newdoc = (Document) evt.getOldValue();
        newdoc.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.