fixed Message bug
[phpeclipse.git] / net.sourceforge.phpeclipse.debug.ui / src / net / sourceforge / phpdt / internal / debug / ui / PHPDebugUiPlugin.java
1 package net.sourceforge.phpdt.internal.debug.ui;
2
3 import net.sourceforge.phpeclipse.PHPeclipsePlugin;
4 import org.eclipse.core.resources.IWorkspace;
5 import org.eclipse.core.runtime.IPluginDescriptor;
6 import org.eclipse.core.runtime.IStatus;
7 import org.eclipse.core.runtime.Status;
8 import org.eclipse.jface.preference.IPreferenceStore;
9 import org.eclipse.ui.IWorkbenchPage;
10 import org.eclipse.ui.IWorkbenchWindow;
11 import org.eclipse.ui.plugin.AbstractUIPlugin;
12 import net.sourceforge.phpdt.debug.ui.PHPDebugUiConstants;
13
14 public class PHPDebugUiPlugin extends AbstractUIPlugin {
15         public static final String PLUGIN_ID = "net.sourceforge.phpeclipse.debug.ui"; //$NON-NLS-1$
16         protected static PHPDebugUiPlugin plugin;
17
18         public PHPDebugUiPlugin(IPluginDescriptor descriptor) {
19                 super(descriptor);
20                 plugin = this;
21         }
22
23         public static IWorkbenchWindow getActiveWorkbenchWindow() {
24                 return getDefault().getWorkbench().getActiveWorkbenchWindow();
25         }
26
27         public static IWorkbenchPage getActivePage() {
28                 return getDefault().getActiveWorkbenchWindow().getActivePage();
29         }
30
31         public static PHPDebugUiPlugin getDefault() {
32                 return plugin;
33         }
34
35         public static IWorkspace getWorkspace() {
36                 return PHPeclipsePlugin.getWorkspace();
37         }
38
39         public static void log(IStatus status) {
40                 getDefault().getLog().log(status);
41         }
42
43         public static void log(Throwable e) {
44                 log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, PHPDebugUiMessages.getString("RdtDebugUiPlugin.internalErrorOccurred"), e)); //$NON-NLS-1$
45         }
46
47 //      protected void initializeDefaultPreferences(IPreferenceStore store) {
48 //              super.initializeDefaultPreferences(store);
49 //              
50 //              store.setDefault(RdtDebugUiConstants.PREFERENCE_KEYWORDS, getDefaultKeywords());
51 //      }
52
53 //      protected String getDefaultKeywords() {
54 //              return "class,def,end,if,module,new,puts,require,rescue,throw,while";
55 //      }
56 }