Package org.zkoss.zss.model

Examples of org.zkoss.zss.model.Range


   * @param skipBlanks true to not have blank cells in the ranage on the Clipboard pasted into this range; default false
   * @param transpose true to transpose rows and columns when pasting to this range; default false
   * @return the real pasted range
   */
  public static Range pasteSpecial(Worksheet srcSheet, Rect srcRect, Worksheet dstSheet, int tRow, int lCol, int bRow, int rCol, int pasteType, int pasteOp, boolean skipBlanks, boolean transpose) {
    Range rng = Utils.getRange(srcSheet, srcRect.getTop(), srcRect.getLeft(), srcRect.getBottom(), srcRect.getRight());
    Range dstRange = Utils.getRange(dstSheet, tRow, lCol, bRow, rCol);
    Range pasteRange = rng.pasteSpecial(dstRange, pasteType, pasteOp, skipBlanks, transpose);
    if (pasteRange == null) {
      showProtectMessage();
    }
    return pasteRange;
  }
View Full Code Here


        final short patternType = cs.getFillPattern();
        if (patternType == CellStyle.NO_FILL) {
          newCellStyle.setFillPattern(CellStyle.SOLID_FOREGROUND);
        }
        BookHelper.setFillForegroundColor(newCellStyle, bsColor);
        Range rng = Utils.getRange(sheet, row, col);
        rng.setStyle(newCellStyle);
      }
  }
View Full Code Here

    int lCol = rect.getLeft();
    int rCol = rect.getRight();
    int tRow = rect.getTop();
    int bRow = rect.getBottom();

    Range rng = Ranges.range(sheet, tRow, lCol, bRow, rCol);
    rng.setBorders(borderType, lineStyle, color);
  }
View Full Code Here

    final Row row = sheet.getRow(rowIndex);
    return row != null ? row.getCell(colIndex) : null;
  }
 
  public static void copyCell(Worksheet srcSheet, int srcRow, int srcCol, Worksheet dstSheet, int dstRow, int dstCol) {
    final Range srcRange = getRange(srcSheet, srcRow, srcCol);
    final Range dstRange = getRange(dstSheet, dstRow, dstCol);
    final Range pasteRange = srcRange.copy(dstRange);
    if(pasteRange == null) {
      showProtectMessage();
    }
  }
View Full Code Here

    copyCell((Worksheet)cell.getSheet(), cell.getRowIndex(), cell.getColumnIndex(), dstSheet, dstRow, dstCol);
  }
 
  public static void insertRows(Worksheet sheet, int startRow, int endRow) {
    final Book book = (Book)sheet.getWorkbook();
    final Range rng = getRange(sheet, startRow, 0, endRow, book.getSpreadsheetVersion().getLastColumnIndex());
    rng.insert(Range.SHIFT_DEFAULT, Range.FORMAT_LEFTABOVE);
  }
View Full Code Here

    rng.insert(Range.SHIFT_DEFAULT, Range.FORMAT_LEFTABOVE);
  }

  public static void deleteRows(Worksheet sheet, int startRow, int endRow) {
    final Book book = (Book)sheet.getWorkbook();
    final Range rng = getRange(sheet, startRow, 0, endRow, book.getSpreadsheetVersion().getLastColumnIndex());
    rng.delete(Range.SHIFT_DEFAULT);
  }
View Full Code Here

    rng.delete(Range.SHIFT_DEFAULT);
  }

  public static void insertColumns(Worksheet sheet, int startCol, int endCol) {
    final Book book = (Book)sheet.getWorkbook();
    final Range rng = getRange(sheet, 0, startCol, book.getSpreadsheetVersion().getLastRowIndex(), endCol);
    rng.insert(Range.SHIFT_DEFAULT, Range.FORMAT_LEFTABOVE);
  }
View Full Code Here

    rng.insert(Range.SHIFT_DEFAULT, Range.FORMAT_LEFTABOVE);
  }

  public static void deleteColumns(Worksheet sheet, int startCol, int endCol) {
    final Book book = (Book)sheet.getWorkbook();
    final Range rng = getRange(sheet, 0, startCol, book.getSpreadsheetVersion().getLastRowIndex(), endCol);
    rng.delete(Range.SHIFT_DEFAULT);
  }
View Full Code Here

   * Returns the {@link Hyperlink} to be shown on the specified cell.
   * @param cell the cell
   * @return the {@link Hyperlink} to be shown on the specified cell.
   */
  public static Hyperlink getHyperlink(Cell cell) {
    Range range = getRange((Worksheet)cell.getSheet(), cell.getRowIndex(), cell.getColumnIndex());
    return range.getHyperlink();
  }
View Full Code Here

   * Returns the {@link RichTextString} to be shown on the specified cell.
   * @param cell the cell
   * @return the {@link RichTextString} to be shown on the specified cell.
   */
  public static RichTextString getText(Cell cell) {
    Range range = getRange((Worksheet)cell.getSheet(), cell.getRowIndex(), cell.getColumnIndex());
    return range.getText();
  }
View Full Code Here

TOP

Related Classes of org.zkoss.zss.model.Range

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.