import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.simantics.Simantics;
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import org.simantics.Simantics;
import org.simantics.db.Disposable;
import org.simantics.db.ReadGraph;
import org.simantics.db.Resource;
import org.simantics.db.Disposable;
import org.simantics.db.ReadGraph;
import org.simantics.db.Resource;
import org.simantics.db.common.procedure.adapter.DisposableListener;
import org.simantics.db.common.procedure.adapter.DisposableSyncListener;
import org.simantics.db.common.procedure.adapter.DisposableListener;
import org.simantics.db.common.procedure.adapter.DisposableSyncListener;
import org.simantics.db.common.request.TernaryRead;
import org.simantics.db.common.request.UnaryRead;
import org.simantics.db.common.request.UniqueRead;
import org.simantics.db.common.request.TernaryRead;
import org.simantics.db.common.request.UnaryRead;
import org.simantics.db.common.request.UniqueRead;
private ConcurrentHashMap<Resource, SCLValueDisposableSyncListener> currentlyListening = new ConcurrentHashMap<>();
private boolean disposed;
private ConcurrentHashMap<Resource, SCLValueDisposableSyncListener> currentlyListening = new ConcurrentHashMap<>();
private boolean disposed;
if (currentlyListening.isEmpty() && newComponents.isEmpty()) {
// we can stop here as nothing will change
return;
if (currentlyListening.isEmpty() && newComponents.isEmpty()) {
// we can stop here as nothing will change
return;
for (Resource addedComponent : addedComponents) {
SCLValueDisposableSyncListener listener = new SCLValueDisposableSyncListener(callback);
currentlyListening.put(addedComponent, listener);
for (Resource addedComponent : addedComponents) {
SCLValueDisposableSyncListener listener = new SCLValueDisposableSyncListener(callback);
currentlyListening.put(addedComponent, listener);