示例#1
0
 @Override
 public void eSet(final EStructuralFeature feature, final Object newValue) {
   TransactionUtils.writing(
       eObjects.toArray()[0],
       new Runnable() {
         @Override
         public void run() {
           for (EObject eObject : eObjects) {
             eObject.eSet(feature, newValue);
           }
         }
       });
 }
 @Override
 protected List<? extends Violation> check(final List<Notification> notifications) {
   return TransactionUtils.reading(
       plan,
       new RunnableWithResult.Impl<List<? extends Violation>>() {
         @Override
         public void run() {
           Set<EPlanElement> affectedElements = getAffectedElements(notifications);
           List<Violation> violations = findViolations(affectedElements);
           setResult(violations);
         }
       });
 }
 @Override
 protected List<? extends Violation> initialize() {
   return TransactionUtils.reading(
       plan,
       new RunnableWithResult.Impl<List<? extends Violation>>() {
         @Override
         public void run() {
           if (isQuit()) {
             return;
           }
           final List<EPlanElement> affectedElements = new ArrayList<EPlanElement>();
           new PlanVisitor() {
             @Override
             protected void visit(EPlanElement element) {
               affectedElements.add(element);
             }
           }.visitAll(plan);
           List<Violation> violations = findViolations(affectedElements);
           setResult(violations);
         }
       });
 }
 @Override
 public void dispose() {
   domain = TransactionUtils.getDomain(getPlan());
   domain.removeResourceSetListener(listener);
 }
 @Override
 public void activate() {
   domain = TransactionUtils.getDomain(getPlan());
   domain.addResourceSetListener(listener);
 }