Class DefaultComponentMarkingUtils

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected DefaultComponentMarkingUtils.Listener getEventListener​(MarkedEventListener listener, java.lang.String markName)  
      protected java.util.Set<org.zkoss.zk.ui.event.EventListener> getListenersToRemove​(java.util.Set<org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>> eventListeners, java.lang.Object newListenerId)  
      protected void handleMarkedComponentListener​(org.zkoss.zk.ui.Component markedComponent, java.lang.String markName, java.lang.String eventName, MarkedEventListener listener)  
      protected boolean isListenerToRemove​(org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> eventListener, java.lang.Object newListenerId)  
      void markComponent​(org.zkoss.zk.ui.Component parent, org.zkoss.zk.ui.Component component, java.lang.String markName)
      Whenever a component created by renderer that widget controller is not aware of, but there is a logic related with it, a renderer may mark it, so that then controller may assign a logic to it.
      void markComponent​(org.zkoss.zk.ui.Component parent, org.zkoss.zk.ui.Component component, java.lang.String markName, java.lang.Object markData)
      Whenever a component created by renderer that widget controller is not aware of, but there is a logic related with it, a renderer may mark it, so that then controller may assign a logic to it.
      protected java.util.Set<org.zkoss.zk.ui.Component> mergeComponentSets​(java.util.Set<org.zkoss.zk.ui.Component> first, java.util.Set<org.zkoss.zk.ui.Component> second)  
      void moveMarkedComponents​(org.zkoss.zk.ui.Component source, org.zkoss.zk.ui.Component target)
      Copies the marked components data structure from source component to target component and removes it from the source component
      void registerMarkedComponentsListener​(org.zkoss.zk.ui.Component parent, java.lang.String markName, java.lang.String eventName, MarkedEventListener listener)
      Whenever a component created by renderer that widget controller is not aware of, but there is a logic related with it, a renderer may mark it, so that then controller may assign a logic to it.
      • Methods inherited from class java.lang.Object

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

      • DefaultComponentMarkingUtils

        public DefaultComponentMarkingUtils()
    • Method Detail

      • markComponent

        public void markComponent​(org.zkoss.zk.ui.Component parent,
                                  org.zkoss.zk.ui.Component component,
                                  java.lang.String markName)
        Description copied from interface: ComponentMarkingUtils
        Whenever a component created by renderer that widget controller is not aware of, but there is a logic related with it, a renderer may mark it, so that then controller may assign a logic to it. This method should mark component appropriately.
        Specified by:
        markComponent in interface ComponentMarkingUtils
        Parameters:
        parent - parent component which will get a data structure of all marked components for every mark; it should be the same object as the one passed as parent to render method
        component - component to be marked
        markName - name of the mark - this value should be known by controller
        See Also:
        ComponentMarkingUtils.registerMarkedComponentsListener(Component, String, String, MarkedEventListener)
      • markComponent

        public void markComponent​(org.zkoss.zk.ui.Component parent,
                                  org.zkoss.zk.ui.Component component,
                                  java.lang.String markName,
                                  java.lang.Object markData)
        Description copied from interface: ComponentMarkingUtils
        Whenever a component created by renderer that widget controller is not aware of, but there is a logic related with it, a renderer may mark it, so that then controller may assign a logic to it. This method should mark component appropriately.
        Specified by:
        markComponent in interface ComponentMarkingUtils
        Parameters:
        parent - parent component which will get a data structure of all marked components for every mark; it should be the same object as the one passed as parent to render method
        component - component to be marked
        markName - name of the mark - this value should be known by controller
        markData - any data object that may be needed by controller to perform a logic
        See Also:
        ComponentMarkingUtils.registerMarkedComponentsListener(Component, String, String, MarkedEventListener)
      • registerMarkedComponentsListener

        public void registerMarkedComponentsListener​(org.zkoss.zk.ui.Component parent,
                                                     java.lang.String markName,
                                                     java.lang.String eventName,
                                                     MarkedEventListener listener)
        Description copied from interface: ComponentMarkingUtils
        Whenever a component created by renderer that widget controller is not aware of, but there is a logic related with it, a renderer may mark it, so that then controller may assign a logic to it. This method registers an UI event to all marked children components. It also makes sure that there is only one consumer for specified event and mark name on particular component.

        To assure that a particular logic is registered as listener is registered only once, it may be wrapped with Identifiable interface. If a listener provided is of type Identifiable and a listener with same id is already registered, then the old one will be removed before new is registered.

        Specified by:
        registerMarkedComponentsListener in interface ComponentMarkingUtils
        Parameters:
        parent - parent component to which marked children logic should be assigned
        markName - name of the mark
        eventName - UI event name which should trigger the logic
        listener - whenever an event takes place, a consumer will be asked with initial event and with data retrieved from a component
        See Also:
        Identifiable
      • handleMarkedComponentListener

        protected void handleMarkedComponentListener​(org.zkoss.zk.ui.Component markedComponent,
                                                     java.lang.String markName,
                                                     java.lang.String eventName,
                                                     MarkedEventListener listener)
      • getListenersToRemove

        protected java.util.Set<org.zkoss.zk.ui.event.EventListener> getListenersToRemove​(java.util.Set<org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event>> eventListeners,
                                                                                          java.lang.Object newListenerId)
      • isListenerToRemove

        protected boolean isListenerToRemove​(org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> eventListener,
                                             java.lang.Object newListenerId)
      • moveMarkedComponents

        public void moveMarkedComponents​(org.zkoss.zk.ui.Component source,
                                         org.zkoss.zk.ui.Component target)
        Description copied from interface: ComponentMarkingUtils
        Copies the marked components data structure from source component to target component and removes it from the source component
        Specified by:
        moveMarkedComponents in interface ComponentMarkingUtils
        Parameters:
        source - component from which the marked components should be copied and removed
        target - component to which the marked components should be copied to
      • mergeComponentSets

        protected java.util.Set<org.zkoss.zk.ui.Component> mergeComponentSets​(java.util.Set<org.zkoss.zk.ui.Component> first,
                                                                              java.util.Set<org.zkoss.zk.ui.Component> second)