X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling.ui%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Fui%2Fchart%2Fproperty%2FTemplateModifier.java;h=b2ec373ef154e08b64cd13d331d3ad38d4c1542a;hb=7396956f115b87067970f690588017fc05393e7a;hp=dc185c21a438f513e07304b6d7fc894df12a5c97;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/chart/property/TemplateModifier.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/chart/property/TemplateModifier.java index dc185c21a..b2ec373ef 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/chart/property/TemplateModifier.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/chart/property/TemplateModifier.java @@ -1,34 +1,34 @@ -/******************************************************************************* - * Copyright (c) 2007, 2011 Association for Decentralized Information Management in - * Industry THTH ry. - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - * - * Contributors: - * VTT Technical Research Centre of Finland - initial API and implementation - *******************************************************************************/ -package org.simantics.modeling.ui.chart.property; - -import org.simantics.browsing.ui.swt.widgets.impl.ModifyComboListenerImpl; -import org.simantics.db.Resource; -import org.simantics.db.WriteGraph; -import org.simantics.db.exception.DatabaseException; -import org.simantics.operation.Layer0X; - -public class TemplateModifier extends ModifyComboListenerImpl { - - @Override - public void applySelection(WriteGraph graph, Resource monitor, Resource template) throws DatabaseException { - - Layer0X L0X = Layer0X.getInstance(graph); - Resource exist = graph.getPossibleObject(monitor, L0X.ObtainsProperty); - if(template.equals(exist)) return; - - graph.deny(monitor, L0X.ObtainsProperty); - graph.claim(monitor, L0X.ObtainsProperty1, null, template); - - } - +/******************************************************************************* + * Copyright (c) 2007, 2011 Association for Decentralized Information Management in + * Industry THTH ry. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.modeling.ui.chart.property; + +import org.simantics.browsing.ui.swt.widgets.impl.ModifyComboListenerImpl; +import org.simantics.db.Resource; +import org.simantics.db.WriteGraph; +import org.simantics.db.exception.DatabaseException; +import org.simantics.operation.Layer0X; + +public class TemplateModifier extends ModifyComboListenerImpl { + + @Override + public void applySelection(WriteGraph graph, Resource monitor, Resource template) throws DatabaseException { + + Layer0X L0X = Layer0X.getInstance(graph); + Resource exist = graph.getPossibleObject(monitor, L0X.ObtainsProperty); + if(template.equals(exist)) return; + + graph.deny(monitor, L0X.ObtainsProperty); + graph.claim(monitor, L0X.ObtainsProperty1, null, template); + + } + } \ No newline at end of file