1 package org.simantics.modeling.ui.diagram.monitor;
3 import org.simantics.browsing.ui.swt.widgets.impl.ModifyComboListenerImpl;
4 import org.simantics.db.Resource;
5 import org.simantics.db.WriteGraph;
6 import org.simantics.db.exception.DatabaseException;
7 import org.simantics.operation.Layer0X;
9 public class TemplateModifier extends ModifyComboListenerImpl<Resource, Resource> {
12 public void applySelection(WriteGraph graph, Resource monitor, Resource template) throws DatabaseException {
13 Layer0X L0X = Layer0X.getInstance(graph);
14 Resource exist = graph.getPossibleObject(monitor, L0X.ObtainsProperty);
15 if (template.equals(exist))
17 graph.markUndoPoint();
18 graph.deny(monitor, L0X.ObtainsProperty);
19 graph.claim(monitor, L0X.ObtainsProperty1, null, template);