public abstract class AbstractFormatter extends java.lang.Object implements ITextFormatter
ITextFormatter
,
or inherit this abstract class.Provide several common functionalities and constants for the formatters.
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
EMPTY
Empty String
|
protected boolean |
ignore
Flag indicating if VerifyEvent must be ignored (true) or not (false)
|
protected static char |
SPACE
Space character
|
protected org.eclipse.swt.widgets.Text |
text
Managed
Text widget |
Constructor and Description |
---|
AbstractFormatter() |
Modifier and Type | Method and Description |
---|---|
protected void |
beep()
Emits an audio beep.
|
void |
detach()
Called when the formatter is replaced by an other one in the
FormattedText
control. |
void |
setIgnore(boolean ignore)
Sets the
ignore flag. |
void |
setText(org.eclipse.swt.widgets.Text text)
Sets the
Text widget that will be managed by this formatter. |
protected void |
updateText(java.lang.String t)
Updates the text in the
Text widget. |
protected void |
updateText(java.lang.String t,
int pos)
Updates the text in the
Text widget. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDisplayString, getEditString, getValue, getValueType, isEmpty, isValid, setValue
protected static final char SPACE
protected static final java.lang.String EMPTY
protected org.eclipse.swt.widgets.Text text
Text
widgetprotected boolean ignore
protected void beep()
public void detach()
FormattedText
control. Allow to release resources like additional listeners.By default, do nothing. Override if needed.
detach
in interface ITextFormatter
ITextFormatter.detach()
public void setIgnore(boolean ignore)
ignore
flag.setIgnore
in interface ITextFormatter
ignore
- when true, VerifyEvent events are processed.ITextFormatter.setIgnore(boolean)
public void setText(org.eclipse.swt.widgets.Text text)
Text
widget that will be managed by this formatter.setText
in interface ITextFormatter
text
- Text widgetITextFormatter.setText(Text)
protected void updateText(java.lang.String t)
Text
widget. The absolute position
of the cursor in the widget is preserved.t
- new textprotected void updateText(java.lang.String t, int pos)
Text
widget. The cursor is set to
the given position.t
- new textpos
- new cursor's position