Package org.zkoss.zss.model

Examples of org.zkoss.zss.model.Range


    final Range rng = Utils.getRange(sheet, 0, lCol, maxrow, rCol);
    rng.move(0, nCol);
  }
 
  public static void moveCells(Worksheet sheet, int tRow, int lCol, int bRow, int rCol, int nRow, int nCol) {
    final Range rng = Utils.getRange(sheet, tRow, lCol, bRow, rCol);
    rng.move(nRow, nCol);
  }
View Full Code Here


    fillRows(sheet, srctRow, 0, srcbRow, maxcol, dsttRow, dstbRow);
  }
 
  private static void fillRows(Worksheet sheet, int srctRow, int srclCol, int srcbRow, int srcrCol, int dsttRow, int dstbRow) {
    if (srctRow == dsttRow && srcbRow > dstbRow) { //if remove bottom
      final Range rng = Utils.getRange(sheet, dstbRow+1, srclCol, srcbRow, srcrCol);
      rng.clearContents();
    } else { //fill
      final Range srcRange = Utils.getRange(sheet, srctRow, srclCol, srcbRow, srcrCol);
      final Range dstRange = Utils.getRange(sheet, dsttRow, srclCol, dstbRow, srcrCol);
      srcRange.autoFill(dstRange, Range.FILL_DEFAULT);
    }
  }
View Full Code Here

    fillColumns(sheet, 0, srclCol, maxrow, srcrCol, dstlCol, dstrCol);
  }
 
  private static void fillColumns(Worksheet sheet, int srctRow, int srclCol, int srcbRow, int srcrCol, int dstlCol, int dstrCol) {
    if (srclCol == dstlCol && srcrCol > dstrCol) { //if remove right
      final Range rng = Utils.getRange(sheet, srctRow, dstrCol+1, srcbRow, srcrCol);
      rng.clearContents();
    } else { //fill
      final Range srcRange = Utils.getRange(sheet, srctRow, srclCol, srcbRow, srcrCol);
      final Range dstRange = Utils.getRange(sheet, srctRow, dstlCol, srcbRow, dstrCol);
      srcRange.autoFill(dstRange, Range.FILL_DEFAULT);
    }
  }
View Full Code Here

    for (String name : cellRefs) {
      if (addedFocusNames.contains(name) || "".equals(name)) {
        newFocus.add(name);
        continue;
      }
      Range rng = null;
      try {
        rng = Ranges.range(formulaSheet, name);
      } catch (NullPointerException ex) { /*input wrong cell reference will cause NPE or IllegalArgumentException*/
      } catch (IllegalArgumentException ex) {
      }
      if (rng == null)
        continue;
      int col = rng.getColumn();
      int row = rng.getRow();
      if (col >= maxCol || row >= maxRow ||
        (col == formulaColumn && row == formulaRow) ||
        (col == currentColumn && row == currentRow))
        continue;

View Full Code Here

  }
 
  private void endEditingFormula(boolean confirmChange) {
    WorkbookCtrl bookCtrl = getDesktopWorkbenchContext().getWorkbookCtrl();
   
    Range range = Ranges.range(formulaSheet, formulaCell.getRowIndex(), formulaCell.getColumnIndex());
    if (confirmChange) {
      range.setEditText(newEdit);
      bookCtrl.focusTo(formulaRow, formulaColumn, false);
    }
    clearCellReferenceFocus();
    editExistingFormula = false;
    formulaCell = null;
View Full Code Here

    initAutofilter();
  }

 
  private void prepareDummyData() {
    Range rng = Ranges.range(sheet);
    int colSize = 10;
    int rowSize = 50;
   
    for (int c = 0; c < colSize; c++) {
      for (int r = 0; r < rowSize; r++) {
View Full Code Here

  }
 
  @Test
  public void test19() {
    Worksheet sheet1 = _workbook.getWorksheet("Sheet1");
    Range rng = Ranges.range(sheet1, "A1");
    rng.setEditText("19");
    assertEquals("19", rng.getText().toString()); //19
  }
View Full Code Here

  }
 
  @Test
  public void test1234() {
    Worksheet sheet1 = _workbook.getWorksheet("Sheet1");
    Range rng = Ranges.range(sheet1, "A1");
    rng.setEditText("1234");
    assertEquals("1,234", rng.getText().toString()); //1,234
  }
View Full Code Here

  }
 
  @Test
  public void test5678dot123() {
    Worksheet sheet1 = _workbook.getWorksheet("Sheet1");
    Range rng = Ranges.range(sheet1, "A1");
    rng.setEditText("5678.123");
    assertEquals("5,678.123", rng.getText().toString()); //5,678.123
  }
View Full Code Here

  }
 
  @Test
  public void test1234567() {
    Worksheet sheet1 = _workbook.getWorksheet("Sheet1");
    Range rng = Ranges.range(sheet1, "A1");
    rng.setEditText("1234567");
    assertEquals("1,234,567", rng.getText().toString()); //1,234,567
  }
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.