X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling.ui%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Fui%2Factions%2FNewSCLQuery.java;h=a2379c2a594e7cf51b853a140f518020bf933575;hb=HEAD;hp=11c77d3fb1d18291fa551def77e82275dd245922;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/NewSCLQuery.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/NewSCLQuery.java index 11c77d3fb..a2379c2a5 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/NewSCLQuery.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/actions/NewSCLQuery.java @@ -1,37 +1,37 @@ -package org.simantics.modeling.ui.actions; - -import org.simantics.Simantics; -import org.simantics.db.Resource; -import org.simantics.db.common.request.PossibleIndexRoot; -import org.simantics.db.exception.DatabaseException; -import org.simantics.db.layer0.adapter.ActionFactory; -import org.simantics.modeling.ui.ModelingUIUtils; -import org.simantics.utils.ui.ErrorLogger; - -/** - * @author Antti Villberg - */ -public class NewSCLQuery implements ActionFactory { - - @Override - public Runnable create(Object target) { - if(!(target instanceof Resource)) - return null; - final Resource parent = (Resource)target; - - return new Runnable() { - @Override - public void run() { - try { - Resource indexRoot = Simantics.getSession().syncRequest(new PossibleIndexRoot(parent)); - if(indexRoot == null) return; - Simantics.getSession().markUndoPoint(); - ModelingUIUtils.newSCLQuery(parent, indexRoot); - } catch (DatabaseException e) { - ErrorLogger.defaultLogError(e); - } - } - }; - } - -} +package org.simantics.modeling.ui.actions; + +import org.simantics.Simantics; +import org.simantics.db.Resource; +import org.simantics.db.common.request.PossibleIndexRoot; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.layer0.adapter.ActionFactory; +import org.simantics.modeling.ui.ModelingUIUtils; +import org.simantics.utils.ui.ErrorLogger; + +/** + * @author Antti Villberg + */ +public class NewSCLQuery implements ActionFactory { + + @Override + public Runnable create(Object target) { + if(!(target instanceof Resource)) + return null; + final Resource parent = (Resource)target; + + return new Runnable() { + @Override + public void run() { + try { + Resource indexRoot = Simantics.getSession().syncRequest(new PossibleIndexRoot(parent)); + if(indexRoot == null) return; + Simantics.getSession().markUndoPoint(); + ModelingUIUtils.newSCLQuery(parent, indexRoot); + } catch (DatabaseException e) { + ErrorLogger.defaultLogError(e); + } + } + }; + } + +}