public interface ItsNatTextComponent extends ItsNatElementComponent
A text based component manages a single piece of text.
Modifier and Type | Method and Description |
---|---|
void |
appendString(java.lang.String str)
Appends a new string at the end.
|
javax.swing.text.Document |
createDefaultDocument()
Create a new instance of the default data model.
|
javax.swing.text.Document |
getDocument()
Returns the current data model of this component.
|
ItsNatTextComponentUI |
getItsNatTextComponentUI()
Returns the user interface manager of this component.
|
java.lang.String |
getText()
Returns the text contained in this component.
|
java.lang.String |
getText(int offset,
int length)
Fetches the text contained within the given portion
of the text of this component.
|
void |
insertString(java.lang.String str,
int pos)
Inserts a new string at the specified position.
|
void |
replaceString(java.lang.String str,
int start,
int end)
Replaces a text part with a new string at the specified position.
|
void |
setDocument(javax.swing.text.Document dataModel)
Changes the data model of this component.
|
void |
setText(java.lang.String t)
Updates the text contained in this component.
|
getElement, getItsNatElementComponentUI
addEventListener, addEventListener, addEventListener, addEventListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, disableEventListener, disableEventListener, dispose, enableEventListener, enableEventListener, getArtifact, getArtifact, getItsNatComponentManager, getItsNatComponentUI, getItsNatDocument, getNode, getPropertyChangeListeners, getPropertyChangeListeners, getVetoableChangeListeners, isDisposed, isEnabled, registerArtifact, removeArtifact, removeEventListener, removeEventListener, removeEventListener, removeEventListener, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, setEnabled, setEventListenerParams, setEventListenerParams, setNode
containsUserValueName, getUserValue, getUserValueNames, removeUserValue, setUserValue
javax.swing.text.Document getDocument()
setDocument(javax.swing.text.Document)
void setDocument(javax.swing.text.Document dataModel)
Current data model is disconnected from this component, and the new data model is bound to this component, every change is tracked and updates the user interfaces accordingly.
If the specified data model is the same instance as the current data model, then is reset, component listener is removed and added again. Use this technique if you want to add a data model listener to be executed before the default component listener.
dataModel
- the new data model.getDocument()
java.lang.String getText()
This method is a quick access to the data model text
(see javax.swing.text.Document.getText(int,int)
)
setText(String)
,
getDocument()
void setText(java.lang.String t)
This method is a quick access to modify the data model text
(see javax.swing.text.Document.remove(int,int)
and javax.swing.text.Document.insertString(int,int,AttributeSet)
).
The component keeps track of data model changes the user interface is updated accordingly.
t
- the text.getText()
,
getDocument()
java.lang.String getText(int offset, int length)
This method is a direct wrapper of javax.swing.text.Document.getText(int,int)
.
offset
- the offset into the document representing the desired start of the text >= 0length
- the length of the desired string >= 0getText()
,
getDocument()
void appendString(java.lang.String str)
This method is a quick access to modify the data model text
(see javax.swing.text.Document.insertString(int,int,AttributeSet)
).
The component keeps track of data model changes the user interface is updated accordingly.
str
- the string to add.getText()
,
getDocument()
,
insertString(String,int)
void insertString(java.lang.String str, int pos)
This method is a quick access to modify the data model text
(see javax.swing.text.Document.insertString(int,int,AttributeSet)
).
The component keeps track of data model changes the user interface is updated accordingly.
str
- the text.getText()
,
getDocument()
,
appendString(String)
void replaceString(java.lang.String str, int start, int end)
This method is a quick access to modify the data model text
(see javax.swing.text.Document.insertString(int,int,AttributeSet)
).
This method is a quick access to modify the data model text
(see javax.swing.text.Document.remove(int,int)
and javax.swing.text.Document.insertString(int,int,AttributeSet)
).
str
- the text.getText()
,
getDocument()
,
appendString(String)
javax.swing.text.Document createDefaultDocument()
Returned data model is not bound to this component.
setDocument(javax.swing.text.Document)
ItsNatTextComponentUI getItsNatTextComponentUI()
Copyright © 2007 Innowhere Software Services S.L. All Rights Reserved.