From: luukkainen Date: Tue, 28 Oct 2008 13:20:52 +0000 (+0000) Subject: fi.vtt -> org X-Git-Tag: simantics-1.19.0~20^2~41 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=00bc3411f126a365e58f12ef85e16cf2221744e9;p=simantics%2F3d.git fi.vtt -> org git-svn-id: https://www.simantics.org/svn/simantics/3d/branches/dev@7308 ac1ea38d-2e2b-0410-8846-a27921b304fc --- diff --git a/org.simantics.proconf.processeditor/src/fi/vtt/simantics/processeditor/Activator.java b/org.simantics.proconf.processeditor/src/fi/vtt/simantics/processeditor/Activator.java deleted file mode 100644 index 9f2ad49d..00000000 --- a/org.simantics.proconf.processeditor/src/fi/vtt/simantics/processeditor/Activator.java +++ /dev/null @@ -1,97 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 VTT Technical Research Centre of Finland and others. - * 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 fi.vtt.simantics.processeditor; - -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; -import org.simantics.db.Graph; -import org.simantics.db.GraphRequestAdapter; -import org.simantics.db.GraphRequestStatus; -import org.simantics.db.management.ISessionContext; -import org.simantics.db.management.ISessionContextChangedListener; -import org.simantics.db.management.SessionContextChangedEvent; -import org.simantics.proconf.ui.ProConfUI; - - - - -/** - * The activator class controls the plug-in life cycle - */ -public class Activator extends AbstractUIPlugin { - - // The plug-in ID - public static final String PLUGIN_ID = "fi.vtt.simantics.processeditor"; - - // The shared instance - private static Activator plugin; - - /** - * The constructor - */ - public Activator() { - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) - */ - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - ProConfUI.getSessionContextProvider().addContextChangedListener(new ISessionContextChangedListener() { - @Override - public void sessionContextChanged(SessionContextChangedEvent event) { - ISessionContext ctx = event.getNewValue(); - if (ctx != null) { - ctx.getSession().asyncRead(new GraphRequestAdapter() { - public GraphRequestStatus perform(Graph g) throws Exception { - ProcessResource.initialize(g); - return GraphRequestStatus.transactionComplete(); - }; - }); - } else { - ProcessResource.deinitialize(); - } - } - }); - try { - ProConfUI.getSession().asyncRead(new GraphRequestAdapter() { - @Override - public GraphRequestStatus perform(Graph g) throws Exception { - ProcessResource.initialize(g); - return GraphRequestStatus.transactionComplete(); - } - }); - } catch (Exception e) { - - } - } - - /* - * (non-Javadoc) - * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) - */ - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - /** - * Returns the shared instance - * - * @return the shared instance - */ - public static Activator getDefault() { - return plugin; - } - -} diff --git a/org.simantics.proconf.processeditor/src/fi/vtt/simantics/processeditor/ProcessResource.java b/org.simantics.proconf.processeditor/src/fi/vtt/simantics/processeditor/ProcessResource.java deleted file mode 100644 index a7df93c9..00000000 --- a/org.simantics.proconf.processeditor/src/fi/vtt/simantics/processeditor/ProcessResource.java +++ /dev/null @@ -1,43 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2007 VTT Technical Research Centre of Finland and others. - * 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 fi.vtt.simantics.processeditor; - -import org.simantics.db.Builtins; -import org.simantics.db.Graph; -import org.simantics.proconf.g3d.stubs.G3DResource; - -import fi.vtt.simantics.processeditor.common.ControlPointTools; -import fi.vtt.simantics.processeditor.stubs.Plant3DResource; - -public class ProcessResource { - public static Builtins builtins; - public static G3DResource g3dResource; - public static Plant3DResource plant3Dresource; - - - public static void initialize(Graph g) { - ProcessResource.builtins = Builtins.getInstance(g); - ProcessResource.g3dResource = G3DResource.getInstance(g); - ProcessResource.plant3Dresource = Plant3DResource.getInstance(g); - ControlPointTools.initialize(); - } - - public static void deinitialize() { - builtins = null; - g3dResource = null; - plant3Dresource = null; - ControlPointTools.deinitialize(); - } - - public static boolean isInitialized() { - return builtins != null; - } -}