예제 #1
0
  static void reconnect(TextEdit ed, TextEdit next) throws InputException {

    // trace("reconnecting oldfile " + ed + " next  " + next);
    if (currfvc.edvec == ed) FvContext.connectFv(next, currfvc.vi);
    // trace("starting iterator");
    for (Iterator<FvContext> fit = fvmap.iterator(); fit.hasNext(); ) {
      FvContext fvc = fit.next();
      if (fvc.edvec == ed) getcontext(fvc.vi, next).activate();
    }
    // trace("done iterator");
  }
예제 #2
0
  private static void disposeAll(boolean ignoreLock) throws IOException {
    if (!ignoreLock) EventQueue.biglock2.assertOwned();

    Set<TextEdit> allEdits = new HashSet<TextEdit>(100);

    for (Iterator<FvContext> fit = fvmap.iterator(); fit.hasNext(); )
      allEdits.add(fit.next().edvec);

    for (TextEdit ev : allEdits)
      try {
        // trace("disposing in fvc quit" + ev);
        ev.disposeFvc();
      } catch (Throwable t) {
        trace("disposeall caught " + t);
        trace("for file " + ev);
        t.printStackTrace();
      }
    EditContainer.disposeAll();
    fvmap.clear();
    currfvc = null;
  }
예제 #3
0
  private void activate() {
    // trace("activate " + this);
    if (null != currfvc) {
      if (currfvc.vi == vi) // the usual case
      currfvc.vis = false;
      else
        for (Iterator<FvContext> fit = fvmap.iterator(); fit.hasNext(); ) {
          FvContext fvc = fit.next();
          if (fvc.vi == vi) fvc.vis = false;
        }
    }

    if (!edvec.containsNow(1)) {
      fileposy = 1;
      fileposx = 0;
    } else {
      fileposy = inrange(fileposy, 1, edvec.readIn() - 1);
      fileposx = inrange(fileposx, 0, edvec.at(fileposy).toString().length());
    }
    vi.newfile(edvec, fileposx, fileposy);
    vis = true;
  }
예제 #4
0
 void invalidateBack(UndoHistory.EhMark ehm) {
   for (Iterator<FvContext> fit = fvmap.iterator(); fit.hasNext(); ) {
     FvContext fvc = fit.next();
     if (fvc.vis) fvc.vi.checkValid(ehm);
   }
 }