|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jgoodies.validation.view.ValidationResultViewFactory
public final class ValidationResultViewFactory
A factory class that vends views that present the state and contents
of ValidationResult
s. The validation views are composed from
user interface components like text areas, lists, labels, etc.
Most factory methods require a ValidationResultModel
that
notifies the view about changes in an underlying ValidationResult.
ValidationResult
,
ValidationMessage
Nested Class Summary | |
---|---|
static class |
ValidationResultViewFactory.MessageStateChangeHandler
Sets the component visible iff the validation result has messages. |
Method Summary | |
---|---|
static JLabel |
createReportIconAndTextLabel(ValidationResultModel model)
Creates and returns a label with icon and text that indicates the validation state and displays the first message text with the highest severity. |
static JComponent |
createReportIconAndTextPane(ValidationResultModel model)
Creates and returns a transparent panel that consists of a report label and a transparent report text area. |
static JLabel |
createReportIconLabel(ValidationResultModel model)
Creates and returns an icon label that indicates the validation severity. |
static JComponent |
createReportList(ValidationResultModel model)
Creates and returns a list that presents validation messages. |
static JComponent |
createReportList(ValidationResultModel model,
Color backgroundColor)
Creates and returns a list wrapped in a scroll pane that presents validation messages. |
static JTextArea |
createReportTextArea(ValidationResultModel model)
Creates and returns a text area that is intended to show validation messages. |
static JTextArea |
createReportTextArea(ValidationResultModel model,
Color backgroundColor)
Creates and returns a text area that is intended to show validation messages. |
static JComponent |
createReportTextPane(ValidationResultModel model)
Creates and returns a text area wrapped by a scroll pane that is intended to show validation messages. |
static JComponent |
createReportTextPane(ValidationResultModel model,
Color backgroundColor)
Creates and returns a text area wrapped by a scroll pane that is intended to show validation messages. |
static ImageIcon |
getCheckIcon()
Returns a check icon useful to indicate good vs. |
static ImageIcon |
getErrorIcon()
Returns a default error icon useful to indicate validation errors. |
static Icon |
getIcon(Severity severity)
Returns the warning icon for warnings, the error icon for errors and null otherwise. |
static ImageIcon |
getInfoIcon()
Returns a default information icon useful to indicate input hints. |
static ImageIcon |
getSmallErrorIcon()
Returns a small default error icon useful to indicate validation errors attached to UI components. |
static Icon |
getSmallIcon(Severity severity)
Returns the small warning icon for warnings, the small error icon for errors and null otherwise. |
static ImageIcon |
getSmallInfoIcon()
Returns a small default information icon useful to indicate input hints. |
static ImageIcon |
getSmallWarningIcon()
Returns a small default warning icon useful to indicate validation warnings attached to UI components. |
static ImageIcon |
getWarningIcon()
Returns a default warnings icon useful to indicate validation warnings. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static JLabel createReportIconLabel(ValidationResultModel model)
model
- the model that provides the observable validation result
public static JLabel createReportIconAndTextLabel(ValidationResultModel model)
model
- the model that provides the observable validation result
public static JComponent createReportIconAndTextPane(ValidationResultModel model)
model
- the model that provides the observable validation result
public static JComponent createReportList(ValidationResultModel model)
ValidationResultModel
using a ValidationResultListAdapter
.
model
- the model that provides the observable validation result
JList
that shows validation messagespublic static JComponent createReportList(ValidationResultModel model, Color backgroundColor)
ValidationResultModel
using a ValidationResultListAdapter
.
model
- the model that provides the observable validation resultbackgroundColor
- the color used to paint the area's background
JList
that shows validation messagespublic static JTextArea createReportTextArea(ValidationResultModel model)
ValidationResultModel
: the text content reflects
the validation result message text and the component is visible
if and only if the model has messages.
model
- the model that provides the observable validation result
public static JTextArea createReportTextArea(ValidationResultModel model, Color backgroundColor)
ValidationResultModel
:
the text content reflects the validation result message text,
and the component is visible if and only if the model has messages.
model
- the model that provides the observable validation resultbackgroundColor
- the color used to paint the area's background
public static JComponent createReportTextPane(ValidationResultModel model)
ValidationResultModel
: the text content reflects
the validation result message text and the component is visible
if and only if the model has messages.
model
- the model that provides the observable validation result
public static JComponent createReportTextPane(ValidationResultModel model, Color backgroundColor)
ValidationResultModel
: the text content reflects
the validation result message text and the component is visible
if and only if the model has messages.
model
- the model that provides the observable validation resultbackgroundColor
- the color used to paint the area's background
public static ImageIcon getErrorIcon()
public static ImageIcon getWarningIcon()
public static ImageIcon getSmallErrorIcon()
public static ImageIcon getSmallWarningIcon()
public static ImageIcon getInfoIcon()
public static ImageIcon getSmallInfoIcon()
public static ImageIcon getCheckIcon()
public static Icon getIcon(Severity severity)
null
otherwise.
severity
- the severity used to lookup the icon
null
otherwisegetWarningIcon()
,
getErrorIcon()
,
getSmallIcon(Severity)
public static Icon getSmallIcon(Severity severity)
null
otherwise.
severity
- the severity used to lookup the icon
null
otherwisegetSmallWarningIcon()
,
getSmallErrorIcon()
,
getIcon(Severity)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |