Package org.zkoss.poi.ss.usermodel

Examples of org.zkoss.poi.ss.usermodel.RichTextString


  //Return simple String form of the cell
  public static String getCellText(Cell cell) {
    final FormatTextImpl ft = getFormatText(cell);
    if (ft != null) {
      if (ft.isRichTextString()) {
        final RichTextString rstr = ft.getRichTextString();
        return rstr == null ? "" : rstr.getString();
      } else if (ft.isCellFormatResult()) {
        return ft.getCellFormatResult().text;     
      }
    }
    return "";
View Full Code Here


    case Cell.CELL_TYPE_FORMULA:
      return cell.getCellFormula();
    case Cell.CELL_TYPE_NUMERIC:
      return new Double(cell.getNumericCellValue());
    case Cell.CELL_TYPE_STRING:
      final RichTextString rtstr = cell.getRichStringCellValue();
      return rtstr;
    default:
      throw new UiException("Unknown cell type:"+cellType);
    }
  }
View Full Code Here

    CellStyle style = (cell == null) ? null : cell.getCellStyle();
    boolean wrap = style != null && style.getWrapText();
    Hyperlink hlink = cell == null ? null : Utils.getHyperlink(cell);
    final FormatText ft = (cell == null) ? null : Utils.getFormatText(cell);
   
    final RichTextString rstr = ft != null && ft.isRichTextString() ? ft.getRichTextString() : null;
    String text = rstr != null ? Utils.formatRichTextString(sheet, rstr, wrap) : ft != null ? Utils.escapeCellText(ft.getCellFormatResult().text, wrap, true) : "";
    if (hlink != null) {
      text = Utils.formatHyperlink(sheet, hlink, text, wrap);
    }
    return text;
View Full Code Here

   * Returns the text for editing on the specified cell.
   * @param cell the cell
   * @return the text for editing on the specified cell.
   */
  public static String getEditText(Cell cell) {
    final RichTextString rstr = cell == null ? null : getRichEditText(cell);
    return rstr != null ? rstr.getString() : "";
  }
View Full Code Here

      if (bgColor != null) {
        sb.append("background-color:").append(bgColor).append(";");
      }
      final FormatText ft = Utils.getFormatText(_cell);
      final boolean isRichText = ft.isRichTextString();
      final RichTextString rstr = isRichText ? ft.getRichTextString() : null;
      final String txt = rstr != null ? rstr.getString() : ft.getCellFormatResult().text;
     
      if(_cell.getCellType() == Cell.CELL_TYPE_BLANK) {
        sb.append("z-index:-1;"); //For IE6/IE7's overflow
      }
    }
View Full Code Here

    final Cell cell = row4.getCell(0);
    CellValue value = _evaluator.evaluate(cell);
    assertEquals(0, value.getNumberValue(), 0.0000000000000001);
   
    Cell cellA1 = row.getCell(0);
    RichTextString rstr = _workbook.getCreationHelper().createRichTextString("10");
    new RangeImpl(0, 0, sheet1, sheet1).setRichEditText(rstr);
  }
View Full Code Here

    final Cell cell = row4.getCell(0);
    CellValue value = _evaluator.evaluate(cell);
    assertEquals(0, value.getNumberValue(), 0.0000000000000001);
   
    Cell cellA1 = row.getCell(0);
    RichTextString rstr = _workbook.getCreationHelper().createRichTextString("10");
    new RangeImpl(0, 0, sheet1, sheet1).setRichEditText(rstr);
  }
View Full Code Here

    if (cell != null) {
      boolean wrap = cell.getCellStyle().getWrapText();
      final FormatText ft = Utils.getFormatText(cell);
      if (ft != null) {
        if (ft.isRichTextString()) {
          final RichTextString rstr = ft.getRichTextString();
          text = rstr == null ? "" : Utils.formatRichTextString(sheet, rstr, wrap);
        } else if (ft.isCellFormatResult()) {
          text = Utils.escapeCellText(ft.getCellFormatResult().text, wrap, true);
        }
      }
View Full Code Here

    String text = "";
    if (cell != null) {
      final FormatText ft = Utils.getFormatText(cell);
      if (ft != null) {
        if (ft.isRichTextString()) {
          final RichTextString rstr = ft.getRichTextString();
          text = rstr == null ? "" : rstr.toString();
        } else if (ft.isCellFormatResult()) {
          text = ft.getCellFormatResult().text;
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.zkoss.poi.ss.usermodel.RichTextString

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.