⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 htmlformrenderer.java

📁 国外的一套开源CRM
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
        buffer.append("<td>&nbsp;</td>");

        this.appendWhitespace(buffer);
    }

    /* (non-Javadoc)
     * @see org.ofbiz.content.widget.form.FormStringRenderer#renderFormatFieldRowWidgetCellOpen(java.lang.StringBuffer, java.util.Map, org.ofbiz.content.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("\"");
        }
        buffer.append(">");

        this.appendWhitespace(buffer);
    }

    /* (non-Javadoc)
     * @see org.ofbiz.content.widget.form.FormStringRenderer#renderFormatFieldRowWidgetCellClose(java.lang.StringBuffer, java.util.Map, org.ofbiz.content.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("&nbsp;");
    }

    /* (non-Javadoc)
     * @see org.ofbiz.content.widget.form.FormStringRenderer#renderTextFindField(java.lang.StringBuffer, java.util.Map, org.ofbiz.content.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);

        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);
        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(" " + opEquals + " <input type=\"radio\" name=\"");
        buffer.append(modelFormField.getParameterName(context));
        buffer.append("_op\" value=\"equals\" checked/>");

        buffer.append(" " + opBeginsWith + " <input type=\"radio\" name=\"");
        buffer.append(modelFormField.getParameterName(context));
        buffer.append("_op\" value=\"like\"/>");

        buffer.append(" " + opContains + " <input type=\"radio\" name=\"");
        buffer.append(modelFormField.getParameterName(context));
        buffer.append("_op\" value=\"contains\"/>");

        buffer.append(" " + opIsEmpty + " <input type=\"radio\" name=\"");
        buffer.append(modelFormField.getParameterName(context));
        buffer.append("_op\" value=\"empty\"/>");
        buffer.append("</span>");

        this.appendTooltip(buffer, context, modelFormField);

        this.appendWhitespace(buffer);
    }

    /* (non-Javadoc)
     * @see org.ofbiz.content.widget.form.FormStringRenderer#renderRangeFindField(java.lang.StringBuffer, java.util.Map, org.ofbiz.content.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);
        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(" " + opEquals + " <input type=\"radio\" name=\"");
        buffer.append(modelFormField.getParameterName(context));
        buffer.append("_fld0_op\" value=\"equals\" checked/>");

        buffer.append(" " + opGreaterThan + " <input type=\"radio\" name=\"");
        buffer.append(modelFormField.getParameterName(context));
        buffer.append("_fld0_op\" value=\"greaterThan\"/>");

        buffer.append(" " + opGreaterThanEquals + " <input type=\"radio\" name=\"");
        buffer.append(modelFormField.getParameterName(context));
        buffer.append("_fld0_op\" value=\"greaterThanEqualTo\"/>");

        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.getTitleStyle());
            buffer.append('"');
        }
        buffer.append('>');

        buffer.append(" " + opLessThan+ " <input type=\"radio\" name=\"");
        buffer.append(modelFormField.getParameterName(context));
        buffer.append("_fld1_op\" value=\"lessThan\"/>");

        buffer.append(" " + opLessThanEquals + " <input type=\"radio\" name=\"");
        buffer.append(" Less than equals<input type=\"radio\" name=\"");
        buffer.append(modelFormField.getParameterName(context));
        buffer.append("_fld1_op\" value=\"lessThanEqualTo\"/>");

        buffer.append(" " + opIsEmpty+ " <input type=\"radio\" name=\"");
        buffer.append(" Is Empty<input type=\"radio\" name=\"");
        buffer.append(modelFormField.getParameterName(context));
        buffer.append("_op\" value=\"empty\"/>");

        buffer.append("</span>");

        this.appendTooltip(buffer, context, modelFormField);

        this.appendWhitespace(buffer);
    }

    /* (non-Javadoc)
     * @see org.ofbiz.content.widget.form.FormStringRenderer#renderDateFindField(java.lang.StringBuffer, java.util.Map, org.ofbiz.content.widget.form.ModelFormField.DateFindField)
     */
    public void renderDateFindField(StringBuffer buffer, Map context, DateFindField dateFindField) {
        ModelFormField modelFormField = dateFindField.getModelFormField();

        Locale locale = (Locale)context.get("locale");
        String opEquals = UtilProperties.getMessage("conditional", "equals", locale);
        String opGreaterThan = UtilProperties.getMessage("conditional", "greater_than", locale);
        String opSameDay = UtilProperties.getMessage("conditional", "same_day", locale);
        String opGreaterThanFromDayStart = UtilProperties.getMessage("conditional", 
                                                "greater_than_from_day_start", locale);
        String opLessThan = UtilProperties.getMessage("conditional", "less_than", locale);
        String opUpToDay = UtilProperties.getMessage("conditional", "up_to_day", locale);
        String opUpThruDay = UtilProperties.getMessage("conditional", "up_thru_day", 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);
        if (UtilValidate.isNotEmpty(value)) {
            buffer.append(" value=\"");
            buffer.append(value);
            buffer.append('"');
        }

        // the default values for a timestamp
        int size = 25;
        int maxlength = 30;

        buffer.append(" size=\"");
        buffer.append(size);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -