Package org.zkoss.zss.engine

Examples of org.zkoss.zss.engine.Ref


  }
 
  @Override
  public void protectSheet(String password) {
    synchronized (_sheet) {
      final Ref ref = getRefs().iterator().next();
      final Worksheet sheet = BookHelper.getSheet(_sheet, ref.getOwnerSheet());
      final Set<Ref> all = new HashSet<Ref>();
      final boolean oldProtected = sheet.getProtect();
      if (oldProtected && password == null) {
        sheet.protectSheet(null);
        all.add(ref);
View Full Code Here


    return new RangeImpl(ref, _sheet);
  }

  @Override
  public long getCount() {
    final Ref ref = getRefs().iterator().next();
    final int col1 = ref.getLeftCol();
    final int col2 = ref.getRightCol();
    final int row1 = ref.getTopRow();
    final int row2 = ref.getBottomRow();
    if (ref.isWholeColumn()) {
      return (long) (col2 - col1 + 1);
    } else if (ref.isWholeRow()) {
      return (long) (row2 - row1 + 1);
    } else if (ref.isWholeSheet()) {
      return 1L;
    }
    final int ccount = col2 - col1 + 1;
    final long rcount = (long) (col2 - col1 + 1);
    return rcount * ccount;
 
View Full Code Here

    return rcount * ccount;
  }
 
  @Override
  public Range getColumns() {
    final Ref ref = getRefs().iterator().next();
    final Worksheet sheet = BookHelper.getSheet(_sheet, ref.getOwnerSheet());
    final int col1 = ref.getLeftCol();
    final int col2 = ref.getRightCol();
    final Book book = (Book) sheet.getWorkbook();
    return new RangeImpl(0, col1, book.getSpreadsheetVersion().getLastRowIndex(), col2, sheet, sheet);
  }
View Full Code Here

    return new RangeImpl(0, col1, book.getSpreadsheetVersion().getLastRowIndex(), col2, sheet, sheet);
  }
 
  @Override
  public Range getRows() {
    final Ref ref = getRefs().iterator().next();
    final Worksheet sheet = BookHelper.getSheet(_sheet, ref.getOwnerSheet());
    final int row1 = ref.getTopRow();
    final int row2 = ref.getBottomRow();
    final Book book = (Book) sheet.getWorkbook();
    return new RangeImpl(row1, 0, row2, book.getSpreadsheetVersion().getLastColumnIndex(), sheet, sheet);
  }
View Full Code Here

  }
 
  @Override
  public Range getDependents() {
    synchronized (_sheet) {
      final Ref ref = getRefs().iterator().next();
      final Worksheet sheet = BookHelper.getSheet(_sheet, ref.getOwnerSheet());
      final int row = ref.getTopRow();
      final int col = ref.getLeftCol();
      final RefSheet refSheet = ref.getOwnerSheet();
      Set<Ref> refs = ((RefSheetImpl)refSheet).getAllDependents(row, col);
      return refs != null && !refs.isEmpty() ?
          new RangeImpl(refs, sheet) : Ranges.EMPTY_RANGE;
    }
  }
View Full Code Here

  }
 
  @Override
  public Range getDirectDependents() {
    synchronized (_sheet) {
      final Ref ref = getRefs().iterator().next();
      final Worksheet sheet = BookHelper.getSheet(_sheet, ref.getOwnerSheet());
      final int row = ref.getTopRow();
      final int col = ref.getLeftCol();
      final RefSheet refSheet = ref.getOwnerSheet();
      Set<Ref> refs = ((RefSheetImpl)refSheet).getDirectDependents(row, col);
      return refs != null && !refs.isEmpty() ?
          new RangeImpl(refs, sheet) : Ranges.EMPTY_RANGE;
    }
  }
View Full Code Here

  }
 
  @Override
  public Range getPrecedents() {
    synchronized (_sheet) {
      final Ref ref = getRefs().iterator().next();
      final Worksheet sheet = BookHelper.getSheet(_sheet, ref.getOwnerSheet());
      final int row = ref.getTopRow();
      final int col = ref.getLeftCol();
      final RefSheet refSheet = ref.getOwnerSheet();
      Set<Ref> refs = refSheet.getAllPrecedents(row, col);
      return refs != null && !refs.isEmpty() ?
          new RangeImpl(refs, sheet) : Ranges.EMPTY_RANGE;
    }
   
View Full Code Here

  }
 
  @Override
  public Range getDirectPrecedents() {
    synchronized (_sheet) {
      final Ref ref = getRefs().iterator().next();
      final Worksheet sheet = BookHelper.getSheet(_sheet, ref.getOwnerSheet());
      final int row = ref.getTopRow();
      final int col = ref.getLeftCol();
      final RefSheet refSheet = ref.getOwnerSheet();
      Set<Ref> refs = refSheet.getDirectPrecedents(row, col);
      return refs != null && !refs.isEmpty() ?
          new RangeImpl(refs, sheet) : Ranges.EMPTY_RANGE;
    }
  }
View Full Code Here

    }
  }
 
  @Override
  public int getRow() {
    final Ref ref = getRefs().iterator().next();
    return ref.getTopRow();
  }
View Full Code Here

    return ref.getTopRow();
  }
 
  @Override
  public int getColumn() {
    final Ref ref = getRefs().iterator().next();
    return ref.getLeftCol();
  }
View Full Code Here

TOP

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

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.