Class RightClickBehavior

  • All Implemented Interfaces:
    Serializable, org.apache.wicket.IComponentAwareEventSink, org.apache.wicket.IRequestListener, org.apache.wicket.markup.html.IComponentAwareHeaderContributor, org.apache.wicket.util.io.IClusterable, IContextMenu

    public abstract class RightClickBehavior
    extends org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
    implements IContextMenu
    This behavior adds a right-click event-handler to the component.
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static String MOUSE_X_PARAM  
      static String MOUSE_Y_PARAM  
      • Fields inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior

        INDICATOR
    • Constructor Summary

      Constructors 
      Constructor Description
      RightClickBehavior​(org.apache.wicket.MarkupContainer contextmenu, org.apache.wicket.MarkupContainer componentToUpdate)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void collapse​(org.apache.wicket.ajax.AjaxRequestTarget target)
      Close the contextmenu
      org.apache.wicket.MarkupContainer getComponentToUpdate()  
      org.apache.wicket.MarkupContainer getContextmenu()  
      void renderHead​(org.apache.wicket.Component component, org.apache.wicket.markup.head.IHeaderResponse response)
      Set up a YUI 'contextmenu' event listener on the component.
      protected void updateAjaxAttributes​(org.apache.wicket.ajax.attributes.AjaxRequestAttributes attributes)  
      • Methods inherited from class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior

        findIndicatorId, getAttributes, getCallbackFunction, getCallbackFunctionBody, getCallbackScript, getCallbackScript, onBind, onMethodMismatch, onRequest, postprocessConfiguration, renderAjaxAttributes, renderAjaxAttributes, respond
      • Methods inherited from class org.apache.wicket.behavior.AbstractAjaxBehavior

        afterRender, bind, getCallbackUrl, getComponent, onComponentRendered, onComponentTag, onComponentTag, onUnbind, unbind
      • Methods inherited from class org.apache.wicket.behavior.Behavior

        beforeRender, canCallListener, detach, getStatelessHint, isEnabled, isTemporary, onAttribute, onConfigure, onEvent, onException, onRemove, onTag
      • Methods inherited from interface org.apache.wicket.IRequestListener

        rendersPage
    • Constructor Detail

      • RightClickBehavior

        public RightClickBehavior​(org.apache.wicket.MarkupContainer contextmenu,
                                  org.apache.wicket.MarkupContainer componentToUpdate)
    • Method Detail

      • renderHead

        public void renderHead​(org.apache.wicket.Component component,
                               org.apache.wicket.markup.head.IHeaderResponse response)
        Set up a YUI 'contextmenu' event listener on the component. The callback function is parameterized with the x&y coordinates of the click event. Also stop the contextmenu event from propagating to prevent the browser's contextmenu from rendering.
        Specified by:
        renderHead in interface org.apache.wicket.markup.html.IComponentAwareHeaderContributor
        Overrides:
        renderHead in class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
      • updateAjaxAttributes

        protected void updateAjaxAttributes​(org.apache.wicket.ajax.attributes.AjaxRequestAttributes attributes)
        Overrides:
        updateAjaxAttributes in class org.apache.wicket.ajax.AbstractDefaultAjaxBehavior
      • collapse

        public void collapse​(org.apache.wicket.ajax.AjaxRequestTarget target)
        Description copied from interface: IContextMenu
        Close the contextmenu
        Specified by:
        collapse in interface IContextMenu
      • getContextmenu

        public org.apache.wicket.MarkupContainer getContextmenu()
      • getComponentToUpdate

        public org.apache.wicket.MarkupContainer getComponentToUpdate()