Package org.zkoss.zss.model.event

Examples of org.zkoss.zss.model.event.SSDataEvent


    assertTrue(_sheet.getCell(2, 1).isMerged());

    List evts = ssl.getList();
    assertEquals(1, evts.size()); //merge_add
   
    SSDataEvent ev = (SSDataEvent) evts.get(0);
    Range rng = ev.getRange();
    int type = ev.getType();
    assertNull(ev.getOriginalRange());
    assertEquals(SSDataEvent.MERGE_ADD, type);
    assertEquals(1, rng.getLeft());
    assertEquals(2, rng.getTop());
    assertEquals(3, rng.getRight());
    assertEquals(4, rng.getBottom());
   
    ssl.getList().clear();
   
    _sheet.unmergeCells(1, 2, 3, 4);
    assertEquals(1, evts.size()); //merge_delete

    ev = (SSDataEvent) evts.get(0);
   
    Range org = ev.getOriginalRange();
   
    type = ev.getType();
    assertNull(ev.getRange());
    assertEquals(SSDataEvent.MERGE_DELETE, type);
    assertEquals(1, org.getLeft());
    assertEquals(2, org.getTop());
    assertEquals(3, org.getRight());
    assertEquals(4, org.getBottom());
View Full Code Here


    _sheet.insertColumns(0, 0); //A:A

    List evts = ssl.getList();
    assertEquals(2, evts.size()); //range_insert, merge_change
   
    SSDataEvent ev = (SSDataEvent) evts.get(1);
    Range org = ev.getOriginalRange();
   
    assertEquals(SSDataEvent.MERGE_CHANGE, ev.getType());
    assertEquals(1, org.getLeft());
    assertEquals(12, org.getTop());
    assertEquals(3, org.getRight());
    assertEquals(14, org.getBottom());

    Range mod = ev.getRange();
    assertEquals(2, mod.getLeft());
    assertEquals(12, mod.getTop());
    assertEquals(4, mod.getRight());
    assertEquals(14, mod.getBottom());
   
View Full Code Here

    _sheet.insertColumns(2, 2); //C:C

    List evts = ssl.getList();
    assertEquals(5, evts.size()); //range_insert, contents_change * 3, merge_change
   
    SSDataEvent ev = (SSDataEvent) evts.get(4);
    Range org = ev.getOriginalRange();
   
    assertEquals(SSDataEvent.MERGE_CHANGE, ev.getType());
    assertEquals(1, org.getLeft());
    assertEquals(12, org.getTop());
    assertEquals(3, org.getRight());
    assertEquals(14, org.getBottom());

    Range mod = ev.getRange();
    assertEquals(1, mod.getLeft());
    assertEquals(12, mod.getTop());
    assertEquals(4, mod.getRight());
    assertEquals(14, mod.getBottom());
   
View Full Code Here

    _sheet.insertColumns(7, 7); //H:H

    List evts = ssl.getList();
    assertEquals(3, evts.size()); //range_insert, contents_change, merge_change
   
    SSDataEvent ev = (SSDataEvent) evts.get(2);
    Range org = ev.getOriginalRange();
   
    assertEquals(6, org.getLeft());
    assertEquals(1, org.getTop());
    assertEquals(9, org.getRight());
    assertEquals(1, org.getBottom());

    Range mod = ev.getRange();
    assertEquals(6, mod.getLeft());
    assertEquals(1, mod.getTop());
    assertEquals(10, mod.getRight());
    assertEquals(1, mod.getBottom());
   
View Full Code Here

    assertTrue(merges.isEmpty());

    List evts = ssl.getList();
    assertEquals(2, evts.size());
   
    SSDataEvent ev = (SSDataEvent)evts.get(1);
    Range org = ev.getOriginalRange();

    assertEquals(SSDataEvent.MERGE_DELETE, ev.getType());
    assertEquals(1, org.getLeft());
    assertEquals(0, org.getTop());
    assertEquals(3, org.getRight());
    assertEquals(0, org.getBottom());

    Range mod = ev.getRange();
    assertNull(mod);
   
  }
View Full Code Here

    assertTrue(merges.isEmpty());

    List evts = ssl.getList();
    assertEquals(2, evts.size());
   
    SSDataEvent ev = (SSDataEvent)evts.get(1);
    Range org = ev.getOriginalRange();

    assertEquals(SSDataEvent.MERGE_DELETE, ev.getType());
    assertEquals(1, org.getLeft());
    assertEquals(0, org.getTop());
    assertEquals(3, org.getRight());
    assertEquals(0, org.getBottom());

    Range mod = ev.getRange();
    assertNull(mod);
  }
View Full Code Here

    sheet1.deleteColumns(2,2); //delete column C (C1 ~ C100)

    List evts = ssl.getList();
   
    for(Iterator it = evts.iterator(); it.hasNext();) {
      final SSDataEvent ev = (SSDataEvent) it.next();
      System.out.println(""+ev);
    }
   
    assertEquals(1, evts.size());
    SSDataEvent evt = (SSDataEvent) evts.get(0);
    assertEquals(SSDataEvent.RANGE_DELETE, evt.getType());
    assertEquals(SSDataEvent.MOVE_H, evt.getDirection());
   
    final Range rng = new RangeSimple(sheet1, null, 2, -1, 2, -1);
    assertEquals(rng, evt.getRange());
  }
View Full Code Here

    sheet1.getCell(1,2).setFormat( newFormat );
   
    List evts = ssl.getList();
    assertEquals(1, evts.size());
   
    SSDataEvent ev = (SSDataEvent)evts.get(0);
    Range org = ev.getRange();

    assertEquals(SSDataEvent.CONTENTS_CHANGE, ev.getType());
    assertEquals(2, org.getLeft());
    assertEquals(1, org.getTop());
    assertEquals(2, org.getRight());
    assertEquals(1, org.getBottom());
  }
View Full Code Here

      ((SSDataListener)it.next()).onChange(event);
  }
 
  public void fireSSDataEvent(Reference ref, int type, int direction) {
    final Range rng = new RangeRef(ref, true, true, true, true, true);
    fireSSDataEvent(new SSDataEvent(rng, type, direction));
  }
View Full Code Here

      //remove the merge range if a merged cell
      final RangeMerge rm = ((CellImpl)old).getRangeMerge();
      if (rm != null) {
        final Range rng = new RangeSimple(this, null, rm.getLeft(), rm.getTop(), rm.getRight(), rm.getBottom());
        rm.getRef().remove();
        _book.fireSSDataEvent(new SSDataEvent(null, rng, SSDataEvent.MERGE_DELETE, SSDataEvent.MOVE_NO));
      }
      if (ci.setCell(null)) { //CellIndex should be removed, too
        _matrix.detachCellIndex(row, col);
      }
    }
View Full Code Here

TOP

Related Classes of org.zkoss.zss.model.event.SSDataEvent

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.