Package org.apache.pivot.wtk
Class Form.Flag
- java.lang.Object
-
- org.apache.pivot.wtk.Form.Flag
-
- Enclosing class:
- Form
public static class Form.Flag extends java.lang.Object
Represents an message alert associated with a form field.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
MESSAGE_KEY
static java.lang.String
MESSAGE_TYPE_KEY
-
Constructor Summary
Constructors Constructor Description Flag()
Creates a new flag with a type of "error" and no message.Flag(MessageType messageType)
Creates a new flag with the given message type and no message.Flag(MessageType messageType, java.lang.String message)
Creates a new flag with the given type and message.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Form.Flag
decode(java.lang.String flag)
java.lang.String
getMessage()
Returns the flag message.MessageType
getMessageType()
Returns the flag's message type.void
setMessage(java.lang.String message)
Sets the flag message.void
setMessageType(MessageType messageType)
Sets the flag's message type.
-
-
-
Field Detail
-
MESSAGE_TYPE_KEY
public static final java.lang.String MESSAGE_TYPE_KEY
- See Also:
- Constant Field Values
-
MESSAGE_KEY
public static final java.lang.String MESSAGE_KEY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Flag
public Flag()
Creates a new flag with a type of "error" and no message.
-
Flag
public Flag(MessageType messageType)
Creates a new flag with the given message type and no message.- Parameters:
messageType
- The type of the flag.
-
Flag
public Flag(MessageType messageType, java.lang.String message)
Creates a new flag with the given type and message.- Parameters:
messageType
- The type of the flag.message
- The message text associated with the flag, ornull
for no message.
-
-
Method Detail
-
getMessageType
public MessageType getMessageType()
Returns the flag's message type.- Returns:
- The message type of the flag.
-
setMessageType
public void setMessageType(MessageType messageType)
Sets the flag's message type.- Parameters:
messageType
- The new message type for this flag.- Throws:
java.lang.IllegalArgumentException
- if the message type isnull
.
-
getMessage
public java.lang.String getMessage()
Returns the flag message.- Returns:
- The message text associated with the flag, or
null
if there is no message.
-
setMessage
public void setMessage(java.lang.String message)
Sets the flag message.- Parameters:
message
- The message text associated with the flag, ornull
if there is no message.
-
decode
public static Form.Flag decode(java.lang.String flag)
-
-