| 1 | |
package org.seasar.eclipse.common; |
| 2 | |
|
| 3 | |
import org.eclipse.core.runtime.Plugin; |
| 4 | |
import org.osgi.framework.BundleContext; |
| 5 | |
import org.seasar.eclipse.common.util.LogUtil; |
| 6 | |
|
| 7 | |
|
| 8 | |
|
| 9 | |
|
| 10 | |
public class CommonPlugin extends Plugin { |
| 11 | |
|
| 12 | |
|
| 13 | |
private static CommonPlugin plugin; |
| 14 | |
|
| 15 | |
|
| 16 | |
|
| 17 | |
|
| 18 | 0 | public CommonPlugin() { |
| 19 | 0 | plugin = this; |
| 20 | 0 | } |
| 21 | |
|
| 22 | |
|
| 23 | |
|
| 24 | |
|
| 25 | |
@Override |
| 26 | |
public void start(BundleContext context) throws Exception { |
| 27 | 0 | throw new UnsupportedOperationException("This plugin cannot started."); |
| 28 | |
} |
| 29 | |
|
| 30 | |
|
| 31 | |
|
| 32 | |
|
| 33 | |
@Override |
| 34 | |
public void stop(BundleContext context) throws Exception { |
| 35 | 0 | super.stop(context); |
| 36 | 0 | plugin = null; |
| 37 | 0 | } |
| 38 | |
|
| 39 | |
|
| 40 | |
|
| 41 | |
|
| 42 | |
public static CommonPlugin getDefault() { |
| 43 | 0 | return plugin; |
| 44 | |
} |
| 45 | |
|
| 46 | |
public static void log(String msg) { |
| 47 | 0 | LogUtil.log(getDefault(), msg); |
| 48 | 0 | } |
| 49 | |
|
| 50 | |
public static void log(Throwable throwable) { |
| 51 | 0 | LogUtil.log(getDefault(), throwable); |
| 52 | 0 | } |
| 53 | |
|
| 54 | |
} |