Package org.zkoss.stateless.ui

## Class IStubsComponent

- java.lang.Object
- - org.zkoss.zk.ui.AbstractComponent
  - - org.zkoss.zk.ui.sys.StubComponent
    - - org.zkoss.zk.ui.sys.StubsComponent
      - - org.zkoss.stateless.ui.IStubsComponent

- All Implemented Interfaces:
    `java.io.Serializable`, `java.lang.Cloneable`, `Component`, `Scope`, `ComponentCtrl`
  Direct Known Subclasses:
    `VolatileIStubsComponent`

      public class IStubsComponent
      extends StubsComponent

  Internal use only.
  Author:
    jumperchen
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.zkoss.zk.ui.AbstractComponent

      `AbstractComponent.Children, AbstractComponent.ForwardInfo, AbstractComponent.TargetInfo`

  - ### Field Summary

    - ### Fields inherited from class org.zkoss.zk.ui.sys.StubsComponent

      `_evtmap, _idmap, _uuids`

    - ### Fields inherited from interface org.zkoss.zk.ui.Component

      `APPLICATION_SCOPE, COMPONENT_SCOPE, DESKTOP_SCOPE, PAGE_SCOPE, REQUEST_SCOPE, SESSION_SCOPE, SPACE_SCOPE`

    - ### Fields inherited from interface org.zkoss.zk.ui.sys.ComponentCtrl

      `AFTER_CHILD_ADDED, AFTER_CHILD_REMOVED, AFTER_CLONED, AFTER_PAGE_ATTACHED, AFTER_PAGE_DETACHED, AFTER_PARENT_CHANGED, CE_BUSY_IGNORE, CE_DUPLICATE_IGNORE, CE_IMPORTANT, CE_NON_DEFERRABLE, CE_REPEAT_IGNORE`

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `IStubsComponent()` |

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `Component` | `getFellow​(java.lang.String compId)` | Returns a component of the specified ID in the same ID space.
    `Component` | `getFellowIfAny​(java.lang.String compId)` | Returns a component of the specified ID in the same ID space, or null if not found.
    `void` | `mergeIComponent​(StubComponent stubComponent)` | Merges the given component into this stubs component.
    `void` | `removeStub​(java.util.List<java.lang.String> uuids)` |
    `void` | `replace​(Component comp, boolean bFellow, boolean bListener, boolean bChildren)` | Replace the specified component with this component in the component tree.
    `void` | `service​(Event event, Scope scope)` | Handles an event.

    - ### Methods inherited from class org.zkoss.zk.ui.sys.StubsComponent

      `getId, getWidgetClass, isChildable, mapChildren, onChildrenMerged, onPageAttached, onPageDetached, toString`

    - ### Methods inherited from class org.zkoss.zk.ui.sys.StubComponent

      `service`

    - ### Methods inherited from class org.zkoss.zk.ui.AbstractComponent

      `addAnnotation, addCallback, addClientEvent, addEventHandler, addEventListener, addEventListener, addForward, addForward, addForward, addForward, addMoved, addRedrawCallback, addScopeListener, addShadowRoot, addShadowRootBefore, addSharedEventHandlerMap, appendChild, applyProperties, beforeChildAdded, beforeChildRemoved, beforeParentChanged, clone, destroyIndexCacheMap, detach, didActivate, didActivate, didDeserialize, didDeserialize, disableBindingAnnotation, disableClientUpdate, disableHostChanged, enableBindingAnnotation, enableHostChanged, getAnnotatedProperties, getAnnotatedPropertiesBy, getAnnotation, getAnnotations, getAnnotations, getAttribute, getAttribute, getAttribute, getAttributeOrFellow, getAttributes, getAttributes, getAuService, getAutag, getCallback, getChildren, getClientAttribute, getClientDataAttribute, getClientEvents, getDefaultMold, getDefinition, getDesktop, getEventHandler, getEventHandlerNames, getEventListenerMap, getEventListeners, getExtraCtrl, getFellow, getFellowIfAny, getFellows, getFirstChild, getForwards, getId, getIndexCacheMap, getLastChild, getMold, getNextSibling, getPage, getParent, getPreviousSibling, getPropertyAccess, getRedrawCallback, getRoot, getShadowFellowIfAny, getShadowRoots, getShadowVariable, getShadowVariable, getShadowVariable0, getSpaceOwner, getSpecialRendererOutput, getStubonly, getSubBindingAnnotationCount, getTemplate, getTemplateNames, getUuid, getWidgetAttributeNames, getWidgetListener, getWidgetListenerNames, getWidgetOverride, getWidgetOverrideNames, hasAttribute, hasAttribute, hasAttribute, hasAttributeOrFellow, hasBindingAnnotation, hasFellow, hasFellow, hasSubBindingAnnotation, initIndexCacheMap, insertBefore, invalidate, isDisabledHostChanged, isInitialized, isInvalidated, isListenerAvailable, isVisible, onChildAdded, onChildRemoved, onParentChanged, onWrongValue, query, queryAll, redraw, redrawChildren, removeAttribute, removeAttribute, removeAttribute, removeCallback, removeChild, removeEventListener, removeForward, removeForward, removeRedrawCallback, removeScopeListener, removeShadowRoot, render, render, render, renderProperties, renderPropertiesOnly, response, response, response, sessionDidActivate, sessionWillPassivate, setAttribute, setAttribute, setAttribute, setAuService, setAutag, setClientAttribute, setClientDataAttribute, setDefinition, setDefinition, setId, setMold, setPage, setPageBefore, setParent, setStubonly, setStubonly, setSubBindingAnnotationCount, setTemplate, setVisible, setVisibleDirectly, setWidgetClass, setWidgetListener, setWidgetOverride, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdate, smartUpdateWidgetListener, smartUpdateWidgetOverride, updateByClient, updateSubBindingAnnotationCount, willPassivate, willPassivate, willSerialize, willSerialize`

    - ### Methods inherited from class java.lang.Object

      `equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### IStubsComponent

          public IStubsComponent()

  - ### Method Detail

    - #### replace

          public void replace​(Component comp,
                              boolean bFellow,
                              boolean bListener,
                              boolean bChildren)

      Description copied from class: `StubComponent`
      Replace the specified component with this component in the component tree. In other words, the parent of the given component will become the parent of this components, so are siblings and children. Furthermore, comp will be detached at the end.

      Notice that the replacement won't change anything at the client. A stub component assumes there is a full-functional widget running at the client to handle everything.

      Overrides:
        `replace` in class `StubComponent`
      Parameters:
        `comp` - the component. In this implementation it supports only derived classes of `AbstractComponent`.
        `bFellow` - whether to add this component to the map of fellows if it is assigned with an ID. If false, the component (comp) cannot be retrieved back even with an ID.
        `bListener` - whether to retain the event listeners and handlers. If true, the event listeners and handlers, if any, will be registered to this stub component. In other words, the event will be processed. However, it is a stub component, rather than the original one. I means the event is the most generic format: an instance of `Event` (rather than MouseEvent or others).
        `bChildren` - whether to have the children of the given component.
        If false, this component won't have any children, and all UUID of children reference back to this component.
        If true, the given component's children will belong to this component.

    - #### mergeIComponent

          public void mergeIComponent​(StubComponent stubComponent)

      Merges the given component into this stubs component.
      Parameters:
        `stubComponent` -

    - #### service

          public void service​(Event event,
                              Scope scope)
                       throws java.lang.Exception

      Description copied from interface: `ComponentCtrl`
      Handles an event. This method will invoke the event handlers registered in a ZUML page, the event listeners registered in Java, and the event handlers declared as part of the component.
      Specified by:
        `service` in interface `ComponentCtrl`
      Overrides:
        `service` in class `StubsComponent`
      Parameters:
        `event` - the event to handle
        `scope` - the scope to evaluate the zscript, if any. (see also `Page.interpret(java.lang.String, java.lang.String, org.zkoss.zk.ui.ext.Scope)`.
      Throws:
        `java.lang.Exception`

    - #### removeStub

          public void removeStub​(java.util.List<java.lang.String> uuids)

    - #### getFellowIfAny

          public Component getFellowIfAny​(java.lang.String compId)

      Description copied from interface: `Component`
      Returns a component of the specified ID in the same ID space, or null if not found.

      Unlike `Component.getFellow(java.lang.String)`, it returns null if not found.

      Specified by:
        `getFellowIfAny` in interface `Component`
      Overrides:
        `getFellowIfAny` in class `AbstractComponent`

    - #### getFellow

          public Component getFellow​(java.lang.String compId)
                              throws ComponentNotFoundException

      Description copied from interface: `Component`
      Returns a component of the specified ID in the same ID space. Components in the same ID space assigned with ID are called fellows.

      Unlike `Component.getFellowIfAny(java.lang.String)`, it throws an exception if not found.

      Specified by:
        `getFellow` in interface `Component`
      Overrides:
        `getFellow` in class `AbstractComponent`
      Throws:
        `ComponentNotFoundException` - is thrown if fellow not found