use of jxl.write.WritableCellFormat in project cubrid-manager by CUBRID.
the class ExportErrorDataProgress method getTitleCell.
/**
* getNormalCell
* @return WritableCellFormat
*/
public static WritableCellFormat getTitleCell() {
WritableFont font = new WritableFont(WritableFont.TIMES, 12);
WritableCellFormat format = new WritableCellFormat(font);
try {
format.setAlignment(jxl.format.Alignment.CENTRE);
format.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);
format.setBorder(Border.ALL, BorderLineStyle.THIN, Colour.BLACK);
format.setWrap(true);
} catch (WriteException e) {
LOGGER.error("", e);
}
return format;
}
use of jxl.write.WritableCellFormat in project cubrid-manager by CUBRID.
the class ExportErrorDataProgress method getNormalCell.
/**
* getNormalCell
* @return WritableCellFormat
*/
public static WritableCellFormat getNormalCell() {
// FIXME logic code move to core module
WritableFont font = new WritableFont(WritableFont.TIMES, 12);
WritableCellFormat format = new WritableCellFormat(font);
try {
format.setAlignment(jxl.format.Alignment.LEFT);
format.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);
format.setBorder(Border.ALL, BorderLineStyle.THIN, Colour.BLACK);
format.setWrap(true);
} catch (WriteException e) {
LOGGER.error("", e);
}
return format;
}
use of jxl.write.WritableCellFormat in project cubrid-manager by CUBRID.
the class RunSQLProcessManager method getNormalCell.
/**
* getNormalCell
* @return WritableCellFormat
*/
public static WritableCellFormat getNormalCell() {
// FIXME logic code move to core module
WritableFont font = new WritableFont(WritableFont.TIMES, 12);
WritableCellFormat format = new WritableCellFormat(font);
try {
format.setAlignment(jxl.format.Alignment.CENTRE);
format.setVerticalAlignment(jxl.format.VerticalAlignment.CENTRE);
format.setBorder(Border.ALL, BorderLineStyle.THIN, Colour.BLACK);
format.setWrap(true);
} catch (WriteException e) {
LOGGER.error(e.getMessage(), e);
}
return format;
}
use of jxl.write.WritableCellFormat in project cubrid-manager by CUBRID.
the class ExportHostStatusDialog method saveTableData.
private void saveTableData(String columnName, String content, String sheetName, int sheetIndex) throws RowsExceededException, WriteException {
WritableCellFormat normalCellStyle = getNormalCell();
WritableSheet ws = wwb.createSheet(sheetName, sheetIndex);
ws.addCell(new jxl.write.Label(0, 0, columnName, normalCellStyle));
ws.setColumnView(0, 30);
ws.addCell(new jxl.write.Label(0, 1, content, normalCellStyle));
}
use of jxl.write.WritableCellFormat in project cubrid-manager by CUBRID.
the class ExportHostStatusDialog method saveTableData.
private void saveTableData(Table table, String sheetName, int sheetIndex) throws RowsExceededException, WriteException {
WritableCellFormat normalCellStyle = getNormalCell();
WritableSheet ws = wwb.createSheet(sheetName, sheetIndex);
int rowIndex = 0;
//title
for (int j = 0; j < table.getColumnCount(); j++) {
String cellString = table.getColumn(j).getText();
ws.addCell(new jxl.write.Label(j, rowIndex, cellString, normalCellStyle));
ws.setColumnView(j, 30);
}
rowIndex++;
//row
for (int j = 0; j < table.getItemCount(); j++) {
TableItem tableItem = table.getItem(j);
for (int k = 0; k < table.getColumnCount(); k++) {
String cellString = tableItem.getText(k);
ws.addCell(new jxl.write.Label(k, rowIndex, cellString, normalCellStyle));
}
rowIndex++;
}
}
Aggregations