| |
|
| java.lang.Object org.openjx.jx.JXDocumentAdapter
JXDocumentAdapter | public class JXDocumentAdapter implements DocumentListener(Code) | | This is an adapter class to the DocumentListener interface. It allows us
to bind swing values of the document to JX properties and vice versa.
author: Jared Spigner |
Method Summary | |
public void | changedUpdate(DocumentEvent evt) This method handles document attribute change events. | public void | insertUpdate(DocumentEvent evt) This method handles document insert change events. | public void | removeUpdate(DocumentEvent evt) This method handles document removal change events. | public void | update() Without this method and the other update method we can not access the
document text or properties without getting a
java.lang.IllegalStateException: Attempt to mutate in notification. | public void | update(boolean value) Value is just a value used to differentiate between the update method
and this update method which is called by the one with no arguments. |
jxTranslator | public JXTranslator jxTranslator(Code) | | This is a reference to the JXTranslator.
|
JXDocumentAdapter | public JXDocumentAdapter()(Code) | | Creates a new instance of JXDocumentAdapter
|
changedUpdate | public void changedUpdate(DocumentEvent evt)(Code) | | This method handles document attribute change events.
Parameters: evt - is the event that was fired off. |
insertUpdate | public void insertUpdate(DocumentEvent evt)(Code) | | This method handles document insert change events.
Parameters: evt - is the event that was fired off. |
removeUpdate | public void removeUpdate(DocumentEvent evt)(Code) | | This method handles document removal change events.
Parameters: evt - is the event that was fired off. |
update | public void update()(Code) | | Without this method and the other update method we can not access the
document text or properties without getting a
java.lang.IllegalStateException: Attempt to mutate in notification. The
reason is because JAVA version 1.4 and onward, however, will not allow
us to set modify the contents of the textField while we are handling one
of its document events. So, we will need to make the following
changes:
1. avoid setting the text field's text within the update() whenever we call
update() from a DocumentListener
2. remove/add the document listener at the start/end of the update()
method.
|
update | public void update(boolean value)(Code) | | Value is just a value used to differentiate between the update method
and this update method which is called by the one with no arguments.
|
|
|
|