Skip to main content



      Home
Home » Archived » Visual Editor (VE) » Document Listener
Document Listener [message #16584] Fri, 23 January 2004 12:30 Go to next message
Eclipse UserFriend
I needed a documnt listener and try to add it using the normal event
extention in the javabeans to no avail so I resorted to the following
code which works but was wondering is there a better way?

private javax.swing.JTextArea getJTextAreaWordList() {
if (jTextAreaWordList == null) {
class documentListener implements DocumentListener {
public void changedUpdate(DocumentEvent arg0) {
System.out.println("changedUpdate");
}
public void insertUpdate(DocumentEvent arg0) {
System.out.println("insertUpdate");
}
public void removeUpdate(DocumentEvent arg0) {
System.out.println("removeUpdate");
}
}
jTextAreaWordList = new javax.swing.JTextArea();
jTextAreaWordList.getDocument().addDocumentListener
(new documentListener());
}
return jTextAreaWordList;
}

Thank in advance andre
Re: Document Listener [message #16600 is a reply to message #16584] Fri, 23 January 2004 13:21 Go to previous messageGo to next message
Eclipse UserFriend
DocumentListener is a special case in event handling, as it acts on the
text area's document, rather than the text area itself (as seen in your
code.) Currently there is no work around for introspecting situations
like this, when important events are invoked on a property of a bean.
For now, coding by hand is required in this case.

- Jeff Myers


Andre Arpin wrote:
> I needed a documnt listener and try to add it using the normal event
> extention in the javabeans to no avail so I resorted to the following
> code which works but was wondering is there a better way?
>
> private javax.swing.JTextArea getJTextAreaWordList() {
> if (jTextAreaWordList == null) {
> class documentListener implements DocumentListener {
> public void changedUpdate(DocumentEvent arg0) {
> System.out.println("changedUpdate");
> }
> public void insertUpdate(DocumentEvent arg0) {
> System.out.println("insertUpdate");
> }
> public void removeUpdate(DocumentEvent arg0) {
> System.out.println("removeUpdate");
> }
> }
> jTextAreaWordList = new javax.swing.JTextArea();
> jTextAreaWordList.getDocument().addDocumentListener
> (new documentListener());
> }
> return jTextAreaWordList;
> }
>
> Thank in advance andre
Re: Document Listener [message #16616 is a reply to message #16584] Fri, 23 January 2004 16:34 Go to previous message
Eclipse UserFriend
Hi Andre,

> I needed a documnt listener and try to add it using the normal event
> extention in the javabeans to no avail

I've opened a bugzilla feature for this
https://bugs.eclipse.org/bugs/show_bug.cgi?id=50511.

Best regards,

Joe Winchester
Re: Document Listener [message #579276 is a reply to message #16584] Fri, 23 January 2004 13:21 Go to previous message
Eclipse UserFriend
DocumentListener is a special case in event handling, as it acts on the
text area's document, rather than the text area itself (as seen in your
code.) Currently there is no work around for introspecting situations
like this, when important events are invoked on a property of a bean.
For now, coding by hand is required in this case.

- Jeff Myers


Andre Arpin wrote:
> I needed a documnt listener and try to add it using the normal event
> extention in the javabeans to no avail so I resorted to the following
> code which works but was wondering is there a better way?
>
> private javax.swing.JTextArea getJTextAreaWordList() {
> if (jTextAreaWordList == null) {
> class documentListener implements DocumentListener {
> public void changedUpdate(DocumentEvent arg0) {
> System.out.println("changedUpdate");
> }
> public void insertUpdate(DocumentEvent arg0) {
> System.out.println("insertUpdate");
> }
> public void removeUpdate(DocumentEvent arg0) {
> System.out.println("removeUpdate");
> }
> }
> jTextAreaWordList = new javax.swing.JTextArea();
> jTextAreaWordList.getDocument().addDocumentListener
> (new documentListener());
> }
> return jTextAreaWordList;
> }
>
> Thank in advance andre
Re: Document Listener [message #579296 is a reply to message #16584] Fri, 23 January 2004 16:34 Go to previous message
Eclipse UserFriend
Hi Andre,

> I needed a documnt listener and try to add it using the normal event
> extention in the javabeans to no avail

I've opened a bugzilla feature for this
https://bugs.eclipse.org/bugs/show_bug.cgi?id=50511

Best regards,

Joe Winchester
Previous Topic:Document Listener
Next Topic:Null layout manager
Goto Forum:
  


Current Time: Sun May 11 05:54:21 EDT 2025

Powered by FUDForum. Page generated in 0.03261 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top