Example #1
0
 // FIXME any restriction whether this method is invoked within model read/write action?
 public <T> T runNonUndoableAction(Computable<T> t) {
   if (ModelAccess.instance().canWrite() && myHandler != DEFAULT) {
     // locks optimization, install temporary dummy handler
     UndoHandler old = myHandler;
     try {
       myHandler = DEFAULT;
       return t.compute();
     } finally {
       myHandler = old;
     }
   } else {
     return myHandler.runNonUndoableAction(t);
   }
 }