public class EntityCombinedScreen extends AbstractLookup
Screen.AfterCloseEvent, Screen.AfterDetachEvent, Screen.AfterInitEvent, Screen.AfterShowEvent, Screen.BeforeCloseEvent, Screen.BeforeShowEvent, Screen.InitEvent
Window.Lookup.Handler, Window.Lookup.Validator
Window.BeforeCloseEvent, Window.BeforeCloseWithCloseButtonEvent, Window.BeforeCloseWithShortcutEvent, Window.CloseListener, Window.CloseOrigin, Window.CloseWithCommitListener, Window.Committable, Window.ContentSwitchMode, Window.Editor<T extends Entity>, Window.HasFoldersPane, Window.HasUserIndicator, Window.HasWorkArea, Window.Lookup<T extends Entity>, Window.TopLevelWindow, Window.Wrapper
Frame.MessageMode, Frame.MessageType, Frame.NotificationType
ExpandingLayout.ExpandDirection
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.OptionsStyleProvider
LookupScreen.ValidationContext<T extends Entity>
Modifier and Type | Field and Description |
---|---|
protected boolean |
creating
Indicates that a new instance of entity is being created.
|
protected boolean |
editing
Indicates that the screen is in editing mode.
|
protected boolean |
justLocked
Indicates that edited entity is pessimistically locked.
|
frame, messages, UNKNOWN_CLOSE_ACTION_ID
LOOKUP_ENTER_PRESSED_ACTION_ID, LOOKUP_ITEM_CLICK_ACTION_ID, NAME
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, FULL_SIZE, UNITS_PERCENTAGE, UNITS_PIXELS
LOOKUP_CANCEL_ACTION_ID, LOOKUP_SELECT_ACTION_ID, LOOKUP_SELECT_CLOSE_ACTION
NO_OPTIONS, WINDOW_CLOSE_ACTION, WINDOW_COMMIT_AND_CLOSE_ACTION, WINDOW_DISCARD_AND_CLOSE_ACTION
Constructor and Description |
---|
EntityCombinedScreen() |
Modifier and Type | Method and Description |
---|---|
void |
cancel()
Method that is invoked by clicking Cancel button, discards changes and disables controls for editing.
|
protected void |
disableEditControls()
Disables edit controls.
|
protected void |
enableEditControls(boolean creating)
Enables controls for editing.
|
protected ComponentContainer |
getActionsPane()
Returns the container with edit actions (save, cancel).
|
protected ComponentContainer |
getEditBox()
Returns the right container with edit components.
|
protected FieldGroup |
getFieldGroup()
Returns the field group.
|
protected ComponentContainer |
getLookupBox()
Returns the left container with browse components.
|
protected MetaClass |
getMetaClassForLocking(Entity item) |
protected ListComponent |
getTable()
Returns the browse table.
|
protected TabSheet |
getTabSheet()
Returns the tab sheet with edit components.
|
void |
init(java.util.Map<java.lang.String,java.lang.Object> params)
Called by the framework after creation of all components and before showing the screen.
|
protected void |
initBrowseCreateAction()
Adds a CreateAction that removes selection in table, sets a newly created item to editDs
and enables controls for record editing.
|
protected void |
initBrowseEditAction()
Adds an EditAction that enables controls for editing.
|
protected void |
initBrowseItemChangeListener()
Adds a listener that reloads the selected record with the specified view and sets it to editDs.
|
protected void |
initBrowseRemoveAction()
Adds AfterRemoveHandler for table's Remove action to reset the record contained in editDs.
|
protected void |
initEditComponents(boolean enabled)
Initializes edit controls, depending on if they should be enabled or disabled.
|
protected void |
initNewItem(Entity item)
Hook to be implemented in subclasses.
|
protected void |
initShortcuts()
Adds ESCAPE shortcut that invokes cancel() method.
|
protected boolean |
lockIfNeeded(Entity entity)
Pessimistic lock before start of editing, if it is configured for the entity.
|
protected void |
refreshOptionsForLookupFields() |
protected void |
releaseLock()
Release pessimistic lock if it was applied.
|
void |
save()
Method that is invoked by clicking Ok button after editing an existing or creating a new record.
|
protected boolean |
validateEditor()
Validates editor fields.
|
afterInit, getLookupComponent, getSelectHandler, getSelectValidator, initLookupActions, initLookupLayout, selectItemsOnClick, setLookupComponent, setSelectHandler, setSelectValidator, setupCommitShortcut, setupLookupComponent
add, add, addAction, addAction, addBeforeWindowCloseListener, addFacet, addStyleName, addTimer, afterShow, applySettings, beforeClose, closeWithDiscard, deleteSettings, expand, expand, formatMessage, getAction, getActions, getActionsPermissions, getAlignment, getCaption, getCompanion, getComponent, getComponent, getComponent, getComponents, getComposition, getContentSwitchMode, getContext, getDescription, getDialogOptions, getDsContext, getExpandDirection, getExpandRatio, getFacet, getFacets, getFocusComponent, getFrame, getFrameOwner, getHeight, getHeightSizeUnit, getIcon, getMargin, getMaxHeight, getMaxWidth, getMessage, getMessagesPack, getMinHeight, getMinWidth, getOwnComponent, getOwnComponents, getOwnComponentsStream, getParent, getScreenHashCode, getSettings, getSpacing, getStyleName, getTimer, getWidth, getWidthSizeUnit, getWindowManager, getWrappedFrame, getWrappedWindow, getXmlDescriptor, handleValidationErrors, hasUnsavedChanges, indexOf, init, initEnableEditingActionStub, isAttributeAccessControlEnabled, isCloseable, isEnabled, isEnabledRecursive, isExpanded, isResponsive, isSameScreen, isValid, isVisible, isVisibleRecursive, postValidate, preClose, ready, remove, removeAction, removeAction, removeAll, removeAllActions, removeBeforeWindowCloseListener, removeFacet, removeStyleName, resetExpanded, saveSettings, setAlignment, setCaption, setCloseable, setCompanion, setContentSwitchMode, setDescription, setDsContext, setEnabled, setExpandRatio, setFocusComponent, setFrame, setHeight, setIcon, setIconFromSet, setId, setMargin, setMaxHeight, setMaxWidth, setMessagesPack, setMinHeight, setMinWidth, setParent, setResponsive, setSpacing, setStyleName, setVisible, setWidth, setWindow, setXmlDescriptor, showValidationErrors, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, validate, validate, validateAdditionalRules, validateAll, withUnwrapped, withUnwrappedComposition
addAfterCloseListener, addAfterDetachListener, addAfterInitListener, addAfterShowListener, addBeforeCloseListener, addBeforeShowListener, addInitListener, addUrlParamsChangeListener, applyDataLoadingSettings, close, close, closeWithDefaultAction, fireEvent, getBeanLocator, getEventHub, getExtensions, getId, getScreenData, getUiEventListeners, getWindow, isMultipleOpen, isSaveScreenHistoryOnClose, isSaveSettingsOnClose, setBeanLocator, setExtensions, setScreenData, setUiEventListeners, show
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getLookupHandler, getLookupValidator, setLookupHandler, setLookupValidator
addBeforeCloseWithCloseButtonListener, addBeforeCloseWithShortcutListener, addBeforeWindowCloseListener, addCloseListener, addCloseWithCommitListener, addListener, addTimer, applySettings, close, close, closeAndRun, deleteSettings, getContext, getDialogOptions, getFocusComponent, getFrameOwner, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getSettings, getTimer, getWindowManager, isCloseable, removeBeforeCloseWithCloseButtonListener, removeBeforeCloseWithShortcutListener, removeBeforeWindowCloseListener, removeCloseListener, removeCloseWithCommitListener, removeListener, saveSettings, setCloseable, setFocusComponent, setMaxHeight, setMaxWidth, setMinHeight, setMinWidth, validate, validateAll
addFacet, getFacet, getFacetNN, getFacets, isValid, removeFacet, validate
expand, expand, getExpandDirection, isExpanded, resetExpanded
add, getComponent, getComponentNN, indexOf
add, add, focusFirstComponent, getComponent, getComponentNN, getComponents, getOwnComponent, getOwnComponents, getOwnComponentsStream, remove, remove, removeAll
addStyleName, getAlignment, getHeight, getHeightSizeUnit, getHeightUnits, getId, getParent, getStyleName, getWidth, getWidthSizeUnit, getWidthUnits, isEnabled, isEnabledItself, isEnabledRecursive, isResponsive, isVisible, isVisibleItself, isVisibleRecursive, removeStyleName, requestFocus, setAlignment, setEnabled, setHeight, setHeightAuto, setHeightFull, setId, setParent, setResponsive, setSizeAuto, setSizeFull, setStyleName, setVisible, setWidth, setWidthAuto, setWidthFull, unwrap, unwrapComposition, unwrapCompositionOrNull, unwrapOrNull, withUnwrapped, withUnwrappedComposition
getFrame, setFrame
getSpacing, setSpacing
getMargin, setMargin, setMargin, setMargin
addAction, addAction, getAction, getActionNN, getActions, getSubPart, removeAction, removeAction, removeAllActions
getIcon, setIcon, setIconFromSet
getCaption, setCaption
getDescription, setDescription
openEditor, openEditor, openEditor, openEditor, openEditor, openEditor, openEditor, openFrame, openFrame, openLookup, openLookup, openLookup, openLookup, openWindow, openWindow, showMessageDialog, showNotification, showNotification, showNotification, showOptionDialog, showOptionDialog, showWebPage
getExpandRatio, setExpandRatio
getCompanion, getContext, getDsContext, getMessagesPack, getXmlDescriptor, isValid, setDsContext, setMessagesPack, setXmlDescriptor, validate, validate, validateAll
getComponent, getComposition
getWrappedFrame
protected boolean creating
protected boolean editing
protected boolean justLocked
protected ComponentContainer getLookupBox()
protected ListComponent getTable()
protected ComponentContainer getEditBox()
@Nullable protected TabSheet getTabSheet()
protected FieldGroup getFieldGroup()
protected ComponentContainer getActionsPane()
public void init(java.util.Map<java.lang.String,java.lang.Object> params)
AbstractWindow
init
in class AbstractWindow
params
- parameters passed from caller's code, usually from
HasWindowManager.openWindow(String, WindowManager.OpenType)
and similar methods, or set in
screens.xml
for this registered screenprotected void initBrowseItemChangeListener()
protected void initBrowseCreateAction()
protected void initNewItem(Entity item)
item
- new entity instanceprotected void initBrowseEditAction()
protected boolean lockIfNeeded(Entity entity)
protected void releaseLock()
protected void initBrowseRemoveAction()
protected void initShortcuts()
protected void refreshOptionsForLookupFields()
protected void enableEditControls(boolean creating)
creating
- indicates that a new instance is being createdprotected void disableEditControls()
protected void initEditComponents(boolean enabled)
enabled
- if true - enables edit controls and disables controls on the left side of the splitter
if false - vice versaprotected boolean validateEditor()
public void save()
public void cancel()