Class AbstractWidget<T extends WidgetModel,U extends WidgetController>
java.lang.Object
org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zul.impl.XulElement
org.zkoss.zul.Div
de.hybris.platform.cockpit.widgets.impl.AbstractWidget<T,U>
- All Implemented Interfaces:
FocusableComponent,WidgetModelListener,Widget<T,,U> Serializable,Cloneable,org.zkoss.zk.ui.api.HtmlBasedComponent,org.zkoss.zk.ui.Component,org.zkoss.zk.ui.ext.Scope,org.zkoss.zk.ui.sys.ComponentCtrl
- Direct Known Subclasses:
DefaultWidget
public abstract class AbstractWidget<T extends WidgetModel,U extends WidgetController>
extends org.zkoss.zul.Div
implements Widget<T,U>
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.zkoss.zk.ui.HtmlBasedComponent
org.zkoss.zk.ui.HtmlBasedComponent.ExtraCtrlNested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent
org.zkoss.zk.ui.AbstractComponent.Children -
Field Summary
FieldsFields inherited from class org.zkoss.zk.ui.HtmlBasedComponent
_zclassFields inherited from interface org.zkoss.zk.ui.Component
APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPEFields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl
AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidcleanup()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.voidhandleFocus(boolean focused) Called whenever the focus view state of this component should be changed.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.protected voidsetCaption(org.zkoss.zk.ui.api.HtmlBasedComponent caption) Sets this widget's caption component tocaption.protected voidsetContent(org.zkoss.zk.ui.api.HtmlBasedComponent content) Sets this widget's content component tocontent.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 lazyLoading) 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 widgetController) Sets the widget's controller tocontroller.voidsetWidgetModel(T model) Sets the widget's (view) model.voidsetWidgetRenderer(WidgetRenderer widgetRenderer) Sets the widget renderer.voidsetWidgetTitle(String title) Sets the widget's title totitle.Methods inherited from class org.zkoss.zul.Div
getAlign, renderProperties, setAlignMethods inherited from class org.zkoss.zul.impl.XulElement
clone, getContext, getCtrlKeys, getPopup, getPropertyAccess, getTooltip, setContext, setContext, setContextAttributes, setCtrlKeys, setPopup, setPopup, setPopupAttributes, setTooltip, setTooltip, setTooltipAttributesMethods inherited from class org.zkoss.zk.ui.HtmlBasedComponent
addSclass, focus, getAction, getDraggable, getDroppable, getExtraCtrl, getHeight, getHflex, getLeft, getRenderdefer, getSclass, getStyle, getTabindex, getTabindexInteger, getTooltiptext, getTop, getVflex, getWidth, getZclass, getZindex, getZIndex, removeSclass, removeSclass, service, setAction, setClass, setDraggable, setDroppable, setFocus, setHeight, setHeight0, setHeightDirectly, setHflex, setHflex0, setHflexDirectly, setLeft, setLeftDirectly, setRenderdefer, setSclass, setStyle, setTabindex, setTabindex, setTooltiptext, setTop, setTopDirectly, setVflex, setVflex0, setVflexDirectly, setWidth, setWidth0, setWidthDirectly, setZclass, setZindex, setZIndex, setZIndexDirectlyMethods inherited from class org.zkoss.zk.ui.AbstractComponent
addAnnotation, addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, enableBindingAnnotation, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotation, getAnnotations, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getFellow, getFellow, getFellowIfAny, getFellowIfAny, getFellows, getFirstChild, getId, getLastChild, getListenerIterator, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttribute, getWidgetAttributeNames, getWidgetClass, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, insertBefore, invalidate, isChildable, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onPageAttached, onPageDetached, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, replace, response, response, response, service, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetAttribute, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, toString, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerializeMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods 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 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
-
Field Details
-
LAZY_LOAD_EVT_KEY
- See Also:
-
-
Constructor Details
-
AbstractWidget
public AbstractWidget()Creates a new widget instance.
-
-
Method Details
-
initialize
Description copied from interface:WidgetInitializes this widget.- Specified by:
initializein interfaceWidget<T extends WidgetModel,U extends WidgetController> - Parameters:
params- initialization parameters
-
isInitialized
public boolean isInitialized()Description copied from interface:WidgetReturns whether this widget has been initialized or not.- Specified by:
isInitializedin interfaceWidget<T extends WidgetModel,U extends WidgetController> - Returns:
trueif widget has been initialized,falseotherwise
-
handleFocus
public void handleFocus(boolean focused) Description copied from interface:FocusableComponentCalled whenever the focus view state of this component should be changed.- Specified by:
handleFocusin interfaceFocusableComponent- Parameters:
focused-trueif the component should be rendered as focused,falseotherwise
-
cleanup
public abstract void cleanup()Description copied from interface:WidgetCalled whenever this widget is invalidated or when a cleanup is needed. Typically unregisters itself and releases any acquired resources.- Specified by:
cleanupin interfaceWidget<T extends WidgetModel,U extends WidgetController>
-
getContent
public org.zkoss.zk.ui.api.HtmlBasedComponent getContent()Description copied from interface:WidgetReturns this widget's content component- Specified by:
getContentin interfaceWidget<T extends WidgetModel,U extends WidgetController> - Returns:
- the content component
- See Also:
-
setContent
protected void setContent(org.zkoss.zk.ui.api.HtmlBasedComponent content) Sets this widget's content component tocontent. Note: If a content component has already been set the old one will be removed.- Parameters:
content- content component
-
getCaption
public org.zkoss.zk.ui.api.HtmlBasedComponent getCaption()Description copied from interface:WidgetReturns this widget's caption component.- Specified by:
getCaptionin interfaceWidget<T extends WidgetModel,U extends WidgetController> - Returns:
- the caption component
- See Also:
-
setCaption
protected void setCaption(org.zkoss.zk.ui.api.HtmlBasedComponent caption) Sets this widget's caption component tocaption. Note: If a caption component has already been set the old one will be removed.- Parameters:
caption- caption component
-
setWidgetContainer
Description copied from interface:WidgetSets the widget container to which this widget belongs.- Specified by:
setWidgetContainerin interfaceWidget<T extends WidgetModel,U extends WidgetController> - Parameters:
container- widget container
-
getWidgetContainer
Description copied from interface:WidgetReturns the widget container to which this widget belongs.- Specified by:
getWidgetContainerin interfaceWidget<T extends WidgetModel,U extends WidgetController> - Returns:
- this widget's widget container
-
setWidgetModel
Description copied from interface:WidgetSets the widget's (view) model.- Specified by:
setWidgetModelin interfaceWidget<T extends WidgetModel,U extends WidgetController> - Parameters:
model- the model
-
getWidgetModel
Description copied from interface:WidgetReturns the widget's (view) model.- Specified by:
getWidgetModelin interfaceWidget<T extends WidgetModel,U extends WidgetController> - Returns:
- widget's model or
nullif no model is available
-
setWidgetCode
Description copied from interface:WidgetSets 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.- Specified by:
setWidgetCodein interfaceWidget<T extends WidgetModel,U extends WidgetController> - Parameters:
widgetCode- widget code
-
getWidgetCode
Description copied from interface:WidgetReturns the widget's code.- Specified by:
getWidgetCodein interfaceWidget<T extends WidgetModel,U extends WidgetController> - Returns:
- this widget's code
- See Also:
-
setWidgetRenderer
Description copied from interface:WidgetSets the widget renderer.- Specified by:
setWidgetRendererin interfaceWidget<T extends WidgetModel,U extends WidgetController> - Parameters:
widgetRenderer- widget renderer
-
getWidgetRenderer
Description copied from interface:WidgetReturns the widget renderer.- Specified by:
getWidgetRendererin interfaceWidget<T extends WidgetModel,U extends WidgetController> - Returns:
- widget renderer
-
setFocusable
public void setFocusable(boolean focusable) Description copied from interface:WidgetSets whether this widget can be focused or not.- Specified by:
setFocusablein interfaceWidget<T extends WidgetModel,U extends WidgetController> - Parameters:
focusable-truemeans focusing is enabled,falsemeans disabled
-
isFocusable
public boolean isFocusable()Description copied from interface:WidgetReturns whether this widget can be focused or not.- Specified by:
isFocusablein interfaceWidget<T extends WidgetModel,U extends WidgetController> - Returns:
trueif focusing is enabled,falseotherwise
-
setWidgetController
Description copied from interface:WidgetSets the widget's controller tocontroller.- Specified by:
setWidgetControllerin interfaceWidget<T extends WidgetModel,U extends WidgetController> - Parameters:
widgetController- widget controller
-
getWidgetController
Description copied from interface:WidgetReturns the widget's controller.- Specified by:
getWidgetControllerin interfaceWidget<T extends WidgetModel,U extends WidgetController> - Returns:
- widget controller
-
setControllerCtx
Description copied from interface:WidgetSets this widget's controller context i.e. the context for which this widget should use when dealing with its controller.- Specified by:
setControllerCtxin interfaceWidget<T extends WidgetModel,U extends WidgetController> - Parameters:
controllerCtx- controller context code
-
getControllerCtx
Description copied from interface:WidgetReturns this widget's controller context.- Specified by:
getControllerCtxin interfaceWidget<T extends WidgetModel,U extends WidgetController> - Returns:
- controller context code
-
isLazyLoadingEnabled
public boolean isLazyLoadingEnabled()Description copied from interface:WidgetReturns whether content lazy loading is enabled or not.- Specified by:
isLazyLoadingEnabledin interfaceWidget<T extends WidgetModel,U extends WidgetController> - Returns:
trueif lazy loading is enabled,falseotherwise
-
setLazyLoadingEnabled
public void setLazyLoadingEnabled(boolean lazyLoading) Description copied from interface:WidgetEnables or disables content lazy loading.- Specified by:
setLazyLoadingEnabledin interfaceWidget<T extends WidgetModel,U extends WidgetController> - Parameters:
lazyLoading- lazy loading
-
setWidgetTitle
Description copied from interface:WidgetSets the widget's title totitle.- Specified by:
setWidgetTitlein interfaceWidget<T extends WidgetModel,U extends WidgetController> - Parameters:
title- widget title as either i3-label key or direct value
-
getWidgetTitle
Description copied from interface:WidgetReturns the widget's title. Note: This method will return the raw title as set by previous call toWidget.setWidgetTitle(String)i.e. in the case of an i3-label key, no evaluation is done.- Specified by:
getWidgetTitlein interfaceWidget<T extends WidgetModel,U extends WidgetController> - Returns:
- widget's title
-