Class CockpitComponentCleanup

  • All Implemented Interfaces:
    org.zkoss.zk.ui.util.DesktopCleanup, org.zkoss.zk.ui.util.UiLifeCycle

    public class CockpitComponentCleanup
    extends java.lang.Object
    implements org.zkoss.zk.ui.util.UiLifeCycle, org.zkoss.zk.ui.util.DesktopCleanup
    Calls Cleanable.cleanup() for each component detached. Calls Initializable.initialize() for each component attached.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void afterComponentAttached​(org.zkoss.zk.ui.Component component, org.zkoss.zk.ui.Page page)  
      void afterComponentDetached​(org.zkoss.zk.ui.Component component, org.zkoss.zk.ui.Page page)  
      void afterComponentMoved​(org.zkoss.zk.ui.Component component, org.zkoss.zk.ui.Component component1, org.zkoss.zk.ui.Component component2)  
      void afterPageAttached​(org.zkoss.zk.ui.Page page, org.zkoss.zk.ui.Desktop desktop)  
      void afterPageDetached​(org.zkoss.zk.ui.Page page, org.zkoss.zk.ui.Desktop desktop)  
      void afterShadowAttached​(org.zkoss.zk.ui.ShadowElement shadowElement, org.zkoss.zk.ui.Component component)  
      void afterShadowDetached​(org.zkoss.zk.ui.ShadowElement shadowElement, org.zkoss.zk.ui.Component component)  
      static void cleanup​(org.zkoss.zk.ui.Component component)
      Calls Cleanable.cleanup() for provided component and all Cleanable registered for it.
      static void cleanup​(org.zkoss.zk.ui.Component component, boolean nested)
      Calls Cleanable.cleanup() for provided component and all Cleanable registered for it.
      void cleanup​(org.zkoss.zk.ui.Desktop desktop)  
      static void initialize​(org.zkoss.zk.ui.Component component)
      Calls Initializable.initialize() for provided component and all Initializable registered for it.
      static void initialize​(org.zkoss.zk.ui.Component component, boolean nested)
      Calls Initializable.initialize() for provided component and all Initializable registered for it.
      static void registerCleanable​(org.zkoss.zk.ui.Component component, Cleanable cleanup)
      Registers a cleanup that should be performed after specified component is detached.
      static void registerInitializable​(org.zkoss.zk.ui.Component component, Initializable initialize)
      Registers a initialize that should be performed before specified component is displayed.
      static void unregisterCleanable​(org.zkoss.zk.ui.Component component, Cleanable cleanup)
      Unregisters a cleanup that should not be performed after specified component is detached.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • CockpitComponentCleanup

        public CockpitComponentCleanup()
    • Method Detail

      • registerCleanable

        public static void registerCleanable​(org.zkoss.zk.ui.Component component,
                                             Cleanable cleanup)
        Registers a cleanup that should be performed after specified component is detached.

        Cleanup is a one-time event and all cleanups will get unregistered after component is detached. This means that, if component it to be attached and detached multiple times, then a a cleanup needs to be registered every time component is attached.

        Parameters:
        component - triggering component
        cleanup - cleanup to be performed
      • unregisterCleanable

        public static void unregisterCleanable​(org.zkoss.zk.ui.Component component,
                                               Cleanable cleanup)
        Unregisters a cleanup that should not be performed after specified component is detached.
        Parameters:
        component - triggering component
        cleanup - cleanup to unregister
      • registerInitializable

        public static void registerInitializable​(org.zkoss.zk.ui.Component component,
                                                 Initializable initialize)
        Registers a initialize that should be performed before specified component is displayed.

        Initialization is a one-time event and all setups will get unregistered after component is displayed. This means that, if component it to be attached and detached multiple times, then a initialize needs to be registered every time component is detached.

        Parameters:
        component - triggering component
        initialize - cleanup to be performed
      • initialize

        public static void initialize​(org.zkoss.zk.ui.Component component)
        Calls Initializable.initialize() for provided component and all Initializable registered for it. Method is invoked for whole tree of components children.
        Parameters:
        component - component to be initialized
      • initialize

        public static void initialize​(org.zkoss.zk.ui.Component component,
                                      boolean nested)
        Calls Initializable.initialize() for provided component and all Initializable registered for it. Method may be invoked for whole tree of components children, depending on value of nested.
        Parameters:
        component - component to be initialized
        nested - if false then only provided component will be initialized, otherwise whole tree
      • cleanup

        public static void cleanup​(org.zkoss.zk.ui.Component component)
        Calls Cleanable.cleanup() for provided component and all Cleanable registered for it. Method is invoked for whole tree of components children.
        Parameters:
        component - component to be cleaned
      • cleanup

        public static void cleanup​(org.zkoss.zk.ui.Component component,
                                   boolean nested)
        Calls Cleanable.cleanup() for provided component and all Cleanable registered for it. Method may be invoked for whole tree of components children, depending on value of nested.
        Parameters:
        component - component to be cleaned
        nested - if false then only provided component will be cleaned, otherwise whole tree
      • afterShadowAttached

        public void afterShadowAttached​(org.zkoss.zk.ui.ShadowElement shadowElement,
                                        org.zkoss.zk.ui.Component component)
        Specified by:
        afterShadowAttached in interface org.zkoss.zk.ui.util.UiLifeCycle
      • afterShadowDetached

        public void afterShadowDetached​(org.zkoss.zk.ui.ShadowElement shadowElement,
                                        org.zkoss.zk.ui.Component component)
        Specified by:
        afterShadowDetached in interface org.zkoss.zk.ui.util.UiLifeCycle
      • afterComponentAttached

        public void afterComponentAttached​(org.zkoss.zk.ui.Component component,
                                           org.zkoss.zk.ui.Page page)
        Specified by:
        afterComponentAttached in interface org.zkoss.zk.ui.util.UiLifeCycle
      • afterComponentDetached

        public void afterComponentDetached​(org.zkoss.zk.ui.Component component,
                                           org.zkoss.zk.ui.Page page)
        Specified by:
        afterComponentDetached in interface org.zkoss.zk.ui.util.UiLifeCycle
      • afterComponentMoved

        public void afterComponentMoved​(org.zkoss.zk.ui.Component component,
                                        org.zkoss.zk.ui.Component component1,
                                        org.zkoss.zk.ui.Component component2)
        Specified by:
        afterComponentMoved in interface org.zkoss.zk.ui.util.UiLifeCycle
      • afterPageAttached

        public void afterPageAttached​(org.zkoss.zk.ui.Page page,
                                      org.zkoss.zk.ui.Desktop desktop)
        Specified by:
        afterPageAttached in interface org.zkoss.zk.ui.util.UiLifeCycle
      • afterPageDetached

        public void afterPageDetached​(org.zkoss.zk.ui.Page page,
                                      org.zkoss.zk.ui.Desktop desktop)
        Specified by:
        afterPageDetached in interface org.zkoss.zk.ui.util.UiLifeCycle
      • cleanup

        public void cleanup​(org.zkoss.zk.ui.Desktop desktop)
                     throws java.lang.Exception
        Specified by:
        cleanup in interface org.zkoss.zk.ui.util.DesktopCleanup
        Throws:
        java.lang.Exception