package org.simantics.browsing.ui.graph.impl; import java.util.Map; import org.eclipse.jface.resource.ImageDescriptor; import org.simantics.browsing.ui.BuiltinKeys.ImagerKey; import org.simantics.browsing.ui.NodeContext; import org.simantics.browsing.ui.PrimitiveQueryUpdater; import org.simantics.browsing.ui.graph.impl.contribution.ImagerContributionImpl; import org.simantics.browsing.ui.model.browsecontexts.BrowseContext; import org.simantics.db.ReadGraph; import org.simantics.db.exception.DatabaseException; @SuppressWarnings("unchecked") public class EvaluatorImager extends ImagerContributionImpl { final BrowseContext browseContext; final boolean useNodeBrowseContexts; public EvaluatorImager(PrimitiveQueryUpdater updater, NodeContext context, ImagerKey key, BrowseContext browseContext, boolean useNodeBrowseContexts) { super(updater, context, key); this.browseContext = browseContext; this.useNodeBrowseContexts = useNodeBrowseContexts; } @Override public Map getDescriptors(ReadGraph graph, NodeContext context) throws DatabaseException { return BrowseContext.get(graph,context,browseContext,useNodeBrowseContexts).getImage(graph, context); } public String toString() { return "EvaluatorImager[" + browseContext + "] " + context; } }