use of com.liferay.ide.portlet.core.model.PortletMode in project liferay-ide by liferay.
the class PortletModeImageService method compute.
@Override
protected ImageData compute() {
String portletMode = null;
Element element = context(Element.class);
ImageData imageData = null;
if (element instanceof CustomPortletMode) {
CustomPortletMode iCustomPortletMode = (CustomPortletMode) element;
portletMode = String.valueOf(iCustomPortletMode.getPortletMode().content());
} else if (element instanceof PortletMode) {
PortletMode iPortletMode = (PortletMode) element;
portletMode = iPortletMode.getPortletMode().content();
}
if (portletMode != null) {
if ("VIEW".equalsIgnoreCase(portletMode)) {
imageData = IMG_VIEW;
} else if ("EDIT".equalsIgnoreCase(portletMode)) {
imageData = IMG_EDIT;
} else if ("HELP".equalsIgnoreCase(portletMode)) {
imageData = IMG_HELP;
}
}
if (imageData == null) {
imageData = IMG_DEFAULT;
}
return imageData;
}
Aggregations