- java.lang.Object
-
- com.gluonhq.charm.glisten.control.Message
-
public abstract class Message extends Object
Message provide lightweight feedback about an operation. They are displayed at the bottom of the screen and disappear automatically. Developers are advised to use a duration of eitherLENGTH_SHORTorLENGTH_LONGwhich corresponds to 2 and 3.5 seconds respectively.There are two types of Message:
-
-
Property Summary
Properties Type Property Description ObjectProperty<Duration>durationThe time the Message is shown.StringPropertyidThe id of thisMessage.StringPropertymessageThe message to display.
-
Field Summary
Fields Modifier and Type Field Description static DurationLENGTH_LONGA long amount of time to display the message - 3500 ms.static DurationLENGTH_SHORTA short amount of time to display the message - 2000 ms.
-
Constructor Summary
Constructors Constructor Description Message()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidcancel()If the Message is currently showing, calling this method will hide it immediately and show the next Message in queue.ObjectProperty<Duration>durationProperty()The time the Message is shown.DurationgetDuration()Gets the value of the property duration.StringgetId()Gets the value of the property id.StringgetMessage()Gets the value of the property message.StringPropertyidProperty()The id of thisMessage.StringPropertymessageProperty()The message to display.voidsetDuration(Duration duration)Sets the value of the property duration.voidsetId(String id)Sets the value of the property id.voidsetMessage(String text)Sets the value of the property message.abstract voidshow()Shows the Message immediately, if no other message is showing.
-
-
-
Property Detail
-
message
public final StringProperty messageProperty
The message to display.- See Also:
getMessage(),setMessage(String)
-
duration
public final ObjectProperty<Duration> durationProperty
The time the Message is shown.- See Also:
getDuration(),setDuration(Duration)
-
id
public final StringProperty idProperty
The id of thisMessage. This simple string identifier is useful for finding a specific Message within the scene graph. While the id of a notification should be unique within the scene graph, this uniqueness is not enforced. This is analogous to the "id" attribute on an HTML element (CSS ID Specification).For example, if a notification is given the id of "myId", then the lookup method can be used to find this notification as follows:
scene.lookup("#myId");.- Default value:
- null
- See Also:
getId(),setId(String)
-
-
Method Detail
-
setMessage
public final void setMessage(String text)
Sets the value of the property message.- Property description:
- The message to display.
-
getMessage
public final String getMessage()
Gets the value of the property message.- Property description:
- The message to display.
-
messageProperty
public final StringProperty messageProperty()
The message to display.- See Also:
getMessage(),setMessage(String)
-
setDuration
public final void setDuration(Duration duration)
Sets the value of the property duration.- Property description:
- The time the Message is shown.
-
getDuration
public final Duration getDuration()
Gets the value of the property duration.- Property description:
- The time the Message is shown.
-
durationProperty
public final ObjectProperty<Duration> durationProperty()
The time the Message is shown.- See Also:
getDuration(),setDuration(Duration)
-
idProperty
public final StringProperty idProperty()
The id of thisMessage. This simple string identifier is useful for finding a specific Message within the scene graph. While the id of a notification should be unique within the scene graph, this uniqueness is not enforced. This is analogous to the "id" attribute on an HTML element (CSS ID Specification).For example, if a notification is given the id of "myId", then the lookup method can be used to find this notification as follows:
scene.lookup("#myId");.- Default value:
- null
- See Also:
getId(),setId(String)
-
setId
public final void setId(String id)
Sets the value of the property id.- Property description:
- The id of this
Message. This simple string identifier is useful for finding a specific Message within the scene graph. While the id of a notification should be unique within the scene graph, this uniqueness is not enforced. This is analogous to the "id" attribute on an HTML element (CSS ID Specification).For example, if a notification is given the id of "myId", then the lookup method can be used to find this notification as follows:
scene.lookup("#myId");. - Default value:
- null
-
getId
public final String getId()
Gets the value of the property id.- Property description:
- The id of this
Message. This simple string identifier is useful for finding a specific Message within the scene graph. While the id of a notification should be unique within the scene graph, this uniqueness is not enforced. This is analogous to the "id" attribute on an HTML element (CSS ID Specification).For example, if a notification is given the id of "myId", then the lookup method can be used to find this notification as follows:
scene.lookup("#myId");. - Default value:
- null
-
show
public abstract void show()
Shows the Message immediately, if no other message is showing. If a message is already showing, it gets added to the waiting queue and will show when its turn arrives.
-
cancel
public abstract void cancel()
If the Message is currently showing, calling this method will hide it immediately and show the next Message in queue. If the Message is waiting in the queue, calling this method removes the Message from the queue and the Message is never shown.
-
-