Package org.zkoss.poi.ss.usermodel

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


      Events.postEvent(new CellMouseEvent(type, comp, shx, shy, key, sheet, row, col, mx, my));
    }
  }
 
  private void processFilter (int row, int col, int field, Worksheet worksheet, Spreadsheet spreadsheet) {
    final AutoFilter autoFilter = worksheet.getAutoFilter();
    final FilterColumn filterColumn = autoFilter.getFilterColumn(field - 1);
    final String rangeAddr = autoFilter.getRangeAddress().formatAsString();
    final Range range = Ranges.range(worksheet, rangeAddr);
   
    spreadsheet.smartUpdate("autoFilterPopup",
      convertFilterInfoToJSON(row, col, field, rangeAddr, scanRows(field, filterColumn, range, worksheet)));
  }
View Full Code Here


  }

  @Override
  public void showAllData() {
    synchronized (_sheet) {
      AutoFilter af = _sheet.getAutoFilter();
      if (af == null) { //no AutoFilter to apply
        return;
      }
      final CellRangeAddress afrng = af.getRangeAddress();
      final List<FilterColumn> fcs = af.getFilterColumns();
      if (fcs == null)
        return;
      for(FilterColumn fc : fcs) {
        BookHelper.setProperties(fc, null, AutoFilter.FILTEROP_VALUES, null, null); //clear all filter
      }
View Full Code Here

  }
 
  @Override
  public void applyFilter() {
    synchronized (_sheet) {
      AutoFilter af = _sheet.getAutoFilter();
      if (af == null) { //no AutoFilter to apply
        return;
      }
      final CellRangeAddress affectedArea = af.getRangeAddress();
      final int row1 = affectedArea.getFirstRow();
      final int col1 = affectedArea.getFirstColumn();
      final int row = row1 + 1;
      final int row2 = affectedArea.getLastRow();
      final int col2 = affectedArea.getLastColumn();
     
      final Set<Ref> all = new HashSet<Ref>();
      for (int r = row; r <= row2; ++r) {
        boolean hidden = false;
        final List<FilterColumn> fcs = af.getFilterColumns();
        if (fcs == null)
          return;
        for(FilterColumn fc : fcs) {
          if (shallHide(fc, r, col1)) {
            hidden = true;
View Full Code Here

  }

  @Override
  public AutoFilter autoFilter(int field, Object criteria1, int filterOp, Object criteria2, Boolean visibleDropDown) {
    synchronized (_sheet) {
      AutoFilter af = _sheet.getAutoFilter();
      if (af == null) {
        af = autoFilter();
      }
      final FilterColumn fc = BookHelper.getOrCreateFilterColumn(af, field-1);
      BookHelper.setProperties(fc, criteria1, filterOp, criteria2, visibleDropDown);
     
      //update rows
      final CellRangeAddress affectedArea = af.getRangeAddress();
      final int row1 = affectedArea.getFirstRow();
      final int col1 = affectedArea.getFirstColumn();
      final int col =  col1 + field - 1;
      final int row = row1 + 1;
      final int row2 = affectedArea.getLastRow();
View Full Code Here

  }
  public void onOpen$_autoFilterDialog(ForwardEvent evt) {
    Object[] info = (Object[]) evt.getOrigin().getData();
    range = (Range) info[2];
    worksheet = (Worksheet) range.getSheet();
    final AutoFilter af = worksheet.getAutoFilter();
    if (af == null) {
      return;
    }
    fieldIndex = (Integer) info[0];
    columnIndex = (Integer) info[1];
   
    final FilterColumn fc = af.getFilterColumn(fieldIndex - 1);
    final TreeSet<RowInfo> rowInfos = new TreeSet<RowInfo>(new MyComparator());
    final Set<RowInfo> selected = new HashSet<RowInfo>();
    fetchRowInfos(fc, range, rowInfos, selected);
   
    _filterListbox.setModel(new ListModelList(rowInfos));
View Full Code Here

  }
 
  protected void syncAutoFilter() {
    final Worksheet worksheet = _spreadsheet.getSelectedSheet();
    boolean appliedFilter = false;
    AutoFilter af = worksheet.getAutoFilter();
    if (af != null) {
      final CellRangeAddress afrng = af.getRangeAddress();
      if (afrng != null) {
        int rowIdx = afrng.getFirstRow() + 1;
        for (int i = rowIdx; i <= afrng.getLastRow(); i++) {
          final Row row = worksheet.getRow(i);
          if (row != null && row.getZeroHeight()) {
View Full Code Here

TOP

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

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.