|
| 1 | +package com.googlecode.androidannotations.api; |
| 2 | +/** |
| 3 | + * Copyright (C) 2010-2012 eBusiness Information, Excilys Group |
| 4 | + * |
| 5 | + * Licensed under the Apache License, Version 2.0 (the "License"); you may not |
| 6 | + * use this file except in compliance with the License. You may obtain a copy of |
| 7 | + * the License at |
| 8 | + * |
| 9 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | + * |
| 11 | + * Unless required by applicable law or agreed To in writing, software |
| 12 | + * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 13 | + * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 14 | + * License for the specific language governing permissions and limitations under |
| 15 | + * the License. |
| 16 | + */ |
| 17 | + |
| 18 | + |
| 19 | +import org.eclipse.core.runtime.Plugin; |
| 20 | +import org.osgi.framework.BundleContext; |
| 21 | + |
| 22 | +/** |
| 23 | + * The activator class controls the plug-in life cycle |
| 24 | + */ |
| 25 | +public class Activator extends Plugin { |
| 26 | + |
| 27 | + // The plug-in ID |
| 28 | + public static final String PLUGIN_ID = "com.googlecode.androidannotations-api"; |
| 29 | + |
| 30 | + // The shared instance |
| 31 | + private static Activator plugin; |
| 32 | + |
| 33 | + /** |
| 34 | + * The constructor |
| 35 | + */ |
| 36 | + public Activator() { |
| 37 | + } |
| 38 | + |
| 39 | + /* |
| 40 | + * (non-Javadoc) |
| 41 | + * @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext) |
| 42 | + */ |
| 43 | + public void start(BundleContext context) throws Exception { |
| 44 | + super.start(context); |
| 45 | + plugin = this; |
| 46 | + } |
| 47 | + |
| 48 | + /* |
| 49 | + * (non-Javadoc) |
| 50 | + * @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext) |
| 51 | + */ |
| 52 | + public void stop(BundleContext context) throws Exception { |
| 53 | + plugin = null; |
| 54 | + super.stop(context); |
| 55 | + } |
| 56 | + |
| 57 | + /** |
| 58 | + * Returns the shared instance |
| 59 | + * |
| 60 | + * @return the shared instance |
| 61 | + */ |
| 62 | + public static Activator getDefault() { |
| 63 | + return plugin; |
| 64 | + } |
| 65 | +} |
0 commit comments