Interface ItemSelectorView<T extends ItemSelectorCriterion>

All Known Subinterfaces:
PortletItemSelectorView<T>

public interface ItemSelectorView<T extends ItemSelectorCriterion>
Provides an interface to render an item selector view for a particular item selector criterion.

If one item selector view can be displayed for multiple different criteria, it needs as many implementations of this interface as criteria.

  • Method Summary

    Modifier and Type
    Method
    Description
    Class<? extends T>
    Returns the item selector criterion associated to this item selector view.
    Returns the item selector return types that this view supports.
    getTitle(Locale locale)
    Returns the localized title of the tab to display in the Item Selector dialog.
    default boolean
    isVisible(com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
    Deprecated.
    As of Athanasius (7.3.x)
    default boolean
    isVisible(T itemSelectorCriterion, com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
    Returns whether the item selector view is visible.
    void
    renderHTML(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, T itemSelectorCriterion, javax.portlet.PortletURL portletURL, String itemSelectedEventName, boolean search)
    Renders the HTML code for the item selector view.
  • Method Details

    • getItemSelectorCriterionClass

      Class<? extends T> getItemSelectorCriterionClass()
      Returns the item selector criterion associated to this item selector view.
      Returns:
      the item selector criterion associated to this item selector view
    • getSupportedItemSelectorReturnTypes

      List<ItemSelectorReturnType> getSupportedItemSelectorReturnTypes()
      Returns the item selector return types that this view supports.
      Returns:
      the ItemSelectorReturnTypes that this view supports
    • getTitle

      String getTitle(Locale locale)
      Returns the localized title of the tab to display in the Item Selector dialog.
      Parameters:
      locale - the current locale
      Returns:
      the localized title of the tab
    • isVisible

      default boolean isVisible(T itemSelectorCriterion, com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
      Returns whether the item selector view is visible.

      Most of the implementations of this method will return true. However, there are certain cases where the view should not be displayed: the view isn't ready, the view needs some additional third-party configuration, etc.

      Parameters:
      itemSelectorCriterion - the item selector criterion that was used to render this view
      themeDisplay - the current page ThemeDisplay
      Returns:
      true if the view is visible
    • isVisible

      @Deprecated default boolean isVisible(com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
      Deprecated.
      As of Athanasius (7.3.x)
      Returns whether the item selector view is visible.

      Most of the implementations of this method will return true. However, there are certain cases where the view should not be displayed: the view isn't ready, the view needs some additional third-party configuration, etc.

      Parameters:
      themeDisplay - the current page ThemeDisplay
      Returns:
      true if the view is visible
    • renderHTML

      void renderHTML(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, T itemSelectorCriterion, javax.portlet.PortletURL portletURL, String itemSelectedEventName, boolean search) throws IOException, javax.servlet.ServletException
      Renders the HTML code for the item selector view.
      Parameters:
      servletRequest - the current ServletRequest
      servletResponse - the current ServletResponse
      itemSelectorCriterion - the item selector criterion that was used to render this view
      portletURL - the portlet render URL to the item selector. This URL should be used to create URLs in the view.
      itemSelectedEventName - the event name that the caller will be listening for. When an element is selected, the view should fire a JavaScript event with this name.
      search - set to true when the view should render search results because the user performed a search.
      Throws:
      IOException
      javax.servlet.ServletException