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 voidNavigates to the specified URL.static voidNavigates to the specified URL.static voidnavigate(BusinessObject<?> businessObject) Navigates to the specified business object.static voidnavigate(BusinessObject<?> businessObject, boolean newTab) Navigates to the specified business object.static voidnavigate(BusinessObject<?> businessObject, UID searchFilterUid) Navigates to the specified business object with a search filter.static voidnavigate(BusinessObject<?> businessObject, UID searchFilterUid, boolean newTab) Navigates to the specified business object with a search filter.static voidnavigate(Direction.AdditionalNavigation additionalNavigation) Navigates to the specified additional navigation.static voidnavigate(Direction.AdditionalNavigation additionalNavigation, boolean newTab) Navigates to the specified additional navigation.static voidSends anCloseCommandto the client.static voidsendCommand(Command command) Sends the given command to the client.static voidsendMessage(boolean translateAndRememberWithGeneratedKey, String message) Sends a message to the client.static voidsendMessage(boolean translateAndRememberWithGeneratedKey, String message, String title) Sends a message with a title to the client.static voidsendMessage(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 voidsendMessage(boolean translateAndRememberWithGeneratedKey, String message, Locale sourceLocale) Sends a message to the client with translation option for a specific locale.static voidsendMessage(boolean translateAndRememberWithGeneratedKey, String message, NuclosLocale sourceLocale) Sends a message to the client with translation option for a specific Nuclos locale.static voidsendMessage(String message) Sends a message to the client.static voidsendMessage(String message, String title) Sends a message with a title to the client.static voidsendMessage(String key, String message, String title) Sends a message with a title to the client using a specific localization key.static voidsendMessage(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 voidsendMessage(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 voidsendMessage(DoNotTranslate message) Sends a message to the client without translation.static voidsendMessage(DoNotTranslate message, DoNotTranslate title) Sends a message with a title to the client without translation.static voidsendMessageDoNotTranslate(String message) Sends a message to the client without translation.static voidsendMessageDoNotTranslate(String message, String title) Sends a message with a title to the client without translation.static voidsendProgress(int percent, boolean translateAndRememberWithGeneratedKey, String message, Locale sourceLocale) Sends a progress update to the client with translation option for a specific locale.static voidsendProgress(int percent, boolean translateAndRememberWithGeneratedKey, String message, NuclosLocale sourceLocale) Sends a progress update to the client with translation option for a specific Nuclos locale.static voidsendProgress(int percent, String message) Sends a progress update to the client.static voidsendProgress(int percent, String key, String message, Locale sourceLocale) Sends a progress update to the client using a specific localization key and locale.static voidsendProgress(int percent, String key, String message, NuclosLocale sourceLocale) Sends a progress update to the client using a specific localization key and Nuclos locale.static voidsendProgress(int percent, DoNotTranslate message) Sends a progress update to the client without translation.static voidsendProgressDoNotTranslate(int percent, String message) Sends a progress update to the client without translation.voidstatic MessageContext.WithArgswithMessageArgs(Object... messageArgs) Creates a new WithArgs instance with the specified message arguments.static MessageContext.WithArgswithTitleArgs(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 anCloseCommandto 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
-