X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.browsing.ui.swt%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2Fswt%2FModelledActionImpl.java;h=adfa8d979c06f1dca1a1de4aeb8cff3437af2766;hp=4ffc0a4a774db3b858d9c0e25d5119d9b24db740;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/ModelledActionImpl.java b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/ModelledActionImpl.java index 4ffc0a4a7..adfa8d979 100644 --- a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/ModelledActionImpl.java +++ b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/ModelledActionImpl.java @@ -1,58 +1,58 @@ -/******************************************************************************* - * Copyright (c) 2012 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.browsing.ui.swt; - -import org.eclipse.ui.IWorkbenchSite; -import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport; -import org.simantics.db.Resource; -import org.simantics.db.exception.DatabaseException; -import org.simantics.db.management.ISessionContext; - -public abstract class ModelledActionImpl implements ModelledAction { - - @SuppressWarnings("unused") - private Resource configuration; - private WidgetSupport support; - - public ModelledActionImpl(Resource configuration) { - this.configuration = configuration; - } - - public abstract void run(T input); - - @SuppressWarnings("unchecked") - protected T2 getParameter(String uri) { - - return (T2)support.getParameter(uri); - - } - - @Override - public Runnable create(IWorkbenchSite site, ISessionContext context, final WidgetSupport support) throws DatabaseException { - - this.support = support; - - return new Runnable() { - - @Override - public void run() { - @SuppressWarnings("unchecked") - T input = (T)support.getInput(); - - ModelledActionImpl.this.run(input); - } - - }; - - } - -} +/******************************************************************************* + * Copyright (c) 2012 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.browsing.ui.swt; + +import org.eclipse.ui.IWorkbenchSite; +import org.simantics.browsing.ui.swt.widgets.impl.WidgetSupport; +import org.simantics.db.Resource; +import org.simantics.db.exception.DatabaseException; +import org.simantics.db.management.ISessionContext; + +public abstract class ModelledActionImpl implements ModelledAction { + + @SuppressWarnings("unused") + private Resource configuration; + private WidgetSupport support; + + public ModelledActionImpl(Resource configuration) { + this.configuration = configuration; + } + + public abstract void run(T input); + + @SuppressWarnings("unchecked") + protected T2 getParameter(String uri) { + + return (T2)support.getParameter(uri); + + } + + @Override + public Runnable create(IWorkbenchSite site, ISessionContext context, final WidgetSupport support) throws DatabaseException { + + this.support = support; + + return new Runnable() { + + @Override + public void run() { + @SuppressWarnings("unchecked") + T input = (T)support.getInput(); + + ModelledActionImpl.this.run(input); + } + + }; + + } + +}