public abstract class WebWindow extends java.lang.Object implements Window, Component.Wrapper, Component.HasXmlDescriptor, WrappedWindow, Component.Disposable, SecuredActionsHolder, Component.HasIcon, FrameImplementation, WindowImplementation
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
Modifier and Type | Field and Description |
---|---|
protected com.haulmont.cuba.web.gui.components.WebFrameActionsHolder |
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 java.lang.String |
debugId |
protected boolean |
defaultScreenWindow |
protected java.lang.String |
description |
protected DialogOptions |
dialogOptions |
protected boolean |
disposed |
protected org.dom4j.Element |
element |
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 |
protected java.util.List<Timer> |
timers |
protected int |
urlStateMark |
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
Constructor and Description |
---|
WebWindow() |
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.
|
com.haulmont.bali.events.Subscription |
addBeforeWindowCloseListener(java.util.function.Consumer<Window.BeforeCloseEvent> listener)
Registers a new before window close listener.
|
void |
addStyleName(java.lang.String styleName)
Adds one or more style names to this component.
|
void |
addTimer(Timer timer)
Add a
Timer component to this screen. |
protected void |
attachTimerToUi(WebTimer timer) |
protected com.vaadin.ui.AbstractOrderedLayout |
createLayout() |
protected void |
disableEventListeners() |
void |
dispose() |
protected void |
enableEventListeners() |
void |
expand(Component component) |
void |
expand(Component component,
java.lang.String height,
java.lang.String width) |
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)
Get component belonging to the whole components tree below this container.
|
java.util.Collection<Component> |
getComponents()
Get 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() |
DialogOptions |
getDialogOptions() |
protected com.haulmont.bali.events.EventHub |
getEventHub() |
ExpandingLayout.ExpandDirection |
getExpandDirection() |
float |
getExpandRatio(Component component) |
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)
Get component directly owned by this container.
|
java.util.Collection<Component> |
getOwnComponents()
Get all components directly owned by this container
|
java.util.stream.Stream<Component> |
getOwnComponentsStream()
Get stream of 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.
|
Timer |
getTimer(java.lang.String id)
Returns a
Timer added to this screen. |
int |
getUrlStateMark() |
float |
getWidth()
Get component width in
Component.getWidthUnits() |
SizeUnit |
getWidthSizeUnit()
Gets the width property units.
|
WindowManager |
getWindowManager()
Deprecated.
|
org.dom4j.Element |
getXmlDescriptor() |
protected boolean |
handleValidationErrors(ValidationErrors errors) |
boolean |
hasDialogOptions() |
int |
indexOf(Component component) |
void |
initUiEventListeners() |
boolean |
isCloseable() |
boolean |
isDefaultScreenWindow() |
boolean |
isDisposed() |
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) |
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() |
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 |
removeBeforeWindowCloseListener(java.util.function.Consumer<Window.BeforeCloseEvent> listener)
Removes a previously added listener.
|
void |
removeStyleName(java.lang.String styleName)
Removes one or more style names from component.
|
void |
resetExpanded() |
void |
setAlignment(Component.Alignment alignment) |
void |
setCaption(java.lang.String caption)
Sets the component's caption.
|
void |
setCloseable(boolean closeable) |
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)
Set 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.getHeightUnits() |
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 |
setUrlStateMark(int urlStateMark) |
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 |
stopTimers()
Completely stop and remove timers of the window.
|
void |
unregisterComponent(Component component)
INTERNAL.
|
<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.
|
void |
validate()
Check validity by invoking validators on all components which support them.
|
boolean |
validate(java.util.List<Validatable> fields)
Check validity by invoking validators on specified components which support them
and show validation result notification.
|
boolean |
validateAll()
Check validity by invoking validators on all components which support them
and show validation result notification.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addBeforeCloseWithCloseButtonListener, addBeforeCloseWithShortcutListener, addCloseListener, addCloseWithCommitListener, addListener, applySettings, close, close, closeAndRun, deleteSettings, getSettings, removeBeforeCloseWithCloseButtonListener, removeBeforeCloseWithShortcutListener, removeCloseListener, removeCloseWithCommitListener, removeListener, saveSettings
getComponentNN
add, focusFirstComponent, getComponentNN, remove
getHeightUnits, getWidthUnits, isEnabledItself, isVisibleItself, requestFocus, setHeightAuto, setHeightFull, setSizeAuto, setSizeFull, setWidthAuto, setWidthFull
openEditor, openEditor, openEditor, openEditor, openEditor, openEditor, openEditor, openFrame, openFrame, openLookup, openLookup, openLookup, openLookup, openWindow, openWindow, showMessageDialog, showNotification, showNotification, showNotification, showOptionDialog, showOptionDialog, showWebPage
protected static final java.lang.String C_WINDOW_LAYOUT
protected java.lang.String id
protected java.lang.String debugId
protected java.util.List<Component> ownComponents
protected java.util.Map<java.lang.String,Component> allComponents
protected java.util.List<Timer> timers
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 com.haulmont.cuba.web.gui.components.WebFrameActionsHolder actionsHolder
protected ActionsPermissions actionsPermissions
protected Icons icons
protected boolean disposed
protected DialogOptions dialogOptions
protected boolean closeable
protected int urlStateMark
protected NavigationState resolvedState
protected boolean defaultScreenWindow
protected com.haulmont.bali.events.EventHub getEventHub()
@Inject 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 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(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);
public <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 Swingpublic 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 widthpublic java.lang.String getMinWidth()
getMinWidth
in interface Window
public void setMaxWidth(java.lang.String maxWidth)
Window
setMaxWidth
in interface Window
maxWidth
- maximum widthpublic java.lang.String getMaxWidth()
getMaxWidth
in interface Window
public void setMinHeight(java.lang.String minHeight)
Window
setMinHeight
in interface Window
minHeight
- minimum heightpublic java.lang.String getMinHeight()
getMinHeight
in interface Window
public void setMaxHeight(java.lang.String maxHeight)
Window
setMaxHeight
in interface Window
maxHeight
- maximum heightpublic 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(@Nullable Action action)
ActionsHolder
removeAction
in interface ActionsHolder
public void removeAction(@Nullable 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 DialogOptions getDialogOptions()
getDialogOptions
in interface Window
OpenMode.DIALOG
.public boolean hasDialogOptions()
public boolean isCloseable()
isCloseable
in interface Window
public void setCloseable(boolean closeable)
setCloseable
in interface Window
public 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
protected Component.Focusable getComponentToFocus(java.util.Iterator<Component> componentsIterator)
public java.lang.String getFocusComponent()
getFocusComponent
in interface Window
public void setFocusComponent(java.lang.String componentId)
Window
setFocusComponent
in interface Window
componentId
- component's ID in XML. If null, then first focusable component will be focusedpublic com.haulmont.bali.events.Subscription addBeforeWindowCloseListener(java.util.function.Consumer<Window.BeforeCloseEvent> listener)
Window
addBeforeWindowCloseListener
in interface Window
listener
- the listener to registerpublic void removeBeforeWindowCloseListener(java.util.function.Consumer<Window.BeforeCloseEvent> listener)
Window
removeBeforeWindowCloseListener
in interface Window
listener
- the listener to removepublic void fireBeforeClose(Window.BeforeCloseEvent event)
public void addTimer(Timer timer)
Window
Timer
component to this screen.
UiComponents
factory.
protected void attachTimerToUi(WebTimer timer)
public Timer getTimer(java.lang.String id)
Window
Timer
added to this screen.public void stopTimers()
public org.dom4j.Element getXmlDescriptor()
getXmlDescriptor
in interface Component.HasXmlDescriptor
public void setXmlDescriptor(org.dom4j.Element element)
setXmlDescriptor
in interface Component.HasXmlDescriptor
@Deprecated public WindowManager getWindowManager()
HasWindowManager
getWindowManager
in interface HasWindowManager
getWindowManager
in interface Window
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()
ComponentContainer
getOwnComponents
in interface ComponentContainer
public java.util.stream.Stream<Component> getOwnComponentsStream()
ComponentContainer
getOwnComponentsStream
in interface ComponentContainer
public java.util.Collection<Component> getComponents()
ComponentContainer
getComponents
in interface ComponentContainer
public java.lang.String getId()
Component
id
attributepublic void setId(java.lang.String id)
Component
public Component getParent()
public void setParent(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(java.lang.String height)
Component
Component.getHeightUnits()
public SizeUnit getHeightSizeUnit()
Component
getHeightSizeUnit
in interface Component
public float getWidth()
Component
Component.getWidthUnits()
public void setWidth(java.lang.String width)
Component
Component.getWidthSizeUnit()
}public SizeUnit getWidthSizeUnit()
Component
getWidthSizeUnit
in interface Component
public Component getOwnComponent(java.lang.String id)
ComponentContainer
getOwnComponent
in interface ComponentContainer
@Nullable public Component getComponent(java.lang.String id)
ComponentContainer
getComponent
in interface ComponentContainer
public Component.Alignment getAlignment()
getAlignment
in interface Component
public void setAlignment(Component.Alignment alignment)
setAlignment
in interface Component
public void expand(Component component, java.lang.String height, java.lang.String width)
expand
in interface ExpandingLayout
public void expand(Component component)
expand
in interface ExpandingLayout
public void resetExpanded()
resetExpanded
in interface ExpandingLayout
public boolean isExpanded(Component component)
isExpanded
in interface ExpandingLayout
public ExpandingLayout.ExpandDirection getExpandDirection()
getExpandDirection
in interface ExpandingLayout
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()
public java.lang.String getCaption()
getCaption
in interface Component.HasCaption
public void setCaption(java.lang.String caption)
Component.HasCaption
setCaption
in interface Component.HasCaption
caption
- the new component's captionpublic java.lang.String getDescription()
getDescription
in interface Component.HasDescription
public void setDescription(java.lang.String description)
Component.HasDescription
setDescription
in interface Component.HasDescription
description
- the new description to setpublic Frame getFrame()
getFrame
in interface Component.BelongToFrame
public void setFrame(Frame frame)
setFrame
in interface Component.BelongToFrame
public void dispose()
dispose
in interface Component.Disposable
public boolean isDisposed()
isDisposed
in interface Component.Disposable
public ActionsPermissions getActionsPermissions()
getActionsPermissions
in interface SecuredActionsHolder
public java.lang.String getIcon()
Component.HasIcon
getIcon
in interface Component.HasIcon
public void setIcon(java.lang.String icon)
Component.HasIcon
setIcon
in interface Component.HasIcon
public void setIconFromSet(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 ratiopublic int getUrlStateMark()
public void setUrlStateMark(int urlStateMark)
public NavigationState getResolvedState()
public void setResolvedState(NavigationState resolvedState)
public boolean isDefaultScreenWindow()
public void setDefaultScreenWindow(boolean defaultScreenWindow)