public void dispose() { synchronized (this) { if (!(myDisposed)) { myDisposed = true; SModelRepository.getInstance().removeModelRepositoryListener(myModelListener); myEventsCollector.remove(myModelDescriptor); myEventsCollector.dispose(); myQueue.runTask( new Runnable() { public void run() { myDifference.removeChangeSet(); } }); } } }
private void runUpdateTask( final _FunctionTypes._void_P0_E0 task, SNode currentNode, final SModelEvent event) { myEventConsumingMapping.addEvent(event); final List<SNodeId> ancestors = ListSequence.fromList(SNodeOperations.getAncestors(currentNode, null, true)) .select( new ISelector<SNode, SNodeId>() { public SNodeId select(SNode a) { return a.getNodeId(); } }) .toListSequence(); myQueue.runTask( new Runnable() { public void run() { if (myDifference.getChangeSet() == null) { update(true); } else { if (ListSequence.fromList(ancestors) .any( new IWhereFilter<SNodeId>() { public boolean accept(SNodeId a) { return myAddedNodesToChanges.containsKey(a); } })) { // ignore } else { if (myEventConsumingMapping.removeEvent(event)) { myDifference.getBroadcaster().changeUpdateStarted(); ModelAccess.instance() .runReadAction( new Runnable() { public void run() { synchronized (ChangesTracking.this) { if (!(myDisposed)) { task.invoke(); } } } }); myDifference.getBroadcaster().changeUpdateFinished(); } } } } }); }