|
Joda System API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object
|
+--javax.swing.text.AbstractDocument
|
+--javax.swing.text.PlainDocument
|
+--org.joda.swing.binder.PropertyPlainDocument
Swing document which binds to an property. Use of this model is best achieved by using SwingBinder.
This class can be used for both mutable and immutable properties. Immutable properties cannot be updated by the swing GUI, however they will update correctly if their value changes.
| Field Summary |
| Fields inherited from class javax.swing.text.PlainDocument |
lineLimitAttribute, tabSizeAttribute |
| Fields inherited from class javax.swing.text.AbstractDocument |
BAD_LOCATION, BidiElementName, ContentElementName, ElementNameAttribute, listenerList, ParagraphElementName, SectionElementName |
| Fields inherited from interface javax.swing.text.Document |
StreamDescriptionProperty, TitleProperty |
| Constructor Summary | |
PropertyPlainDocument()
Constructor |
|
PropertyPlainDocument(javax.swing.text.JTextComponent textComp,
DataProperty property)
Constructor that binds to a particular property. |
|
| Method Summary | |
protected void |
activate()
Activate the connection between the GUI and the model |
void |
bind(javax.swing.JComponent component,
Property property)
Bind a Property object to the component. |
protected void |
deactivate()
Deactivate the connection between the GUI and the model |
void |
insertString(int offs,
java.lang.String str,
javax.swing.text.AttributeSet attrs)
Inserts some content into the document and updates the property. |
void |
propertyChange(java.beans.PropertyChangeEvent event)
Handle programmatic changes made to the property by updating the swing model. |
void |
remove(int offs,
int len)
Removes some content from the document and updates the property. |
void |
setActive(boolean active)
Set the model to GUI binding as active or inactive |
| Methods inherited from class javax.swing.text.PlainDocument |
createDefaultRoot, getDefaultRootElement, getParagraphElement, insertUpdate, removeUpdate |
| Methods inherited from class javax.swing.text.AbstractDocument |
addDocumentListener, addUndoableEditListener, createBranchElement, createLeafElement, createPosition, dump, fireChangedUpdate, fireInsertUpdate, fireRemoveUpdate, fireUndoableEditUpdate, getAsynchronousLoadPriority, getAttributeContext, getBidiRootElement, getContent, getCurrentWriter, getDocumentFilter, getDocumentListeners, getDocumentProperties, getEndPosition, getLength, getListeners, getProperty, getRootElements, getStartPosition, getText, getText, getUndoableEditListeners, postRemoveUpdate, putProperty, readLock, readUnlock, removeDocumentListener, removeUndoableEditListener, render, replace, setAsynchronousLoadPriority, setDocumentFilter, setDocumentProperties, writeLock, writeUnlock |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PropertyPlainDocument()
public PropertyPlainDocument(javax.swing.text.JTextComponent textComp,
DataProperty property)
| Method Detail |
public void insertString(int offs,
java.lang.String str,
javax.swing.text.AttributeSet attrs)
throws javax.swing.text.BadLocationException
insertString in interface javax.swing.text.DocumentinsertString in class javax.swing.text.PlainDocumentoffs - the starting offset >= 0str - the string to insert; does nothing with null/empty strings
javax.swing.text.BadLocationException - the given insert position is not a valid
position within the documentDocument.insertString(int, java.lang.String, javax.swing.text.AttributeSet)
public void remove(int offs,
int len)
throws javax.swing.text.BadLocationException
remove in interface javax.swing.text.Documentremove in class javax.swing.text.AbstractDocumentoffs - the starting offset >= 0len - the number of characters to remove >= 0
javax.swing.text.BadLocationException - the given remove position is not a valid
position within the documentDocument.remove(int, int)public void propertyChange(java.beans.PropertyChangeEvent event)
propertyChange in interface java.beans.PropertyChangeListenerevent - the property change eventpublic void setActive(boolean active)
setActive in interface JComponentBinderprotected void activate()
protected void deactivate()
public void bind(javax.swing.JComponent component,
Property property)
JComponentBinder
bind in interface JComponentBindercomponent - the component to bindproperty - the property to bind toJComponentBinder.bind(JComponent,Property)
|
Joda System API | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||