Class 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
    • Field Summary

      • Fields inherited from class org.zkoss.zk.ui.util.GenericAutowireComposer

        _separator, application, applicationScope, arg, componentScope, desktop, desktopScope, execution, page, pageScope, param, requestScope, self, session, sessionScope, spaceOwner, spaceScope
      • Fields inherited from class org.zkoss.zk.ui.util.GenericComposer

        _applied
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void doAfterCompose​(org.zkoss.zk.ui.Component component)  
      protected void indicateCurrentRole()
      Displays current impersonated authority group.
      protected boolean isIndicatorVisible()
      Determines if the indicator should be visible.
      protected java.lang.String resolveGroupLabel​(AuthorityGroup group)
      Returns group name or code if name is blank.
      void stopImpersonatedPreview()
      Ends the impersonation preview.
      void update()
      Updates the current authority group indicator, meaning: checks visibility updates the current impersonation authority group
      • 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
      • Methods inherited from class org.zkoss.zk.ui.event.GenericEventListener

        bindComponent, getController, onEvent, unbindComponent
      • Methods inherited from class java.lang.Object

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

      • RoleIndicatorComposer

        public RoleIndicatorComposer()
    • Method Detail

      • doAfterCompose

        public void doAfterCompose​(org.zkoss.zk.ui.Component component)
                            throws java.lang.Exception
        Specified by:
        doAfterCompose in interface org.zkoss.zk.ui.util.Composer<org.zkoss.zk.ui.Component>
        Overrides:
        doAfterCompose in class ViewAnnotationAwareComposer
        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