1 package org.simantics.modeling.ui.diagram.monitor;
3 import org.simantics.browsing.ui.swt.widgets.impl.ReadFactoryImpl;
4 import org.simantics.common.format.Formatter;
5 import org.simantics.db.ReadGraph;
6 import org.simantics.db.Resource;
7 import org.simantics.db.exception.DatabaseException;
8 import org.simantics.diagram.stubs.DiagramResource;
10 public class CurrentFormatFactory extends ReadFactoryImpl<Resource, String> {
13 public String perform(ReadGraph graph, Resource monitor) throws DatabaseException {
15 DiagramResource DIA = DiagramResource.getInstance(graph);
16 Formatter formatter = graph.getPossibleRelatedAdapter(monitor, DIA.HasFormatter, Formatter.class);
17 if(formatter != null) return formatter.toString();