01: package com.quantum.dbunit;
02:
03: import java.net.MalformedURLException;
04: import java.net.URL;
05:
06: import org.eclipse.jface.resource.ImageRegistry;
07: import org.eclipse.ui.plugin.AbstractUIPlugin;
08:
09: /**
10: *
11: * @author BC Holmes
12: */
13: public class QuantumDbUnitPlugin extends AbstractUIPlugin {
14:
15: protected static AbstractUIPlugin plugin;
16:
17: public QuantumDbUnitPlugin() {
18: super ();
19: plugin = this ;
20: }
21:
22: public static AbstractUIPlugin getDefault() {
23: return QuantumDbUnitPlugin.plugin;
24: }
25:
26: protected void initializeImageRegistry(ImageRegistry registry) {
27: super .initializeImageRegistry(registry);
28: try {
29: ImageStoreInitializer.initialize(this , getIconLocation());
30: } catch (MalformedURLException e) {
31: // this should never happen, but if it does, we don't get images.
32: }
33: }
34:
35: /**
36: * @return
37: * @throws MalformedURLException
38: */
39: private URL getIconLocation() throws MalformedURLException {
40: URL installURL = getBundle().getEntry("/");
41: return new URL(installURL, "icons/");
42: }
43:
44: }
|