Package org.nuclos.api.context
Class MessageContext
java.lang.Object
org.nuclos.api.context.MessageContext
MessageContext
adds support for sending commands to the client.-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Navigates to the specified URL.static void
Navigates to the specified URL.static void
navigate
(BusinessObject<?> businessObject) Navigates to the specified business object.static void
navigate
(BusinessObject<?> businessObject, boolean newTab) Navigates to the specified business object.static void
navigate
(BusinessObject<?> businessObject, UID searchFilterUid) Navigates to the specified business object with a search filter.static void
navigate
(BusinessObject<?> businessObject, UID searchFilterUid, boolean newTab) Navigates to the specified business object with a search filter.static void
navigate
(Direction.AdditionalNavigation additionalNavigation) Navigates to the specified additional navigation.static void
navigate
(Direction.AdditionalNavigation additionalNavigation, boolean newTab) Navigates to the specified additional navigation.static void
Sends anCloseCommand
to the client.static void
sendCommand
(Command command) Sends the given command to the client.static void
sendMessage
(boolean translateAndRememberWithGeneratedKey, String message) Sends a message to the client.static void
sendMessage
(boolean translateAndRememberWithGeneratedKey, String message, String title) Sends a message with a title to the client.static void
sendMessage
(boolean translateAndRememberWithGeneratedKey, String message, String title, Locale sourceLocale) Sends a message with a title to the client with translation option for a specific locale.static void
sendMessage
(boolean translateAndRememberWithGeneratedKey, String message, Locale sourceLocale) Sends a message to the client with translation option for a specific locale.static void
sendMessage
(boolean translateAndRememberWithGeneratedKey, String message, NuclosLocale sourceLocale) Sends a message to the client with translation option for a specific Nuclos locale.static void
sendMessage
(String message) Sends a message to the client.static void
sendMessage
(String message, String title) Sends a message with a title to the client.static void
sendMessage
(String key, String message, String title) Sends a message with a title to the client using a specific localization key.static void
sendMessage
(String key, String message, String title, Locale sourceLocale) Sends a message with a title to the client using a specific localization key and locale.static void
sendMessage
(String key, String message, String title, NuclosLocale sourceLocale) Sends a message with a title to the client using a specific localization key and Nuclos locale.static void
sendMessage
(DoNotTranslate message) Sends a message to the client without translation.static void
sendMessage
(DoNotTranslate message, DoNotTranslate title) Sends a message with a title to the client without translation.static void
sendMessageDoNotTranslate
(String message) Sends a message to the client without translation.static void
sendMessageDoNotTranslate
(String message, String title) Sends a message with a title to the client without translation.static void
sendProgress
(int percent, boolean translateAndRememberWithGeneratedKey, String message, Locale sourceLocale) Sends a progress update to the client with translation option for a specific locale.static void
sendProgress
(int percent, boolean translateAndRememberWithGeneratedKey, String message, NuclosLocale sourceLocale) Sends a progress update to the client with translation option for a specific Nuclos locale.static void
sendProgress
(int percent, String message) Sends a progress update to the client.static void
sendProgress
(int percent, String key, String message, Locale sourceLocale) Sends a progress update to the client using a specific localization key and locale.static void
sendProgress
(int percent, String key, String message, NuclosLocale sourceLocale) Sends a progress update to the client using a specific localization key and Nuclos locale.static void
sendProgress
(int percent, DoNotTranslate message) Sends a progress update to the client without translation.static void
sendProgressDoNotTranslate
(int percent, String message) Sends a progress update to the client without translation.void
static MessageContext.WithArgs
withMessageArgs
(Object... messageArgs) Creates a new WithArgs instance with the specified message arguments.static MessageContext.WithArgs
withTitleArgs
(Object... titleArgs) Creates a new WithArgs instance with the specified title arguments.
-
Constructor Details
-
MessageContext
MessageContext()
-
-
Method Details
-
setMessageContextService
-
sendMessage
Sends a message to the client.- Parameters:
message
- The message text to send
-
sendMessage
Sends a message to the client.- Parameters:
translateAndRememberWithGeneratedKey
- If true, translate and remember with a generated keymessage
- The message text to send
-
sendMessage
public static void sendMessage(boolean translateAndRememberWithGeneratedKey, String message, Locale sourceLocale) Sends a message to the client with translation option for a specific locale.- Parameters:
translateAndRememberWithGeneratedKey
- If true, translate and remember with a generated keymessage
- The message text to sendsourceLocale
- The locale of the text
-
sendMessage
public static void sendMessage(boolean translateAndRememberWithGeneratedKey, String message, NuclosLocale sourceLocale) Sends a message to the client with translation option for a specific Nuclos locale.- Parameters:
translateAndRememberWithGeneratedKey
- If true, translate and remember with a generated keymessage
- The message text to sendsourceLocale
- The NuclosLocale of the text
-
sendMessageDoNotTranslate
Sends a message to the client without translation.- Parameters:
message
- The message text to send without translation
-
sendMessage
Sends a message to the client without translation.- Parameters:
message
- The message to send without translation
-
sendMessage
Sends a message with a title to the client.- Parameters:
message
- The message text to sendtitle
- The title for the message
-
sendMessage
public static void sendMessage(boolean translateAndRememberWithGeneratedKey, String message, String title) Sends a message with a title to the client.- Parameters:
translateAndRememberWithGeneratedKey
- If true, translate and remember with a generated keymessage
- The message text to sendtitle
- The title for the message
-
sendMessage
public static void sendMessage(boolean translateAndRememberWithGeneratedKey, String message, String title, Locale sourceLocale) Sends a message with a title to the client with translation option for a specific locale.- Parameters:
translateAndRememberWithGeneratedKey
- If true, translate and remember with a generated keymessage
- The message text to sendtitle
- The title for the messagesourceLocale
- The locale of the text
-
sendMessageDoNotTranslate
Sends a message with a title to the client without translation.- Parameters:
message
- The message text to send without translationtitle
- The title for the message without translation
-
sendMessage
Sends a message with a title to the client without translation.- Parameters:
message
- The message to send without translationtitle
- The title for the message without translation
-
sendMessage
Sends a message with a title to the client using a specific localization key.- Parameters:
key
- The localization key to usemessage
- The message text to sendtitle
- The title for the message
-
sendMessage
Sends a message with a title to the client using a specific localization key and locale.- Parameters:
key
- The localization key to usemessage
- The message text to sendtitle
- The title for the messagesourceLocale
- The locale of the text
-
sendMessage
Sends a message with a title to the client using a specific localization key and Nuclos locale.- Parameters:
key
- The localization key to usemessage
- The message text to sendtitle
- The title for the messagesourceLocale
- The NuclosLocale of the text
-
sendProgress
Sends a progress update to the client.- Parameters:
percent
- The progress percentage (0-100)message
- The progress message text
-
sendProgressDoNotTranslate
Sends a progress update to the client without translation.- Parameters:
percent
- The progress percentage (0-100)message
- The progress message text without translation
-
sendProgress
Sends a progress update to the client without translation.- Parameters:
percent
- The progress percentage (0-100)message
- The progress message without translation
-
sendProgress
public static void sendProgress(int percent, boolean translateAndRememberWithGeneratedKey, String message, Locale sourceLocale) Sends a progress update to the client with translation option for a specific locale.- Parameters:
percent
- The progress percentage (0-100)translateAndRememberWithGeneratedKey
- If true, translate and remember with a generated keymessage
- The progress message textsourceLocale
- The locale of the text
-
sendProgress
public static void sendProgress(int percent, boolean translateAndRememberWithGeneratedKey, String message, NuclosLocale sourceLocale) Sends a progress update to the client with translation option for a specific Nuclos locale.- Parameters:
percent
- The progress percentage (0-100)translateAndRememberWithGeneratedKey
- If true, translate and remember with a generated keymessage
- The progress message textsourceLocale
- The NuclosLocale of the text
-
sendProgress
Sends a progress update to the client using a specific localization key and locale.- Parameters:
percent
- The progress percentage (0-100)key
- The localization key to usemessage
- The progress message textsourceLocale
- The locale of the text
-
sendProgress
Sends a progress update to the client using a specific localization key and Nuclos locale.- Parameters:
percent
- The progress percentage (0-100)key
- The localization key to usemessage
- The progress message textsourceLocale
- The NuclosLocale of the text
-
sendClose
public static void sendClose()Sends anCloseCommand
to the client. -
sendCommand
Sends the given command to the client.- Parameters:
command
-
-
withMessageArgs
Creates a new WithArgs instance with the specified message arguments. Allows for fluent method chaining when sending messages with arguments.- Parameters:
messageArgs
- The arguments to use for message formatting- Returns:
- A new WithArgs instance
-
withTitleArgs
Creates a new WithArgs instance with the specified title arguments. Allows for fluent method chaining when sending messages with arguments.- Parameters:
titleArgs
- The arguments to use for title formatting- Returns:
- A new WithArgs instance
-