e3873a435dd521df759ad4609f258f9f8efda0b4
[phpeclipse.git] / net.sourceforge.phpeclipse.phpunit / src / net / sourceforge / phpeclipse / phpunit / PHPUnitPlugin.java
1 /*
2  * Created on Sep 4, 2004
3  *
4  * To change the template for this generated file go to
5  * Window>Preferences>Java>Code Generation>Code and Comments
6  */
7 package net.sourceforge.phpeclipse.phpunit;
8
9 import java.net.MalformedURLException;
10 import java.net.URL;
11 import java.util.ResourceBundle;
12
13 import org.eclipse.core.runtime.CoreException;
14 import org.eclipse.core.runtime.IPluginDescriptor;
15 import org.eclipse.jface.dialogs.IDialogSettings;
16 import org.eclipse.jface.preference.IPreferenceStore;
17 import org.eclipse.jface.resource.ImageDescriptor;
18 import org.eclipse.jface.resource.ImageRegistry;
19 import org.eclipse.ui.IWorkbench;
20 import org.eclipse.ui.plugin.AbstractUIPlugin;
21
22 /**
23  * @author Ali Echihabi
24  *
25  * To change the template for this generated type comment go to
26  * Window>Preferences>Java>Code Generation>Code and Comments
27  */
28 public class PHPUnitPlugin extends AbstractUIPlugin {
29
30
31
32         private static PHPUnitPlugin plugin;
33         private ResourceBundle resourceBundle;
34
35
36         /**
37          * @param descriptor
38          */
39         public PHPUnitPlugin(IPluginDescriptor descriptor) {
40                 super(descriptor);
41                 
42                 plugin = this;
43
44                 
45         
46                 
47         }
48
49         public static PHPUnitPlugin getDefault() {
50                 return plugin;
51         }
52
53         /* (non-Javadoc)
54          * @see org.eclipse.ui.plugin.AbstractUIPlugin#createImageRegistry()
55          */
56         protected ImageRegistry createImageRegistry() {
57                 // TODO Auto-generated method stub
58                 return super.createImageRegistry();
59         }
60
61         /* (non-Javadoc)
62          * @see org.eclipse.ui.plugin.AbstractUIPlugin#getDialogSettings()
63          */
64         public IDialogSettings getDialogSettings() {
65                 // TODO Auto-generated method stub
66                 return super.getDialogSettings();
67         }
68
69         /* (non-Javadoc)
70          * @see org.eclipse.ui.plugin.AbstractUIPlugin#getImageRegistry()
71          */
72         public ImageRegistry getImageRegistry() {
73                 // TODO Auto-generated method stub
74                 return super.getImageRegistry();
75         }
76
77         /* (non-Javadoc)
78          * @see org.eclipse.ui.plugin.AbstractUIPlugin#getPreferenceStore()
79          */
80         public IPreferenceStore getPreferenceStore() {
81                 // TODO Auto-generated method stub
82                 return super.getPreferenceStore();
83         }
84
85         /* (non-Javadoc)
86          * @see org.eclipse.ui.plugin.AbstractUIPlugin#getWorkbench()
87          */
88         public IWorkbench getWorkbench() {
89                 // TODO Auto-generated method stub
90                 return super.getWorkbench();
91         }
92
93         /* (non-Javadoc)
94          * @see org.eclipse.core.runtime.Plugin#initializeDefaultPluginPreferences()
95          */
96         protected void initializeDefaultPluginPreferences() {
97                 // TODO Auto-generated method stub
98                 super.initializeDefaultPluginPreferences();
99         }
100
101         /* (non-Javadoc)
102          * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeDefaultPreferences(org.eclipse.jface.preference.IPreferenceStore)
103          */
104         protected void initializeDefaultPreferences(IPreferenceStore store) {
105                 // TODO Auto-generated method stub
106                 super.initializeDefaultPreferences(store);
107         }
108
109         /* (non-Javadoc)
110          * @see org.eclipse.ui.plugin.AbstractUIPlugin#initializeImageRegistry(org.eclipse.jface.resource.ImageRegistry)
111          */
112         protected void initializeImageRegistry(ImageRegistry reg) {
113                 // TODO Auto-generated method stub
114                 super.initializeImageRegistry(reg);
115         }
116
117         /* (non-Javadoc)
118          * @see org.eclipse.ui.plugin.AbstractUIPlugin#loadDialogSettings()
119          */
120         protected void loadDialogSettings() {
121                 // TODO Auto-generated method stub
122                 super.loadDialogSettings();
123         }
124
125
126
127         /* (non-Javadoc)
128          * @see org.eclipse.ui.plugin.AbstractUIPlugin#refreshPluginActions()
129          */
130         protected void refreshPluginActions() {
131                 // TODO Auto-generated method stub
132                 super.refreshPluginActions();
133         }
134
135         /* (non-Javadoc)
136          * @see org.eclipse.ui.plugin.AbstractUIPlugin#saveDialogSettings()
137          */
138         protected void saveDialogSettings() {
139                 // TODO Auto-generated method stub
140                 super.saveDialogSettings();
141         }
142
143
144
145         /* (non-Javadoc)
146          * @see org.eclipse.core.runtime.Plugin#shutdown()
147          */
148         public void shutdown() throws CoreException {
149                 // TODO Auto-generated method stub
150                 super.shutdown();
151         }
152
153         /* (non-Javadoc)
154          * @see org.eclipse.core.runtime.Plugin#startup()
155          */
156         public void startup() throws CoreException {
157                 // TODO Auto-generated method stub
158                 super.startup();
159         }
160
161         /**
162          * @param string
163          */
164         public static ImageDescriptor getImageDescriptor(String name) {
165                 
166                 String iconPath = "icons/";
167                 try {
168                         URL installURL = getDefault().getDescriptor().getInstallURL();
169                         URL url = new URL(installURL, iconPath + name);
170                         
171                         System.out.println("url:" + url.toExternalForm());
172                         
173                         return ImageDescriptor.createFromURL(url);
174                 } catch (MalformedURLException e) {
175                         // should not happen
176                         return ImageDescriptor.getMissingImageDescriptor();
177                 }               
178                 
179                 
180         }
181
182 }