boolean isOk = (result.getStatus() == TestStatus.TR_OK); if (isOk) { formattedValue.append("<i class=\"case-success\"></i> ").append(XlsDataFormatterFactory.getFormattedValue(cell, cell.getMetaInfo())); } else {
IFormatter cellDataFormatter = getFormatter(cell, meta); cellDataFormatter = getDateFormatter(cell);
IFormatter numberFormatter = getNumberFormatter(cell); formatter = getDateFormatter(cell);
private IFormatter getCellFormatter(String cellEditor, TableEditorModel editorModel, int row, int col) { IFormatter formatter = null; if (ICellEditor.CE_FORMULA.equals(cellEditor)) { ICell cell = editorModel.getOriginalGridTable().getCell(col, row); CellMetaInfo meta = getMetaInfo(editorModel, row, col); IFormatter currentFormatter = XlsDataFormatterFactory.getFormatter(cell, meta); IFormatter formulaResultFormatter = null; if (!(currentFormatter instanceof FormulaFormatter)) { formulaResultFormatter = currentFormatter; } formatter = new FormulaFormatter(formulaResultFormatter); } else if (ICellEditor.CE_TEXT.equals(cellEditor) || ICellEditor.CE_MULTILINE.equals(cellEditor)) { formatter = new DefaultFormatter(); } else if (cellEditor == null) { // Format must be same as in DateEditor.js ICell cell = editorModel.getOriginalGridTable().getCell(col, row); CellMetaInfo meta = getMetaInfo(editorModel, row, col); ICellEditor editor = new CellEditorSelector().selectEditor(cell, meta); if (ICellEditor.CE_DATE.equals(editor.getEditorTypeAndMetadata().getEditor())) { return FormattersManager.getFormatter(Date.class); } } return formatter; }
ICell cell = gridTable.getGrid().getCell(gcol, grow); CellMetaInfo metaInfo = getMetaInfoReader().getMetaInfo(grow, gcol); dataFormatter = XlsDataFormatterFactory.getFormatter(cell, metaInfo);
public FormattedCell filterFormat(FormattedCell cell) { Object value = cell.getObjectValue(); if (value instanceof ExplanationNumberValue<?>) { int rootID = Explanator.getUniqueId(requestId, (ExplanationNumberValue<?>) value); String url = "javascript: explain(\'?rootID=" + rootID + "')"; cell.setFormattedValue("<a href=\"" + url + "\">" + XlsDataFormatterFactory.getFormattedValue(cell, cell.getMetaInfo()) + "</a>"); } return cell; } }
IFormatter formatter = XlsDataFormatterFactory.getFormatter(cell, meta); if (formatter instanceof ArrayFormatter) {
public FormattedCell(ICell delegate, CellMetaInfo cellMetaInfo) { this.delegate = delegate; try { this.objectValue = this.delegate.getObjectValue(); } catch (IncorrectFormulaException e) { //logged in XlsCell.getObjectValue() method. this.objectValue = ERROR_VALUE; } this.formattedValue = XlsDataFormatterFactory.getFormattedValue(delegate, cellMetaInfo); this.font = new CellFont(delegate.getFont()); this.style = new CellStyle(delegate.getStyle()); this.metaInfo = cellMetaInfo; }
String formattedValue = XlsDataFormatterFactory.getFormattedValue(cell, metaInfo); if (StringUtils.isNotBlank(formattedValue)) { String content;