📄 htmlformrenderer.java
字号:
buffer.append(" class=\""); buffer.append(areaStyle); buffer.append("\""); } buffer.append(">"); this.appendWhitespace(buffer); } /* (non-Javadoc) * @see org.ofbiz.widget.form.FormStringRenderer#renderFormatItemRowFormCellClose(java.lang.StringBuffer, java.util.Map, org.ofbiz.widget.form.ModelForm) */ public void renderFormatItemRowFormCellClose(StringBuffer buffer, Map context, ModelForm modelForm) { buffer.append("</td>"); this.appendWhitespace(buffer); } public void renderFormatSingleWrapperOpen(StringBuffer buffer, Map context, ModelForm modelForm) { buffer.append("<table border=\"0\" cellpadding=\"2\" cellspacing=\"0\">"); this.appendWhitespace(buffer); } public void renderFormatSingleWrapperClose(StringBuffer buffer, Map context, ModelForm modelForm) { buffer.append("</table>"); this.appendWhitespace(buffer); } /* (non-Javadoc) * @see org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowOpen(java.lang.StringBuffer, java.util.Map, org.ofbiz.widget.form.ModelForm) */ public void renderFormatFieldRowOpen(StringBuffer buffer, Map context, ModelForm modelForm) { buffer.append("<tr>"); this.appendWhitespace(buffer); } /* (non-Javadoc) * @see org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowClose(java.lang.StringBuffer, java.util.Map, org.ofbiz.widget.form.ModelForm) */ public void renderFormatFieldRowClose(StringBuffer buffer, Map context, ModelForm modelForm) { buffer.append("</tr>"); this.appendWhitespace(buffer); } /* (non-Javadoc) * @see org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCellOpen(java.lang.StringBuffer, java.util.Map, org.ofbiz.widget.form.ModelFormField) */ public void renderFormatFieldRowTitleCellOpen(StringBuffer buffer, Map context, ModelFormField modelFormField) { buffer.append("<td width=\"20%\" align=\"right\""); String areaStyle = modelFormField.getTitleAreaStyle(); if (UtilValidate.isNotEmpty(areaStyle)) { buffer.append(" class=\""); buffer.append(areaStyle); buffer.append("\""); } buffer.append(">"); this.appendWhitespace(buffer); } /* (non-Javadoc) * @see org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowTitleCellClose(java.lang.StringBuffer, java.util.Map, org.ofbiz.widget.form.ModelFormField) */ public void renderFormatFieldRowTitleCellClose(StringBuffer buffer, Map context, ModelFormField modelFormField) { buffer.append("</td>"); this.appendWhitespace(buffer); } /* (non-Javadoc) * @see org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowSpacerCell(java.lang.StringBuffer, java.util.Map, org.ofbiz.widget.form.ModelFormField) */ public void renderFormatFieldRowSpacerCell(StringBuffer buffer, Map context, ModelFormField modelFormField) { buffer.append("<td> </td>"); this.appendWhitespace(buffer); } /* (non-Javadoc) * @see org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowWidgetCellOpen(java.lang.StringBuffer, java.util.Map, org.ofbiz.widget.form.ModelFormField, int) */ public void renderFormatFieldRowWidgetCellOpen(StringBuffer buffer, Map context, ModelFormField modelFormField, int positions, int positionSpan, Integer nextPositionInRow) { buffer.append("<td width=\""); if (nextPositionInRow != null || modelFormField.getPosition() > 1) { buffer.append("30"); } else { buffer.append("80"); } buffer.append("%\" align=\"left\""); if (positionSpan > 0) { buffer.append(" colspan=\""); // do a span of 1 for this column, plus 3 columns for each spanned //position or each blank position that this will be filling in buffer.append(1 + (positionSpan * 3)); buffer.append("\""); } String areaStyle = modelFormField.getWidgetAreaStyle(); if (UtilValidate.isNotEmpty(areaStyle)) { buffer.append(" class=\""); buffer.append(areaStyle); buffer.append("\""); } buffer.append(">"); this.appendWhitespace(buffer); } /* (non-Javadoc) * @see org.ofbiz.widget.form.FormStringRenderer#renderFormatFieldRowWidgetCellClose(java.lang.StringBuffer, java.util.Map, org.ofbiz.widget.form.ModelFormField, int) */ public void renderFormatFieldRowWidgetCellClose(StringBuffer buffer, Map context, ModelFormField modelFormField, int positions, int positionSpan, Integer nextPositionInRow) { buffer.append("</td>"); this.appendWhitespace(buffer); } public void renderFormatEmptySpace(StringBuffer buffer, Map context, ModelForm modelForm) { buffer.append(" "); } /* (non-Javadoc) * @see org.ofbiz.widget.form.FormStringRenderer#renderTextFindField(java.lang.StringBuffer, java.util.Map, org.ofbiz.widget.form.ModelFormField.TextFindField) */ public void renderTextFindField(StringBuffer buffer, Map context, TextFindField textFindField) { ModelFormField modelFormField = textFindField.getModelFormField(); Locale locale = (Locale)context.get("locale"); String opEquals = UtilProperties.getMessage("conditional", "equals", locale); String opBeginsWith = UtilProperties.getMessage("conditional", "begins_with", locale); String opContains = UtilProperties.getMessage("conditional", "contains", locale); String opIsEmpty = UtilProperties.getMessage("conditional", "is_empty", locale); String ignoreCase = UtilProperties.getMessage("conditional", "ignore_case", locale); String defaultOption = textFindField.getDefaultOption(); boolean ignCase = textFindField.getIgnoreCase(); buffer.append(" <select name=\""); buffer.append(modelFormField.getParameterName(context)); buffer.append("_op\" class=\"selectBox\">"); buffer.append("<option value=\"equals\"" + ("equals".equals(defaultOption)? " selected": "") + ">" + opEquals + "</option>"); buffer.append("<option value=\"like\"" + ("like".equals(defaultOption)? " selected": "") + ">" + opBeginsWith + "</option>"); buffer.append("<option value=\"contains\"" + ("contains".equals(defaultOption)? " selected": "") + ">" + opContains + "</option>"); buffer.append("<option value=\"empty\"" + ("empty".equals(defaultOption)? " selected": "") + ">" + opIsEmpty + "</option>"); buffer.append("</select>"); buffer.append("<input type=\"text\""); String className = modelFormField.getWidgetStyle(); if (UtilValidate.isNotEmpty(className)) { buffer.append(" class=\""); buffer.append(className); buffer.append('"'); } // add a style of red if this is a date/time field and redWhen is true if (modelFormField.shouldBeRed(context)) { buffer.append(" style=\"color: red;\""); } buffer.append(" name=\""); buffer.append(modelFormField.getParameterName(context)); buffer.append('"'); String value = modelFormField.getEntry(context, textFindField.getDefaultValue(context)); if (UtilValidate.isNotEmpty(value)) { buffer.append(" value=\""); buffer.append(value); buffer.append('"'); } buffer.append(" size=\""); buffer.append(textFindField.getSize()); buffer.append('"'); Integer maxlength = textFindField.getMaxlength(); if (maxlength != null) { buffer.append(" maxlength=\""); buffer.append(maxlength.intValue()); buffer.append('"'); } buffer.append("/>"); buffer.append(" <span"); if (UtilValidate.isNotEmpty(modelFormField.getTitleStyle())) { buffer.append(" class=\""); buffer.append(modelFormField.getTitleStyle()); buffer.append('"'); } buffer.append('>'); buffer.append(" <input type=\"checkbox\" name=\""); buffer.append(modelFormField.getParameterName(context)); buffer.append("_ic\" value=\"Y\"" + (ignCase ? " checked=\"checked\"" : "") + "/>"); buffer.append(ignoreCase); buffer.append("</span>"); this.appendTooltip(buffer, context, modelFormField); this.appendWhitespace(buffer); } /* (non-Javadoc) * @see org.ofbiz.widget.form.FormStringRenderer#renderRangeFindField(java.lang.StringBuffer, java.util.Map, org.ofbiz.widget.form.ModelFormField.RangeFindField) */ public void renderRangeFindField(StringBuffer buffer, Map context, RangeFindField rangeFindField) { ModelFormField modelFormField = rangeFindField.getModelFormField(); Locale locale = (Locale)context.get("locale"); String opEquals = UtilProperties.getMessage("conditional", "equals", locale); String opGreaterThan = UtilProperties.getMessage("conditional", "greater_than", locale); String opGreaterThanEquals = UtilProperties.getMessage("conditional", "greater_than_equals", locale); String opLessThan = UtilProperties.getMessage("conditional", "less_than", locale); String opLessThanEquals = UtilProperties.getMessage("conditional", "less_than_equals", locale); //String opIsEmpty = UtilProperties.getMessage("conditional", "is_empty", locale); buffer.append("<input type=\"text\""); String className = modelFormField.getWidgetStyle(); if (UtilValidate.isNotEmpty(className)) { buffer.append(" class=\""); buffer.append(className); buffer.append('"'); } // add a style of red if this is a date/time field and redWhen is true if (modelFormField.shouldBeRed(context)) { buffer.append(" style=\"color: red;\""); } buffer.append(" name=\""); buffer.append(modelFormField.getParameterName(context)); buffer.append("_fld0_value\""); String value = modelFormField.getEntry(context, rangeFindField.getDefaultValue(context)); if (UtilValidate.isNotEmpty(value)) { buffer.append(" value=\""); buffer.append(value); buffer.append('"'); } buffer.append(" size=\""); buffer.append(rangeFindField.getSize()); buffer.append('"'); Integer maxlength = rangeFindField.getMaxlength(); if (maxlength != null) { buffer.append(" maxlength=\""); buffer.append(maxlength.intValue()); buffer.append('"'); } buffer.append("/>"); buffer.append(" <span"); if (UtilValidate.isNotEmpty(modelFormField.getTitleStyle())) { buffer.append(" class=\""); buffer.append(modelFormField.getTitleStyle()); buffer.append('"'); } buffer.append('>'); buffer.append(" <select name=\""); buffer.append(modelFormField.getParameterName(context)); buffer.append("_fld0_op\" class=\"selectBox\">"); buffer.append("<option value=\"equals\" selected>" + opEquals + "</option>"); buffer.append("<option value=\"greaterThan\">" + opGreaterThan + "</option>"); buffer.append("<option value=\"greaterThanEqualTo\">" + opGreaterThanEquals + "</option>"); buffer.append("</select>"); buffer.append("</span>"); buffer.append(" <br/> "); buffer.append("<input type=\"text\""); className = modelFormField.getWidgetStyle(); if (UtilValidate.isNotEmpty(className)) { buffer.append(" class=\""); buffer.append(className); buffer.append('"'); } // add a style of red if this is a date/time field and redWhen is true if (modelFormField.shouldBeRed(context)) { buffer.append(" style=\"color: red;\""); } buffer.append(" name=\""); buffer.append(modelFormField.getParameterName(context)); buffer.append("_fld1_value\""); value = modelFormField.getEntry(context); if (UtilValidate.isNotEmpty(value)) { buffer.append(" value=\""); buffer.append(value); buffer.append('"'); } buffer.append(" size=\""); buffer.append(rangeFindField.getSize()); buffer.append('"'); if (maxlength != null) { buffer.append(" maxlength=\""); buffer.append(maxlength.intValue()); buffer.append('"'); } buffer.append("/>"); buffer.append(" <span"); if (UtilValidate.isNotEmpty(modelFormField.getTitleStyle())) { buffer.append(" class=\""); buffer.append(modelFormField.getTitleStyl
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -