📄 table.java
字号:
/*
* Copyright 2006-2007 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.ecside.core.bean;
import org.apache.commons.lang.StringUtils;
import org.ecside.core.TableModel;
import org.ecside.preferences.TableProperties;
/**
* @author Wei Zijun
*
*/
public class Table extends BaseBean {
private String action;
private String enctype;
private String insertAction;
private String updateAction;
private String deleteAction;
private String shadowRowAction;
private Boolean batchUpdate;
private Boolean autoIncludeParameters;
private String border;
private Boolean bufferView;
private String cellpadding;
private String cellspacing;
private Boolean filterable;
private String filterRowsCallback;
private String form;
private String imagePath;
private String interceptor;
private Object items;
private String locale;
// private int maxRowsDisplayed;
// private int medianRowsDisplayed;
private String method;
private String onInvokeAction;
private String retrieveRowsCallback;
private int rowsDisplayed;
private Boolean saveFilterSort;
private String scope;
private Boolean showTitle;
private Boolean showTooltips;
private String sortRowsCallback;
private Boolean sortable;
private String state;
private String stateAttr;
private String style;
private String styleClass;
private String tableId;
private String title;
private String theme;
private String var;
private String view;
private String width;
private String height;
private String pageSizeList;
private Boolean resizeColWidth;
private Boolean editable;
private int minColWidth;
private String nearPageNum;
private String includeParameters;
private String excludeParameters;
private String maxRowsExported;
private Boolean scrollList;
private String listWidth;
// private String listHeight;
private String minWidth;
private Boolean showHeader;
private String oddRowBgColor;
private String evenRowBgColor;
protected Boolean classic;
private int totalWidth=0;
private Boolean generateScript;
private Boolean useAjax;
private Boolean doPreload;
private String excludeTool;
private String minHeight;
public Table(TableModel model) {
setModel(model);
}
public void defaults() {
this.tableId = TableDefaults.getTableId(tableId); //must be first
this.generateScript = TableDefaults.isGenerateScript(getModel(), generateScript);
this.useAjax =TableDefaults.isUseAjax(getModel(), useAjax);
this.doPreload = TableDefaults.isDoPreload(getModel(), doPreload);
this.classic=TableDefaults.isClassic(getModel(), classic);
this.autoIncludeParameters = TableDefaults.getAutoIncludeParameters(getModel(), autoIncludeParameters);
this.batchUpdate = TableDefaults.getBatchUpdate(getModel(), batchUpdate);
this.border = TableDefaults.getBorder(getModel(), border);
this.bufferView = TableDefaults.isBufferView(getModel(), bufferView);
this.cellpadding = TableDefaults.getCellpadding(getModel(), cellpadding);
this.cellspacing = TableDefaults.getCellspacing(getModel(), cellspacing);
this.filterable = TableDefaults.isFilterable(getModel(), filterable);
this.filterRowsCallback = TableDefaults.getFilterRowsCallback(getModel(), filterRowsCallback);
// this.imagePath = TableDefaults.getImagePath(getModel(), imagePath);
// this.maxRowsDisplayed = TableDefaults.getMaxRowsDisplayed(getModel());
// this.medianRowsDisplayed = TableDefaults.getMedianRowsDisplayed(getModel());
this.method = TableDefaults.getMethod(getModel(), method);
this.retrieveRowsCallback = TableDefaults.getRetrieveRowsCallback(getModel(), retrieveRowsCallback);
this.rowsDisplayed = TableDefaults.getRowsDisplayed(getModel(), rowsDisplayed);
this.showTitle = TableDefaults.isShowTitle(getModel(), showTitle);
this.showTooltips = TableDefaults.isShowTooltips(getModel(), showTooltips);
this.state = TableDefaults.getState(getModel(), state);
this.stateAttr = TableDefaults.getStateAttr(getModel(), stateAttr);
this.sortable = TableDefaults.isSortable(getModel(), sortable);
this.sortRowsCallback = TableDefaults.getSortRowsCallback(getModel(), sortRowsCallback);
this.styleClass = TableDefaults.getStyleClass(getModel(), styleClass);
this.theme = TableDefaults.getTheme(getModel(), theme);
this.title = TableDefaults.getTitle(getModel(), title);
this.var = TableDefaults.getVar(var, tableId);
this.view = TableDefaults.getView(view);
this.width = TableDefaults.getWidth(getModel(), width);
this.toolbarLocation=TableDefaults.getToolbarLocation(getModel(), toolbarLocation);
this.alwaysShowExtend=TableDefaults.getAlwaysShowExtend(getModel(), alwaysShowExtend);
this.toolbarContent=TableDefaults.getToolbarContent(getModel(), toolbarContent);
this.pageSizeList=TableDefaults.getPageSizeList(getModel(), pageSizeList);
this.resizeColWidth=TableDefaults.getResizeColWidth(getModel(), resizeColWidth);
this.minColWidth=TableDefaults.getMinColWidth(getModel(), minColWidth);
this.nearPageNum=TableDefaults.getNearPageNum(getModel(), nearPageNum);
this.maxRowsExported=TableDefaults.getMaxRowsExported(getModel(), maxRowsExported);
this.editable = TableDefaults.isEditable(getModel(), editable);
this.excludeTool = TableProperties.getDefaultPreference(model, "table.excludeTool", excludeTool);
}
public String getAction() {
return action;
}
public void setAction(String action) {
this.action = action;
}
public boolean isAutoIncludeParameters() {
return autoIncludeParameters.booleanValue();
}
public void setAutoIncludeParameters(Boolean autoIncludeParameters) {
this.autoIncludeParameters = autoIncludeParameters;
}
public String getBorder() {
return border;
}
public void setBorder(String border) {
this.border = border;
}
public boolean isBufferView() {
return bufferView.booleanValue();
}
public void setBufferView(Boolean bufferView) {
this.bufferView = bufferView;
}
public String getCellpadding() {
return cellpadding;
}
public void setCellpadding(String cellpadding) {
this.cellpadding = cellpadding;
}
public String getCellspacing() {
return cellspacing;
}
public void setCellspacing(String cellspacing) {
this.cellspacing = cellspacing;
}
public boolean isFilterable() {
return filterable.booleanValue();
}
public void setFilterable(Boolean filterable) {
this.filterable = filterable;
}
public String getFilterRowsCallback() {
return filterRowsCallback;
}
public void setFilterRowsCallback(String filterRowsCallback) {
this.filterRowsCallback = filterRowsCallback;
}
public String getForm() {
return form;
}
public void setForm(String form) {
this.form = form;
}
public String getImagePath() {
return imagePath;
}
public void setImagePath(String imagePath) {
this.imagePath = imagePath;
}
public String getInterceptor() {
return interceptor;
}
public void setInterceptor(String interceptor) {
this.interceptor = interceptor;
}
public Object getItems() {
return items;
}
public void setItems(Object items) {
this.items = items;
}
public String getLocale() {
return locale;
}
public void setLocale(String locale) {
this.locale = locale;
}
public String getMethod() {
return method;
}
public void setMethod(String method) {
this.method = method;
}
public String getOnInvokeAction() {
return onInvokeAction;
}
public void setOnInvokeAction(String onInvokeAction) {
this.onInvokeAction = onInvokeAction;
}
public String getRetrieveRowsCallback() {
return retrieveRowsCallback;
}
public void setRetrieveRowsCallback(String retrieveRowsCallback) {
this.retrieveRowsCallback = retrieveRowsCallback;
}
public boolean isSaveFilterSort() {
return saveFilterSort.booleanValue();
}
public void setSaveFilterSort(Boolean saveFilterSort) {
this.saveFilterSort = saveFilterSort;
}
public String getScope() {
return scope;
}
public void setScope(String scope) {
this.scope = scope;
}
public boolean isShowTitle() {
return showTitle.booleanValue();
}
public void setShowTitle(Boolean showTitle) {
this.showTitle = showTitle;
}
public boolean isShowTooltips() {
return showTooltips.booleanValue();
}
public void setShowTooltips(Boolean showTooltips) {
this.showTooltips = showTooltips;
}
public boolean isSortable() {
return sortable.booleanValue();
}
public void setSortable(Boolean sortable) {
this.sortable = sortable;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getStateAttr() {
return stateAttr;
}
public void setStateAttr(String stateAttr) {
this.stateAttr = stateAttr;
}
public String getSortRowsCallback() {
return sortRowsCallback;
}
public void setSortRowsCallback(String sortRowsCallback) {
this.sortRowsCallback = sortRowsCallback;
}
public String getStyle() {
return style;
}
public void setStyle(String style) {
this.style = style;
}
public String getStyleClass() {
return styleClass;
}
public void setStyleClass(String styleClass) {
this.styleClass = styleClass;
}
public String getTableId() {
return tableId;
}
public void setTableId(String tableId) {
this.tableId = tableId;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getTheme() {
return theme;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -