}
renderer.render("showToolbar", _showToolbar);
}
renderer.render("showFormulabar", _showFormulabar);
Worksheet sheet = this.getSelectedSheet();
if (sheet == null) {
return;
}
if (_showContextMenu) {
renderer.render("showContextMenu", _showContextMenu);
}
if (_clientCacheDisabled) //default: use client cache
renderer.render("clientCacheDisabled", _clientCacheDisabled);
if (_maxRenderedCellSize != DEFAULT_MAX_RENDERED_CELL_SIZE)
renderer.render("maxRenderedCellSize", _maxRenderedCellSize);
//Note: sheetLabels (sheet name, sheet uuid) must before showSheetTabpanel
List<LinkedHashMap<String, String>> sheetLabels = getSheetLabels();
if (sheetLabels != null) {
renderer.render("sheetLabels", sheetLabels);
}
if (_showSheetbar)
renderer.render("showSheetbar", _showSheetbar);
//handle link to new browser tab window; default to link to new tab
if (!getLinkToNewTab()) {
renderer.render("_linkToNewTab", false);
}
//handle AutoFilter
Map afmap = convertAutoFilterToJSON(sheet.getAutoFilter());
if (afmap != null) {
renderer.render("autoFilter", afmap);
} else {
renderer.render("autoFilter", (String) null);
}
int rowHeight = getRowheight();
if (rowHeight != DEFAULT_ROW_HEIGHT) {
renderer.render("rowHeight", getRowheight());
}
renderer.render("columnWidth", getColumnwidth());
if (_hideGridlines) {
renderer.render("displayGridlines", !_hideGridlines);
}
if (_protectSheet)
renderer.render("protect", _protectSheet);
renderer.render("topPanelHeight", isHidecolumnhead() ? 1 : this.getTopheadheight());
renderer.render("leftPanelWidth", isHiderowhead() ? 1 : this.getLeftheadwidth());
if (_cellpadding != DEFAULT_CELL_PADDING)
renderer.render("cellPadding", _cellpadding);
String sheetId = getSelectedSheetId();
String css = getDynamicMediaURI(this, _cssVersion++, "ss_" + this.getUuid() + "_" + sheetId, "css");
renderer.render("loadcss", new JavaScriptValue("zk.loadCSS('" + css + "', '" + this.getUuid() + "-sheet')"));
renderer.render("scss", css);
int maxRows = getMaxrows();
if (maxRows != DEFAULT_MAX_ROWS) {
renderer.render("maxRows", maxRows);
}
int maxCols = getMaxcolumns();
if (maxCols != DEFAULT_MAX_COLUMNS) {
renderer.render("maxColumns", maxCols);
}
int rowFreeze = getRowfreeze();
if (rowFreeze != DEFAULT_ROW_FREEZE) {
renderer.render("rowFreeze", rowFreeze);
}
int colFreeze = getColumnfreeze();
if (colFreeze != DEFAULT_COLUMN_FREEZE) {
renderer.render("columnFreeze", colFreeze);
}
renderer.render("sheetId", getSelectedSheetId());
renderer.render("focusRect", getRectStr(_focusRect));
renderer.render("selectionRect", getRectStr(_selectionRect));
if (_highlightRect != null) {
renderer.render("highLightRect", getRectStr(_highlightRect));
}
// generate customized row & column information
HeaderPositionHelper colHelper = getColumnPositionHelper(sheet);
HeaderPositionHelper rowHelper = getRowPositionHelper(sheet);
renderer.render("csc", getSizeHelperStr(colHelper));
renderer.render("csr", getSizeHelperStr(rowHelper));
// generate merge range information
MergeMatrixHelper mmhelper = getMergeMatrixHelper(sheet);
Iterator iter = mmhelper.getRanges().iterator();
StringBuffer merr = new StringBuffer();
while (iter.hasNext()) {
MergedRect block = (MergedRect) iter.next();
int left = block.getLeft();
int top = block.getTop();
int right = block.getRight();
int bottom = block.getBottom();
int id = block.getId();
merr.append(left).append(",").append(top).append(",").append(right).append(",").append(bottom).append(",").append(id);
if (iter.hasNext()) {
merr.append(";");
}
}
renderer.render("mergeRange", merr.toString());
/**
* Add attr for UI renderer
*/
final SpreadsheetCtrl spreadsheetCtrl = ((SpreadsheetCtrl) this.getExtraCtrl());
int initColSize = getInitColumnSize();
int preloadColSize = getPreloadColumnSize();
int initRowSize = getInitRowSize();
int preloadRowSize = getPreloadRowSize();
renderer.render("activeRange",
spreadsheetCtrl.getRangeAttrs(sheet, SpreadsheetCtrl.Header.BOTH, SpreadsheetCtrl.CellAttribute.ALL, 0, 0,
initColSize , initRowSize));
renderer.render("preloadRowSize", preloadColSize);
renderer.render("preloadColumnSize", preloadRowSize);
renderer.render("initRowSize", initRowSize);
renderer.render("initColumnSize", initColSize);
renderer.render("columnHeadHidden", _hideColhead);
renderer.render("rowHeadHidden", _hideRowhead);
//handle Validation, must after render("activeRange" ...)
List<Map> dvs = convertDataValidationToJSON(sheet.getDataValidations());
if (dvs != null) {
renderer.render("dataValidations", dvs);
} else {
renderer.render("dataValidations", (String) null);
}