Class Layer1ApiUserMessageNotification

java.lang.Object
velox.api.layer1.messages.Layer1ApiUserMessageNotification
All Implemented Interfaces:
velox.api.layer1.messages.EchoMessage

public class Layer1ApiUserMessageNotification extends Object implements velox.api.layer1.messages.EchoMessage
Can be used to print some text over chart with optional close icon
If message with id was already present, displayed message will be updated
Messages need to be removed with this message (note that you need to do this in response for close icon pressed as well)
  • Field Details

    • RESERVED_ID_HISTORICAL_DATA

      public static final long RESERVED_ID_HISTORICAL_DATA
    • alias

      public final String alias
    • text

      public final String text
    • id

      public final long id
    • isAdd

      public final boolean isAdd
    • onMessageClosedCallback

      public final Runnable onMessageClosedCallback
    • minWidthPx

      @Deprecated public final int minWidthPx
      Deprecated.
    • type

  • Constructor Details

    • Layer1ApiUserMessageNotification

      @Deprecated public Layer1ApiUserMessageNotification(String alias, long id, String text, boolean isAdd, int minWidthPx, Runnable onMessageClosedCallback)
      Deprecated.
      Use Layer1ApiUserMessageNotification(String, long, String, boolean, Runnable, Type) or the builder. This constructor is deprecated because it relies on an implicit Layer1ApiUserMessageNotification.Type.INFO value and the minWidthPx parameter is no longer available and is kept only for backward compatibility.
      Parameters:
      alias - target alias of message, or null if notification is for all aliases
      id - unique id of message (use getNextId() to generate it first time)
      text - message text to display. Can be plain text or HTML. Line breaks in plain text can be specified using \n. When HTML is used, text must be an HTML fragment: you do not need to wrap it into <html> and <body> tags. Hyperlinks are supported and rendered as clickable links. Example of HTML text message: "Message with <a href=\"https://example.com\">link</a>".
      isAdd - if true, message is displayed (if message with this id is already displayed - it will be updated) otherwise message with this id will be removed
      minWidthPx - minimum width required to paint this string. Ignored. This parameter is no longer used and is kept only for binary backward compatibility with older external components that might access minWidthPx field directly.
      onMessageClosedCallback - if not null, message will have cross icon, and callback will be called when it's pressed
    • Layer1ApiUserMessageNotification

      public Layer1ApiUserMessageNotification(String alias, long id, String text, boolean isAdd, Runnable onMessageClosedCallback, Layer1ApiUserMessageNotification.Type type)
      Parameters:
      alias - target alias of message, or null if notification is for all aliases
      id - unique id of message (use getNextId() to generate it first time)
      text - message text to display. Can be plain text or HTML. Line breaks in plain text can be specified using \n. When HTML is used, text must be an HTML fragment: you do not need to wrap it into <html> and <body> tags. Hyperlinks are supported and rendered as clickable links. Example of HTML text message: "Message with <a href=\"https://example.com\">link</a>".
      isAdd - if true, message is displayed (if message with this id is already displayed - it will be updated) otherwise message with this id will be removed
      onMessageClosedCallback - if not null, message will have cross icon, and callback will be called when it's pressed
      type - notification type that defines visual style and severity (INFO, WARNING, ERROR); if null, Layer1ApiUserMessageNotification.Type.INFO will be used
  • Method Details