Package org.zkoss.zss.engine

Examples of org.zkoss.zss.engine.RefSheet


      }
    }
  }
 
  /*package*/ static void notifyMoveFriendFocus(Ref ref, Object obj) {
    final RefSheet refSheet = ref.getOwnerSheet();
    final RefBook refBook = refSheet.getOwnerBook();
    refBook.publish(new SSDataEvent(SSDataEvent.ON_FRIEND_FOCUS_MOVE, ref, obj));
  }
View Full Code Here


    final RefBook refBook = refSheet.getOwnerBook();
    refBook.publish(new SSDataEvent(SSDataEvent.ON_FRIEND_FOCUS_MOVE, ref, obj));
  }
 
  /*package*/ static void notifyDeleteFriendFocus(Ref ref, Object obj) {
    final RefSheet refSheet = ref.getOwnerSheet();
    final RefBook refBook = refSheet.getOwnerBook();
    refBook.publish(new SSDataEvent(SSDataEvent.ON_FRIEND_FOCUS_DELETE, ref, obj));
  }
View Full Code Here

    final RefBook refBook = refSheet.getOwnerBook();
    refBook.publish(new SSDataEvent(SSDataEvent.ON_FRIEND_FOCUS_DELETE, ref, obj));
  }
 
  /*package*/ static void notifyDeleteSheet(Ref ref, Object[] namePairs) {
    final RefSheet refSheet = ref.getOwnerSheet();
    final RefBook refBook = refSheet.getOwnerBook();
    refBook.publish(new SSDataEvent(SSDataEvent.ON_SHEET_DELETE, ref, namePairs));
  }
View Full Code Here

    final RefBook refBook = refSheet.getOwnerBook();
    refBook.publish(new SSDataEvent(SSDataEvent.ON_SHEET_DELETE, ref, namePairs));
  }
 
  /*package*/ static void notifyCreateSheet(Ref ref, String sheetName) {
    final RefSheet refSheet = ref.getOwnerSheet();
    final RefBook refBook = refSheet.getOwnerBook();
    refBook.publish(new SSDataEvent(SSDataEvent.ON_SHEET_CREATE, ref, sheetName));
  }
View Full Code Here

    final RefBook refBook = refSheet.getOwnerBook();
    refBook.publish(new SSDataEvent(SSDataEvent.ON_SHEET_CREATE, ref, sheetName));
  }

  /*package*/ static void notifyChangeSheetName(Ref ref, String sheetName) {
    final RefSheet refSheet = ref.getOwnerSheet();
    final RefBook refBook = refSheet.getOwnerBook();
    refBook.publish(new SSDataEvent(SSDataEvent.ON_SHEET_NAME_CHANGE, ref, sheetName));
  }
View Full Code Here

    final RefBook refBook = refSheet.getOwnerBook();
    refBook.publish(new SSDataEvent(SSDataEvent.ON_SHEET_NAME_CHANGE, ref, sheetName));
  }
 
  /*package*/ static void notifyChangeSheetOrder(Ref ref, String sheetName) {
    final RefSheet refSheet = ref.getOwnerSheet();
    final RefBook refBook = refSheet.getOwnerBook();
    refBook.publish(new SSDataEvent(SSDataEvent.ON_SHEET_ORDER_CHANGE, ref, sheetName));
  }
View Full Code Here

 
  //[0]:last, [1]:all
  private static Set<Ref>[] getBothDependents(Cell cell) {
    final Worksheet sheet = (Worksheet) cell.getSheet();
    final Book book = (Book) sheet.getWorkbook();
    final RefSheet refSheet = getRefSheet(book, sheet);
   
    //clear/update formula cache
    book.getFormulaEvaluator().notifySetFormula(cell);
    //get affected dependents(last, all)
    final int row = cell.getRowIndex();
    final int col = cell.getColumnIndex();
    Set<Ref>[] refs = ((RefSheetImpl)refSheet).getBothDependents(row, col);
    //no dependent but myself is a formula cell
    if (refs[0].isEmpty() && cell.getCellType() == Cell.CELL_TYPE_FORMULA) {
      final Ref srcRef = refSheet.getRef(row, col, row, col);
      if (srcRef != null) {
        refs[0].add(srcRef);
        refs[1].add(srcRef);
      }
    }
View Full Code Here

      //clear the formula reference dependency
      final int rowIndex = cell.getRowIndex();
      final int colIndex = cell.getColumnIndex();
      final Worksheet sheet = (Worksheet)cell.getSheet();
      final Book book = (Book) sheet.getWorkbook();
      final RefSheet refSheet = getRefSheet(book, sheet);
      final Ref ref = refSheet.getRef(rowIndex, colIndex, rowIndex, colIndex);
      //bug 60: Sort function when seelct multiple columns cause NullPointer Exception
      //ref could be null if never evaluated or cleared if an orphan reference during operation
      if (ref != null) {
        ref.removeAllPrecedents();
      }
View Full Code Here

    }
  }
 
  private static ChangeInfo insertXSSFRows(Worksheet sheet, int startRow, int num, int copyOrigin) {
    final Book book = (Book) sheet.getWorkbook();
    final RefSheet refSheet = getRefSheet(book, sheet);
    final Set<Ref>[] refs = refSheet.insertRows(startRow, num);
    final int lastRowNum = sheet.getLastRowNum();
    if (startRow > lastRowNum) {
      return null;
    }
    final List<CellRangeAddress[]> shiftedRanges = ((XSSFSheetImpl)sheet).shiftRowsOnly(startRow, lastRowNum, num, true, false, true, false, copyOrigin);
View Full Code Here

    return new ChangeInfo(last, all, changeMerges);
  }
 
  private static ChangeInfo insertHSSFRows(Worksheet sheet, int startRow, int num, int copyOrigin) {
    final Book book = (Book) sheet.getWorkbook();
    final RefSheet refSheet = getRefSheet(book, sheet);
    final Set<Ref>[] refs = refSheet.insertRows(startRow, num);
    final int lastRowNum = sheet.getLastRowNum();
    if (startRow > lastRowNum) {
      return null;
    }
    final List<CellRangeAddress[]> shiftedRanges = ((HSSFSheetImpl)sheet).shiftRowsOnly(startRow, lastRowNum, num, true, false, true, false, copyOrigin);
View Full Code Here

TOP

Related Classes of org.zkoss.zss.engine.RefSheet

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.