}
return columnsArray;
}
private JSONObject getColumnParams(FacesContext context, BaseColumn columnOrGroup, int level) throws JSONException {
JSONObject columnObj = new JSONObject();
columnObj.put("columnId", columnOrGroup.getId());
UIComponent styleOwnerComponent = getComponent();
boolean noDataRows = getBody().getNoDataRows();
boolean ordinaryColumn = !(columnOrGroup instanceof ColumnGroup);
String defaultColumnStyleClass = getColumnDefaultClass(columnOrGroup);
String colClassName = Styles.getCSSClass(context,
styleOwnerComponent, columnOrGroup.getStyle(), StyleGroup.regularStyleGroup(level), columnOrGroup.getStyleClass(), defaultColumnStyleClass
);
String resizingWidthClass;
{
AbstractTable table = styleOwnerComponent instanceof AbstractTable ? (AbstractTable) styleOwnerComponent : null;
ColumnResizing columnResizing = (table != null) ? table.getColumnResizing() : null;
ColumnResizingState columnResizingState = columnResizing != null ? columnResizing.getResizingState() : null;
String resizingWidth = columnResizingState != null ? columnResizingState.getColumnWidth(columnOrGroup.getId()) : null;
if (resizingWidth != null) {
resizingWidthClass = Styles.getCSSClass(context, table, "width: " + resizingWidth, StyleGroup.selectedStyleGroup(), null
);
} else
resizingWidthClass = null;
}
columnObj.put("className", Styles.mergeClassNames(colClassName, resizingWidthClass));
appendColumnEventsArray(columnObj,
columnOrGroup.getOnclick(),
columnOrGroup.getOndblclick(),
columnOrGroup.getOnmousedown(),
columnOrGroup.getOnmouseover(),
columnOrGroup.getOnmousemove(),
columnOrGroup.getOnmouseout(),
columnOrGroup.getOnmouseup());
boolean hasCellWrappers = columnOrGroup instanceof TreeColumn;
if (hasCellWrappers)
columnObj.put("hasCellWrappers", hasCellWrappers);
TableHeader tableHeader = getHeader();
CellCoordinates headerCellCoordinates = tableHeader.findCell(columnOrGroup, CellKind.COL_HEADER);
if (headerCellCoordinates != null) {
JSONObject header = new JSONObject();
columnObj.put("header", header);
header.put("pos", headerCellCoordinates.asJSONObject());
header.put("className", Styles.getCSSClass(context, styleOwnerComponent,
columnOrGroup.getHeaderStyle(), columnOrGroup.getHeaderClass()));
appendColumnEventsArray(header,
columnOrGroup.getHeaderOnclick(),
columnOrGroup.getHeaderOndblclick(),
columnOrGroup.getHeaderOnmousedown(),
columnOrGroup.getHeaderOnmouseover(),
columnOrGroup.getHeaderOnmousemove(),
columnOrGroup.getHeaderOnmouseout(),
columnOrGroup.getHeaderOnmouseup());
}
if (ordinaryColumn && tableHeader.hasSubHeader()) {
CellCoordinates subHeaderCellCoordinates = tableHeader.findCell(columnOrGroup, CellKind.COL_SUBHEADER);
if (subHeaderCellCoordinates != null) {
JSONObject subHeader = new JSONObject();
columnObj.put("subHeader", subHeader);
subHeader.put("pos", subHeaderCellCoordinates.asJSONObject());
subHeader.put("className", Styles.getCSSClass(context, styleOwnerComponent, columnOrGroup.getSubHeaderStyle(), columnOrGroup.getSubHeaderClass()));
}
}
if (!noDataRows) {
JSONObject body = new JSONObject();
columnObj.put("body", body);
body.put("className", Styles.getCSSClass(context,
styleOwnerComponent, getColumnBodyStyle(columnOrGroup), StyleGroup.regularStyleGroup(level), getColumnBodyClass(columnOrGroup), null
));
appendColumnEventsArray(body,
columnOrGroup.getBodyOnclick(),
columnOrGroup.getBodyOndblclick(),
columnOrGroup.getBodyOnmousedown(),
columnOrGroup.getBodyOnmouseover(),
columnOrGroup.getBodyOnmousemove(),
columnOrGroup.getBodyOnmouseout(),
columnOrGroup.getBodyOnmouseup());
}
TableFooter tableFooter = getFooter();
CellCoordinates footerCellCoordinates = tableFooter.findCell(columnOrGroup, CellKind.COL_HEADER);
if (footerCellCoordinates != null) {
JSONObject footer = new JSONObject();
columnObj.put("footer", footer);
footer.put("pos", footerCellCoordinates.asJSONObject());
footer.put("className", Styles.getCSSClass(context, styleOwnerComponent, columnOrGroup.getFooterStyle(), columnOrGroup.getFooterClass()));
appendColumnEventsArray(footer,
columnOrGroup.getFooterOnclick(),
columnOrGroup.getFooterOndblclick(),
columnOrGroup.getFooterOnmousedown(),
columnOrGroup.getFooterOnmouseover(),