%@ include file="imports.jsp"%>
<%@page import="org.openxava.util.XavaPreferences"%>
<%@page import="org.openxava.util.Is"%>
<%@page import="org.openxava.controller.meta.MetaControllers"%>
<%@page import="org.openxava.controller.meta.MetaAction"%>
<%
boolean showImages = style.isShowImageInButtonBarButton();
boolean showIcons = style.isUseIconsInsteadOfImages();
boolean showLabels = !showImages?true:XavaPreferences.getInstance().isShowLabelsForToolBarActions();
String actionName = request.getParameter("action");
String addSpaceWithoutImage = request.getParameter("addSpaceWithoutImage");
boolean addSpace = "true".equals(addSpaceWithoutImage);
if (!Is.emptyString(actionName)) {
MetaAction action = MetaControllers.getMetaAction(request.getParameter("action"));
String argv = request.getParameter("argv");
String label = action.getLabel(request);
%>
<% if (style.isUseStandardImageActionForOnlyImageActionOnButtonBar() && action.hasImage() && Is.emptyString(label)) { %>
<% } else { %>
<%
boolean showLabel = (showLabels || !action.hasImage()) && !Is.emptyString(label);
boolean showImage = showImages && action.hasImage() || action.hasImage() && Is.emptyString(label);
boolean showIcon = action.hasIcon() && (showImages && (showIcons || !action.hasImage()) || Is.emptyString(label) && (showIcons || !action.hasImage()));
%>
<% if (showIcon) { %>
<% } else if (showImage) { %>
<% } else if(addSpace) {%>
<%
}
if (showLabel) { %>
<%=label%>
<% } %>
<% } %>
<%
}
%>