org.vishia.gral.widget

## Class GralMsgOutputList

- java.lang.Object
- - org.vishia.gral.widget.GralMsgOutputList

- All Implemented Interfaces:
    LogMessage

      public class GralMsgOutputList
      extends java.lang.Object
      implements LogMessage

  This class supports output of messages in a GralTable to view and scroll. The table contains only a defined maximum of messages, older messages will be removed if the capacity is used. It is recommended to write messages in a persistent medium additionally (usual a `LogMessageFile`).

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `private java.text.SimpleDateFormat` | `dateFormat`
    `private GralMng_ifc` | `guiAccess` The access to the gui, to change data to show.
    `private java.util.Locale` | `localization`
    `static int` | `version` Version, history and license.

    - ### Fields inherited from interface org.vishia.msgDispatch.LogMessage

      `sVersion`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `GralMsgOutputList(GralMng_ifc guiAccess, java.lang.String sTimeZoneShow, java.lang.String sTimeFormat)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` A call of this method closes the devices, which processed the message.
    `void` | `flush()` A call of this method causes an activating of transmission of all messages since last flush.
    `boolean` | `isOnline()` Checks whether the message output is available.
    `boolean` | `sendMsg(int identNumber, java.lang.String text, java.lang.Object... args)` Sends a message.
    `boolean` | `sendMsgTime(int identNumber, OS_TimeStamp creationTime, java.lang.String text, java.lang.Object... args)` Sends a message.
    `boolean` | `sendMsgVaList(int identNumber, OS_TimeStamp creationTime, java.lang.String text, Va_list args)` This is the only one method, which is called from the message dispatcher.

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

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

- - ### Field Detail

    - #### version

          public static final int version

      Version, history and license.
      - 2013-01-26 Hartmut:fine tuning while adapt message system in component javaSrc_vishiaRun.
      - 2011-04-05 Hartmut creation
      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 ist 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 intent 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

    - #### guiAccess

          private final GralMng_ifc guiAccess

      The access to the gui, to change data to show.

    - #### dateFormat

          private final java.text.SimpleDateFormat dateFormat

    - #### localization

          private final java.util.Locale localization

  - ### Constructor Detail

    - #### GralMsgOutputList

          public GralMsgOutputList(GralMng_ifc guiAccess,
                                   java.lang.String sTimeZoneShow,
                                   java.lang.String sTimeFormat)

  - ### Method Detail

    - #### close

          public void close()

      Description copied from interface: `org.vishia.msgDispatch.LogMessage`
      A call of this method closes the devices, which processed the message. It is abstract. It depends from the kind of device, what `close` mean. If the device is a log file writer it should be clearly. `close` may mean, the processing of messages is finite temporary. An `open` occurs automatically, if a new message is dispatched.
      Specified by:
        `close` in interface `LogMessage`

    - #### flush

          public void flush()

      Description copied from interface: `org.vishia.msgDispatch.LogMessage`
      A call of this method causes an activating of transmission of all messages since last flush. It is abstract. It depends from the kind of device, what `flush` mean. If the device is a log file writer it should be clearly. `flush` may mean, the processing of messages is ready to transmit yet.
      Specified by:
        `flush` in interface `LogMessage`

    - #### isOnline

          public boolean isOnline()

      Description copied from interface: `org.vishia.msgDispatch.LogMessage`
      Checks whether the message output is available.
      Specified by:
        `isOnline` in interface `LogMessage`

    - #### sendMsg

          public boolean sendMsg(int identNumber,
                                 java.lang.String text,
                                 java.lang.Object... args)

      Description copied from interface: `org.vishia.msgDispatch.LogMessage`
      Sends a message. The timestamp of the message is build with the system time. All other parameter are identically see `#sendMsg(int, OS_TimeStamp, String, Object...)`.
      Specified by:
        `sendMsg` in interface `LogMessage`
      Parameters:
        `identNumber` - of the message. If it is negative, it is the same message as positive number, but with information 'going state', where the positive number is 'coming state'.
        `text` - The text representation of the message, format string, see java.lang.String.format(..).
        `args` - 0, 1 or more arguments of any type. The interpretation of the arguments is controlled by param text.
      Returns:
        true if the message will be dispatched, false if it is suppressed

    - #### sendMsgTime

          public boolean sendMsgTime(int identNumber,
                                     OS_TimeStamp creationTime,
                                     java.lang.String text,
                                     java.lang.Object... args)

      Description copied from interface: `org.vishia.msgDispatch.LogMessage`
      Sends a message.
      Specified by:
        `sendMsgTime` in interface `LogMessage`
      Parameters:
        `identNumber` - of the message. If it is negative, it is the same message as positive number, but with information 'going state', where the positive number is 'coming state'.
        `creationTime` - absolute time stamp. @Java2C=perValue.
        `text` - The text representation of the message, format string, see java.lang.String.format(..).
        `args` - 0, 1 or more arguments of any type. The interpretation of the arguments is controlled by param text.
      Returns:
        true if the message will be dispatched, false if it is suppressed

    - #### sendMsgVaList

          public boolean sendMsgVaList(int identNumber,
                                       OS_TimeStamp creationTime,
                                       java.lang.String text,
                                       Va_list args)

      This is the only one method, which is called from the message dispatcher. Only this is implemented.
      Specified by:
        `sendMsgVaList` in interface `LogMessage`
        `text` - The text of the message: Hint for Java2C: This is a StringJc, not a simple char const*. That is necessary because the String may be replaced.
        `args` - Reference to a buffer which contains the values for a variable argument list.
        In C implementation it is a reference either to the stack, or to a buffer elsewhere, but the reference type is appropriate to provide the values in stack for calling routines with variable argument list such as `vprintf(buffer, text, args)`. The referenced instance shouldn't accepted as persistent outside processing time of the called routine. Therefore stack content is able to provide.
        In Java it is a special class wrapping a Object[] tantamount to a Object... as variable argument list. Using of this wrapper class is only a concession to C-programming, because in Java an Object[] would adequate.
      Returns:
        true than okay. It is possible, that a destination for dispatching is not available yet. Than the routine returns false. That is for special outputs of message dispatcher. Normally the user shouldn't realize false here and react anywise. If a message isn't able to transport, it is not visible in the creating thread. It is possible that a message is lost anywhere in transportation way. In Generally, to secure a complex systems functionality, any timeouts, repeats and backup strategies are necessary in the supervise software above sending a single message.
      See Also:
        `LogMessage.sendMsgVaList(int, org.vishia.bridgeC.OS_TimeStamp, java.lang.String, org.vishia.bridgeC.Va_list)`