package org.simantics.desktop.ui.internal;
+import java.util.Collections;
+import java.util.Set;
+
+import org.simantics.project.ontology.ProjectResource;
import org.simantics.selectionview.StandardPropertyPage;
import org.simantics.ui.workbench.IPropertyPage;
import org.simantics.views.swt.ModelledView;
public class StandardModelledView extends ModelledView {
+ private static final Set<String> defaultBrowseContexts = Collections.singleton(ProjectResource.URIs.ProjectBrowseContext);
+
@Override
protected IPropertyPage getPropertyPage() {
- return new StandardPropertyPage(getSite());
+ return new StandardPropertyPage(getSite(), defaultBrowseContexts);
}
}
import org.simantics.scl.ui.Activator;
import org.simantics.scl.ui.editor2.SCLModuleEditor2;
import org.simantics.scl.ui.editor2.SCLModuleEditorInput;
+import org.simantics.utils.ui.SWTUtils;
public class SCLModuleOutlinePage extends ContentOutlinePage {
@Override
public void notifyAboutUpdate() {
- parent.getDisplay().asyncExec(() -> {
+ if (parent.isDisposed())
+ return;
+
+ Failable<Module> module = SCLOsgi.MODULE_REPOSITORY.getModule(moduleSource.getModuleName(), updateListener);
+ SWTUtils.asyncExec(parent, () -> {
if (!outlineViewer.getControl().isDisposed()) {
+ outlineViewer.setInput(module.didSucceed() ? module.getResult() : null);
outlineViewer.refresh();
}
});
}
};
- Failable<Module> module = SCLOsgi.MODULE_REPOSITORY.getModule(moduleSource.getModuleName(), updateListener);
- Module result = module.getResult();
- outlineViewer.setInput(result);
+
+ updateListener.notifyAboutUpdate();
}
@Override