import org.simantics.db.ReadGraph;
import org.simantics.db.Resource;
import org.simantics.db.exception.DatabaseException;
-import org.simantics.ui.utils.ResourceAdaptionUtils;
+import org.simantics.ui.selection.WorkbenchSelectionUtils;
import org.simantics.ui.workbench.action.ResourceEditorAdapterAction;
import org.simantics.ui.workbench.editor.EditorAdapter;
import org.simantics.ui.workbench.editor.EditorRegistry;
}
protected Object extractResource(ReadGraph graph, Object object) throws DatabaseException {
- Resource resource = ResourceAdaptionUtils.adaptToResource(graph, object);
- if(resource != null) return resource;
- else return object;
+ Resource resource = WorkbenchSelectionUtils.getPossibleResourceFromSelection(graph, object);
+ return resource != null ? resource : object;
}
-
+
@Override
protected boolean preAcceptSelection(Object[] selection) {
return selection.length == 1;