Contributors:
IBM Corporation - Initial implementation
- Klaus Hartlage - www.eclipseproject.de
+ www.phpeclipse.de
**********************************************************************/
package net.sourceforge.phpdt.phphelp;
-import net.sourceforge.phpdt.externaltools.internal.model.ColorManager;
-import net.sourceforge.phpdt.externaltools.internal.model.VariableContextManager;
-import net.sourceforge.phpeclipse.resourcesview.PHPElement;
-import net.sourceforge.phpeclipse.resourcesview.PHPElementAdapterFactory;
-import net.sourceforge.phpeclipse.resourcesview.ResourceAdapterFactory;
-
-import org.eclipse.core.boot.BootLoader;
-import org.eclipse.core.resources.IResource;
import org.eclipse.core.resources.IWorkspace;
import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IAdapterManager;
-import org.eclipse.core.runtime.IPath;
import org.eclipse.core.runtime.IPluginDescriptor;
import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Path;
import org.eclipse.core.runtime.Platform;
import org.eclipse.core.runtime.Status;
import org.eclipse.jface.preference.IPreferenceStore;
import org.eclipse.swt.widgets.Shell;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
/**
* The main plugin class to be used in the desktop.
* The constructor.
*/
public PHPHelpPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
+ super();
plugin = this;
}
}
private IWorkbenchPage internalGetActivePage() {
- IWorkbenchWindow window = getWorkbench().getActiveWorkbenchWindow();
+ IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
if (window != null)
return window.getActivePage();
return null;
}
public static IWorkbenchWindow getActiveWorkbenchWindow() {
- return getDefault().getWorkbench().getActiveWorkbenchWindow();
+ return PlatformUI.getWorkbench().getActiveWorkbenchWindow();
}
public static Shell getActiveWorkbenchShell() {
return getActiveWorkbenchWindow().getShell();
}
- public static String getPluginId() {
- return getDefault().getDescriptor().getUniqueIdentifier();
- }
+// public static String getPluginId() {
+// return getDefault().getDescriptor().getUniqueIdentifier();
+// }
public static void log(IStatus status) {
getDefault().getLog().log(status);
return getDefault().isDebugging();
}
- static IPath getInstallLocation() {
- return new Path(getDefault().getDescriptor().getInstallURL().getFile());
- }
+// static IPath getInstallLocation() {
+// return new Path(getDefault().getDescriptor().getInstallURL().getFile());
+// }
protected void initializeDefaultPreferences(IPreferenceStore store) {
// windows preferences:
- String windowsSystem = BootLoader.getWS();
+ String windowsSystem = Platform.getWS();
- if (windowsSystem.equals(BootLoader.WS_WIN32)) {
+ if (windowsSystem.equals(Platform.WS_WIN32)) {
store.setDefault(PHP_CHM_ENABLED, "false");
store.setDefault(PHP_CHM_FILE, "c:\\wampp2\\php\\php_manual_en.chm");
store.setDefault(PHP_CHM_COMMAND, "hh.exe \"mk:@MSITStore:{0}::/en/function.{1}.html\"");
return display;
}
- public void startup() throws CoreException {
- super.startup();
- IAdapterManager manager = Platform.getAdapterManager();
- manager.registerAdapters(new PHPElementAdapterFactory(), PHPElement.class);
- manager.registerAdapters(new ResourceAdapterFactory(), IResource.class);
- // externalTools.startUp();
- getStandardDisplay().asyncExec(new Runnable() {
- public void run() {
- //initialize the variable context manager
- VariableContextManager.getDefault();
- }
- });
- }
-
- /**
- * @see org.eclipse.core.runtime.Plugin#shutdown()
- */
- public void shutdown() throws CoreException {
- // externalTools.shutDown();
- ColorManager.getDefault().dispose();
- }
-
+// public void startup() throws CoreException {
+// super.startup();
+// IAdapterManager manager = Platform.getAdapterManager();
+// manager.registerAdapters(new PHPElementAdapterFactory(), PHPElement.class);
+// manager.registerAdapters(new ResourceAdapterFactory(), IResource.class);
+// // externalTools.startUp();
+// getStandardDisplay().asyncExec(new Runnable() {
+// public void run() {
+// //initialize the variable context manager
+// VariableContextManager.getDefault();
+// }
+// });
+// }
+
+// /**
+// * @see org.eclipse.core.runtime.Plugin#shutdown()
+// */
+// public void shutdown() throws CoreException {
+// // externalTools.shutDown();
+// ColorManager.getDefault().dispose();
+// }
+
+ /* (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+// IAdapterManager manager = Platform.getAdapterManager();
+// manager.registerAdapters(new PHPElementAdapterFactory(), PHPElement.class);
+// manager.registerAdapters(new ResourceAdapterFactory(), IResource.class);
+// // externalTools.startUp();
+// getStandardDisplay().asyncExec(new Runnable() {
+// public void run() {
+// //initialize the variable context manager
+// VariableContextManager.getDefault();
+// }
+// });
+ }
+ /* (non-Javadoc)
+ * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+// ColorManager.getDefault().dispose();
+ super.stop(context);
+ }
}
\ No newline at end of file