com.levigo.util.swing.messaging
Class Message

java.lang.Object
  extended by com.levigo.util.swing.messaging.Message

public class Message
extends Object

An object to hold message relevant data.

Author:
Carolin Koehler

Field Summary
static String CHOICE
           
static String CONFIRM
           
static String DISPLAY
           
static String ERROR
           
static String HIDDEN_INPUT
           
static String INFO
           
static String INPUT
           
static String NO
           
static String NOTICE
           
static String WARNING
           
static String YES
           
 
Constructor Summary
Message(String id, String type, String severity, String title, String body, String details, String description, Throwable e, String[] controlTexts, boolean isSuppressable, boolean isSuppressed)
          Constructor
Message(String id, String type, String severity, String title, String body, String details, String description, Throwable e, String[] controlTexts, String[] controlMnemonics, boolean isSuppressable, boolean isSuppressed)
          Constructor
Message(String id, String type, String severity, String title, String body, String details, Throwable e, String[] controlTexts)
          Constructor
 
Method Summary
 String getBodyText()
          Gets the message content text,
 String[] getControlLabels()
          Gets an array of message control labels.
 String[] getControlMnemonics()
          Gets an array of message control mnemonics.
 String getDescription()
          Returns the description text of a message.
 String getDetailsText()
          Gets more detailed information belonging to the message.
 String getIdentifier()
          Returns the messageIdentifier.
 String getSeverity()
           
 String getTitleText()
          Returns the title text that characterizes the message.
 String getType()
           
 boolean isSuppressable()
          Tells you if a message can be suppressed.
 boolean isSuppressed()
          Tells you if a message is suppressed.
 void setBodyText(String bodyText)
          Sets the bodyText.
 void setControlLabels(String[] controlLabels)
          Sets the controlLabels.
 void setDetailsText(String detailsText)
          Sets more detailed information belonging to the message
 void setException(Throwable e)
          Sets the exception held by this message.
 void setIdentifier(String messageIdentifier)
          Sets the messageIdentifier.
 void setSeverity(String severity)
           
 void setTitleText(String titleText)
          Sets the title of the message.
 void setType(String type)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DISPLAY

public static final String DISPLAY
See Also:
Constant Field Values

CONFIRM

public static final String CONFIRM
See Also:
Constant Field Values

CHOICE

public static final String CHOICE
See Also:
Constant Field Values

INPUT

public static final String INPUT
See Also:
Constant Field Values

HIDDEN_INPUT

public static final String HIDDEN_INPUT
See Also:
Constant Field Values

NOTICE

public static final String NOTICE
See Also:
Constant Field Values

INFO

public static final String INFO
See Also:
Constant Field Values

WARNING

public static final String WARNING
See Also:
Constant Field Values

ERROR

public static final String ERROR
See Also:
Constant Field Values

NO

public static final String NO
See Also:
Constant Field Values

YES

public static final String YES
See Also:
Constant Field Values
Constructor Detail

Message

public Message(String id,
               String type,
               String severity,
               String title,
               String body,
               String details,
               Throwable e,
               String[] controlTexts)
Constructor

Parameters:
id - The key that identifies this message
type - The type of the message. One of CHOICE, CONFIRM, DISPLAY, INPUT
severity - The severity of the message. One of INFO, WARNING, ERROR.
title - the title of the message
body - the message body
details - an additional, more detailed message text
e - An exception that can be held by this message
controlTexts - an array with the control labels of the displayed message at position 0 confirm button name e.g. "OK", at position 1 cancel button name e.g. "CANCEL"

Message

public Message(String id,
               String type,
               String severity,
               String title,
               String body,
               String details,
               String description,
               Throwable e,
               String[] controlTexts,
               boolean isSuppressable,
               boolean isSuppressed)
Constructor

Parameters:
id - The key that identifies this message
type - The type of the message. One of CHOICE, CONFIRM, DISPLAY, INPUT
severity - The severity of the message. One of INFO, WARNING, ERROR.
title - the title of the message
body - the message body
details - an additional, more detailed message text
e - An exception that can be held by this message
controlTexts - an array with the control labels of the displayed message at position 0 confirm button name e.g. "OK", at position 1 cancel button name e.g. "CANCEL"

Message

public Message(String id,
               String type,
               String severity,
               String title,
               String body,
               String details,
               String description,
               Throwable e,
               String[] controlTexts,
               String[] controlMnemonics,
               boolean isSuppressable,
               boolean isSuppressed)
Constructor

Parameters:
id - The key that identifies this message
type - The type of the message. One of CHOICE, CONFIRM, DISPLAY, INPUT
severity - The severity of the message. One of INFO, WARNING, ERROR.
title - the title of the message
body - the message body
details - an additional, more detailed message text
e - An exception that can be held by this message
controlTexts - an array with the control labels of the displayed message at position 0 confirm button name e.g. "OK", at position 1 cancel button name e.g. "CANCEL"
controlMnemonics - an array with mnemonics for the control labels of the displayed message at position 0 confirm button mnemonic e.g. "O" for the "OK"-Button, at position 1 confirm button mnemonic e.g. "N" for the "NO"-Button, etc.
isSuppressable - flag indicating whether the message is suppressable
isSuppressed - flag indicating whether the message is suppressed
Method Detail

getBodyText

public String getBodyText()
Gets the message content text,

Returns:
String

getControlLabels

public String[] getControlLabels()
Gets an array of message control labels. Position 0 refers to the OK button, position 1 to the CANCEL button, position[2..n] can be used for special purposes

Returns:
String[]

getControlMnemonics

public String[] getControlMnemonics()
Gets an array of message control mnemonics. Position 0 refers to the OK button, position 1 to the CANCEL or NO button, position[2..n] can be used for special purposes

Returns:
String[]

getDetailsText

public String getDetailsText()
Gets more detailed information belonging to the message. When an exception is part of the message, the original details text and the exception's details (cause messages) are concatenated.

Returns:
The details (plus, if available, the exception's message) of this message

getTitleText

public String getTitleText()
Returns the title text that characterizes the message.

Returns:
The title text to be displayed with the message

getDescription

public String getDescription()
Returns the description text of a message.

Returns:
the description text of a message

setBodyText

public void setBodyText(String bodyText)
Sets the bodyText.

Parameters:
bodyText - The bodyText to set

setControlLabels

public void setControlLabels(String[] controlLabels)
Sets the controlLabels.

Parameters:
controlLabels - The controlLabels to set

setDetailsText

public void setDetailsText(String detailsText)
Sets more detailed information belonging to the message

Parameters:
detailsText - The detailsText to set

setTitleText

public void setTitleText(String titleText)
Sets the title of the message.

Parameters:
titleText - The titleText to set

getType

public String getType()

getSeverity

public String getSeverity()

setType

public void setType(String type)

setSeverity

public void setSeverity(String severity)

getIdentifier

public String getIdentifier()
Returns the messageIdentifier.

Returns:
String

setIdentifier

public void setIdentifier(String messageIdentifier)
Sets the messageIdentifier.

Parameters:
messageIdentifier - The messageIdentifier to set

setException

public void setException(Throwable e)
Sets the exception held by this message. Messages that don't refer to an exception simply hold null here.

Parameters:
e - The exception to be held by the message

isSuppressable

public boolean isSuppressable()
Tells you if a message can be suppressed.


isSuppressed

public boolean isSuppressed()
Tells you if a message is suppressed.


toString

public String toString()
Overrides:
toString in class Object


Copyright © 1995-2020 levigo holding gmbh. All Rights Reserved.