📄 basecell.java
字号:
/* * Copyright original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */package org.extremecomponents.table.cell;import org.apache.commons.lang.StringUtils;import org.extremecomponents.table.bean.Column;import org.extremecomponents.table.core.BaseModel;import org.extremecomponents.util.HtmlBuilder;/** * Some of the common things that a cell needs to do. Most of the time this * class should be extended for convenience * * @author Jeff Johnston */public abstract class BaseCell implements Cell { protected BaseModel model; protected Column column; public BaseCell() { } /** * Set the Model, Column and current rowcount. */ public void init(BaseModel model, Column column) { this.model = model; this.column = column; } /** * Destroy the objects set up in the init() method. */ public void destroy() { this.model = null; this.column = null; } /** * Get the HTML for the td * <td>tag. If the style is defined then it will try to use that first. If * no style is defined then will use the alternating even and odd styles. */ public String startTD() { HtmlBuilder html = new HtmlBuilder(); html.td(2); if (StringUtils.isNotEmpty(column.getStyleClass())) { html.styleClass(column.getStyleClass()); } if (StringUtils.isNotEmpty(column.getStyle())) { html.style(column.getStyle()); } if (StringUtils.isNotEmpty(column.getWidth())) { html.width(column.getWidth()); } html.close(); return html.toString(); } /** * Get the HTML for the end td</td> * tag. */ public String endTD() { return new HtmlBuilder().tdEnd().toString(); } /** * Get the cell specific HTML */ public abstract String html();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -