|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ptc.core.components.util.FeedbackMessage
public class FeedbackMessage
A class used for creating standardized user feedback messages for display
in javascript alert or confirm dialog windows.
Messages are formatted as follows:
<MESSAGE_TYPE_STRING>: <Message title>
<Message text 1>
<Message text 2>
.
.
<Message text n >
The MESSAGE_TYPE_STRING will be automatically generated based on the input message type.
Can accept localized or nonlocalized message title and message text.
Supported API: true
Extendable: false
| Constructor Summary | |
|---|---|
FeedbackMessage(FeedbackType type,
Locale locale,
LocalizableMessage msgTitle,
ArrayList<String> incorrectFieldNames,
LocalizableMessage... msgs)
Supported API: true |
|
FeedbackMessage(FeedbackType type,
Locale locale,
String msgTitle,
ArrayList<String> incorrectFieldNames,
String... msgs)
Supported API: true |
|
| Method Summary | |
|---|---|
void |
addMessage(LocalizableMessage msg)
Adds a localizable message to the message list. |
void |
addMessage(String msg)
Adds a localized message to the message list. |
static String |
formatException(Throwable t,
LocalizableMessage messageTitle,
boolean includeNested,
Locale locale)
Format a Throwable message into a standard multiline message string The text displayed for MESSAGE_TYPE will be that appropriate for messages of type FeedbackType.FAILURE. |
static String |
formatMessage(FeedbackType type,
Locale locale,
String messageTitle,
String... messageText)
Formats the localized input text into the standard message format described in the class-level javadoc. |
String |
getLocalizedDisplayMessage()
Returns a formatted, localized, multi-line display message. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FeedbackMessage(FeedbackType type,
Locale locale,
String msgTitle,
ArrayList<String> incorrectFieldNames,
String... msgs)
throws WTException
type - - Message type. Only the following three types are handled: FeedbackType.SUCCESS, FeedbackType.FAILURE,
and FeedbackType.CONFIRMATION. Optional.locale - - Locale to use for localization. Optional. If null, SessionHelper.getLocale() will be used.msgTitle - - Localized message title. Optional.incorrectFieldNames - - Name attribute of the incorrect input field(s) with which this message is associated so
user can be returned to that field. Currently not used.msgs - - One or more localized message text strings. Optional.
WTException
public FeedbackMessage(FeedbackType type,
Locale locale,
LocalizableMessage msgTitle,
ArrayList<String> incorrectFieldNames,
LocalizableMessage... msgs)
throws WTException
type - - Message type. Only the following three types are handled: FeedbackType.SUCCESS, FeedbackType.FAILURE,
and FeedbackType.CONFIRMATION. Optional.locale - - Locale to use for localization. Optional. If null, SessionHelper.getLocale() will be used.incorrectFieldNames - - Name attribute of the incorrect input field(s) with which this message is associated so
user can be returned to that field. Currently not used.msgTitle - - Localizable message title. Optional.msgs - - One or more localizable message text strings. Optional.
WTException| Method Detail |
|---|
public void addMessage(String msg)
msg - - message to add. Required.public void addMessage(LocalizableMessage msg)
msg - - message to add. Required.public String getLocalizedDisplayMessage()
locale - - locale to use for localization. Optional. If null, locale will be obtained from SessionHelper.getLocale().
public static String formatException(Throwable t,
LocalizableMessage messageTitle,
boolean includeNested,
Locale locale)
t - - Throwable containing message to display. Required.msgTitle - - Localized message title. Optional.includeNested - - if true and t is a WTException, nested exception messages will also be returned. Required.locale - - Locale to use for localization. Optional. If null, SessionHelper.getLocale() will be used.
public static String formatMessage(FeedbackType type,
Locale locale,
String messageTitle,
String... messageText)
type - - Message type. Only the following three types are handled: FeedbackType.SUCCESS, FeedbackType.FAILURE,
and FeedbackType.CONFIRMATION. Optional. If null, no title line will be returned and msgTitle will be ignored.locale - - Locale to use for localization of the Message Type string. Optional. If null, SessionHelper.getLocale() will be used.msgTitle - - Localized message title. Optional.msgs - - One or more localized message text strings. Optional.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||