public class AttributeEditor extends AbstractEditor<CategoryAttribute>
CategoryAttribute
entities.Screen.AfterCloseEvent, Screen.AfterDetachEvent, Screen.AfterInitEvent, Screen.AfterShowEvent, Screen.BeforeCloseEvent, Screen.BeforeShowEvent, Screen.InitEvent
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
commitActionPerformed, crossFieldValidate, justLocked, readOnly, readOnlyDueToLock, showEnableEditingBtn, showSaveNotification
frame, messages, UNKNOWN_CLOSE_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
ENABLE_EDITING, WINDOW_CLOSE, WINDOW_COMMIT, WINDOW_COMMIT_AND_CLOSE
NO_OPTIONS, WINDOW_CLOSE_ACTION, WINDOW_COMMIT_AND_CLOSE_ACTION, WINDOW_DISCARD_AND_CLOSE_ACTION
Constructor and Description |
---|
AttributeEditor() |
Modifier and Type | Method and Description |
---|---|
protected void |
changeAttributesUI() |
protected void |
changeAttributeValues() |
protected java.util.List<CategoryAttribute> |
getAttributesOptions() |
protected java.util.Map<java.lang.String,java.lang.Boolean> |
getBooleanOptions() |
protected java.util.Map<java.lang.String,java.lang.String> |
getEntityOptions() |
protected java.util.Map<java.lang.String,CategoryAttributeOptionsLoaderType> |
getLoaderOptions() |
protected java.util.Map<java.lang.String,PropertyType> |
getTypeOptions() |
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 |
initAttributesFieldGroup() |
protected void |
initCalculatedAttrsAndOptionsFieldGroup() |
protected void |
initDsListeners() |
protected void |
initLocalizedFrame() |
protected void |
initScreensTable(CategoryAttribute attribute) |
protected void |
initScreenTableActions() |
void |
openConstraintWizard() |
protected void |
postInit()
Hook to be implemented in subclasses.
|
void |
postValidate(ValidationErrors errors)
Hook to be implemented in subclasses.
|
boolean |
preCommit()
Hook to be implemented in subclasses.
|
protected java.util.List<Suggestion> |
requestHint(SourceCodeEditor sender,
int senderCursorPosition) |
protected void |
setAttributeCodeValue() |
protected void |
setDefaultEntityFieldValue() |
protected void |
setupNumberFormat() |
afterWindowApplyPostInit, closeWithCommit, commit, commit, commitAndClose, commitInternal, disableCommitAction, getDatasourceInternal, getEditedEntity, getItem, getMetaClassForLocking, getParentDs, handlePreviouslyDeletedCompositionItems, hasUnsavedChanges, initCommitActions, initNewItem, isCrossFieldValidate, isLocked, isModified, isReadOnly, isShowSaveNotification, postCommit, releaseLock, setCrossFieldValidate, setEntityToEdit, setItem, setItemInternal, setParentDs, setReadOnly, setShowSaveNotification, validateAdditionalRules
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, indexOf, init, initEnableEditingActionStub, isAttributeAccessControlEnabled, isCloseable, isEnabled, isEnabledRecursive, isExpanded, isResponsive, isSameScreen, isValid, isVisible, isVisibleRecursive, 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, 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
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 static final com.google.common.collect.Multimap<PropertyType,java.lang.String> FIELDS_VISIBLE_FOR_TYPES
protected static final java.util.Set<PropertyType> SUPPORTED_OPTIONS_TYPES
protected static final java.lang.String WHERE
@Inject protected Dom4jTools dom4JTools
@Inject protected FieldGroup attributeFieldGroup
@Inject protected FieldGroup optionalAttributeFieldGroup
@Inject protected FieldGroup calculatedAttrsAndOptionsFieldGroup
@Inject protected Table<ScreenAndComponent> targetScreensTable
@Inject protected TabSheet tabsheet
@Named(value="attributeFieldGroup.dataType") protected LookupField<PropertyType> dataType
@Named(value="optionalAttributeFieldGroup.entityClass") protected LookupField<java.lang.String> entityClassField
@Named(value="optionalAttributeFieldGroup.screen") protected LookupField<java.lang.String> screen
@Named(value="optionalAttributeFieldGroup.defaultBoolean") protected LookupField defaultBoolean
@Named(value="optionalAttributeFieldGroup.defaultDecimal") protected TextField defaultDecimal
@Named(value="optionalAttributeFieldGroup.defaultEntityId") protected PickerField<Entity> defaultEntityId
@Named(value="optionalAttributeFieldGroup.minDecimal") protected TextField minDecimal
@Named(value="optionalAttributeFieldGroup.maxDecimal") protected TextField maxDecimal
@Named(value="attributeFieldGroup.validatorGroovyScript") protected SourceCodeEditor validatorGroovyScript
@Named(value="calculatedAttrsAndOptionsFieldGroup.optionsLoaderType") protected LookupField<CategoryAttributeOptionsLoaderType> optionsLoaderType
@Named(value="calculatedAttrsAndOptionsFieldGroup.optionsLoaderScript") protected SourceCodeEditor optionsLoaderScript
@Named(value="calculatedAttrsAndOptionsFieldGroup.constraintWizard") protected HBoxLayout constraintWizardBox
@Named(value="calculatedAttrsAndOptionsFieldGroup.joinClause") protected SourceCodeEditor joinClause
@Named(value="calculatedAttrsAndOptionsFieldGroup.whereClause") protected SourceCodeEditor whereClause
@Named(value="calculatedAttrsAndOptionsFieldGroup.recalculationScript") protected SourceCodeEditor recalculationScript
protected ListEditor<java.lang.String> enumerationListEditor
protected ListEditor<CategoryAttribute> dependsOnAttributesListEditor
protected LocalizedNameAndDescriptionFrame localizedFrame
@Inject protected Datasource<CategoryAttribute> attributeDs
@Inject protected Datasource<CategoryAttributeConfiguration> configurationDs
@Inject protected CollectionDatasource<ScreenAndComponent,java.util.UUID> screensDs
@Inject protected UiComponents uiComponents
@Inject protected Metadata metadata
@Inject protected MetadataTools metadataTools
@Inject protected MessageTools messageTools
@Inject protected DatatypeFormatter datatypeFormatter
@Inject protected ThemeConstants themeConstants
@Inject protected ScreensHelper screensHelper
@Inject protected DynamicAttributesGuiTools dynamicAttributesGuiTools
@Inject protected DataManager dataManager
@Inject protected ReferenceToEntitySupport referenceToEntitySupport
@Inject protected GlobalConfig globalConfig
@Inject protected ClientConfig clientConfig
@Inject protected Icons icons
@Inject protected FilterParser filterParser
protected java.lang.String fieldWidth
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 postInit()
AbstractEditor
AbstractEditor.setItem(com.haulmont.cuba.core.entity.Entity)
.
At the moment of calling the main datasource is initialized and AbstractEditor.getItem()
returns reloaded entity instance.
AbstractEditor.postCommit(boolean, boolean)
if the window is not closed after
commit. Then AbstractEditor.getItem()
contains instance, returned from DataService.commit()
.
This is useful for initialization of components that have to show fresh information from the current instance.
protected void postInit() { if (!PersistenceHelper.isNew(getItem())) { diffFrame.loadVersions(getItem()); entityLogDs.refresh(); } }
postInit
in class AbstractEditor<CategoryAttribute>
protected void initScreenTableActions()
protected void initScreensTable(CategoryAttribute attribute)
protected void initDsListeners()
protected void initAttributesFieldGroup()
protected void initCalculatedAttrsAndOptionsFieldGroup()
protected void initLocalizedFrame()
protected void changeAttributesUI()
protected void changeAttributeValues()
protected void setDefaultEntityFieldValue()
protected void setAttributeCodeValue()
public boolean preCommit()
AbstractEditor
preCommit
in class AbstractEditor<CategoryAttribute>
public void postValidate(ValidationErrors errors)
AbstractWindow
AbstractWindow.validateAll()
at the end of standard validation.postValidate
in class AbstractWindow
errors
- the list of validation errors. Caller fills it by errors found during the default validation.
Overridden method should add into it errors found by custom validation.protected java.util.List<Suggestion> requestHint(SourceCodeEditor sender, int senderCursorPosition)
protected void setupNumberFormat()
public void openConstraintWizard()
protected java.util.List<CategoryAttribute> getAttributesOptions()
protected java.util.Map<java.lang.String,java.lang.Boolean> getBooleanOptions()
protected java.util.Map<java.lang.String,PropertyType> getTypeOptions()
protected java.util.Map<java.lang.String,CategoryAttributeOptionsLoaderType> getLoaderOptions()
protected java.util.Map<java.lang.String,java.lang.String> getEntityOptions()