📄 columntag.java
字号:
* the correct cell can be resolved. For instance, a date * needs to be parsed in the specific format, such as * MM-dd-yyyy." required="false" rtexprvalue="true" */ public String getParse() { String parse = TagUtils.evaluateExpressionAsString("parse", this.parse, this, pageContext); return ColumnTagUtils.getParse(TagUtils.getModel(this), parse, getCell()); } public void setParse(String parse) { this.parse = parse; } /** * @jsp.attribute description="Specify whether or not the column should be * filterable. Acceptable values are true or false." * required="false" rtexprvalue="true" */ public String getFilterable() { String filterable = TagUtils.evaluateExpressionAsString("filterable", this.filterable, this, pageContext); return ColumnTagUtils.getFilterable(TagUtils.getModel(this), filterable); } public void setFilterable(String filterable) { this.filterable = filterable; } /** * @jsp.attribute description="Specify whether or not the column should be * sortable. The acceptable values are true or false." * required="false" rtexprvalue="true" */ public String getSortable() { String sortable = TagUtils.evaluateExpressionAsString("sortable", this.sortable, this, pageContext); return ColumnTagUtils.getSortable(TagUtils.getModel(this), sortable); } public void setSortable(String sortable) { this.sortable = sortable; } /** * @jsp.attribute description="Specify the column width." required="false" * rtexprvalue="true" */ public String getWidth() { String width = TagUtils.evaluateExpressionAsString("width", this.width, this, pageContext); return ColumnTagUtils.getWidth(TagUtils.getModel(this), width); } public void setWidth(String width) { this.width = width; } /** * @jsp.attribute description="The css inline style sheet." required="false" * rtexprvalue="true" */ public String getStyle() { String style = TagUtils.evaluateExpressionAsString("style", this.style, this, pageContext); return ColumnTagUtils.getStyle(TagUtils.getModel(this), style); } public void setStyle(String style) { this.style = style; } /** * @jsp.attribute description="Specify whether or not the total for the * column should be displayed. The acceptable values are true * or false." required="false" rtexprvalue="true" */ public String getShowTotal() { String showTotal = TagUtils.evaluateExpressionAsString("showTotal", this.showTotal, this, pageContext); return ColumnTagUtils.getShowTotal(TagUtils.getModel(this), showTotal); } public void setShowTotal(String showTotal) { this.showTotal = showTotal; } /** * @jsp.attribute description="The comma separated list of Views that this * column will be used in." required="false" * rtexprvalue="true" */ public String getViewsAllowed() { String viewsToAllow = TagUtils.evaluateExpressionAsString("viewsToAllow", this.viewsAllowed, this, pageContext); return ColumnTagUtils.getViewsAllowed(TagUtils.getModel(this), viewsToAllow); } public void setViewsAllowed(String viewsAllowed) { this.viewsAllowed = viewsAllowed; } /** * @jsp.attribute description="The comma separated list of Views that this * column will be used in." required="false" * rtexprvalue="true" */ public String getViewsDenied() { String viewsToDeny = TagUtils.evaluateExpressionAsString("viewsToDeny", this.viewsDenied, this, pageContext); return ColumnTagUtils.getViewsDenied(TagUtils.getModel(this), viewsToDeny); } public void setViewsDenied(String viewsDenied) { this.viewsDenied = viewsDenied; } /** * Get the value for the column. First look to see if it displayed in the * body of the column. If it is not in the body, then use the value * attribute. If the value attribute is not specified then use the property * attribute to find the value in the bean. Note: Weblogic will always * return a bodyContent so do additional checking. */ protected Object getColumnValue(Object propertyValue) throws JspException { Object result = value; if (result == null && bodyContent != null) { result = getBodyContent().getString(); } if (result != null) { result = ExpressionEvaluatorManager.evaluate("result", result.toString(), Object.class, this, pageContext); } if (result == null || (result != null && result instanceof String && StringUtils.isBlank(result.toString()))) { result = propertyValue; } return result; } protected Object getColumnPropertyValue() throws JspException { Object result = null; try { Object bean = TagUtils.getModel(this).getCurrentCollectionBean(); if (ExtremeUtils.isBeanPropertyReadable(bean, getProperty())) { result = PropertyUtils.getProperty(bean, getProperty()); } } catch (Exception e) { String collection = TagUtils.getModel(this).getTableHandler().getTable().getTableId(); String message = "Could not find the property " + getProperty() + " in " + collection; logger.error(message); throw new JspException(message); } return result; } public int doStartTag() throws JspException { if (!TagUtils.isIteratingBody(this)) { return SKIP_BODY; } return EVAL_BODY_BUFFERED; } /** * Must make a copy of the column because this tag may be reused. Send the * copy up to the Model. */ public int doEndTag() throws JspException { if (TagUtils.isIteratingBody(this)) { Object propertyValue = getColumnPropertyValue(); TagUtils.getModel(this).getViewHandler().addColumnValue(getProperty(), getColumnValue(propertyValue), propertyValue); } else { Column column = new Column(); column.addAttribute(Column.PROPERTY, getProperty()); column.addAttribute(Column.CELL, getCell()); column.addAttribute(Column.TITLE, getTitle()); column.addAttribute(Column.STYLE_CLASS, getStyleClass()); column.addAttribute(Column.STYLE, getStyle()); column.addAttribute(Column.HEADER_CLASS, getHeaderClass()); column.addAttribute(Column.HEADER_STYLE, getHeaderStyle()); column.addAttribute(Column.FILTER_CLASS, getFilterClass()); column.addAttribute(Column.FILTER_STYLE, getFilterStyle()); column.addAttribute(Column.FILTER_CELL, getFilterCell()); column.addAttribute(Column.HEADER_CELL, getHeaderCell()); column.addAttribute(Column.FORMAT, getFormat()); column.addAttribute(Column.PARSE, getParse()); column.addAttribute(Column.SORTABLE, getSortable()); column.addAttribute(Column.FILTERABLE, getFilterable()); column.addAttribute(Column.WIDTH, getWidth()); column.addAttribute(Column.VIEWS_ALLOWED, getViewsAllowed()); column.addAttribute(Column.VIEWS_DENIED, getViewsDenied()); column.addAttribute(Column.SHOW_TOTAL, getShowTotal()); addExtendedAttributes(column); TagUtils.getModel(this).getColumnHandler().addColumn(column); } if (bodyContent != null) { bodyContent.clearBody(); } return EVAL_PAGE; } public void addExtendedAttributes(Attributes attributes) throws JspException { } public void release() { property = null; value = null; title = null; styleClass = null; headerClass = null; headerStyle = null; filterClass = null; filterStyle = null; cell = null; filterCell = null; headerCell = null; format = null; parse = null; width = null; style = null; showTotal = null; filterable = null; sortable = null; viewsAllowed = null; viewsDenied = null; super.release(); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -