ScreenFragment
APIs instead.@Deprecated public class AbstractFrame extends ScreenFragment implements Frame, Frame.Wrapper, LegacyFrame
ScreenFragment.AfterInitEvent, ScreenFragment.AttachEvent, ScreenFragment.DetachEvent, ScreenFragment.InitEvent
Frame.MessageMode, Frame.MessageType, Frame.NotificationType, Frame.Wrapper
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 Frame |
frame
Deprecated.
|
protected Messages |
messages
Deprecated.
|
NO_OPTIONS, WINDOW_CLOSE_ACTION, WINDOW_COMMIT_AND_CLOSE_ACTION, WINDOW_DISCARD_AND_CLOSE_ACTION
AUTO_SIZE, AUTO_SIZE_PX, FULL_SIZE, UNITS_PERCENTAGE, UNITS_PIXELS
Constructor and Description |
---|
AbstractFrame()
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
void |
add(Component component)
Deprecated.
Adds a component to this container.
|
void |
add(Component childComponent,
int index)
Deprecated.
|
void |
addAction(Action action)
Deprecated.
Add an action to the component
|
void |
addAction(Action action,
int index)
Deprecated.
Add an action to the component with index.
|
void |
addFacet(Facet facet)
Deprecated.
Registers the passed non-visual component in the frame.
|
void |
addStyleName(java.lang.String styleName)
Deprecated.
Adds one or more style names to this component.
|
void |
dispose()
Deprecated.
Disposes frame references.
|
void |
expand(Component component)
Deprecated.
|
void |
expand(Component component,
java.lang.String height,
java.lang.String width)
Deprecated.
|
protected java.lang.String |
formatMessage(java.lang.String key,
java.lang.Object... params)
Deprecated.
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)
Deprecated.
|
java.util.Collection<Action> |
getActions()
Deprecated.
|
Component.Alignment |
getAlignment()
Deprecated.
|
java.lang.String |
getCaption()
Deprecated.
|
<T> T |
getCompanion()
Deprecated.
|
java.lang.Object |
getComponent()
Deprecated.
|
Component |
getComponent(int index)
Deprecated.
Returns the component at the given position.
|
Component |
getComponent(java.lang.String id)
Deprecated.
Get component belonging to the whole components tree below this container.
|
java.util.Collection<Component> |
getComponents()
Deprecated.
Get all components belonging to the whole components tree below this container
|
java.lang.Object |
getComposition()
Deprecated.
|
FrameContext |
getContext()
Deprecated.
|
java.lang.String |
getDescription()
Deprecated.
|
DsContext |
getDsContext()
Deprecated.
|
ExpandingLayout.ExpandDirection |
getExpandDirection()
Deprecated.
|
float |
getExpandRatio(Component component)
Deprecated.
|
Facet |
getFacet(java.lang.String id)
Deprecated.
Finds registered facet by ID.
|
java.util.stream.Stream<Facet> |
getFacets()
Deprecated.
|
Frame |
getFrame()
Deprecated.
|
FrameOwner |
getFrameOwner()
Deprecated.
|
float |
getHeight()
Deprecated.
Get component height in
Component.getHeightSizeUnit() |
SizeUnit |
getHeightSizeUnit()
Deprecated.
Gets the height property units.
|
java.lang.String |
getIcon()
Deprecated.
Get icon source: "font-icon:ADD", "icons/myicon.png", "theme://createIcon", etc.
|
MarginInfo |
getMargin()
Deprecated.
|
protected java.lang.String |
getMessage(java.lang.String key)
Deprecated.
Get localized message from the message pack associated with this frame or window.
|
java.lang.String |
getMessagesPack()
Deprecated.
|
Component |
getOwnComponent(java.lang.String id)
Deprecated.
Get component directly owned by this container.
|
java.util.Collection<Component> |
getOwnComponents()
Deprecated.
Get all components directly owned by this container
|
java.util.stream.Stream<Component> |
getOwnComponentsStream()
Deprecated.
Get stream of components directly owned by this container
|
Component |
getParent()
Deprecated.
|
boolean |
getSpacing()
Deprecated.
|
java.lang.String |
getStyleName()
Deprecated.
Styles implementation is client-type-specific.
|
float |
getWidth()
Deprecated.
Get component width in
Component.getWidthUnits() |
SizeUnit |
getWidthSizeUnit()
Deprecated.
Gets the width property units.
|
WindowManager |
getWindowManager()
Deprecated.
|
Frame |
getWrappedFrame()
Deprecated.
|
int |
indexOf(Component component)
Deprecated.
|
void |
init(java.util.Map<java.lang.String,java.lang.Object> params)
Deprecated.
Called by the framework after creation of all components and before showing the screen.
|
protected void |
init(ScreenFragment.InitEvent initEvent)
Deprecated.
|
boolean |
isEnabled()
Deprecated.
Is the component enabled?
Note that this method only returns the status of the component and does not take parents into account. |
boolean |
isEnabledRecursive()
Deprecated.
|
boolean |
isExpanded(Component component)
Deprecated.
|
boolean |
isResponsive()
Deprecated.
Is the component responsive?
|
boolean |
isValid()
Deprecated.
Check validity by invoking validators on all components which support them.
|
boolean |
isVisible()
Deprecated.
Is the component visible?
A component is visible only if all its parents are also visible. |
boolean |
isVisibleRecursive()
Deprecated.
|
void |
remove(Component component)
Deprecated.
Removes a component from this container.
|
void |
removeAction(Action action)
Deprecated.
Remove the action from the component
|
void |
removeAction(java.lang.String id)
Deprecated.
Remove the action by its ID.
|
void |
removeAll()
Deprecated.
Removes all components from this container.
|
void |
removeAllActions()
Deprecated.
Remove all actions from the component
|
void |
removeFacet(Facet facet)
Deprecated.
Removes the non-visual component from the frame.
|
void |
removeStyleName(java.lang.String styleName)
Deprecated.
Removes one or more style names from component.
|
void |
resetExpanded()
Deprecated.
|
void |
setAlignment(Component.Alignment alignment)
Deprecated.
|
void |
setCaption(java.lang.String caption)
Deprecated.
Sets the component's caption.
|
void |
setCompanion(java.lang.Object companion)
Deprecated.
INTERNAL.
|
void |
setDescription(java.lang.String description)
Deprecated.
Sets the component's description.
|
void |
setDsContext(DsContext dsContext)
Deprecated.
INTERNAL.
|
void |
setEnabled(boolean enabled)
Deprecated.
Sets the component enabled state.
|
void |
setExpandRatio(Component component,
float ratio)
Deprecated.
Sets expand ratio for the component.
|
protected void |
setFragment(Fragment fragment)
Deprecated.
|
void |
setFrame(Frame frame)
Deprecated.
|
void |
setHeight(java.lang.String height)
Deprecated.
Set component height in
Component.getHeightUnits() |
void |
setIcon(java.lang.String icon)
Deprecated.
Set an icon by its source: "font-icon:ADD", "icons/myicon.png", "theme://createIcon", etc.
|
void |
setIconFromSet(Icons.Icon icon)
Deprecated.
Set an icon from an icon set.
|
void |
setId(java.lang.String id)
Deprecated.
Sets id of the screen fragment.
|
void |
setMargin(MarginInfo marginInfo)
Deprecated.
|
void |
setMessagesPack(java.lang.String name)
Deprecated.
|
void |
setParent(Component parent)
Deprecated.
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)
Deprecated.
Sets component to be responsive by width and height.
|
void |
setSpacing(boolean enabled)
Deprecated.
|
void |
setStyleName(java.lang.String styleName)
Deprecated.
Sets one or more style names of the component, replacing any
previous styles.
|
void |
setVisible(boolean visible)
Deprecated.
Sets visibility value for the component.
|
void |
setWidth(java.lang.String width)
Deprecated.
Set component width in
Component.getWidthSizeUnit() } |
void |
setWrappedFrame(Frame frame)
Deprecated.
INTERNAL.
|
void |
showValidationErrors(ValidationErrors errors)
Deprecated.
Show validation errors alert.
|
<X> X |
unwrap(java.lang.Class<X> internalComponentClass)
Deprecated.
Get client specific component instance.
|
<X> X |
unwrapComposition(java.lang.Class<X> internalCompositionClass)
Deprecated.
Get the outmost external container of client specific component instance.
|
<X> X |
unwrapCompositionOrNull(java.lang.Class<X> internalCompositionClass)
Deprecated.
Get the outmost external container of client specific component instance.
|
<X> X |
unwrapOrNull(java.lang.Class<X> internalComponentClass)
Deprecated.
Get client specific component instance.
|
void |
validate()
Deprecated.
Check validity by invoking validators on all components which support them.
|
boolean |
validate(java.util.List<Validatable> fields)
Deprecated.
Check validity by invoking validators on specified components which support them
and show validation result notification.
|
boolean |
validateAll()
Deprecated.
Check 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)
Deprecated.
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)
Deprecated.
Get the outmost external container of client specific component instance and performs the given
action . |
addAfterInitListener, addAttachEventListener, addDetachEventListener, addInitListener, fireEvent, getBeanLocator, getEventHub, getExtensions, getFragment, getHostController, getHostScreen, getId, getScreenData, getUiEventListeners, init, setBeanLocator, setExtensions, setHostController, setScreenData, setUiEventListeners
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFacetNN
getXmlDescriptor, setXmlDescriptor
getActionNN, getSubPart
getComponentNN
add, focusFirstComponent, getComponentNN, remove
getHeightUnits, getId, 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 Frame frame
@Inject protected Messages messages
protected void setFragment(Fragment fragment)
setFragment
in class ScreenFragment
public WindowManager getWindowManager()
HasWindowManager
getWindowManager
in interface HasWindowManager
public Frame getWrappedFrame()
getWrappedFrame
in interface Frame.Wrapper
public 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)
ScreenFragment
setId
in interface Component
setId
in class ScreenFragment
id
- screen idpublic 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 isEnabledRecursive()
isEnabledRecursive
in interface Component
public boolean isVisible()
Component
public void setVisible(boolean visible)
Component
setVisible
in interface Component
visible
- visible flagpublic boolean isVisibleRecursive()
isVisibleRecursive
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.Alignment getAlignment()
getAlignment
in interface Component
public void setAlignment(Component.Alignment alignment)
setAlignment
in interface Component
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 boolean isResponsive()
Component
isResponsive
in interface Component
public void setResponsive(boolean responsive)
Component
setResponsive
in interface Component
responsive
- responsive flagpublic 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 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 add(Component component)
ComponentContainer
add
in interface ComponentContainer
component
- a component to addpublic void remove(Component component)
ComponentContainer
remove
in interface ComponentContainer
component
- a component to removepublic void removeAll()
ComponentContainer
removeAll
in interface ComponentContainer
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 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.Object getComponent()
getComponent
in interface Component.Wrapper
public java.lang.Object getComposition()
getComposition
in interface Component.Wrapper
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 FrameOwner getFrameOwner()
getFrameOwner
in interface Frame
Screen
,
ScreenFragment
public FrameContext getContext()
getContext
in interface Frame
getContext
in interface LegacyFrame
public DsContext getDsContext()
getDsContext
in interface LegacyFrame
DsContext
of the current frame or windowpublic void setDsContext(DsContext dsContext)
LegacyFrame
setDsContext
in interface LegacyFrame
public java.lang.String getMessagesPack()
getMessagesPack
in interface LegacyFrame
public void setMessagesPack(java.lang.String name)
setMessagesPack
in interface LegacyFrame
protected 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()
Frame
isValid
in interface Frame
isValid
in interface LegacyFrame
public void validate() throws ValidationException
Frame
validate
in interface Frame
validate
in interface LegacyFrame
ValidationException
- if some components are currently in invalid statepublic boolean validate(java.util.List<Validatable> fields)
Frame
validate
in interface Frame
validate
in interface LegacyFrame
public boolean validateAll()
Frame
validateAll
in interface Frame
validateAll
in interface LegacyFrame
public 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 OrderedContainer
public int indexOf(Component component)
indexOf
in interface OrderedContainer
@Nullable public Component getComponent(int index)
OrderedContainer
getComponent
in interface OrderedContainer
index
- component index@Nullable public <T> T getCompanion()
getCompanion
in interface LegacyFrame
public void setCompanion(java.lang.Object companion)
public Frame getFrame()
getFrame
in interface Component.BelongToFrame
public void setFrame(Frame frame)
setFrame
in interface Component.BelongToFrame
public java.lang.String getStyleName()
Component
getStyleName
in interface Component
public void setStyleName(java.lang.String styleName)
Component
setStyleName
in interface Component
styleName
- 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 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 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 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)
Frame
public void removeFacet(Facet facet)
Frame
removeFacet
in interface Frame
facet
- facet