Interface Widget<T extends WidgetModel,U extends WidgetController>
- Type Parameters:
T- widget model typeU- widget controller type
- All Superinterfaces:
Cloneable,org.zkoss.zk.ui.Component,FocusableComponent,org.zkoss.zk.ui.api.HtmlBasedComponent,org.zkoss.zk.ui.ext.Scope,Serializable,WidgetModelListener
- All Known Subinterfaces:
InputWidget<T,,U> ListboxWidget<T,U>
- All Known Implementing Classes:
AbstractWidget,DefaultInputWidget,DefaultListboxWidget,DefaultWidget
public interface Widget<T extends WidgetModel,U extends WidgetController>
extends WidgetModelListener, FocusableComponent
A Widget component is an independent view component providing a caption and a content area as well as focus handling.
-
Field Summary
Fields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE -
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()Called whenever this widget is invalidated or when a cleanup is needed.org.zkoss.zk.ui.api.HtmlBasedComponentReturns this widget's caption component.org.zkoss.zk.ui.api.HtmlBasedComponentReturns this widget's content componentReturns this widget's controller context.Returns the widget's code.Returns the widget container to which this widget belongs.Returns the widget's controller.Returns the widget's (view) model.Returns the widget renderer.Returns the widget's title.voidinitialize(Map<String, Object> params) Initializes this widget.booleanReturns whether this widget can be focused or not.booleanReturns whether this widget has been initialized or not.booleanReturns whether content lazy loading is enabled or not.voidsetControllerCtx(String controllerCtx) Sets this widget's controller context i.e.voidsetFocusable(boolean focusable) Sets whether this widget can be focused or not.voidsetLazyLoadingEnabled(boolean enabled) Enables or disables content lazy loading.voidsetWidgetCode(String widgetCode) Sets the widget's code.voidsetWidgetContainer(WidgetContainer container) Sets the widget container to which this widget belongs.voidsetWidgetController(U controller) Sets the widget's controller tocontroller.voidsetWidgetModel(T model) Sets the widget's (view) model.voidsetWidgetRenderer(WidgetRenderer renderer) Sets the widget renderer.voidsetWidgetTitle(String title) Sets the widget's title totitle.Methods inherited from interface org.zkoss.zk.ui.Component
addEventListener, addEventListener, addForward, addForward, addForward, addForward, appendChild, applyProperties, clone, detach, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getChildren, getClientAttribute, getClientDataAttribute, getDefinition, getDesktop, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRoot, getShadowVariable, getShadowVariable, getSpaceOwner, getStubonly, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttributeOrFellow, hasFellow, hasFellow, insertBefore, invalidate, isInvalidated, isListenerAvailable, isVisible, query, queryAll, removeAttribute, removeAttribute, removeChild, removeEventListener, removeForward, removeForward, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setTemplate, setVisible, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverrideMethods inherited from interface de.hybris.platform.cockpit.components.FocusableComponent
handleFocusMethods inherited from interface org.zkoss.zk.ui.api.HtmlBasedComponent
focus, getHeight, getLeft, getSclass, getStyle, getTooltiptext, getTop, getWidth, getZclass, getZindex, getZIndex, setDraggable, setDroppable, setFocus, setHeight, setLeft, setSclass, setStyle, setTooltiptext, setTop, setWidth, setZclass, setZindex, setZIndexMethods inherited from interface org.zkoss.zk.ui.ext.Scope
addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttributeMethods inherited from interface de.hybris.platform.cockpit.widgets.events.WidgetModelListener
onModelEvent
-
Method Details
-
setWidgetCode
Sets the widget's code. The code of a widget is used for focus handling and internal mapping, thus it is important that widgets' codes are unique within oneWidgetContainer.- Parameters:
widgetCode- widget code
-
getWidgetCode
String getWidgetCode()Returns the widget's code.- Returns:
- this widget's code
- See Also:
-
setWidgetModel
Sets the widget's (view) model.- Parameters:
model- the model
-
getWidgetModel
T getWidgetModel()Returns the widget's (view) model.- Returns:
- widget's model or
nullif no model is available
-
setWidgetContainer
Sets the widget container to which this widget belongs.- Parameters:
container- widget container
-
getWidgetContainer
WidgetContainer getWidgetContainer()Returns the widget container to which this widget belongs.- Returns:
- this widget's widget container
-
setFocusable
void setFocusable(boolean focusable) Sets whether this widget can be focused or not.- Parameters:
focusable-truemeans focusing is enabled,falsemeans disabled
-
isFocusable
boolean isFocusable()Returns whether this widget can be focused or not.- Returns:
trueif focusing is enabled,falseotherwise
-
setWidgetTitle
Sets the widget's title totitle.- Parameters:
title- widget title as either i3-label key or direct value
-
getWidgetTitle
String getWidgetTitle()Returns the widget's title. Note: This method will return the raw title as set by previous call tosetWidgetTitle(String)i.e. in the case of an i3-label key, no evaluation is done.- Returns:
- widget's title
-
initialize
Initializes this widget.- Parameters:
params- initialization parameters
-
isInitialized
boolean isInitialized()Returns whether this widget has been initialized or not.- Returns:
trueif widget has been initialized,falseotherwise
-
getCaption
org.zkoss.zk.ui.api.HtmlBasedComponent getCaption()Returns this widget's caption component.- Returns:
- the caption component
- See Also:
-
getContent
org.zkoss.zk.ui.api.HtmlBasedComponent getContent()Returns this widget's content component- Returns:
- the content component
- See Also:
-
cleanup
void cleanup()Called whenever this widget is invalidated or when a cleanup is needed. Typically unregisters itself and releases any acquired resources. -
setWidgetRenderer
Sets the widget renderer.- Parameters:
renderer- widget renderer
-
getWidgetRenderer
WidgetRenderer getWidgetRenderer()Returns the widget renderer.- Returns:
- widget renderer
-
setWidgetController
Sets the widget's controller tocontroller.- Parameters:
controller- widget controller
-
getWidgetController
U getWidgetController()Returns the widget's controller.- Returns:
- widget controller
-
setControllerCtx
Sets this widget's controller context i.e. the context for which this widget should use when dealing with its controller.- Parameters:
controllerCtx- controller context code
-
getControllerCtx
String getControllerCtx()Returns this widget's controller context.- Returns:
- controller context code
-
setLazyLoadingEnabled
void setLazyLoadingEnabled(boolean enabled) Enables or disables content lazy loading.- Parameters:
enabled- lazy loading
-
isLazyLoadingEnabled
boolean isLazyLoadingEnabled()Returns whether content lazy loading is enabled or not.- Returns:
trueif lazy loading is enabled,falseotherwise
-