001
014
015 package com.liferay.taglib.portletext;
016
017 import com.liferay.portal.theme.PortletDisplay;
018 import com.liferay.taglib.FileAvailabilityUtil;
019 import com.liferay.taglib.ui.IconTag;
020
021
025 public class IconPortletCssTag extends IconTag {
026
027 @Override
028 protected String getPage() {
029 if (FileAvailabilityUtil.isAvailable(servletContext, _PAGE)) {
030 return _PAGE;
031 }
032
033 PortletDisplay portletDisplay =
034 (PortletDisplay)pageContext.getAttribute("portletDisplay");
035
036 if (!portletDisplay.isShowPortletCssIcon()) {
037 return null;
038 }
039
040 setCssClass("portlet-css portlet-css-icon lfr-js-required");
041 setImage("../aui/picture");
042 setMessage("look-and-feel");
043
044 String onClick = "Liferay.Portlet.loadCSSEditor('".concat(
045 portletDisplay.getId()).concat("'); return false;");
046
047 setOnClick(onClick);
048
049 setToolTip(false);
050 setUrl(portletDisplay.getURLPortletCss());
051
052 return super.getPage();
053 }
054
055 private static final String _PAGE =
056 "/html/taglib/portlet/icon_portlet_css/page.jsp";
057
058 }