ItemSelectorViewDescriptorRendererDisplayContext { public String getDisplayStyle() { if (_displayStyle != null) { return _displayStyle; } _displayStyle = ParamUtil.getString( _httpServletRequest, "displayStyle", _itemSelectorViewDescriptor.getDefaultDisplayStyle()); return _displayStyle; } ItemSelectorViewDescriptorRendererDisplayContext(
		HttpServletRequest httpServletRequest, String itemSelectedEventName,
		ItemSelectorViewDescriptor<Object> itemSelectorViewDescriptor,
		LiferayPortletRequest liferayPortletRequest,
		LiferayPortletResponse liferayPortletResponse); List<BreadcrumbEntry> getBreadcrumbEntries(PortletURL currentURL); String getDisplayStyle(); String getItemSelectedEventName(); ItemSelectorViewDescriptor<Object> getItemSelectorViewDescriptor(); String getReturnType(); SearchContainer<Object> getSearchContainer(); boolean isIconDisplayStyle(); boolean isMultipleSelection();  }
@Test public void testGetDisplayStyle() { ItemSelectorViewDescriptorRendererDisplayContext itemSelectorViewDescriptorRendererDisplayContext = new ItemSelectorViewDescriptorRendererDisplayContext( new MockHttpServletRequest(), null, new ItemSelectorViewDescriptor<Object>() { @Override public ItemDescriptor getItemDescriptor(Object object) { return null; } @Override public ItemSelectorReturnType getItemSelectorReturnType() { return null; } @Override public SearchContainer<Object> getSearchContainer() { return null; } }, null, null); Assert.assertEquals( "icon", itemSelectorViewDescriptorRendererDisplayContext.getDisplayStyle()); }
@Test public void testGetDisplayStyleWithDefaultDisplayStyle() { MockHttpServletRequest mockHttpServletRequest = new MockHttpServletRequest(); mockHttpServletRequest.setParameter("displayStyle", "descriptive"); ItemSelectorViewDescriptorRendererDisplayContext itemSelectorViewDescriptorRendererDisplayContext = new ItemSelectorViewDescriptorRendererDisplayContext( mockHttpServletRequest, null, new ItemSelectorViewDescriptor<Object>() { @Override public String getDefaultDisplayStyle() { return "descriptive"; } @Override public ItemDescriptor getItemDescriptor(Object object) { return null; } @Override public ItemSelectorReturnType getItemSelectorReturnType() { return null; } @Override public SearchContainer<Object> getSearchContainer() { return null; } }, null, null); Assert.assertEquals( "descriptive", itemSelectorViewDescriptorRendererDisplayContext.getDisplayStyle()); }
@Test public void testGetDisplayStyleWithDisplayStyleParameter() { MockHttpServletRequest mockHttpServletRequest = new MockHttpServletRequest(); mockHttpServletRequest.setParameter("displayStyle", "descriptive"); ItemSelectorViewDescriptorRendererDisplayContext itemSelectorViewDescriptorRendererDisplayContext = new ItemSelectorViewDescriptorRendererDisplayContext( mockHttpServletRequest, null, new ItemSelectorViewDescriptor<Object>() { @Override public ItemDescriptor getItemDescriptor(Object object) { return null; } @Override public ItemSelectorReturnType getItemSelectorReturnType() { return null; } @Override public SearchContainer<Object> getSearchContainer() { return null; } }, null, null); Assert.assertEquals( "descriptive", itemSelectorViewDescriptorRendererDisplayContext.getDisplayStyle()); }