Package com.hybris.cockpitng.admin
Class RoleIndicatorComposer
- java.lang.Object
-
- org.zkoss.zk.ui.event.GenericEventListener
-
- org.zkoss.zk.ui.util.GenericComposer<T>
-
- org.zkoss.zk.ui.util.GenericAutowireComposer<T>
-
- org.zkoss.zk.ui.util.GenericForwardComposer<org.zkoss.zk.ui.Component>
-
- com.hybris.cockpitng.util.ViewAnnotationAwareComposer
-
- com.hybris.cockpitng.admin.RoleIndicatorComposer
-
- All Implemented Interfaces:
java.io.Serializable,org.zkoss.zk.ui.event.EventListener,org.zkoss.zk.ui.event.SerializableEventListener,org.zkoss.zk.ui.util.ComponentActivationListener,org.zkoss.zk.ui.util.ComponentCloneListener,org.zkoss.zk.ui.util.Composer<org.zkoss.zk.ui.Component>,org.zkoss.zk.ui.util.ComposerExt<org.zkoss.zk.ui.Component>
public class RoleIndicatorComposer extends ViewAnnotationAwareComposer
Composer of the current impersonated authority group indicator.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description RoleIndicatorComposer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoAfterCompose(org.zkoss.zk.ui.Component component)protected voidindicateCurrentRole()Displays current impersonated authority group.protected booleanisIndicatorVisible()Determines if the indicator should be visible.protected java.lang.StringresolveGroupLabel(AuthorityGroup group)Returns group name or code if name is blank.voidstopImpersonatedPreview()Ends the impersonation preview.voidupdate()Updates the current authority group indicator, meaning: checks visibility updates the current impersonation authority group-
Methods inherited from class com.hybris.cockpitng.util.ViewAnnotationAwareComposer
invokeListenerMethod, scanEventListeners
-
Methods inherited from class org.zkoss.zk.ui.util.GenericAutowireComposer
alert, didActivate, getPage, willClone, willPassivate
-
Methods inherited from class org.zkoss.zk.ui.util.GenericComposer
doBeforeCompose, doBeforeComposeChildren, doCatch, doFinally
-
-
-
-
Method Detail
-
doAfterCompose
public void doAfterCompose(org.zkoss.zk.ui.Component component) throws java.lang.Exception- Specified by:
doAfterComposein interfaceorg.zkoss.zk.ui.util.Composer<org.zkoss.zk.ui.Component>- Overrides:
doAfterComposein classViewAnnotationAwareComposer- Throws:
java.lang.Exception
-
indicateCurrentRole
protected void indicateCurrentRole()
Displays current impersonated authority group.
-
isIndicatorVisible
protected boolean isIndicatorVisible()
Determines if the indicator should be visible. By default, the method checks if the current user is ADMIN user and if current mode is NOT admin-mode and if currently selected authority group is impersonated or not.
-
resolveGroupLabel
protected java.lang.String resolveGroupLabel(AuthorityGroup group)
Returns group name or code if name is blank.- Parameters:
group-- Returns:
- group label
-
stopImpersonatedPreview
public void stopImpersonatedPreview()
Ends the impersonation preview. Clears the indicator and removes the active impersonation authority group.
-
update
public void update()
Updates the current authority group indicator, meaning:- checks visibility
- updates the current impersonation authority group
-
-