org.vishia.gral.ifc

## Interface GralTextField_ifc

- All Superinterfaces:
    GralWidget_ifc, Removeable
  All Known Subinterfaces:
    GralTextBox_ifc
  All Known Implementing Classes:
    GralInfoBox, GralTextBox, GralTextField

      public interface GralTextField_ifc
      extends GralWidget_ifc

  This is the interface to all widgets which represents a simple text.

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.vishia.gral.ifc.GralWidget_ifc

      `GralWidget_ifc.ActionChange, GralWidget_ifc.ActionChangeWhen`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `version` Version and history 2012-01-17 new `#setSelection(String)`.

    - ### Fields inherited from interface org.vishia.gral.ifc.GralWidget_ifc

      `sVersion`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `getCursorPos()`
    `java.lang.String` | `getText()` Returns the text of this field.
    `int` | `setCursorPos(int pos)`
    `void` | `setText(java.lang.CharSequence text)` Set the textual content of the widget.
    `void` | `setText(java.lang.CharSequence text, int caretPos)` Sets the textual content and show it with the given caret position.
    `void` | `setTextStyle(GralColor color, GralFont font)` Sets the style of all new set and added texts.

    - ### Methods inherited from interface org.vishia.gral.ifc.GralWidget_ifc

      `createImplWidget_Gthread, getActionChange, getBackColor, getCmd, getContentIdent, getContentInfo, getData, getDataPath, getName, gralMng, isChanged, isEditable, isGraphicDisposed, isInFocus, isNotEditableOrShouldInitialize, isVisible, refreshFromVariable, refreshFromVariable, repaint, repaint, setBackColor, setBackgroundColor, setBoundsPixel, setCmd, setContentIdent, setData, setDataPath, setEditable, setFocus, setFocus, setForegroundColor, setHtmlHelp, setLineColor, setTextColor, setToPanel, setVisible`

    - ### Methods inherited from interface org.vishia.util.Removeable

      `remove`

- - ### Field Detail

    - #### version

          static final int version

      Version and history
      - 2012-01-17 new `#setSelection(String)`. The possible values of the string parameter are not defined well yet. The method is only used to show a text right aligned.
      - 2011-12-11 chg `setText(CharSequence)` now uses CharSequence instead String. A CharSequence is more universal. Internally the contained String will be copied.
      - 2011-12-01 new `getCursorPos()`, to get parts of selected texts in a box. It is used for commands in the output window for JavaCommander.
      - 2011-09-00 created, universal access to textual kind fields.
      Copyright/Copyleft:
      For this source the LGPL Lesser General Public License, published by the Free Software Foundation is valid. It means:
      1. You can use this source without any restriction for any desired purpose.
      2. You can redistribute copies of this source to everybody.
      3. Every user of this source, also the user of redistribute copies with or without payment, must accept this license for further using.
      4. But the LPGL is not appropriate for a whole software product, if this source is only a part of them. It means, the user must publish this part of source, but doesn't need to publish the whole source of the own product.
      5. You can study and modify (improve) this source for own using or for redistribution, but you have to license the modified sources likewise under this LGPL Lesser General Public License. You mustn't delete this Copyright/Copyleft inscription in this source file.
      If you intent to use this source without publishing its usage, you can get a second license subscribing a special contract with the author.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### setText

          void setText(java.lang.CharSequence text)

      Set the textual content of the widget. This method is able to call in any thread. The text may be stored in a queue and applied to the widget in the graphical thread.
      Specified by:
        `setText` in interface `GralWidget_ifc`
      Parameters:
        `text` - The content

    - #### setText

          void setText(java.lang.CharSequence text,
                       int caretPos)

      Sets the textual content and show it with the given caret position. It is adequate `setText(CharSequence)` if caretPos = 0.
      Parameters:
        `text` - The text to show in the widget.
        `caretPos` - 0 for left, -1 for right, 0 to Integer.MAXINT for a given position. If the caret position is greater then the number of chars, it is set right. That character which is left from the caret position is shown guaranteed in the text field. Especially -1 can be given to show the text right-aligned.

    - #### getText

          java.lang.String getText()

      Returns the text of this field. Returns always a valid String object, "" if the text was never set.

    - #### getCursorPos

          int getCursorPos()

    - #### setCursorPos

          int setCursorPos(int pos)

    - #### setTextStyle

          void setTextStyle(GralColor color,
                            GralFont font)

      Sets the style of all new set and added texts. The content contained in the text field or box are not changed.
      Parameters:
        `color` -
        `font` -