public class StringFormatter extends AbstractFormatter
EMPTY, ignore, SPACE, text
Constructor and Description |
---|
StringFormatter() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDisplayString()
Returns the current value formatted for display.
|
java.lang.String |
getEditString()
Returns the current value formatted for editing.
|
java.lang.Object |
getValue()
Returns the current value.
This formatter has no formatting features. |
java.lang.Class<java.lang.String> |
getValueType()
Returns the type of value this
ITextFormatter handles,
i.e. |
boolean |
isEmpty()
Returns
true if current edited value is empty, else returns
false .A string is empty if its length is 0. |
boolean |
isValid()
Returns
true if current edited value is valid, else returns
false .StringFormatter always return true. |
void |
setValue(java.lang.Object value)
Sets the value to edit.
|
void |
verifyText(org.eclipse.swt.events.VerifyEvent e)
Handles a
VerifyEvent sent when the text is about to be modified. |
beep, detach, setIgnore, setText, updateText, updateText
public java.lang.String getDisplayString()
There is no difference in this formatter between edit and display values. So this method returns the edit string.
ITextFormatter.getDisplayString()
public java.lang.String getEditString()
FormattedText
when the Text
widget gains focus.ITextFormatter.getEditString()
public java.lang.Object getValue()
ITextFormatter.getValue()
public java.lang.Class<java.lang.String> getValueType()
ITextFormatter
handles,
i.e. returns in getValue()
.public boolean isEmpty()
true
if current edited value is empty, else returns
false
.public boolean isValid()
true
if current edited value is valid, else returns
false
.ITextFormatter.isValid()
public void setValue(java.lang.Object value)
String
.
The Text widget is simply updated with the value.value
- string valuejava.lang.IllegalArgumentException
- if not a stringITextFormatter.setValue(java.lang.Object)
public void verifyText(org.eclipse.swt.events.VerifyEvent e)
VerifyEvent
sent when the text is about to be modified.
This method is the entry point of all operations of formatting.VerifyListener.verifyText(org.eclipse.swt.events.VerifyEvent)