public class AbstractFrame extends ScreenFragment implements Frame, Frame.Wrapper, LegacyFrame
ScreenFragment.AfterInitEvent, ScreenFragment.AttachEvent, ScreenFragment.DetachEvent, ScreenFragment.InitEventFrame.MessageMode, Frame.MessageType, Frame.NotificationType, Frame.WrapperExpandingLayout.ExpandDirectionComponent.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 Frame |
frame |
protected Messages |
messages |
NO_OPTIONS, WINDOW_CLOSE_ACTION, WINDOW_COMMIT_AND_CLOSE_ACTION, WINDOW_DISCARD_AND_CLOSE_ACTIONAUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE, UNITS_PERCENTAGE, UNITS_PIXELS| Constructor and Description |
|---|
AbstractFrame() |
| Modifier and Type | Method and Description |
|---|---|
void |
add(Component component)
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.
|
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.
|
void |
dispose()
Disposes frame references.
|
void |
expand(Component component) |
void |
expand(Component component,
java.lang.String height,
java.lang.String width) |
protected java.lang.String |
formatMessage(java.lang.String key,
java.lang.Object... params)
Get localized message from the message pack associated with this frame or window, and use it as a format
string for parameters provided.
|
Action |
getAction(java.lang.String id) |
java.util.Collection<Action> |
getActions() |
Component.Alignment |
getAlignment() |
java.lang.String |
getCaption() |
<T> T |
getCompanion() |
java.lang.Object |
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
|
java.lang.Object |
getComposition() |
FrameContext |
getContext() |
java.lang.String |
getDescription() |
DsContext |
getDsContext() |
ExpandingLayout.ExpandDirection |
getExpandDirection() |
float |
getExpandRatio(Component component) |
Facet |
getFacet(java.lang.String id)
Finds registered facet by ID.
|
java.util.stream.Stream<Facet> |
getFacets() |
Frame |
getFrame() |
FrameOwner |
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.
|
MarginInfo |
getMargin() |
protected java.lang.String |
getMessage(java.lang.String key)
Get localized message from the message pack associated with this frame or window.
|
java.lang.String |
getMessagesPack() |
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() |
boolean |
getSpacing() |
java.lang.String |
getStyleName()
Styles implementation is client-type-specific.
|
float |
getWidth()
Get component width in
Component.getWidthUnits() |
SizeUnit |
getWidthSizeUnit()
Gets the width property units.
|
WindowManager |
getWindowManager()
|
Frame |
getWrappedFrame() |
int |
indexOf(Component component) |
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 |
init(ScreenFragment.InitEvent initEvent) |
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 |
remove(Component component)
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() |
void |
setAlignment(Component.Alignment alignment) |
void |
setCaption(java.lang.String caption)
Sets the component's caption.
|
void |
setCompanion(java.lang.Object companion)
INTERNAL.
|
void |
setDescription(java.lang.String description)
Sets the component's description.
|
void |
setDsContext(DsContext dsContext)
INTERNAL.
|
void |
setEnabled(boolean enabled)
Sets the component enabled state.
|
void |
setExpandRatio(Component component,
float ratio)
Sets expand ratio for the component.
|
protected void |
setFragment(Fragment fragment) |
void |
setFrame(Frame frame) |
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.
|
void |
setId(java.lang.String id)
Sets id of the screen fragment.
|
void |
setMargin(MarginInfo marginInfo) |
void |
setMessagesPack(java.lang.String name) |
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 |
setResponsive(boolean responsive)
Sets component to be responsive by width and height.
|
void |
setSpacing(boolean enabled) |
void |
setStyleName(java.lang.String styleName)
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 |
setWrappedFrame(Frame frame)
INTERNAL.
|
void |
showValidationErrors(ValidationErrors errors)
Show validation errors alert.
|
<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.
|
addAfterInitListener, addAttachEventListener, addDetachEventListener, addInitListener, fireEvent, getBeanLocator, getEventHub, getExtensions, getFragment, getHostController, getHostScreen, getId, getScreenData, getUiEventListeners, init, setBeanLocator, setExtensions, setHostController, setScreenData, setUiEventListenersclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetFacetNNgetXmlDescriptor, setXmlDescriptorgetActionNN, getSubPartgetComponentNNadd, focusFirstComponent, getComponentNN, removegetHeightUnits, getId, getWidthUnits, isEnabledItself, isVisibleItself, requestFocus, setHeightAuto, setHeightFull, setSizeAuto, setSizeFull, setWidthAuto, setWidthFullopenEditor, openEditor, openEditor, openEditor, openEditor, openEditor, openEditor, openFrame, openFrame, openLookup, openLookup, openLookup, openLookup, openWindow, openWindow, showMessageDialog, showNotification, showNotification, showNotification, showOptionDialog, showOptionDialog, showWebPageprotected void setFragment(Fragment fragment)
setFragment in class ScreenFragmentpublic WindowManager getWindowManager()
HasWindowManagergetWindowManager in interface HasWindowManagerpublic Frame getWrappedFrame()
getWrappedFrame in interface Frame.Wrapperpublic void setWrappedFrame(Frame frame)
public void init(java.util.Map<java.lang.String,java.lang.Object> params)
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 screen@Order(value=110) @Subscribe protected void init(ScreenFragment.InitEvent initEvent)
public void setId(java.lang.String id)
ScreenFragmentsetId in interface ComponentsetId in class ScreenFragmentid - screen idpublic Component getParent()
public void setParent(Component parent)
ComponentComponentContainer.add(Component) is normally used for adding components
to a parent and the used method will call this method implicitly.public boolean isEnabled()
Componentpublic void setEnabled(boolean enabled)
ComponentsetEnabled in interface Componentenabled - enabled flagpublic boolean isEnabledRecursive()
isEnabledRecursive in interface Componentpublic boolean isVisible()
Componentpublic void setVisible(boolean visible)
ComponentsetVisible in interface Componentvisible - visible flagpublic boolean isVisibleRecursive()
isVisibleRecursive in interface Componentpublic float getHeight()
ComponentComponent.getHeightSizeUnit()public void setHeight(java.lang.String height)
ComponentComponent.getHeightUnits()public SizeUnit getHeightSizeUnit()
ComponentgetHeightSizeUnit in interface Componentpublic float getWidth()
ComponentComponent.getWidthUnits()public void setWidth(java.lang.String width)
ComponentComponent.getWidthSizeUnit()}public SizeUnit getWidthSizeUnit()
ComponentgetWidthSizeUnit in interface Componentpublic Component.Alignment getAlignment()
getAlignment in interface Componentpublic void setAlignment(Component.Alignment alignment)
setAlignment in interface Componentpublic java.lang.String getCaption()
getCaption in interface Component.HasCaptionpublic void setCaption(java.lang.String caption)
Component.HasCaptionsetCaption in interface Component.HasCaptioncaption - the new component's captionpublic boolean isResponsive()
ComponentisResponsive in interface Componentpublic void setResponsive(boolean responsive)
ComponentsetResponsive in interface Componentresponsive - responsive flagpublic java.lang.String getDescription()
getDescription in interface Component.HasDescriptionpublic void setDescription(java.lang.String description)
Component.HasDescriptionsetDescription in interface Component.HasDescriptiondescription - the new description to setpublic java.lang.String getIcon()
Component.HasIcongetIcon in interface Component.HasIconpublic void setIcon(java.lang.String icon)
Component.HasIconsetIcon in interface Component.HasIconpublic void setIconFromSet(Icons.Icon icon)
Component.HasIconsetIconFromSet in interface Component.HasIconpublic void add(Component component)
ComponentContaineradd in interface ComponentContainercomponent - a component to addpublic void remove(Component component)
ComponentContainerremove in interface ComponentContainercomponent - a component to removepublic void removeAll()
ComponentContainerremoveAll in interface ComponentContainerpublic Component getOwnComponent(java.lang.String id)
ComponentContainergetOwnComponent in interface ComponentContainer@Nullable public Component getComponent(java.lang.String id)
ComponentContainergetComponent in interface ComponentContainerpublic java.util.Collection<Component> getOwnComponents()
ComponentContainergetOwnComponents in interface ComponentContainerpublic java.util.stream.Stream<Component> getOwnComponentsStream()
ComponentContainergetOwnComponentsStream in interface ComponentContainerpublic java.util.Collection<Component> getComponents()
ComponentContainergetComponents in interface ComponentContainerpublic java.lang.Object getComponent()
getComponent in interface Component.Wrapperpublic java.lang.Object getComposition()
getComposition in interface Component.Wrapperpublic void expand(Component component, java.lang.String height, java.lang.String width)
expand in interface ExpandingLayoutpublic void expand(Component component)
expand in interface ExpandingLayoutpublic void resetExpanded()
resetExpanded in interface ExpandingLayoutpublic boolean isExpanded(Component component)
isExpanded in interface ExpandingLayoutpublic ExpandingLayout.ExpandDirection getExpandDirection()
getExpandDirection in interface ExpandingLayoutpublic FrameOwner getFrameOwner()
getFrameOwner in interface FrameScreen,
ScreenFragmentpublic FrameContext getContext()
getContext in interface FramegetContext in interface LegacyFramepublic DsContext getDsContext()
getDsContext in interface LegacyFrameDsContext of the current frame or windowpublic void setDsContext(DsContext dsContext)
LegacyFramesetDsContext in interface LegacyFramepublic java.lang.String getMessagesPack()
getMessagesPack in interface LegacyFramepublic void setMessagesPack(java.lang.String name)
setMessagesPack in interface LegacyFrameprotected java.lang.String getMessage(java.lang.String key)
key - message keyMessages.getMessage(String, String)protected java.lang.String formatMessage(java.lang.String key,
java.lang.Object... params)
key - message keyparams - parameter valuesMessages.formatMessage(String, String, Object...)public boolean isValid()
FrameisValid in interface FrameisValid in interface LegacyFramepublic void validate()
throws ValidationException
Framevalidate in interface Framevalidate in interface LegacyFrameValidationException - if some components are currently in invalid statepublic boolean validate(java.util.List<Validatable> fields)
Framevalidate in interface Framevalidate in interface LegacyFramepublic boolean validateAll()
FramevalidateAll in interface FramevalidateAll in interface LegacyFramepublic void showValidationErrors(ValidationErrors errors)
errors - the list of validation errors. Caller fills it by errors found during the default validation.public void add(Component childComponent, int index)
add in interface OrderedContainerpublic int indexOf(Component component)
indexOf in interface OrderedContainer@Nullable public Component getComponent(int index)
OrderedContainergetComponent in interface OrderedContainerindex - component index@Nullable public <T> T getCompanion()
getCompanion in interface LegacyFramepublic void setCompanion(java.lang.Object companion)
public Frame getFrame()
getFrame in interface Component.BelongToFramepublic void setFrame(Frame frame)
setFrame in interface Component.BelongToFramepublic java.lang.String getStyleName()
ComponentgetStyleName in interface Componentpublic void setStyleName(java.lang.String styleName)
ComponentsetStyleName in interface ComponentstyleName - one or more style names separated by space.public void addStyleName(java.lang.String styleName)
ComponentaddStyleName in interface ComponentstyleName - one or more style names separated by space.public void removeStyleName(java.lang.String styleName)
ComponentremoveStyleName in interface ComponentstyleName - one or more style names separated by space.public <X> X unwrap(java.lang.Class<X> internalComponentClass)
Componentcom.vaadin.ui.TextField vTextField = textField.unwrap(com.vaadin.ui.TextField.class);
public <X> X unwrapComposition(java.lang.Class<X> internalCompositionClass)
Componentcom.vaadin.ui.Layout vLayout = table.unwrapComposition(com.vaadin.ui.Layout.class);
unwrapComposition in interface ComponentX - type of internal classinternalCompositionClass - class of underlying composition implementation based on Vaadin or Swingpublic boolean getSpacing()
getSpacing in interface HasSpacingpublic void setSpacing(boolean enabled)
setSpacing in interface HasSpacingpublic MarginInfo getMargin()
public void setMargin(MarginInfo marginInfo)
public void addAction(Action action)
ActionsHolderaddAction in interface ActionsHolderpublic void addAction(Action action, int index)
ActionsHolderaddAction in interface ActionsHolderpublic void removeAction(@Nullable
Action action)
ActionsHolderremoveAction in interface ActionsHolderpublic void removeAction(@Nullable
java.lang.String id)
ActionsHolderremoveAction in interface ActionsHolderpublic void removeAllActions()
ActionsHolderremoveAllActions in interface ActionsHolderpublic java.util.Collection<Action> getActions()
getActions in interface ActionsHolder@Nullable public Action getAction(java.lang.String id)
getAction in interface ActionsHolderpublic void setExpandRatio(Component component, float ratio)
SupportsExpandRatiosetExpandRatio in interface SupportsExpandRatiocomponent - component to expand with ratioratio - ratiopublic float getExpandRatio(Component component)
getExpandRatio in interface SupportsExpandRatiocomponent - component for which returns ratiopublic void dispose()
Should be called when a frame is removed from UI.
public void addFacet(Facet facet)
Frame@Nullable public Facet getFacet(java.lang.String id)
Framepublic void removeFacet(Facet facet)
FrameremoveFacet in interface Framefacet - facet