public class SwtTextFieldWrapper extends GralTextField.GraphicImplAccess
| Modifier and Type | Class and Description |
|---|---|
private class |
SwtTextFieldWrapper.TextFieldFocusListener
For edit able fields.
|
protected class |
SwtTextFieldWrapper.TextFieldKeyListener |
protected class |
SwtTextFieldWrapper.TextFieldModifyListener |
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
bbox |
private DropTarget |
drop |
(package private) PaintListener |
paintListener |
(package private) SwtTransparentLabel |
promptSwt
A possible prompt for the text field or null.
|
(package private) short[] |
startPosLine
This is a helper array for a text box to calculate the column from the position.
|
private SwtWidgetHelper |
swtWidgHelper
It contains the association to the swt widget (Control) and the
SwtMng
and implements some methods of GralWidgImplAccess_ifc which are delegate from this. |
protected Text |
textFieldSwt |
static java.lang.String |
version
Version, history and license.
|
chgAddText, chgCursor, chgEditable, chgNonEditable, chgPrompt, chgViewTrail, posField, posPromptbRedrawOnlyDynamics, chgBitsDerived, chgColorBack, chgColorLine, chgColorText, chgCurrTab, chgFloat, chgFocus, chgFont, chgIntg, chgInvisible, chgObjects, chgPos, chgText, chgVisible, chgVisibleInfo, mngImpl, pixBounds, wdgimpl, widgg| Modifier | Constructor and Description |
|---|---|
private |
SwtTextFieldWrapper(GralTextField widgg,
SwtMng swtMng,
boolean bbox)
|
| Modifier and Type | Method and Description |
|---|---|
(package private) static GralWidget.ImplAccess |
createTextBox(GralTextField widgg,
GralMng mng) |
(package private) static GralWidget.ImplAccess |
createTextField(GralTextField widgg,
GralMng mng)
Creates a SwtTextField.
|
GralRectangle |
getPixelPositionSize() |
Text |
getWidgetImplementation()
Returns the implementation class of the widget.
|
protected void |
paintWidget(Text swt,
PaintEvent e) |
void |
redrawGthread()
This method should be implemented in all Widget implementations of the adapter for the
underlying graphic system.
|
void |
removeWidgetImplementation()
Removes the graphical widget in the graphic.
|
void |
setBoundsPixel(int x,
int y,
int dx,
int dy)
Set the bounds of the implementation widget.
|
protected void |
setDragEnable(int dragType)
Implementation routine to set receiving a drag event and initializes the drag feature of the widget.
|
protected void |
setDropEnable(int dropType)
Implementation routine to set receiving a drop event and initializes the drop feature of the widget.
|
boolean |
setFocusGThread()
Sets the focus to the widget.
|
GralRectangle |
setPosBounds(GralRectangle parentPix)
Set the bounds of the widget from the stored GralPos.
|
void |
setVisibleGThread(boolean bVisible)
Sets the implementation widget(s) visible state.
|
(package private) void |
stop() |
protected void |
textFieldFocusGained() |
protected void |
textFieldFocusLost()
On focus lost all values are updated, because it is possible to evaluate from any other widget.
|
void |
updateValuesForAction()
This operation should be called before any action is invoked in the user space.
|
borderwidth, caretPos, caretPos, cursorPos, getAndClearNewText, getCurserLine, getCursorCol, isPasswordField, prompt, promptStylePosition, setTouched, useracknChanged, actionShow, dyda, getActionChange, getChanged, gralMng, gralWidgetFromImplData, redrawOnlyDynamics, setTextChanged, setVisibleState, XXXfocusGainedpublic static final java.lang.String version
updateValuesForAction():
a text changed with GralTextBox.append(CharSequence) was not mirrored in GralWidget.DynamicData#displayedText.
The reason was: It was no more updated, before updated not planned on Focus lost.
Now the displayedText is updated in redrawGthread() on evaluation of dyda().
updateValuesForAction() a GralTextField.setText(CharSequence) was pending
during a focus lost event. The focus lost calls updateValues... but the new value was not written till yet
(delayed GralWidget.ImplAccess#redrawGthread()
textFieldFocusLost() calls GralWidgImplAccess_ifc.updateValuesForAction().
implemented here in updateValuesForAction() which sets the cursor line and column.
GralTextField.setBorderWidth(int) to show the text field with a border. That is not a property
of an SWT Text, therefore a new paintListener was added to draw the border.
GralTextField uses the new concept of instantiation: It is not
the super class of the implementation class. But it provides GralTextField.GraphicImplAccess
as the super class.
#swtKeyListener. The [Enter] key will be send to the User
in opposite to SwtTextBox.
redrawGthread() does not do anything if the textFieldSwt is removed
because the widget was removed. Prevent null-Pointer exception.
private final SwtWidgetHelper swtWidgHelper
SwtMng
and implements some methods of GralWidgImplAccess_ifc which are delegate from this.protected Text textFieldSwt
protected final boolean bbox
SwtTransparentLabel promptSwt
private DropTarget drop
short[] startPosLine
Text#getCaretPosition() returns only the absolute position,
not the column. Whereas Text#getCaretLineNumber() returns the line.PaintListener paintListener
private SwtTextFieldWrapper(GralTextField widgg, SwtMng swtMng, boolean bbox)
widgg - swtMng - bbox - static GralWidget.ImplAccess createTextField(GralTextField widgg, GralMng mng)
SwtMng.widgg - name - The name to register it.editable - false then show fieldprompt - maybe null, propmt textpromptStylePosition - maybe null, prompt positionmng - static GralWidget.ImplAccess createTextBox(GralTextField widgg, GralMng mng)
public GralRectangle getPixelPositionSize()
protected void setDropEnable(int dropType)
GralWidget.ImplAccesssetDropEnable in class GralWidget.ImplAccessdropType - one of org.vishia.util.KeyCode#dropFiles or ..dropTextprotected void setDragEnable(int dragType)
GralWidget.ImplAccesssetDragEnable in class GralWidget.ImplAccessdragType - one of org.vishia.util.KeyCode#dragFiles or ..dragTextpublic void redrawGthread()
GralWidgImplAccess_ifc#repaintRequpublic Text getWidgetImplementation()
GralWidgImplAccess_ifcComponent.
GralWidget._wdgImpl class
which should contain the references to that implementation widgets.getWidgetImplementation in interface GralWidgImplAccess_ifcgetWidgetImplementation in class GralWidget.ImplAccesspublic boolean setFocusGThread()
GralWidgImplAccess_ifcGralMng_ifc#setFocus(GralWidget).public void setVisibleGThread(boolean bVisible)
GralWidgImplAccess_ifcGralWidgetBase.bVisibleState too. Therewith it is able to quest GralWidget.isVisible() in any thread.bVisible - true then the widget should be visible, false it is set to invisible.public void removeWidgetImplementation()
GralWidgImplAccess_ifcpublic void setBoundsPixel(int x,
int y,
int dx,
int dy)
GralWidgImplAccess_ifcpublic GralRectangle setPosBounds(GralRectangle parentPix)
GralWidget.ImplAccesssetPosBounds in interface GralWidgImplAccess_ifcsetPosBounds in class GralWidget.ImplAccessparentPix - the bounds of a parent. It is not necessary that this is the bounds of an existing panel.
Also a sub region in a panel can be described with it, used for GralWidgComposite.protected void textFieldFocusGained()
protected void textFieldFocusLost()
ActionChangeWhen#onChangeAndFocusLost.protected void paintWidget(Text swt,
PaintEvent e)
void stop()
public void updateValuesForAction()
GralWidgImplAccess_ifc