* Converts its state based on table attribute value or create default state if it is not set.
*/
protected void init(UIExtendedDataTable extendedDataTable){
//get state value from components attribute
String value = extendedDataTable.getTableState();
JSONMap stateMap = null;
if ((value != null) && (value.length() > 0)){
try {
stateMap = new JSONMap(value);
} catch (JSONException e) {
e.printStackTrace();
}
}
//initialize columns order part
try{
columnsOrder = ColumnsOrder.getColumnsOrder(extendedDataTable, (stateMap == null ? null : (JSONCollection)stateMap.get("columnsOrder")));
}
catch(Exception e){
columnsOrder = ColumnsOrder.getColumnsOrder(extendedDataTable, (JSONCollection)null);
}
//initialize columns visibility part
try{
columnsVisibility = ColumnsVisibility.getColumnsVisibility(extendedDataTable, (stateMap == null ? null : (JSONMap)stateMap.get("columnsVisibility")));
}
catch(Exception e){
columnsVisibility = ColumnsVisibility.getColumnsVisibility(extendedDataTable, (JSONMap)null);
}
//initialize columns size part
try{
columnsSizeState = ColumnsSizeState.getColumnsSize(extendedDataTable, (stateMap == null ? null : (JSONMap)stateMap.get("columnsSizeState")));
}
catch(Exception e){
columnsSizeState = ColumnsSizeState.getColumnsSize(extendedDataTable, (JSONMap)null);
}
//initialize column grouping part
try{
columnGroupingState = ColumnGroupingState.getColumnGropingState(extendedDataTable, (stateMap == null ? null : (JSONMap)stateMap.get("columnGroupingState")));
}
catch(Exception e){
columnGroupingState = ColumnGroupingState.getColumnGropingState(extendedDataTable, (JSONMap)null);
}
}//init