@Component(value="cuba_ScreenValidation")
public class ScreenValidation
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ScreenValidation.SaveChangesDialogResult
Callbacks holder for save changes dialog.
|
static class |
ScreenValidation.UnsavedChangesDialogResult
Callbacks holder for unsaved changes dialog.
|
Modifier and Type | Field and Description |
---|---|
protected BeanValidation |
beanValidation |
protected Configuration |
configuration |
protected Icons |
icons |
protected Messages |
messages |
static java.lang.String |
NAME |
Constructor and Description |
---|
ScreenValidation() |
Modifier and Type | Method and Description |
---|---|
protected void |
focusProblemComponent(ValidationErrors errors) |
ScreenValidation.SaveChangesDialogResult |
showSaveConfirmationDialog(FrameOwner origin,
CloseAction closeAction)
Shows standard save confirmation dialog with Save, Discard and Cancel actions.
|
ScreenValidation.UnsavedChangesDialogResult |
showUnsavedChangesDialog(FrameOwner origin,
CloseAction closeAction)
Shows standard unsaved changes dialog with Discard and Cancel actions.
|
void |
showValidationErrors(FrameOwner origin,
ValidationErrors errors)
Show validation alert with passed errors and first problem UI component.
|
protected void |
validate(Validatable validatable,
ValidationErrors errors) |
ValidationErrors |
validateCrossFieldRules(FrameOwner origin,
Entity item)
Validate cross-field BeanValidation rules.
|
ValidationErrors |
validateUiComponents(java.util.Collection<Component> components)
Validates UI components by invoking their
Validatable.validate() . |
ValidationErrors |
validateUiComponents(ComponentContainer container)
Validates UI components by invoking their
Validatable.validate() . |
public static final java.lang.String NAME
@Inject protected Configuration configuration
@Inject protected Messages messages
@Inject protected Icons icons
@Inject protected BeanValidation beanValidation
public ValidationErrors validateUiComponents(java.util.Collection<Component> components)
Validatable.validate()
.components
- components collectionpublic ValidationErrors validateUiComponents(ComponentContainer container)
Validatable.validate()
.container
- components containerprotected void validate(Validatable validatable, ValidationErrors errors)
public void showValidationErrors(FrameOwner origin, ValidationErrors errors)
origin
- screen controllererrors
- validation errorprotected void focusProblemComponent(ValidationErrors errors)
public ValidationErrors validateCrossFieldRules(FrameOwner origin, Entity item)
origin
- screen controlleritem
- item to validatepublic ScreenValidation.UnsavedChangesDialogResult showUnsavedChangesDialog(FrameOwner origin, CloseAction closeAction)
origin
- screen controllercloseAction
- close actionpublic ScreenValidation.SaveChangesDialogResult showSaveConfirmationDialog(FrameOwner origin, CloseAction closeAction)
origin
- screen controllercloseAction
- close action