net.sf.genuine.resources
Class MessageResourceItem

java.lang.Object
  extended bynet.sf.genuine.resources.MessageResourceItem

public class MessageResourceItem
extends java.lang.Object

A MessageResourceItem is a wrapper for a ResourceItem object that performs checks on the values of the resource item:

If the resource item defines an icon that icon is shown. Otherwise, the typical icon that represents the type is shown.


Constructor Summary
MessageResourceItem(ResourceItem resourceItem)
          Initializes a Message object with the values of a resource item.
MessageResourceItem(ResourceItem resourceItem, java.lang.Object[] parameters)
          Initializes a Message object with the values of a resource item and an array of parameters that have to be inserted into the message text.
 
Method Summary
 java.util.List getButtonsResourceItems()
          Returns a list of ResourceItem objects that has to be used to add buttons to the message box.
 javax.swing.ImageIcon getIcon()
          Returns an icon to be shown in the message box.
 java.lang.String getText()
          Returns the message text into which given parameters are already inserted.
 java.lang.String getTitle()
          Returns the title of the message box.
 boolean isErrorMessage()
          Returns true if this message is an error message.
 boolean isInfoMessage()
          Returns true if this message is an information message.
 boolean isStatusMessage()
          Returns true if this message is a status message.
 boolean isWarningMessage()
          Returns true if this message is a warning message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MessageResourceItem

public MessageResourceItem(ResourceItem resourceItem)
Initializes a Message object with the values of a resource item. All values are checked.


MessageResourceItem

public MessageResourceItem(ResourceItem resourceItem,
                           java.lang.Object[] parameters)
Initializes a Message object with the values of a resource item and an array of parameters that have to be inserted into the message text. See MessageFormat for details.

Method Detail

isStatusMessage

public boolean isStatusMessage()
Returns true if this message is a status message.


isInfoMessage

public boolean isInfoMessage()
Returns true if this message is an information message.


isWarningMessage

public boolean isWarningMessage()
Returns true if this message is a warning message.


isErrorMessage

public boolean isErrorMessage()
Returns true if this message is an error message.


getTitle

public java.lang.String getTitle()
Returns the title of the message box.


getText

public java.lang.String getText()
Returns the message text into which given parameters are already inserted.


getButtonsResourceItems

public java.util.List getButtonsResourceItems()
Returns a list of ResourceItem objects that has to be used to add buttons to the message box. These resource items have to be defined using the "choices" property. If that property has not been set, the "ok" resource item is returned.


getIcon

public javax.swing.ImageIcon getIcon()
Returns an icon to be shown in the message box. If no icon has been defined in the resource item, standard items are used that reflect the message type.