public class EntityInspectorEditor extends AbstractWindow
Modifier and Type | Class and Description |
---|---|
protected class |
EntityInspectorEditor.CancelAction |
protected class |
EntityInspectorEditor.CommitAction |
protected class |
EntityInspectorEditor.CreateAction
Opens entity inspector's editor to create entity
|
protected class |
EntityInspectorEditor.EditAction |
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.MainWindow, 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
frame, messages, UNKNOWN_CLOSE_ACTION_ID
BROWSE_WINDOW_SUFFIX, CLOSE_ACTION_ID, COMMIT_ACTION_ID, CREATE_WINDOW_SUFFIX, EDITOR_WINDOW_SUFFIX, LOOKUP_WINDOW_SUFFIX, NAME, SELECT_ACTION_ID
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE, UNITS_PERCENTAGE, UNITS_PIXELS
NO_OPTIONS, WINDOW_CLOSE_ACTION, WINDOW_COMMIT_AND_CLOSE_ACTION, WINDOW_DISCARD_AND_CLOSE_ACTION
Constructor and Description |
---|
EntityInspectorEditor() |
Modifier and Type | Method and Description |
---|---|
protected void |
addBooleanCustomField(com.haulmont.chile.core.model.MetaClass metaClass,
com.haulmont.chile.core.model.MetaProperty metaProperty,
Entity item,
FieldGroup fieldGroup,
boolean required,
boolean readOnly)
Adds LookupField with boolean values instead of CheckBox that can't display null value.
|
protected void |
addEmbeddedFieldGroup(com.haulmont.chile.core.model.MetaProperty embeddedMetaProperty,
java.lang.String fqnPrefix,
Entity embeddedItem,
boolean editable)
Creates field group for the embedded property
|
protected void |
addField(com.haulmont.chile.core.model.MetaClass metaClass,
com.haulmont.chile.core.model.MetaProperty metaProperty,
Entity item,
FieldGroup fieldGroup,
boolean required,
boolean custom,
boolean readOnly,
java.util.Collection<FieldGroup.FieldConfig> customFields)
Adds field to the specified field group.
|
protected void |
addTable(com.haulmont.chile.core.model.MetaClass metaClass,
com.haulmont.chile.core.model.MetaProperty childMeta)
Creates a table for the entities in ONE_TO_MANY or MANY_TO_MANY relation with the current one
|
protected boolean |
attrPermitted(com.haulmont.chile.core.model.MetaClass metaClass,
java.lang.String property,
EntityAttrAccess entityAttrAccess) |
protected boolean |
attrViewPermitted(com.haulmont.chile.core.model.MetaClass metaClass,
com.haulmont.chile.core.model.MetaProperty metaProperty) |
protected boolean |
attrViewPermitted(com.haulmont.chile.core.model.MetaClass metaClass,
java.lang.String property) |
void |
commitAndClose() |
protected boolean |
containsSeparator(java.lang.String s) |
protected AddAction |
createAddAction(com.haulmont.chile.core.model.MetaProperty metaProperty,
CollectionDatasource propertyDs,
Table table,
com.haulmont.chile.core.model.MetaClass propertyMetaClass) |
protected Window.Lookup.Handler |
createAddHandler(com.haulmont.chile.core.model.MetaProperty metaProperty,
CollectionDatasource propertyDs) |
protected ButtonsPanel |
createButtonsPanel(com.haulmont.chile.core.model.MetaProperty metaProperty,
CollectionDatasource propertyDs,
Table table)
Creates a buttons panel managing table's content.
|
protected void |
createCommitButtons() |
protected void |
createCustomFields(FieldGroup fieldGroup,
java.util.Collection<FieldGroup.FieldConfig> customFields)
Creates custom fields and adds them to the fieldGroup
|
protected void |
createDataComponents(com.haulmont.chile.core.model.MetaClass metaClass,
Entity item)
Creates components representing item data
(fieldGroup, fieldGroups for embedded properties, tables for the referred entities)
|
protected void |
createEmbeddedFields(com.haulmont.chile.core.model.MetaClass metaClass,
Entity item)
Recursively instantiates the embedded properties.
|
protected View |
createEmbeddedView(com.haulmont.chile.core.model.MetaClass metaPropertyClass) |
protected void |
createNestedEmbeddedDatasources(com.haulmont.chile.core.model.MetaClass metaClass,
java.lang.String fqnPrefix,
Datasource masterDs) |
protected void |
createPropertyDatasources(Datasource masterDs)
Creates and registers in dsContext property datasource for each of the entity non-datatype
and non-enum property
|
protected RemoveAction |
createRemoveAction(com.haulmont.chile.core.model.MetaProperty metaProperty,
Table table)
Creates either Remove or Exclude action depending on property type
|
protected void |
createRuntimeDataComponents() |
protected View |
createView(com.haulmont.chile.core.model.MetaClass meta)
Creates a view, loading all the properties.
|
protected boolean |
entityOpPermitted(com.haulmont.chile.core.model.MetaClass metaClass,
EntityOp entityOp) |
Entity |
getItem() |
protected com.haulmont.chile.core.model.MetaProperty |
getNullIndicatorProperty(com.haulmont.chile.core.model.MetaProperty embeddedMetaProperty)
Returns metaProperty of the referred entity annotated with either nullIndicatorAttributeName or
nullIndicatorColumnName property.
|
protected java.lang.String |
getPropertyCaption(com.haulmont.chile.core.model.MetaClass metaClass,
com.haulmont.chile.core.model.MetaProperty metaProperty) |
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 |
initNamePatternFields(Entity entity)
Tries to initialize entity fields included in entity name pattern by default values
|
protected void |
initRuntimePropertiesDatasources(View view) |
protected void |
initShortcuts() |
protected boolean |
isByteArray(com.haulmont.chile.core.model.MetaProperty metaProperty) |
protected boolean |
isEmbedded(com.haulmont.chile.core.model.MetaProperty metaProperty)
Checks if the property is embedded
|
protected boolean |
isParentProperty(com.haulmont.chile.core.model.MetaProperty metaProperty)
Checks if specified property is a reference to entity's parent entity.
|
protected boolean |
isRelatedToNonLocalProperty(com.haulmont.chile.core.model.MetaProperty metaProperty)
Determine whether the given metaProperty relates to at least one non local property
|
protected boolean |
isRequired(com.haulmont.chile.core.model.MetaProperty metaProperty) |
protected boolean |
isUuid(com.haulmont.chile.core.model.MetaProperty metaProperty) |
protected Entity |
loadSingleItem(com.haulmont.chile.core.model.MetaClass meta,
java.lang.Object id,
View view)
Loads single item by id.
|
protected boolean |
requireTextArea(com.haulmont.chile.core.model.MetaProperty metaProperty,
Entity item) |
protected void |
setParentField(Entity item,
java.lang.String parentProperty,
Entity parent) |
add, add, addAction, addAction, addBeforeWindowCloseListener, 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, 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, isAttributeAccessControlEnabled, isCloseable, isEnabled, isEnabledRecursive, isExpanded, isResponsive, isSameScreen, isValid, isVisible, isVisibleRecursive, postValidate, preClose, ready, remove, removeAction, removeAction, removeAll, removeAllActions, removeBeforeWindowCloseListener, 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, validate, validate, validateAdditionalRules, validateAll
addAfterCloseListener, addAfterDetachListener, addAfterInitListener, addAfterShowListener, addBeforeCloseListener, addBeforeShowListener, addInitListener, addUrlParamsChangeListener, 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, addCloseListener, addCloseWithCommitListener, addListener, close, close, closeAndRun, removeBeforeCloseWithCloseButtonListener, removeBeforeCloseWithShortcutListener, removeCloseListener, removeCloseWithCommitListener, removeListener
getComponentNN
add, focusFirstComponent, getComponentNN, remove
getHeightUnits, getId, getWidthUnits, isEnabledItself, isVisibleItself, requestFocus, setHeightAuto, setHeightFull, setSizeAuto, setSizeFull, setWidthAuto, setWidthFull
getActionNN, getSubPart
openEditor, openEditor, openEditor, openEditor, openEditor, openEditor, openEditor, openFrame, openFrame, openLookup, openLookup, openLookup, openLookup, openWindow, openWindow, showMessageDialog, showNotification, showNotification, showNotification, showOptionDialog, showOptionDialog, showWebPage
public static final int CAPTION_MAX_LENGTH
public static final int MAX_TEXT_LENGTH
public static final WindowManager.OpenType OPEN_TYPE
public static final int MAX_TEXTFIELD_STRING_LENGTH
@Inject protected Metadata metadata
@Inject protected MessageTools messageTools
@Inject protected ViewRepository viewRepository
@Inject protected Security security
@Inject protected DataSupplier dataSupplier
@Inject protected BoxLayout buttonsBox
@Inject protected BoxLayout contentPane
@Inject protected BoxLayout runtimePane
@Inject protected TabSheet tablesTabSheet
@Inject protected UiComponents uiComponents
@Inject protected Configuration configuration
@Inject protected ThemeConstants themeConstants
@Inject protected EntityStates entityStates
protected Entity item
protected Entity parent
protected java.lang.String parentProperty
protected Datasource parentDs
protected Datasource datasource
protected com.haulmont.chile.core.model.MetaClass meta
protected DsContextImpl dsContext
protected java.util.Map<java.lang.String,Datasource> datasources
protected java.lang.Boolean isNew
protected java.lang.Boolean autocommit
protected java.lang.Boolean showSystemFields
protected java.util.Collection<Table> tables
protected java.util.Collection<Field> reserveLineSeparatorFields
protected RuntimePropsDatasource rDS
protected CollectionDatasource categoriesDs
protected ButtonsPanel buttonsPanel
protected Button commitButton
protected Button cancelButton
protected FieldGroup focusFieldGroup
protected java.lang.String focusFieldId
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 screenpublic Entity getItem()
protected void initShortcuts()
protected void setParentField(Entity item, java.lang.String parentProperty, Entity parent)
protected void createRuntimeDataComponents()
protected void initRuntimePropertiesDatasources(View view)
protected void createEmbeddedFields(com.haulmont.chile.core.model.MetaClass metaClass, Entity item)
metaClass
- meta class of the entityitem
- entity instanceprotected com.haulmont.chile.core.model.MetaProperty getNullIndicatorProperty(com.haulmont.chile.core.model.MetaProperty embeddedMetaProperty)
embeddedMetaProperty
- embedded property of the current entityprotected boolean isEmbedded(com.haulmont.chile.core.model.MetaProperty metaProperty)
metaProperty
- meta propertyprotected Entity loadSingleItem(com.haulmont.chile.core.model.MetaClass meta, java.lang.Object id, View view)
meta
- item's meta classid
- item's idview
- viewprotected void createDataComponents(com.haulmont.chile.core.model.MetaClass metaClass, Entity item)
metaClass
- item meta classprotected void addEmbeddedFieldGroup(com.haulmont.chile.core.model.MetaProperty embeddedMetaProperty, java.lang.String fqnPrefix, Entity embeddedItem, boolean editable)
embeddedMetaProperty
- meta property of the embedded propertyembeddedItem
- current value of the embedded propertyprotected boolean isByteArray(com.haulmont.chile.core.model.MetaProperty metaProperty)
protected boolean isUuid(com.haulmont.chile.core.model.MetaProperty metaProperty)
protected boolean isRequired(com.haulmont.chile.core.model.MetaProperty metaProperty)
protected void createPropertyDatasources(Datasource masterDs)
masterDs
- master datasourceprotected void createNestedEmbeddedDatasources(com.haulmont.chile.core.model.MetaClass metaClass, java.lang.String fqnPrefix, Datasource masterDs)
protected void createCommitButtons()
protected void addField(com.haulmont.chile.core.model.MetaClass metaClass, com.haulmont.chile.core.model.MetaProperty metaProperty, Entity item, FieldGroup fieldGroup, boolean required, boolean custom, boolean readOnly, java.util.Collection<FieldGroup.FieldConfig> customFields)
metaProperty
- meta property of the item's property which field is creatingitem
- entity instance containing given propertyfieldGroup
- field group to which created field will be addedcustomFields
- if the field is custom it will be added to this collectionrequired
- true if the field is requiredcustom
- true if the field is customprotected void addBooleanCustomField(com.haulmont.chile.core.model.MetaClass metaClass, com.haulmont.chile.core.model.MetaProperty metaProperty, Entity item, FieldGroup fieldGroup, boolean required, boolean readOnly)
metaClass
- meta property of the item's property which field is creatingmetaProperty
- meta property of the item's property which field is creatingitem
- entity instance containing given propertyfieldGroup
- field group to which created field will be addedrequired
- true if the field is requiredreadOnly
- false if field should be editableprotected boolean requireTextArea(com.haulmont.chile.core.model.MetaProperty metaProperty, Entity item)
metaProperty
- meta propertyitem
- entity containing property of the given meta propertyprotected boolean containsSeparator(java.lang.String s)
protected boolean isParentProperty(com.haulmont.chile.core.model.MetaProperty metaProperty)
metaProperty
- meta propertyprotected void createCustomFields(FieldGroup fieldGroup, java.util.Collection<FieldGroup.FieldConfig> customFields)
protected void initNamePatternFields(Entity entity)
entity
- instanceprotected java.lang.String getPropertyCaption(com.haulmont.chile.core.model.MetaClass metaClass, com.haulmont.chile.core.model.MetaProperty metaProperty)
protected void addTable(com.haulmont.chile.core.model.MetaClass metaClass, com.haulmont.chile.core.model.MetaProperty childMeta)
protected boolean isRelatedToNonLocalProperty(com.haulmont.chile.core.model.MetaProperty metaProperty)
protected ButtonsPanel createButtonsPanel(com.haulmont.chile.core.model.MetaProperty metaProperty, CollectionDatasource propertyDs, Table table)
metaProperty
- property representing table's datapropertyDs
- property's Datasource (CollectionPropertyDatasource usually)table
- tableprotected AddAction createAddAction(com.haulmont.chile.core.model.MetaProperty metaProperty, CollectionDatasource propertyDs, Table table, com.haulmont.chile.core.model.MetaClass propertyMetaClass)
protected Window.Lookup.Handler createAddHandler(com.haulmont.chile.core.model.MetaProperty metaProperty, CollectionDatasource propertyDs)
public void commitAndClose()
protected RemoveAction createRemoveAction(com.haulmont.chile.core.model.MetaProperty metaProperty, Table table)
protected View createView(com.haulmont.chile.core.model.MetaClass meta)
meta
- meta classprotected View createEmbeddedView(com.haulmont.chile.core.model.MetaClass metaPropertyClass)
protected boolean attrViewPermitted(com.haulmont.chile.core.model.MetaClass metaClass, java.lang.String property)
protected boolean attrViewPermitted(com.haulmont.chile.core.model.MetaClass metaClass, com.haulmont.chile.core.model.MetaProperty metaProperty)
protected boolean attrPermitted(com.haulmont.chile.core.model.MetaClass metaClass, java.lang.String property, EntityAttrAccess entityAttrAccess)
protected boolean entityOpPermitted(com.haulmont.chile.core.model.MetaClass metaClass, EntityOp entityOp)