Class AbstractCtxMenu

All Implemented Interfaces:
CtxMenuConstants, Serializable
Direct Known Subclasses:
GroupCtxMenu, MemberCtxMenu, PublicationCtxMenu

public abstract class AbstractCtxMenu extends AbstractJcmsAjaxContext implements CtxMenuConstants
This abstract class is the used to process AJAX Contextual Menu.
Since:
jcms-5.7.0
See Also:
  • Field Details

  • Constructor Details

  • Method Details

    • addEditMenu

      protected int addEditMenu(StringBuffer sb, Data data, boolean isEnabled, boolean popup)
    • addDeleteMenu

      protected int addDeleteMenu(StringBuffer sb, Data data, String workspaceFilter, boolean isEnabled)
    • addInspectMenu

      protected int addInspectMenu(StringBuffer sb, Data data)
    • addCaddyMenu

      protected int addCaddyMenu(StringBuffer sb, Data data)
    • setRedirect

      public void setRedirect(String redirect)
    • addItemSeparator

      public void addItemSeparator(StringBuffer sb)
      Adds a menu item separator.
      Parameters:
      sb - the StringBuffer
      Since:
      jcms-5.7.0
    • addModalItem

      protected void addModalItem(StringBuffer sb, boolean isEnabled, String icon, String label, String url)
      Adds a modal action using the same button renderer as dropdownItemModal.
      Parameters:
      sb - the StringBuffer
      isEnabled - true if this item is enabled
      icon - the item icon
      label - the property of the label
      url - the complete modal URL, including any redirect
    • addModalItem

      protected void addModalItem(StringBuffer sb, boolean isEnabled, String icon, String label, String url, String wrapperCss)
      Adds a modal action with a CSS class on its list item.
      Parameters:
      sb - the StringBuffer
      isEnabled - true if this item is enabled
      icon - the item icon
      label - the property of the label
      url - the complete modal URL, including any redirect
      wrapperCss - the CSS class of the list item
    • addItem

      public void addItem(StringBuffer sb, boolean isEnabled, String icon, String label, String url)
      Adds a menu item
      Parameters:
      sb - the StringBuffer
      isEnabled - true if this item is enabled
      icon - the icon of this item
      label - the property of the label
      url - the URL to access if the user selects this item
      Since:
      jcms-5.7.0
    • addItem

      public void addItem(StringBuffer sb, boolean isEnabled, String icon, String label, String url, String css)
      Adds a menu item wit css
      Parameters:
      sb - the StringBuffer
      isEnabled - true if this item is enabled
      icon - the icon of this item
      label - the property of the label
      url - the URL to access if the user selects this item
      css - o add to link (for modal)
      Since:
      jcms-7.0.0
    • addItem

      public void addItem(StringBuffer sb, boolean isEnabled, String icon, String label, String url, String css, String wrapperCss)
      Adds a menu item with css on the link wrapper
      Parameters:
      sb - the StringBuffer
      isEnabled - true if this item is enabled
      icon - the icon of this item
      label - the property of the label
      url - the URL to access if the user selects this item
      css - o add to link (for modal)
      wrapperCss - added on the link wrapper
      Since:
      jcms-9.0.3
    • addItem

      public void addItem(StringBuffer sb, boolean isEnabled, String icon, String label, String url, boolean addRedirect)
      Adds a menu item
      Parameters:
      sb - the StringBuffer
      isEnabled - true if this item is enabled
      icon - the icon of this item
      label - the property of the label
      url - the URL to access if the user selects this item
      addRedirect - if true add a redirect attribute in the url.
      Since:
      jcms-5.7.0
    • addItemWithOnclick

      @Deprecated(forRemoval=true) public void addItemWithOnclick(StringBuffer sb, boolean isEnabled, String icon, String label, String url, String onclick)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since JCMS-3712, inline onclick event are not compliance with strict Content-Security-Policy.
      Parameters:
      sb - the StringBuffer
      isEnabled - true if this item is enabled
      icon - the icon of this item
      label - the property of the label
      url - the URL to access if the user selects this item
      onclick - the javascript function to call
    • addItemWithOnclick

      @Deprecated(forRemoval=true) public void addItemWithOnclick(StringBuffer sb, boolean isEnabled, String icon, String label, String url, String onclick, String title)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since JCMS-3712, inline onclick event are not compliance with strict Content-Security-Policy.
      Adds a menu item with onclick value. The given url may be null and will be replaced by '#'
      Parameters:
      sb - the StringBuffer
      isEnabled - true if this item is enabled
      icon - the icon of this item
      label - the property of the label
      url - the URL to access if the user selects this item
      onclick - the javascript function to call
      title - the title to set
      Since:
      jcms-5.7.0
    • addItemWithConfirm

      public void addItemWithConfirm(StringBuffer sb, boolean isEnabled, String icon, String label, String url, String confirmMsg)
      Adds a menu item with a confirm message dialog box.
      Parameters:
      sb - the StringBuffer
      isEnabled - true if this item is enabled
      icon - the icon of this item
      label - the property of the label
      url - the URL to access if the user confirms the dialog box
      confirmMsg - the confirm message
      Since:
      jcms-5.7.0
    • addItemWithConfirm

      public void addItemWithConfirm(StringBuffer sb, boolean isEnabled, String icon, String label, String url, String confirmMsg, String specificRedirect)
      Adds a menu item with a confirm message dialog box.
      Parameters:
      sb - the StringBuffer
      isEnabled - true if this item is enabled
      icon - the icon of this item
      label - the property of the label
      url - the URL to access if the user confirms the dialog box
      confirmMsg - the confirm message
      specificRedirect - to force the value of the redirect
      Since:
      jcms-5.7.5
    • addItemWithJSConfirm

      @Deprecated(forRemoval=true) public void addItemWithJSConfirm(StringBuffer sb, boolean isEnabled, String icon, String label, String func, String confirmMsg)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since JCMS-3712, inline onclick event are not compliance with strict Content-Security-Policy.
      Adds a menu item with a confirm message dialog box.
      Parameters:
      sb - the StringBuffer
      isEnabled - true if this item is enabled
      icon - the icon of this item
      label - the property of the label
      func - the JavaScript Func to call if the user confirms the dialog box If you need to use string literal in your function, use the simple quote ('), e.g : String func = "function() {Popup.popupWindow('"+url+"', 'Something');}";
      confirmMsg - the confirm message
      Since:
      jcms-5.7.0
    • addItemWithPrompt

      @Deprecated(forRemoval=true) public void addItemWithPrompt(StringBuffer sb, boolean isEnabled, String icon, String label, String url, String promptMsg, String param, String defaultValue)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since JCMS-3712, inline onclick event are not compliance with strict Content-Security-Policy.
      Adds a menu item with an input dialog box. Then redirect prompt value to given url.
      Parameters:
      sb - the StringBuffer
      isEnabled - true if this item is enabled
      icon - the icon
      label - the property of the label
      url - the URL to access if the user confirm the dialog box
      promptMsg - the prompt message
      param - the name of the parameter for the input text
      defaultValue - the default value of the input
      Since:
      jcms-5.7.0
    • addItemWithPrompt

      @Deprecated(forRemoval=true) public void addItemWithPrompt(StringBuffer sb, boolean isEnabled, String icon, String label, String func, String promptMsg, String defaultValue)
      Deprecated, for removal: This API element is subject to removal in a future version.
      since JCMS-3712, inline onclick event are not compliance with strict Content-Security-Policy.
      Adds a menu item with an input dialog box. Then call javascript with prompt value.
      Parameters:
      sb - the StringBuffer
      isEnabled - true if this item is enabled
      icon - the icon
      label - the property of the label
      func - the JavaScript function to call with prompt value
      promptMsg - the prompt message
      defaultValue - the default value of the input
      Since:
      jcms-5.7.0
    • startSubSection

      public void startSubSection(StringBuffer sb, String label, String icon)
      Starts an sub-section
      Parameters:
      sb - the StringBuffer
      label - the label of the section
      icon - the icon
      Since:
      jcms-5.7.0
    • startSubSection

      public void startSubSection(StringBuffer sb, String label, String icon, String ul)
      Starts an sub-section
      Parameters:
      sb - the StringBuffer
      label - the label of the section
      icon - the icon
      ul - the class on the ul subsection or null
      Since:
      jcms-5.7.0
    • endSubSection

      public void endSubSection(StringBuffer sb)
      Ends an sub-section
      Parameters:
      sb - the StringBuffer
      Since:
      jcms-5.7.0
    • startInfoSection

      public void startInfoSection(StringBuffer sb, String label, String icon)
      Starts an info section
      Parameters:
      sb - the StringBuffer
      label - the label of the section
      icon - the icon
      Since:
      jcms-5.7.0
    • endInfoSection

      public void endInfoSection(StringBuffer sb)
      Ends an info section
      Parameters:
      sb - the StringBuffer
      Since:
      jcms-5.7.0
    • addInfo

      public void addInfo(StringBuffer sb, String label, String value)
      Adds an info in an info section
      Parameters:
      sb - the StringBuffer
      label - the label of the info
      value - the value
      Since:
      jcms-5.7.0
    • addInfoText

      public void addInfoText(StringBuffer sb, String text)
      Adds an info in an info section
      Parameters:
      sb - the StringBuffer
      text - the text to display
      Since:
      jcms-5.7.0
    • addInfoImage

      public void addInfoImage(StringBuffer sb, String path)
      Adds an info in an info section
      Parameters:
      sb - the StringBuffer
      path - the path of the image to display
      Since:
      jcms-6.0.0
    • openItem

      public void openItem(StringBuffer sb, boolean isEnabled)
      Open a menu item which has got an icon.
      Parameters:
      sb - the StringBuffer
      isEnabled - true if this item is enabled.
      Since:
      jcms-5.7.0
    • openItem

      public void openItem(StringBuffer sb, boolean isEnabled, String css)
      Open a menu item which has got an icon.
      Parameters:
      sb - the StringBuffer
      isEnabled - true if this item is enabled.
      css - the css to add in class attribute (Will be added on the LI element)
      Since:
      jcms-9.0.3
    • closeItem

      public void closeItem(StringBuffer sb, String icon, String label)
      Close a menu item which has got an icon.
      Parameters:
      sb - the StringBuffer
      icon - the item icon
      label - the label of the item
      Since:
      jcms-5.7.0