Interface Widget<T extends WidgetModel,U extends WidgetController>

Type Parameters:
T - widget model type
U - 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.
See Also:
  • 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 Type
    Method
    Description
    void
    Called whenever this widget is invalidated or when a cleanup is needed.
    org.zkoss.zk.ui.api.HtmlBasedComponent
    Returns this widget's caption component.
    org.zkoss.zk.ui.api.HtmlBasedComponent
    Returns this widget's content component
    Returns 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.
    void
    Initializes this widget.
    boolean
    Returns whether this widget can be focused or not.
    boolean
    Returns whether this widget has been initialized or not.
    boolean
    Returns whether content lazy loading is enabled or not.
    void
    setControllerCtx(String controllerCtx)
    Sets this widget's controller context i.e.
    void
    setFocusable(boolean focusable)
    Sets whether this widget can be focused or not.
    void
    setLazyLoadingEnabled(boolean enabled)
    Enables or disables content lazy loading.
    void
    setWidgetCode(String widgetCode)
    Sets the widget's code.
    void
    Sets the widget container to which this widget belongs.
    void
    setWidgetController(U controller)
    Sets the widget's controller to controller.
    void
    Sets the widget's (view) model.
    void
    Sets the widget renderer.
    void
    Sets the widget's title to title.

    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, setWidgetOverride

    Methods inherited from interface de.hybris.platform.cockpit.components.FocusableComponent

    handleFocus

    Methods 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, setZIndex

    Methods inherited from interface org.zkoss.zk.ui.ext.Scope

    addScopeListener, getAttribute, hasAttribute, removeAttribute, removeScopeListener, setAttribute

    Methods inherited from interface de.hybris.platform.cockpit.widgets.events.WidgetModelListener

    onModelEvent
  • Method Details

    • setWidgetCode

      void setWidgetCode(String widgetCode)
      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 one WidgetContainer.

      Parameters:
      widgetCode - widget code
    • getWidgetCode

      String getWidgetCode()
      Returns the widget's code.
      Returns:
      this widget's code
      See Also:
    • setWidgetModel

      void setWidgetModel(T model)
      Sets the widget's (view) model.
      Parameters:
      model - the model
    • getWidgetModel

      T getWidgetModel()
      Returns the widget's (view) model.
      Returns:
      widget's model or null if no model is available
    • setWidgetContainer

      void setWidgetContainer(WidgetContainer container)
      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 - true means focusing is enabled, false means disabled
    • isFocusable

      boolean isFocusable()
      Returns whether this widget can be focused or not.
      Returns:
      true if focusing is enabled, false otherwise
    • setWidgetTitle

      void setWidgetTitle(String title)
      Sets the widget's title to title.
      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 to setWidgetTitle(String) i.e. in the case of an i3-label key, no evaluation is done.

      Returns:
      widget's title
    • initialize

      void initialize(Map<String,Object> params)
      Initializes this widget.
      Parameters:
      params - initialization parameters
    • isInitialized

      boolean isInitialized()
      Returns whether this widget has been initialized or not.
      Returns:
      true if widget has been initialized, false otherwise
    • 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

      void setWidgetRenderer(WidgetRenderer renderer)
      Sets the widget renderer.
      Parameters:
      renderer - widget renderer
    • getWidgetRenderer

      WidgetRenderer getWidgetRenderer()
      Returns the widget renderer.
      Returns:
      widget renderer
    • setWidgetController

      void setWidgetController(U controller)
      Sets the widget's controller to controller.
      Parameters:
      controller - widget controller
    • getWidgetController

      U getWidgetController()
      Returns the widget's controller.
      Returns:
      widget controller
    • setControllerCtx

      void setControllerCtx(String controllerCtx)
      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:
      true if lazy loading is enabled, false otherwise