Package com.hybris.cockpitng.util.impl
Class DefaultComponentMarkingUtils
- java.lang.Object
-
- com.hybris.cockpitng.util.impl.DefaultComponentMarkingUtils
-
- All Implemented Interfaces:
ComponentMarkingUtils
- Direct Known Subclasses:
DefaultWidgetRenderingUtils
public class DefaultComponentMarkingUtils extends java.lang.Object implements ComponentMarkingUtils
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classDefaultComponentMarkingUtils.IdentifiableEventListenerDeprecated, for removal: This API element is subject to removal in a future version.since 1905, useDefaultComponentMarkingUtils.Listenerinsteadprotected static classDefaultComponentMarkingUtils.Listener
-
Constructor Summary
Constructors Constructor Description DefaultComponentMarkingUtils()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected DefaultComponentMarkingUtils.ListenergetEventListener(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 voidhandleMarkedComponentListener(org.zkoss.zk.ui.Component markedComponent, java.lang.String markName, java.lang.String eventName, MarkedEventListener listener)protected booleanisListenerToRemove(org.zkoss.zk.ui.event.EventListener<org.zkoss.zk.ui.event.Event> eventListener, java.lang.Object newListenerId)voidmarkComponent(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.voidmarkComponent(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)voidmoveMarkedComponents(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 componentvoidregisterMarkedComponentsListener(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.
-
-
-
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:ComponentMarkingUtilsWhenever 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:
markComponentin interfaceComponentMarkingUtils- 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 methodcomponent- component to be markedmarkName- 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:ComponentMarkingUtilsWhenever 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:
markComponentin interfaceComponentMarkingUtils- 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 methodcomponent- component to be markedmarkName- name of the mark - this value should be known by controllermarkData- 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:ComponentMarkingUtilsWhenever 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
Identifiableinterface. If a listener provided is of typeIdentifiableand a listener with same id is already registered, then the old one will be removed before new is registered.- Specified by:
registerMarkedComponentsListenerin interfaceComponentMarkingUtils- Parameters:
parent- parent component to which marked children logic should be assignedmarkName- name of the markeventName- UI event name which should trigger the logiclistener- 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)
-
getEventListener
protected DefaultComponentMarkingUtils.Listener getEventListener(MarkedEventListener listener, java.lang.String markName)
-
moveMarkedComponents
public void moveMarkedComponents(org.zkoss.zk.ui.Component source, org.zkoss.zk.ui.Component target)Description copied from interface:ComponentMarkingUtilsCopies the marked components data structure from source component to target component and removes it from the source component- Specified by:
moveMarkedComponentsin interfaceComponentMarkingUtils- Parameters:
source- component from which the marked components should be copied and removedtarget- 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)
-
-