org.vishia.gral.base

## Class GralTextBox

- java.lang.Object
- - org.vishia.gral.base.GralWidget
  - - org.vishia.gral.base.GralTextField
    - - org.vishia.gral.base.GralTextBox

- All Implemented Interfaces:
    java.lang.Appendable, GetGralWidget_ifc, GralSetValue_ifc, GralTextBox_ifc, GralTextField_ifc, GralWidget_ifc, Removeable

      public class GralTextBox
      extends GralTextField
      implements java.lang.Appendable, GralTextBox_ifc

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `GralTextBox.GraphicImplAccess`

    - ### Nested classes/interfaces inherited from class org.vishia.gral.base.GralTextField

      `GralTextField.Type`

    - ### Nested classes/interfaces inherited from class org.vishia.gral.base.GralWidget

      `GralWidget.ActionChangeSelect, GralWidget.ConfigData, GralWidget.DynamicData, GralWidget.ImplAccess`

    - ### 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
    --- | ---
    `private java.lang.StringBuffer` | `newText` Buffer for new text which is set or appended in another thread than the graphic thread.
    `static java.lang.String` | `sVersion` Version and history 2014-08-16 Hartmut chg: GrapTextBox not abstract, using GraphicImplAccess like new concept of all GralWidgets.

    - ### Fields inherited from class org.vishia.gral.base.GralTextField

      `borderwidth, bPassword, caretPos, gralKeyListener, sPrompt, sPromptStylePosition, user, version, windowMng`

    - ### Fields inherited from class org.vishia.gral.base.GralWidget

      `_wdgImpl, bEditable, bHasFocus, bShouldInitialize, buildMng, bVisibleState, cfg, contextMenu, dateUser, dyda, htmlHelp, itsMng, lastTimeSetVisible, name, repaintDelay, repaintDelayMax, sCmd, sFormat, sToolTip, whatIs`

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

      `version`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GralTextBox(java.lang.String name, GralTextField.Type... property)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.Appendable` | `append(char arg0)` Append a single char, able to call threadsafe in any thread.
    `java.lang.Appendable` | `append(java.lang.CharSequence arg0)` Append the text, able to call threadsafe in any thread.
    `java.lang.Appendable` | `append(java.lang.CharSequence arg0, int arg1, int arg2)` Append a sub char sequence, able to call threadsafe in any thread.
    `int` | `getNrofLines()`
    `void` | `setEditable(boolean editable)` Sets whether it is able to edit the content of the text field or text box.
    `void` | `setTextStyle(GralColor color, GralFont font)` Sets the style of all new set and added texts.
    `void` | `viewTrail()` Sets the view to the trail of the text.

    - ### Methods inherited from class org.vishia.gral.base.GralTextField

      `getCursorPos, getPromptLabelImpl, getValue, setBorderWidth, setCursorPos, setFormat, setLongValue, setPrompt, setPrompt, setText, setText, setUser, setValue, setValue, setValue`

    - ### Methods inherited from class org.vishia.gral.base.GralWidget

      `chgPos, clearShowParam, createImplWidget_Gthread, getActionChange, getActionChangeStrict, getActionDrag, getActionDrop, getActionFocused, getActionShow, getBackColor, getCfgElement, getCmd, getCmd, getContentIdent, getContentInfo, getContextMenu, getData, getDataIx, getDataPath, getDataPath, getFloatValue, getFormat, getGralWidget, getHtmlHelp, getImpl, getItsPanel, getLongValue, getName, getShowMethod, getShowParam, getsToolTip, getText, getVariable, getVariableFromContentInfo, gralMng, isChanged, isEditable, isGraphicDisposed, isInFocus, isNotEditableOrShouldInitialize, isVisible, pos, refreshFromVariable, refreshFromVariable, registerWidget, remove, repaint, repaint, requestNewValueForVariable, setActionChange, setActionFocused, setActionMouse, setActionShow, setBackColor, setBackgroundColor, setBoundsPixel, setCfgElement, setCmd, setContentIdent, setContentInfo, setData, setDataIx, setDataPath, setDragEnable, setDropEnable, setFocus, setFocus, setForegroundColor, setHtmlHelp, setLineColor, setMinMax, setPanelMng, setPrimaryWidgetOfPanel, setTextColor, setToolTip, setToPanel, setValue, setValue, setVisible, setVisibleState, setVisibleStateWidget, specifyActionChange, specifyContextMenu, stop, toString, XXXgetPixelPositionSize, XXXgetWidgetImplementation, XXXremoveWidgetImplementation, XXXrepaintGthread, XXXsetFocusGThread, XXXsetVisibleGThread`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

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

      `getCursorPos, getText, setCursorPos, setText, setText`

    - ### 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, setFocus, setFocus, setForegroundColor, setHtmlHelp, setLineColor, setTextColor, setToPanel, setVisible`

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

      `remove`

- - ### Field Detail

    - #### sVersion

          public static final java.lang.String sVersion

      Version and history
      - 2014-08-16 Hartmut chg: GrapTextBox not abstract, using GraphicImplAccess like new concept of all GralWidgets.
      - 2012-01-06 Hartmut chg: The `append(CharSequence)` etc. methods are implemented in this super class instead in the graphic layer implementation classes. Therefore the methods `#appendTextInGThread(CharSequence)` and `#setTextInGThread(CharSequence)` are defined here to implement in the graphic layer. The set- and apppend methods are threadsafe now.
      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 don'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 are indent to use this sources without publishing its usage, you can get a second license subscribing a special contract with the author.
      See Also:
        Constant Field Values

    - #### newText

          private java.lang.StringBuffer newText

      Buffer for new text which is set or appended in another thread than the graphic thread. This buffer is empty if the graphic thread has processed the `GralGraphicTimeOrder` after calling `append(CharSequence)` or `GralTextField.setText(CharSequence)`. It is filled only temporary.

  - ### Constructor Detail

    - #### GralTextBox

          public GralTextBox(java.lang.String name,
                             GralTextField.Type... property)

  - ### Method Detail

    - #### append

          public final java.lang.Appendable append(java.lang.CharSequence arg0)
                                            throws java.io.IOException

      Append the text, able to call threadsafe in any thread. If the thread is the graphic thread, the text will be appended to the current text of the widget immediately. But if the thread is any other one, the text will be stored in a StringBuilder and the graphic thread will be waked up with the `#appendTextViewTrail` dispatch listener.
      Specified by:
        `append` in interface `java.lang.Appendable`
      Throws:
        `java.io.IOException`
      See Also:
        `Appendable.append(java.lang.CharSequence)`

    - #### append

          public final java.lang.Appendable append(char arg0)
                                            throws java.io.IOException

      Append a single char, able to call threadsafe in any thread.
      Specified by:
        `append` in interface `java.lang.Appendable`
      Throws:
        `java.io.IOException`
      See Also:
        `append(CharSequence)`, `Appendable.append(java.lang.CharSequence)`

    - #### append

          public final java.lang.Appendable append(java.lang.CharSequence arg0,
                                                   int arg1,
                                                   int arg2)
                                            throws java.io.IOException

      Append a sub char sequence, able to call threadsafe in any thread.
      Specified by:
        `append` in interface `java.lang.Appendable`
      Throws:
        `java.io.IOException`
      See Also:
        `append(CharSequence)`, `Appendable.append(java.lang.CharSequence, int, int)`

    - #### setTextStyle

          public void setTextStyle(GralColor color,
                                   GralFont font)

      Description copied from interface: `GralTextField_ifc`
      Sets the style of all new set and added texts. The content contained in the text field or box are not changed.
      Specified by:
        `setTextStyle` in interface `GralTextField_ifc`
      Overrides:
        `setTextStyle` in class `GralTextField`

    - #### setEditable

          public void setEditable(boolean editable)

      Description copied from interface: `GralWidget_ifc`
      Sets whether it is able to edit the content of the text field or text box. If a content is not able to edit, it is a showing field or box. The user can't change the content. But the user can set the cursor, select any text and copy to the systems clipboard. If the content is able to edit, the change should be notified and the content should be gotten. To do that TODO
      Specified by:
        `setEditable` in interface `GralWidget_ifc`
      Overrides:
        `setEditable` in class `GralWidget`
      Parameters:
        `editable` - true then the content is going to be able to change. False then the edit functionality is disabled.

    - #### getNrofLines

          public int getNrofLines()

      Specified by:
        `getNrofLines` in interface `GralTextBox_ifc`

    - #### viewTrail

          public void viewTrail()

      Description copied from interface: `GralTextBox_ifc`
      Sets the view to the trail of the text.
      Specified by:
        `viewTrail` in interface `GralTextBox_ifc`