Package com.projity.pm.graphic.spreadsheet

Examples of com.projity.pm.graphic.spreadsheet.SpreadSheetSearchContext


      doPostExceptionTreatment();
    }
  }

  public SearchContext createSearchContext() {
    SpreadSheetSearchContext ctx = new SpreadSheetSearchContext();
    return ctx;

  }
View Full Code Here


/**
* Used by find dialog
*/
  public boolean findNext(SearchContext context) {
    SpreadSheetSearchContext ctx = (SpreadSheetSearchContext)context;

    int row = this.getCurrentRow();
    // make sure in bounds
    if (row < 0)
      row =0;
    if (row >= getCache().getSize())
      row = getCache().getSize() -1;

    ListIterator i =getCache().getIterator(row);
    if (ctx.getRow() != -1) { // after the first search, need to move ahead or back
      if (ctx.isForward())
        if (i.hasNext())
          i.next();
      else
        if (i.hasPrevious())
          i.previous();
    }

    boolean found = false;
    GraphicNode gnode = null;
    Object obj;
    Node node;
    while (ctx.isForward() ? i.hasNext() : i.hasPrevious()) {
      gnode=(GraphicNode)(ctx.isForward() ? i.next() : i.previous());
      if (gnode.isVoid())
        continue;
      node = gnode.getNode();
      obj = node.getImpl();
      if (ctx.matches(obj)) {
        found = true;
        break;
      }
    }
    if (found) {
      int r = getCache().getRowAt(gnode);
      int col = getFieldArray().indexOf(ctx.getField())-1;
      this.changeSelection(r, col, false, false);
      ctx.setRow(r);
    }
    return found;
  }
View Full Code Here

TOP

Related Classes of com.projity.pm.graphic.spreadsheet.SpreadSheetSearchContext

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.