|
||||||||||
| 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 ValidationResults. 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 javax.swing.JLabel |
createReportIconAndTextLabel(ValidationResultModel model)
Creates and returns a label with icon and text that indicates the validation state and displays the first message text. |
static javax.swing.JComponent |
createReportIconAndTextPane(ValidationResultModel model)
Creates and returns a transparent panel that consists of a report label and a transparent report text area. |
static javax.swing.JLabel |
createReportIconLabel(ValidationResultModel model)
Creates and returns an icon label that indicates the validation severity. |
static javax.swing.JComponent |
createReportList(ValidationResultModel model)
Creates and returns a list that presents validation messages. |
static javax.swing.JComponent |
createReportList(ValidationResultModel model,
java.awt.Color backgroundColor)
Creates and returns a list wrapped in a scroll pane that presents validation messages. |
static javax.swing.JTextArea |
createReportTextArea(ValidationResultModel model)
Creates and returns a text area that is intended to show validation messages. |
static javax.swing.JTextArea |
createReportTextArea(ValidationResultModel model,
java.awt.Color backgroundColor)
Creates and returns a text area that is intended to show validation messages. |
static javax.swing.JComponent |
createReportTextPane(ValidationResultModel model)
Creates and returns a text area wrapped by a scroll pane that is intended to show validation messages. |
static javax.swing.JComponent |
createReportTextPane(ValidationResultModel model,
java.awt.Color backgroundColor)
Creates and returns a text area wrapped by a scroll pane that is intended to show validation messages. |
static javax.swing.ImageIcon |
getCheckIcon()
Returns a check icon useful to indicate good vs. no good. |
static javax.swing.ImageIcon |
getErrorIcon()
Returns a default error icon useful to indicate validation errors. |
static javax.swing.Icon |
getIcon(Severity severity)
Returns the warning icon for warnings, the error icon for errors and null otherwise. |
static javax.swing.ImageIcon |
getInfoIcon()
Returns a default information icon useful to indicate input hints. |
static javax.swing.ImageIcon |
getSmallErrorIcon()
Returns a small default error icon useful to indicate validation errors attached to UI components. |
static javax.swing.Icon |
getSmallIcon(Severity severity)
Returns the small warning icon for warnings, the small error icon for errors and null otherwise. |
static javax.swing.ImageIcon |
getSmallInfoIcon()
Returns a small default information icon useful to indicate input hints. |
static javax.swing.ImageIcon |
getSmallWarningIcon()
Returns a small default warning icon useful to indicate validation warnings attached to UI components. |
static javax.swing.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 javax.swing.JLabel createReportIconLabel(ValidationResultModel model)
model - the model that provides the observable validation result
public static javax.swing.JLabel createReportIconAndTextLabel(ValidationResultModel model)
model - the model that provides the observable validation result
public static javax.swing.JComponent createReportIconAndTextPane(ValidationResultModel model)
model - the model that provides the observable validation result
public static javax.swing.JComponent createReportList(ValidationResultModel model)
ValidationResultModel
using a ValidationResultListAdapter.
model - the model that provides the observable validation result
JList that shows validation messages
public static javax.swing.JComponent createReportList(ValidationResultModel model,
java.awt.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 javax.swing.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 javax.swing.JTextArea createReportTextArea(ValidationResultModel model,
java.awt.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 javax.swing.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 javax.swing.JComponent createReportTextPane(ValidationResultModel model,
java.awt.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 javax.swing.ImageIcon getErrorIcon()
public static javax.swing.ImageIcon getWarningIcon()
public static javax.swing.ImageIcon getSmallErrorIcon()
public static javax.swing.ImageIcon getSmallWarningIcon()
public static javax.swing.ImageIcon getInfoIcon()
public static javax.swing.ImageIcon getSmallInfoIcon()
public static javax.swing.ImageIcon getCheckIcon()
public static javax.swing.Icon getIcon(Severity severity)
null otherwise.
severity - the severity used to lookup the icon
null otherwisegetWarningIcon(),
getErrorIcon(),
getSmallIcon(Severity)public static javax.swing.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 | |||||||||