public class AbstractEditor<T extends Entity> extends AbstractWindow implements Window.Editor
Window.BeforeCloseEvent, Window.BeforeCloseWithCloseButtonEvent, Window.BeforeCloseWithCloseButtonListener, Window.BeforeCloseWithShortcutEvent, Window.BeforeCloseWithShortcutListener, Window.CloseListener, Window.CloseWithCommitListener, Window.Committable, Window.ContentSwitchMode, Window.Editor, Window.HasFoldersPane, Window.HasUserIndicator, Window.HasWorkArea, Window.Lookup, Window.MainWindow, Window.TopLevelWindow, Window.Wrapper
Frame.MessageMode, Frame.MessageType, Frame.NotificationType
ExpandingLayout.ExpandDirection
Component.ActionOwner, Component.ActionsHolder, Component.Alignment, Component.BelongToFrame, Component.Buffered, Component.ChildEditableController, Component.Collapsable, Component.Container, Component.ContextHelpIconClickEvent, Component.Disposable, Component.Editable, Component.EditableChangeEvent, Component.EditableChangeListener, Component.EditableChangeNotifier, Component.ExpandedStateChangeEvent, Component.ExpandedStateChangeListener, Component.Focusable, Component.HasBorder, Component.HasButtonsPanel, Component.HasCaption, Component.HasContextHelp, Component.HasFormatter, Component.HasIcon, Component.HasInputPrompt, Component.HasNamedComponents, Component.HasOptionsStyleProvider, Component.HasPresentations, Component.HasRowsCount, Component.HasSettings, Component.HasValue, Component.HasXmlDescriptor, Component.LayoutClickEvent, Component.LayoutClickListener, Component.LayoutClickNotifier, Component.Margin, Component.MouseEventDetails, Component.OptionsStyleProvider, Component.OrderedContainer, Component.OuterMargin, Component.SecuredActionsHolder, Component.ShortcutAction, Component.ShortcutNotifier, Component.ShortcutTriggeredEvent, Component.Spacing, Component.UiPermissionAware, Component.Validatable, Component.ValueChangeEvent, Component.ValueChangeListener
NAME, WINDOW_CLOSE, WINDOW_COMMIT, WINDOW_COMMIT_AND_CLOSE
BROWSE_WINDOW_SUFFIX, CLOSE_ACTION_ID, COMMIT_ACTION_ID, CREATE_WINDOW_SUFFIX, EDITOR_WINDOW_SUFFIX, LOOKUP_WINDOW_SUFFIX, SELECT_ACTION_ID
AUTO_SIZE, AUTO_SIZE_PX, UNITS_PERCENTAGE, UNITS_PIXELS
Constructor and Description |
---|
AbstractEditor() |
Modifier and Type | Method and Description |
---|---|
boolean |
commit()
Called by the framework to validate and commit changes.
|
boolean |
commit(boolean validate)
Commit changes with optional validation.
|
void |
commitAndClose()
Validate, commit and close the window if commit was successful.
|
T |
getItem() |
Datasource |
getParentDs() |
boolean |
isCrossFieldValidate() |
boolean |
isLocked() |
boolean |
isModified() |
boolean |
isShowSaveNotification() |
void |
setCrossFieldValidate(boolean crossFieldValidate)
Enable/disable cross field validation on
Window.validateAll() call. |
void |
setItem(Entity item)
Called by the framework to set an edited entity after creation of all components and datasources, and after
AbstractFrame.init(java.util.Map) . |
void |
setParentDs(Datasource parentDs)
This method is called by the framework to set parent datasource to commit into this datasource instead
of directly to the database.
|
void |
setShowSaveNotification(boolean showSaveNotification) |
addBeforeCloseWithCloseButtonListener, addBeforeCloseWithShortcutListener, addCloseListener, addCloseWithCommitListener, addListener, addTimer, applySettings, close, close, closeAndRun, deleteSettings, getActionsPermissions, getCaption, getContentSwitchMode, getContext, getDescription, getDialogOptions, getDsContext, getFocusComponent, getIcon, getSettings, getTimer, getWindowManager, getWrappedWindow, getXmlDescriptor, isAttributeAccessControlEnabled, ready, removeBeforeCloseWithCloseButtonListener, removeBeforeCloseWithShortcutListener, removeCloseListener, removeCloseWithCommitListener, removeListener, saveSettings, setCaption, setContentSwitchMode, setDescription, setDsContext, setFocusComponent, setIcon, setIconFromSet, setWindowManager, setXmlDescriptor, validate, validateAll
add, add, addAction, addAction, addStyleName, expand, expand, getAction, getActions, getAlignment, getCompanion, getComponent, getComponent, getComponent, getComponents, getComposition, getDebugId, getDialogParams, getExpandDirection, getFrame, getHeight, getHeightUnits, getId, getMargin, getMessagesPack, getOwnComponent, getOwnComponents, getParent, getRegisteredComponent, getSpacing, getStyleName, getUiEventListeners, getWidth, getWidthUnits, getWrappedFrame, indexOf, init, isEnabled, isEnabledItself, isExpanded, isResponsive, isValid, isVisible, isVisibleItself, openEditor, openEditor, openEditor, openEditor, openEditor, openEditor, openEditor, openFrame, openFrame, openLookup, openLookup, openLookup, openLookup, openWindow, openWindow, registerComponent, remove, removeAction, removeAction, removeAll, removeAllActions, removeStyleName, requestFocus, resetExpanded, setAlignment, setCompanion, setContext, setDebugId, setEnabled, setFrame, setHeight, setId, setMargin, setMessagesPack, setParent, setResponsive, setSpacing, setStyleName, setUiEventListeners, setVisible, setWidth, setWrappedFrame, showMessageDialog, showNotification, showNotification, showNotification, showOptionDialog, showOptionDialog, showValidationErrors, showWebPage, unregisterComponent, unwrap, unwrapComposition, validate
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addBeforeCloseWithCloseButtonListener, addBeforeCloseWithShortcutListener, addCloseListener, addCloseWithCommitListener, addListener, addTimer, applySettings, close, close, closeAndRun, deleteSettings, getContentSwitchMode, getContext, getDialogOptions, getFocusComponent, getSettings, getTimer, getWindowManager, removeBeforeCloseWithCloseButtonListener, removeBeforeCloseWithShortcutListener, removeCloseListener, removeCloseWithCommitListener, removeListener, saveSettings, setContentSwitchMode, setFocusComponent, setWindowManager, validate, validateAll
getDialogParams, getDsContext, getMessagesPack, getRegisteredComponent, isValid, openEditor, openEditor, openEditor, openEditor, openEditor, openEditor, openEditor, openFrame, openFrame, openLookup, openLookup, openLookup, openLookup, openWindow, openWindow, registerComponent, setContext, setDsContext, setMessagesPack, showMessageDialog, showNotification, showNotification, showNotification, showOptionDialog, showOptionDialog, showWebPage, unregisterComponent, validate
expand, expand, getExpandDirection, isExpanded, resetExpanded
add, getComponent, getComponentNN, indexOf
add, getComponent, getComponentNN, getComponents, getOwnComponent, getOwnComponents, remove, removeAll
addStyleName, getAlignment, getDebugId, getHeight, getHeightUnits, getId, getParent, getStyleName, getWidth, getWidthUnits, isEnabled, isEnabledItself, isResponsive, isVisible, isVisibleItself, removeStyleName, requestFocus, setAlignment, setDebugId, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition
getFrame, setFrame
getSpacing, setSpacing
getMargin, setMargin, setMargin, setMargin
addAction, addAction, getAction, getActionNN, getActions, removeAction, removeAction, removeAllActions
getIcon, setIcon, setIconFromSet
getCaption, getDescription, setCaption, setDescription
public T getItem()
getItem
in interface Window.Editor
@Nullable public Datasource getParentDs()
getParentDs
in interface Window.Editor
public void setParentDs(Datasource parentDs)
Window.Editor
setParentDs
in interface Window.Editor
public void setItem(Entity item)
AbstractFrame.init(java.util.Map)
.
Don't override this method in subclasses, use hooks initNewItem(com.haulmont.cuba.core.entity.Entity)
and postInit()
instead.
setItem
in interface Window.Editor
item
- entity instancepublic boolean isModified()
isModified
in interface Window.Committable
public boolean commit()
Don't override this method in subclasses, use hooks AbstractWindow.postValidate(ValidationErrors)
, preCommit()
and postCommit(boolean, boolean)
instead.
commit
in interface Window.Editor
public boolean commit(boolean validate)
Don't override this method in subclasses, use hooks AbstractWindow.postValidate(ValidationErrors)
, preCommit()
and postCommit(boolean, boolean)
instead.
commit
in interface Window.Editor
validate
- false to avoid validationpublic void commitAndClose()
Window.COMMIT_ACTION_ID
to associated CloseListener
s
Don't override this method in subclasses, use hooks AbstractWindow.postValidate(ValidationErrors)
, preCommit()
and postCommit(boolean, boolean)
instead.
commitAndClose
in interface Window.Committable
commitAndClose
in interface Window.Editor
public boolean isLocked()
isLocked
in interface Window.Editor
public boolean isCrossFieldValidate()
isCrossFieldValidate
in interface Window.Editor
Window.validateAll()
call using BeanValidation
.BeanValidation
public void setCrossFieldValidate(boolean crossFieldValidate)
Window.Editor
Window.validateAll()
call. UiCrossFieldChecks
group only
(without Default
group) when there are no other validation errors in UI components.
Cross field validation is triggered before AbstractWindow.postValidate(com.haulmont.cuba.gui.components.ValidationErrors)
hook.
setCrossFieldValidate
in interface Window.Editor
crossFieldValidate
- cross field validate flagBeanValidation
public boolean isShowSaveNotification()
public void setShowSaveNotification(boolean showSaveNotification)