public abstract class WindowImpl extends java.lang.Object implements Window, Component.Wrapper, Component.HasXmlDescriptor, SecuredActionsHolder, Component.HasIcon, FrameImplementation, WindowImplementation
Window.BeforeCloseEvent, Window.CloseOrigin, Window.Committable, Window.ContentSwitchMode, Window.HasUserIndicator, Window.HasWorkArea
ExpandingLayout.ExpandDirection
Component.Alignment, Component.BelongToFrame, Component.Disposable, Component.Editable, Component.Focusable, Component.HasCaption, Component.HasDescription, Component.HasIcon, Component.HasXmlDescriptor, Component.Wrapper
Modifier and Type | Field and Description |
---|---|
protected FrameActionsHolder |
actionsHolder |
protected ActionsPermissions |
actionsPermissions |
protected java.util.Map<java.lang.String,Component> |
allComponents |
protected static java.lang.String |
C_WINDOW_LAYOUT |
protected java.lang.String |
caption |
protected boolean |
closeable |
protected com.vaadin.ui.AbstractOrderedLayout |
component |
protected WindowContext |
context |
protected boolean |
defaultScreenWindow |
protected java.lang.String |
description |
protected org.dom4j.Element |
element |
protected java.util.Set<Facet> |
facets |
protected java.lang.String |
focusComponentId |
protected Screen |
frameOwner |
protected java.lang.String |
icon |
protected Icons |
icons |
protected java.lang.String |
id |
protected java.util.List<Component> |
ownComponents |
protected NavigationState |
resolvedState |
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
Constructor and Description |
---|
WindowImpl() |
Modifier and Type | Method and Description |
---|---|
void |
add(Component childComponent)
Adds a component to this container.
|
void |
add(Component childComponent,
int index) |
void |
addAction(Action action)
Add an action to the component
|
void |
addAction(Action action,
int index)
Add an action to the component with index.
|
io.jmix.core.common.event.Subscription |
addBeforeWindowCloseListener(java.util.function.Consumer<Window.BeforeCloseEvent> listener)
Registers a new before window close listener.
|
void |
addFacet(Facet facet)
Registers the passed non-visual component in the frame.
|
void |
addStyleName(java.lang.String styleName)
Adds one or more style names to this component.
|
protected com.vaadin.ui.AbstractOrderedLayout |
createLayout() |
protected void |
disableEventListeners() |
protected void |
enableEventListeners() |
void |
expand(Component childComponent)
Specifies the component that will be given maximum available space.
|
boolean |
findAndFocusChildComponent() |
void |
fireBeforeClose(Window.BeforeCloseEvent event) |
Action |
getAction(java.lang.String id) |
java.util.Collection<Action> |
getActions() |
ActionsPermissions |
getActionsPermissions() |
Component.Alignment |
getAlignment() |
java.lang.String |
getCaption() |
com.vaadin.ui.Component |
getComponent() |
Component |
getComponent(int index)
Returns the component at the given position.
|
Component |
getComponent(java.lang.String id)
Gets a component belonging to the whole components tree below this container.
|
java.util.Collection<Component> |
getComponents()
Gets all components belonging to the whole components tree below this container.
|
protected Component.Focusable |
getComponentToFocus(java.util.Iterator<Component> componentsIterator) |
com.vaadin.ui.Component |
getComposition() |
protected com.vaadin.ui.ComponentContainer |
getContainer() |
WindowContext |
getContext() |
java.lang.String |
getDescription() |
protected io.jmix.core.common.event.EventHub |
getEventHub() |
ExpandingLayout.ExpandDirection |
getExpandDirection() |
float |
getExpandRatio(Component component) |
Facet |
getFacet(java.lang.String id)
Finds registered facet by ID.
|
java.util.stream.Stream<Facet> |
getFacets() |
java.lang.String |
getFocusComponent() |
Frame |
getFrame() |
Screen |
getFrameOwner() |
float |
getHeight()
Get component height in
Component.getHeightSizeUnit() |
SizeUnit |
getHeightSizeUnit()
Gets the height property units.
|
java.lang.String |
getIcon()
Get icon source: "font-icon:ADD", "icons/myicon.png", "theme://createIcon", etc.
|
java.lang.String |
getId()
Component ID as defined in
id attribute |
MarginInfo |
getMargin() |
java.lang.String |
getMaxHeight() |
java.lang.String |
getMaxWidth() |
java.lang.String |
getMinHeight() |
java.lang.String |
getMinWidth() |
Component |
getOwnComponent(java.lang.String id)
Gets component directly owned by this container.
|
java.util.Collection<Component> |
getOwnComponents()
Gets all components directly owned by this container.
|
java.util.stream.Stream<Component> |
getOwnComponentsStream()
Gets stream of all components directly owned by this container.
|
Component |
getParent() |
Component |
getRegisteredComponent(java.lang.String id)
INTERNAL.
|
NavigationState |
getResolvedState() |
boolean |
getSpacing() |
java.lang.String |
getStyleName()
Styles implementation is client-type-specific.
|
float |
getWidth()
Get component width in
Component.getWidthSizeUnit() |
SizeUnit |
getWidthSizeUnit()
Gets the width property units.
|
org.dom4j.Element |
getXmlDescriptor() |
protected boolean |
handleValidationErrors(ValidationErrors errors) |
int |
indexOf(Component component) |
void |
initUiEventListeners() |
boolean |
isCloseable() |
boolean |
isDefaultScreenWindow() |
boolean |
isEnabled()
Is the component enabled?
Note that this method only returns the status of the component and does not take parents into account. |
boolean |
isEnabledRecursive() |
boolean |
isExpanded(Component component)
Returns true if the component occupies the maximum available space.
|
boolean |
isResponsive()
Is the component responsive?
|
boolean |
isValid()
Check validity by invoking validators on all components which support them.
|
boolean |
isVisible()
Is the component visible?
A component is visible only if all its parents are also visible. |
boolean |
isVisibleRecursive() |
protected <E> void |
publish(java.lang.Class<E> eventType,
E event) |
void |
registerComponent(Component component)
INTERNAL.
|
void |
remove(Component childComponent)
Removes a component from this container.
|
void |
removeAction(Action action)
Remove the action from the component
|
void |
removeAction(java.lang.String id)
Remove the action by its ID.
|
void |
removeAll()
Removes all components from this container.
|
void |
removeAllActions()
Remove all actions from the component
|
void |
removeFacet(Facet facet)
Removes the non-visual component from the frame.
|
void |
removeStyleName(java.lang.String styleName)
Removes one or more style names from component.
|
void |
resetExpanded()
Resets the expanded component and provides equal space for all nested components.
|
void |
setAlignment(Component.Alignment alignment) |
void |
setCaption(java.lang.String caption)
Sets the component's caption.
|
void |
setCloseable(boolean closeable)
Sets the closable status for the window.
|
void |
setContext(FrameContext ctx)
INTERNAL.
|
void |
setDefaultScreenWindow(boolean defaultScreenWindow) |
void |
setDescription(java.lang.String description)
Sets the component's description.
|
void |
setEnabled(boolean enabled)
Sets the component enabled state.
|
void |
setExpandRatio(Component component,
float ratio)
Sets expand ratio for the component.
|
void |
setFocusComponent(java.lang.String componentId)
Sets a component to be focused after the screen is opened.
|
void |
setFrame(Frame frame) |
void |
setFrameOwner(Screen controller) |
void |
setHeight(java.lang.String height)
Set component height in
Component.getHeightSizeUnit() |
void |
setIcon(java.lang.String icon)
Set an icon by its source: "font-icon:ADD", "icons/myicon.png", "theme://createIcon", etc.
|
void |
setIconFromSet(Icons.Icon icon)
Set an icon from an icon set.
|
protected void |
setIcons(Icons icons) |
void |
setId(java.lang.String id)
Set component ID
|
void |
setMargin(MarginInfo marginInfo) |
void |
setMaxHeight(java.lang.String maxHeight)
Sets maximum CSS height for window layout.
|
void |
setMaxWidth(java.lang.String maxWidth)
Sets maximum CSS width for window layout.
|
void |
setMinHeight(java.lang.String minHeight)
Sets minimum CSS height for window layout.
|
void |
setMinWidth(java.lang.String minWidth)
Sets minimum CSS width for window layout.
|
void |
setParent(Component parent)
INTERNAL.
ComponentContainer.add(Component) is normally used for adding components
to a parent and the used method will call this method implicitly. |
void |
setResolvedState(NavigationState resolvedState) |
void |
setResponsive(boolean responsive)
Sets component to be responsive by width and height.
|
void |
setSpacing(boolean enabled) |
void |
setStyleName(java.lang.String name)
Sets one or more style names of the component, replacing any
previous styles.
|
void |
setVisible(boolean visible)
Sets visibility value for the component.
|
void |
setWidth(java.lang.String width)
Set component width in
Component.getWidthSizeUnit() } |
void |
setXmlDescriptor(org.dom4j.Element element) |
void |
unregisterComponent(Component component)
INTERNAL.
|
protected <E> boolean |
unsubscribe(java.lang.Class<E> eventType,
java.util.function.Consumer<E> listener) |
<X> X |
unwrap(java.lang.Class<X> internalComponentClass)
Get client specific component instance.
|
<X> X |
unwrapComposition(java.lang.Class<X> internalCompositionClass)
Get the outmost external container of client specific component instance.
|
<X> X |
unwrapCompositionOrNull(java.lang.Class<X> internalCompositionClass)
Get the outmost external container of client specific component instance.
|
<X> X |
unwrapOrNull(java.lang.Class<X> internalComponentClass)
Get client specific component instance.
|
void |
validate()
Check validity by invoking validators on all components which support them.
|
boolean |
validate(java.util.List<Validatable> fields)
Checks validity by invoking validators on specified components which support them
and show validation result notification.
|
boolean |
validateAll()
Checks validity by invoking validators on all components which support them
and show validation result notification.
|
<X> void |
withUnwrapped(java.lang.Class<X> internalComponentClass,
java.util.function.Consumer<X> action)
Performs the given
action with underlying component if it can be casted to the given
internalComponentClass . |
<X> void |
withUnwrappedComposition(java.lang.Class<X> internalCompositionClass,
java.util.function.Consumer<X> action)
Get the outmost external container of client specific component instance and performs the given
action . |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFacetNN
getComponentNN
add, remove
setHeightAuto, setHeightFull, setSizeAuto, setSizeFull, setWidthAuto, setWidthFull
focusFirstComponent, getComponentNN
protected static final java.lang.String C_WINDOW_LAYOUT
protected java.lang.String id
protected java.util.Set<Facet> facets
protected java.util.List<Component> ownComponents
protected java.util.Map<java.lang.String,Component> allComponents
protected java.lang.String focusComponentId
protected com.vaadin.ui.AbstractOrderedLayout component
protected Screen frameOwner
protected org.dom4j.Element element
protected WindowContext context
protected java.lang.String icon
protected java.lang.String caption
protected java.lang.String description
protected FrameActionsHolder actionsHolder
protected ActionsPermissions actionsPermissions
protected Icons icons
protected boolean closeable
protected NavigationState resolvedState
protected boolean defaultScreenWindow
protected io.jmix.core.common.event.EventHub getEventHub()
protected <E> void publish(java.lang.Class<E> eventType, E event)
protected <E> boolean unsubscribe(java.lang.Class<E> eventType, java.util.function.Consumer<E> listener)
@Autowired protected void setIcons(Icons icons)
protected void disableEventListeners()
protected void enableEventListeners()
protected com.vaadin.ui.AbstractOrderedLayout createLayout()
protected com.vaadin.ui.ComponentContainer getContainer()
public void addFacet(Facet facet)
Frame
@Nullable public Facet getFacet(java.lang.String id)
Frame
public void removeFacet(Facet facet)
Frame
removeFacet
in interface Frame
facet
- facetpublic java.util.stream.Stream<Facet> getFacets()
public void registerComponent(Component component)
FrameImplementation
registerComponent
in interface FrameImplementation
public void unregisterComponent(Component component)
FrameImplementation
unregisterComponent
in interface FrameImplementation
@Nullable public Component getRegisteredComponent(java.lang.String id)
FrameImplementation
getRegisteredComponent
in interface FrameImplementation
public java.lang.String getStyleName()
Component
getStyleName
in interface Component
public void setStyleName(@Nullable java.lang.String name)
Component
setStyleName
in interface Component
name
- one or more style names separated by space.public void addStyleName(java.lang.String styleName)
Component
addStyleName
in interface Component
styleName
- one or more style names separated by space.public void removeStyleName(java.lang.String styleName)
Component
removeStyleName
in interface Component
styleName
- one or more style names separated by space.public <X> X unwrap(java.lang.Class<X> internalComponentClass)
Component
com.vaadin.ui.TextField vTextField = textField.unwrap(com.vaadin.ui.TextField.class);
@Nullable public <X> X unwrapOrNull(java.lang.Class<X> internalComponentClass)
Component
null
if underlying component cannot be casted to the given internalComponentClass
.
Example:
com.vaadin.ui.TextField vTextField = textField.unwrapOrNull(com.vaadin.ui.TextField.class);
unwrapOrNull
in interface Component
X
- type of internal classinternalComponentClass
- class of underlying component implementation based on Vaadin or Swingpublic <X> void withUnwrapped(java.lang.Class<X> internalComponentClass, java.util.function.Consumer<X> action)
Component
action
with underlying component if it can be casted to the given
internalComponentClass
.
Example:
textField.withUnwrapped(com.vaadin.ui.TextField.class, vTextField -> { // do something });
withUnwrapped
in interface Component
X
- type of internal classinternalComponentClass
- class of underlying component implementation based on Vaadin or Swingaction
- action to perform if underlying component can be casted to given classpublic <X> X unwrapComposition(java.lang.Class<X> internalCompositionClass)
Component
com.vaadin.ui.Layout vLayout = table.unwrapComposition(com.vaadin.ui.Layout.class);
unwrapComposition
in interface Component
X
- type of internal classinternalCompositionClass
- class of underlying composition implementation based on Vaadin or Swing@Nullable public <X> X unwrapCompositionOrNull(java.lang.Class<X> internalCompositionClass)
Component
internalCompositionClass
.
Example:
com.vaadin.ui.Layout vLayout = table.unwrapCompositionOrNull(com.vaadin.ui.Layout.class);
unwrapCompositionOrNull
in interface Component
X
- type of internal classinternalCompositionClass
- class of underlying composition implementation based on Vaadin or Swingpublic <X> void withUnwrappedComposition(java.lang.Class<X> internalCompositionClass, java.util.function.Consumer<X> action)
Component
action
.
table.withUnwrappedComposition(com.vaadin.ui.Layout.class, vLayout -> { // do something });
withUnwrappedComposition
in interface Component
X
- type of internal classinternalCompositionClass
- class of underlying composition implementation based on Vaadin or Swingaction
- to perform if underlying composition can be casted to given classpublic boolean getSpacing()
getSpacing
in interface HasSpacing
public void setSpacing(boolean enabled)
setSpacing
in interface HasSpacing
public MarginInfo getMargin()
public void setMargin(MarginInfo marginInfo)
public void setMinWidth(java.lang.String minWidth)
Window
setMinWidth
in interface Window
minWidth
- minimum width@Nullable public java.lang.String getMinWidth()
getMinWidth
in interface Window
public void setMaxWidth(java.lang.String maxWidth)
Window
setMaxWidth
in interface Window
maxWidth
- maximum width@Nullable public java.lang.String getMaxWidth()
getMaxWidth
in interface Window
public void setMinHeight(java.lang.String minHeight)
Window
setMinHeight
in interface Window
minHeight
- minimum height@Nullable public java.lang.String getMinHeight()
getMinHeight
in interface Window
public void setMaxHeight(java.lang.String maxHeight)
Window
setMaxHeight
in interface Window
maxHeight
- maximum height@Nullable public java.lang.String getMaxHeight()
getMaxHeight
in interface Window
public void addAction(Action action)
ActionsHolder
addAction
in interface ActionsHolder
public void addAction(Action action, int index)
ActionsHolder
addAction
in interface ActionsHolder
public void removeAction(Action action)
ActionsHolder
removeAction
in interface ActionsHolder
public void removeAction(java.lang.String id)
ActionsHolder
removeAction
in interface ActionsHolder
public void removeAllActions()
ActionsHolder
removeAllActions
in interface ActionsHolder
public java.util.Collection<Action> getActions()
getActions
in interface ActionsHolder
@Nullable public Action getAction(java.lang.String id)
getAction
in interface ActionsHolder
public boolean isValid()
Frame
public void validate() throws ValidationException
Frame
validate
in interface Frame
ValidationException
- if some components are currently in invalid statepublic boolean validate(java.util.List<Validatable> fields)
Window
public boolean validateAll()
Window
validateAll
in interface Frame
validateAll
in interface Window
protected boolean handleValidationErrors(ValidationErrors errors)
public boolean isCloseable()
isCloseable
in interface Window
public void setCloseable(boolean closeable)
Window
setCloseable
in interface Window
closeable
- closeable flagpublic Screen getFrameOwner()
getFrameOwner
in interface Frame
getFrameOwner
in interface Window
Screen
,
ScreenFragment
public void setFrameOwner(Screen controller)
setFrameOwner
in interface WindowImplementation
public void initUiEventListeners()
initUiEventListeners
in interface WindowImplementation
public WindowContext getContext()
getContext
in interface Frame
getContext
in interface Window
public void setContext(FrameContext ctx)
FrameImplementation
setContext
in interface FrameImplementation
@Nullable protected Component.Focusable getComponentToFocus(java.util.Iterator<Component> componentsIterator)
public java.lang.String getFocusComponent()
getFocusComponent
in interface Window
public void setFocusComponent(@Nullable java.lang.String componentId)
Window
setFocusComponent
in interface Window
componentId
- component's ID in XML. If null, then first focusable component will be focusedpublic io.jmix.core.common.event.Subscription addBeforeWindowCloseListener(java.util.function.Consumer<Window.BeforeCloseEvent> listener)
Window
addBeforeWindowCloseListener
in interface Window
listener
- the listener to registerpublic void fireBeforeClose(Window.BeforeCloseEvent event)
@Nullable public org.dom4j.Element getXmlDescriptor()
getXmlDescriptor
in interface Component.HasXmlDescriptor
public void setXmlDescriptor(@Nullable org.dom4j.Element element)
setXmlDescriptor
in interface Component.HasXmlDescriptor
public void add(Component childComponent)
ComponentContainer
add
in interface ComponentContainer
childComponent
- a component to addpublic void add(Component childComponent, int index)
add
in interface OrderedContainer
public int indexOf(Component component)
indexOf
in interface OrderedContainer
@Nullable public Component getComponent(int index)
OrderedContainer
getComponent
in interface OrderedContainer
index
- component indexpublic void remove(Component childComponent)
ComponentContainer
remove
in interface ComponentContainer
childComponent
- a component to removepublic void removeAll()
ComponentContainer
removeAll
in interface ComponentContainer
public java.util.Collection<Component> getOwnComponents()
HasComponents
getOwnComponents
in interface HasComponents
public java.util.stream.Stream<Component> getOwnComponentsStream()
HasComponents
getOwnComponentsStream
in interface HasComponents
public java.util.Collection<Component> getComponents()
HasComponents
getComponents
in interface HasComponents
@Nullable public java.lang.String getId()
Component
id
attributepublic void setId(@Nullable java.lang.String id)
Component
@Nullable public Component getParent()
public void setParent(@Nullable Component parent)
Component
ComponentContainer.add(Component)
is normally used for adding components
to a parent and the used method will call this method implicitly.public boolean isEnabled()
Component
public void setEnabled(boolean enabled)
Component
setEnabled
in interface Component
enabled
- enabled flagpublic boolean isResponsive()
Component
isResponsive
in interface Component
public void setResponsive(boolean responsive)
Component
setResponsive
in interface Component
responsive
- responsive flagpublic boolean isVisible()
Component
public void setVisible(boolean visible)
Component
setVisible
in interface Component
visible
- visible flagpublic boolean isVisibleRecursive()
isVisibleRecursive
in interface Component
public boolean isEnabledRecursive()
isEnabledRecursive
in interface Component
public float getHeight()
Component
Component.getHeightSizeUnit()
public void setHeight(@Nullable java.lang.String height)
Component
Component.getHeightSizeUnit()
public SizeUnit getHeightSizeUnit()
Component
getHeightSizeUnit
in interface Component
public float getWidth()
Component
Component.getWidthSizeUnit()
public void setWidth(@Nullable java.lang.String width)
Component
Component.getWidthSizeUnit()
}public SizeUnit getWidthSizeUnit()
Component
getWidthSizeUnit
in interface Component
@Nullable public Component getOwnComponent(java.lang.String id)
HasComponents
getOwnComponent
in interface HasComponents
@Nullable public Component getComponent(java.lang.String id)
HasComponents
getComponent
in interface HasComponents
public Component.Alignment getAlignment()
getAlignment
in interface Component
public void setAlignment(Component.Alignment alignment)
setAlignment
in interface Component
public void expand(Component childComponent)
ExpandingLayout
expand
in interface ExpandingLayout
childComponent
- the componentpublic void resetExpanded()
ExpandingLayout
resetExpanded
in interface ExpandingLayout
public boolean isExpanded(Component component)
ExpandingLayout
isExpanded
in interface ExpandingLayout
component
- component to checkpublic ExpandingLayout.ExpandDirection getExpandDirection()
getExpandDirection
in interface ExpandingLayout
ExpandingLayout.ExpandDirection
public com.vaadin.ui.Component getComponent()
getComponent
in interface Component.Wrapper
public com.vaadin.ui.Component getComposition()
getComposition
in interface Component.Wrapper
public boolean findAndFocusChildComponent()
@Nullable public java.lang.String getCaption()
getCaption
in interface Component.HasCaption
public void setCaption(@Nullable java.lang.String caption)
Component.HasCaption
setCaption
in interface Component.HasCaption
caption
- the new component's caption@Nullable public java.lang.String getDescription()
getDescription
in interface Component.HasDescription
public void setDescription(@Nullable java.lang.String description)
Component.HasDescription
setDescription
in interface Component.HasDescription
description
- the new description to set@Nullable public Frame getFrame()
getFrame
in interface Component.BelongToFrame
public void setFrame(@Nullable Frame frame)
setFrame
in interface Component.BelongToFrame
public ActionsPermissions getActionsPermissions()
getActionsPermissions
in interface SecuredActionsHolder
@Nullable public java.lang.String getIcon()
Component.HasIcon
getIcon
in interface Component.HasIcon
public void setIcon(@Nullable java.lang.String icon)
Component.HasIcon
setIcon
in interface Component.HasIcon
public void setIconFromSet(@Nullable Icons.Icon icon)
Component.HasIcon
setIconFromSet
in interface Component.HasIcon
public void setExpandRatio(Component component, float ratio)
SupportsExpandRatio
setExpandRatio
in interface SupportsExpandRatio
component
- component to expand with ratioratio
- ratiopublic float getExpandRatio(Component component)
getExpandRatio
in interface SupportsExpandRatio
component
- component for which returns ratio@Nullable public NavigationState getResolvedState()
public void setResolvedState(NavigationState resolvedState)
public boolean isDefaultScreenWindow()
public void setDefaultScreenWindow(boolean defaultScreenWindow)