1 package org.simantics.issues.ui;
3 import java.util.Collection;
4 import java.util.Collections;
6 import org.simantics.browsing.ui.model.children.ChildRule;
7 import org.simantics.db.ReadGraph;
8 import org.simantics.db.Resource;
9 import org.simantics.db.exception.DatabaseException;
10 import org.simantics.issues.common.DynamicIssueSources;
13 * @author Tuukka Lehtonen
16 public class DynamicIssueSourceRule implements ChildRule {
19 public boolean isCompatible(Class<?> contentType) {
20 return contentType.equals(Resource.class);
24 public Collection<?> getChildren(ReadGraph graph, Object parent) throws DatabaseException {
25 return graph.syncRequest(new DynamicIssueSources((Resource) parent));
29 public Collection<?> getParents(ReadGraph graph, Object child) throws DatabaseException {
30 return Collections.singleton(child);