public interface ItemSelectorView<T extends ItemSelectorCriterion>
If one item selector view can be displayed for multiple different criteria, it needs as many implementations of this interface as criteria.
Modifier and Type | Method and Description |
---|---|
java.lang.Class<T> |
getItemSelectorCriterionClass()
Returns the item selector criterion associated to this item selector
view.
|
java.util.List<ItemSelectorReturnType> |
getSupportedItemSelectorReturnTypes()
Returns the item selector return types that this view supports.
|
java.lang.String |
getTitle(java.util.Locale locale)
Returns the localized title of the tab to display in the Item Selector
dialog.
|
boolean |
isShowSearch()
Returns whether the item selector view should show the search field.
|
boolean |
isVisible(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,
java.lang.String itemSelectedEventName,
boolean search)
Renders the HTML code for the item selector view.
|
java.lang.Class<T> getItemSelectorCriterionClass()
java.util.List<ItemSelectorReturnType> getSupportedItemSelectorReturnTypes()
ItemSelectorReturnType
s that this view supportsjava.lang.String getTitle(java.util.Locale locale)
locale
- the current localeboolean isShowSearch()
true
.true
if the item selector view should show the
search fieldboolean isVisible(com.liferay.portal.kernel.theme.ThemeDisplay themeDisplay)
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.
themeDisplay
- the current page ThemeDisplay
true
if the view is visiblevoid renderHTML(javax.servlet.ServletRequest servletRequest, javax.servlet.ServletResponse servletResponse, T itemSelectorCriterion, javax.portlet.PortletURL portletURL, java.lang.String itemSelectedEventName, boolean search) throws java.io.IOException, javax.servlet.ServletException
servletRequest
- the current ServletRequest
servletResponse
- the current ServletResponse
itemSelectorCriterion
- the item selector criterion that was used to
render this viewportletURL
- 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.java.io.IOException
javax.servlet.ServletException