2 * Copyright (C) 2010 Mathieu Baudier <mbaudier@argeo.org>
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org
.argeo
.eclipse
.ui
;
19 import org
.eclipse
.core
.runtime
.Platform
;
20 import org
.eclipse
.ui
.plugin
.AbstractUIPlugin
;
21 import org
.osgi
.framework
.Bundle
;
22 import org
.osgi
.framework
.BundleContext
;
25 * The activator class controls the plug-in life cycle
27 public class ArgeoUiPlugin
extends AbstractUIPlugin
{
30 public static final String PLUGIN_ID
= "org.argeo.eclipse.ui";
32 private final static String SPRING_OSGI_EXTENDER
= "org.springframework.osgi.extender";
34 // The shared instance
35 private static ArgeoUiPlugin plugin
;
37 private BundleContext bundleContext
;
42 public ArgeoUiPlugin() {
49 * org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext
52 public void start(BundleContext context
) throws Exception
{
55 bundleContext
= context
;
57 // Make sure that the Spring OSGi extender is started
58 Bundle osgiExtBundle
= Platform
.getBundle(SPRING_OSGI_EXTENDER
);
59 if (osgiExtBundle
!= null)
60 osgiExtBundle
.start();
62 throw new Exception("Spring OSGi Extender not found");
69 * org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext
72 public void stop(BundleContext context
) throws Exception
{
78 * Returns the shared instance
80 * @return the shared instance
82 public static ArgeoUiPlugin
getDefault() {
86 public BundleContext
getBundleContext() {