swingwtx.swing.text
Class PlainView
java.lang.Object
swingwtx.swing.text.View
swingwtx.swing.text.PlainView
- All Implemented Interfaces:
- SwingConstants
- public class PlainView
- extends View
Mapped view descendant that allows translation
of a Document to a plain SWT Text component (works
for JTextField, JPasswordField and JTextArea - ie.
Is used by JTextComponent).
Since it takes text either en-masse, this is appallingly
inefficient. It will do for now (and since JTextField/
JPasswordField and JTextArea generally don't contain that
much changeable text, it should be ok - we'll use
something better for JEditorPane/JTextPane).
Fields inherited from class swingwtx.swing.text.View |
doc |
Fields inherited from interface swingwtx.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Method Summary |
void |
setDocument(Document doc)
Sets a replacement Document - this routine calls
updateComponentFromModel to load the model's
content into the component |
void |
updateComponentFromModel()
Reads the text from the model and replaces the text in the
component. |
void |
updateModelFromComponent(java.lang.String newText)
Copies the text passed in from the component to the model,
replacing any content already there entirely. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
comp
protected JTextComponent comp
PlainView
public PlainView(Document doc,
JTextComponent component)
updateModelFromComponent
public void updateModelFromComponent(java.lang.String newText)
- Copies the text passed in from the component to the model,
replacing any content already there entirely.
updateComponentFromModel
public void updateComponentFromModel()
- Reads the text from the model and replaces the text in the
component.
setDocument
public void setDocument(Document doc)
- Sets a replacement Document - this routine calls
updateComponentFromModel to load the model's
content into the component