1 /*******************************************************************************
\r
2 * Copyright (c) 2007- VTT Technical Research Centre of Finland.
\r
3 * All rights reserved. This program and the accompanying materials
\r
4 * are made available under the terms of the Eclipse Public License v1.0
\r
5 * which accompanies this distribution, and is available at
\r
6 * http://www.eclipse.org/legal/epl-v10.html
\r
9 * VTT Technical Research Centre of Finland - initial API and implementation
\r
10 *******************************************************************************/
\r
11 package org.simantics.proconf.g3d.occ;
\r
13 import org.eclipse.ui.plugin.AbstractUIPlugin;
\r
14 import org.osgi.framework.BundleContext;
\r
15 import org.simantics.proconf.g3d.csg.stubs.CSGResource;
\r
16 import org.simantics.db.Graph;
\r
17 import org.simantics.db.GraphRequestAdapter;
\r
18 import org.simantics.db.GraphRequestStatus;
\r
19 import org.simantics.proconf.g3d.stubs.G3DResource;
\r
20 import org.simantics.proconf.ui.ProConfUI;
\r
23 * The activator class controls the plug-in life cycle
\r
25 public class Activator extends AbstractUIPlugin {
\r
28 public static final String PLUGIN_ID = "org.simantics.proconf.g3d.occ";
\r
30 // The shared instance
\r
31 private static Activator plugin;
\r
36 public Activator() {
\r
41 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
\r
43 public void start(BundleContext context) throws Exception {
\r
44 super.start(context);
\r
47 ProConfUI.getSession().syncRead(new GraphRequestAdapter() {
\r
49 public GraphRequestStatus perform(Graph g) throws Exception {
\r
50 OccResources.csgResource = CSGResource.getInstance(g);
\r
51 OccResources.g3dResource = G3DResource.getInstance(g);
\r
52 return GraphRequestStatus.transactionComplete();
\r
59 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
\r
61 public void stop(BundleContext context) throws Exception {
\r
63 super.stop(context);
\r
67 * Returns the shared instance
\r
69 * @return the shared instance
\r
71 public static Activator getDefault() {
\r