Package velox.api.layer1.messages
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
Messages need to be removed with this message (note that you need to do this in response for close icon pressed as well)
If message with
id was already present, displayed message will be updatedMessages need to be removed with this message (note that you need to do this in response for close icon pressed as well)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classstatic enum -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionLayer1ApiUserMessageNotification(String alias, long id, String text, boolean isAdd, int minWidthPx, Runnable onMessageClosedCallback) Deprecated.Layer1ApiUserMessageNotification(String alias, long id, String text, boolean isAdd, Runnable onMessageClosedCallback, Layer1ApiUserMessageNotification.Type type) -
Method Summary
Modifier and TypeMethodDescriptionbuilder()Builder to buildLayer1ApiUserMessageNotification.static longtoString()
-
Field Details
-
RESERVED_ID_HISTORICAL_DATA
public static final long RESERVED_ID_HISTORICAL_DATA -
alias
-
text
-
id
public final long id -
isAdd
public final boolean isAdd -
onMessageClosedCallback
-
minWidthPx
Deprecated. -
type
-
-
Constructor Details
-
Layer1ApiUserMessageNotification
@Deprecated public Layer1ApiUserMessageNotification(String alias, long id, String text, boolean isAdd, int minWidthPx, Runnable onMessageClosedCallback) Deprecated.UseLayer1ApiUserMessageNotification(String, long, String, boolean, Runnable, Type)or the builder. This constructor is deprecated because it relies on an implicitLayer1ApiUserMessageNotification.Type.INFOvalue and theminWidthPxparameter is no longer available and is kept only for backward compatibility.- Parameters:
alias- target alias of message, or null if notification is for all aliasesid- unique id of message (usegetNextId()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,textmust 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 removedminWidthPx- 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 accessminWidthPxfield 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 aliasesid- unique id of message (usegetNextId()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,textmust 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 removedonMessageClosedCallback- if not null, message will have cross icon, and callback will be called when it's pressedtype- notification type that defines visual style and severity (INFO, WARNING, ERROR); if null,Layer1ApiUserMessageNotification.Type.INFOwill be used
-
-
Method Details
-
getNextId
public static long getNextId()- Returns:
- unique id
-
builder
Builder to buildLayer1ApiUserMessageNotification. -
toString
-
Layer1ApiUserMessageNotification(String, long, String, boolean, Runnable, Type)or the builder.