From dd6abdc193e8988a2bf95ea153c5772c54a48e67 Mon Sep 17 00:00:00 2001 From: axelcl Date: Sun, 5 Jun 2005 21:34:54 +0000 Subject: [PATCH] deleted dependency from net.sourceforge.phpeclipse module --- .../internal/model/ExternalToolsImages.java | 5 +- .../BackgroundResourceRefresher.java | 8 ++-- .../internal/registry/ExternalToolMigration.java | 5 +- .../internal/registry/ExternalToolVariable.java | 4 +- .../launchConfigurations/ExternalToolsMainTab.java | 13 +++--- .../externaltools/variable/LocalhostExpander.java | 4 +- .../phpdt/externaltools/variable/UrlExpander.java | 4 +- .../externaltools/ExternalToolsPlugin.java | 47 ++++++++++++++++--- 8 files changed, 59 insertions(+), 31 deletions(-) diff --git a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/model/ExternalToolsImages.java b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/model/ExternalToolsImages.java index 24abd4b..e333652 100644 --- a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/model/ExternalToolsImages.java +++ b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/model/ExternalToolsImages.java @@ -5,7 +5,7 @@ Copyright (c) 2002 IBM Corp. and others. All rights reserved. This file is made available under the terms of the Common Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/cpl-v10.html -  +� Contributors: **********************************************************************/ @@ -15,7 +15,6 @@ import java.util.HashMap; import net.sourceforge.phpdt.externaltools.internal.ui.IExternalToolsUIConstants; import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; import org.eclipse.jface.resource.ImageDescriptor; import org.eclipse.jface.resource.ImageRegistry; @@ -159,7 +158,7 @@ public class ExternalToolsImages { * @see JFace's ImageRegistry */ public static ImageRegistry initializeImageRegistry() { - imageRegistry= new ImageRegistry(PHPeclipsePlugin.getStandardDisplay()); + imageRegistry= new ImageRegistry(ExternalToolsPlugin.getStandardDisplay()); imageDescriptors = new HashMap(30); declareImages(); return imageRegistry; diff --git a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/BackgroundResourceRefresher.java b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/BackgroundResourceRefresher.java index 3b1136a..1625a08 100644 --- a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/BackgroundResourceRefresher.java +++ b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/program/launchConfigurations/BackgroundResourceRefresher.java @@ -5,7 +5,7 @@ Copyright (c) 2002 IBM Corp. and others. All rights reserved. This file is made available under the terms of the Common Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/cpl-v10.html -  +� Contributors: **********************************************************************/ @@ -13,7 +13,7 @@ import java.lang.reflect.InvocationTargetException; import net.sourceforge.phpdt.externaltools.launchConfigurations.ExternalToolsUtil; import net.sourceforge.phpdt.externaltools.variable.ExpandVariableContext; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; +import net.sourceforge.phpeclipse.externaltools.ExternalToolsPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IProgressMonitor; @@ -74,7 +74,7 @@ public class BackgroundResourceRefresher implements IDebugEventSetListener, Runn * Submits a runnable to do the refresh */ protected void refresh() { - PHPeclipsePlugin.getStandardDisplay().asyncExec(this); + ExternalToolsPlugin.getStandardDisplay().asyncExec(this); } /** @@ -83,7 +83,7 @@ public class BackgroundResourceRefresher implements IDebugEventSetListener, Runn * @see java.lang.Runnable#run() */ public void run() { - ProgressMonitorDialog dialog = new ProgressMonitorDialog(PHPeclipsePlugin.getStandardDisplay().getActiveShell()); + ProgressMonitorDialog dialog = new ProgressMonitorDialog(ExternalToolsPlugin.getStandardDisplay().getActiveShell()); try { dialog.run(true, true, this); } catch (InvocationTargetException e) { diff --git a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolMigration.java b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolMigration.java index 115ea90..3ca3b59 100644 --- a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolMigration.java +++ b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolMigration.java @@ -21,7 +21,6 @@ import java.util.StringTokenizer; import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants; import net.sourceforge.phpdt.externaltools.model.ToolUtil; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; import net.sourceforge.phpeclipse.externaltools.ExternalToolsPlugin; import org.eclipse.core.runtime.CoreException; @@ -125,7 +124,7 @@ public final class ExternalToolMigration { public static void readIn20Tools() { boolean migrationSuccessful = true; - IPath path = PHPeclipsePlugin.getDefault().getStateLocation(); + IPath path = ExternalToolsPlugin.getDefault().getStateLocation(); File file = path.append(STATE_FILE_NAME).toFile(); if (!file.exists()) return; @@ -163,7 +162,7 @@ public final class ExternalToolMigration { ExternalToolsPlugin.getDefault().log("File I/O error with reading old external tools.", e); migrationSuccessful = false; } catch (WorkbenchException e) { - PHPeclipsePlugin.getDefault().getLog().log(e.getStatus()); + ExternalToolsPlugin.getDefault().getLog().log(e.getStatus()); System.err.println("Error reading old external tools. See .log file for more details"); migrationSuccessful = false; } finally { diff --git a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolVariable.java b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolVariable.java index 6fbbefb..ea4a706 100644 --- a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolVariable.java +++ b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/internal/registry/ExternalToolVariable.java @@ -12,7 +12,7 @@ Contributors: import net.sourceforge.phpdt.externaltools.group.IGroupDialogPage; import net.sourceforge.phpdt.externaltools.internal.model.ExternalToolsModelMessages; import net.sourceforge.phpdt.externaltools.variable.IVariableComponent; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; +import net.sourceforge.phpeclipse.externaltools.ExternalToolsPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IConfigurationElement; @@ -57,7 +57,7 @@ public abstract class ExternalToolVariable { try { return element.createExecutableExtension(attributeName); } catch (CoreException e) { - PHPeclipsePlugin.getDefault().getLog().log(e.getStatus()); + ExternalToolsPlugin.getDefault().getLog().log(e.getStatus()); return null; } } diff --git a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsMainTab.java b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsMainTab.java index 7e823ba..49102df 100644 --- a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsMainTab.java +++ b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/launchConfigurations/ExternalToolsMainTab.java @@ -14,7 +14,6 @@ import net.sourceforge.phpdt.externaltools.internal.registry.ExternalToolVariabl import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants; import net.sourceforge.phpdt.externaltools.model.ToolUtil; import net.sourceforge.phpdt.externaltools.variable.ExpandVariableContext; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; import net.sourceforge.phpeclipse.externaltools.ExternalToolsPlugin; import org.eclipse.core.resources.IResource; @@ -122,17 +121,17 @@ public class ExternalToolsMainTab extends AbstractLaunchConfigurationTab { label.setText(ExternalToolsLaunchConfigurationMessages.getString("ExternalToolsMainTab.&Location___2")); //$NON-NLS-1$ label.setFont(font); - final IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); + final IPreferenceStore store = ExternalToolsPlugin.getDefault().getPreferenceStore(); locationField = new Combo(composite, SWT.DROP_DOWN | SWT.BORDER); GridData data = new GridData(GridData.FILL_HORIZONTAL); data.widthHint = IDialogConstants.ENTRY_FIELD_WIDTH; locationField.setLayoutData(data); locationField.setFont(font); - locationField.add(store.getString(PHPeclipsePlugin.PHP_RUN_PREF), 0); - locationField.add(store.getString(PHPeclipsePlugin.APACHE_RUN_PREF), 1); - locationField.add(store.getString(PHPeclipsePlugin.MYSQL_RUN_PREF), 2); - locationField.add(store.getString(PHPeclipsePlugin.XAMPP_START_PREF), 3); - locationField.add(store.getString(PHPeclipsePlugin.XAMPP_STOP_PREF), 4); + locationField.add(store.getString(ExternalToolsPlugin.PHP_RUN_PREF), 0); + locationField.add(store.getString(ExternalToolsPlugin.APACHE_RUN_PREF), 1); + locationField.add(store.getString(ExternalToolsPlugin.MYSQL_RUN_PREF), 2); + locationField.add(store.getString(ExternalToolsPlugin.XAMPP_START_PREF), 3); + locationField.add(store.getString(ExternalToolsPlugin.XAMPP_STOP_PREF), 4); Composite buttonComposite = new Composite(parent, SWT.NONE); layout = new GridLayout(); layout.marginWidth = 0; diff --git a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/variable/LocalhostExpander.java b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/variable/LocalhostExpander.java index 2966aaf..9cf0788 100644 --- a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/variable/LocalhostExpander.java +++ b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/variable/LocalhostExpander.java @@ -1,6 +1,6 @@ package net.sourceforge.phpdt.externaltools.variable; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; +import net.sourceforge.phpeclipse.externaltools.ExternalToolsPlugin; import net.sourceforge.phpeclipse.ui.WebUI; import org.eclipse.jface.preference.IPreferenceStore; @@ -14,7 +14,7 @@ import org.eclipse.jface.preference.IPreferenceStore; public class LocalhostExpander implements IVariableTextExpander { public String getText(String varTag, String varValue, ExpandVariableContext context) { - IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); + IPreferenceStore store = ExternalToolsPlugin.getDefault().getPreferenceStore(); return store.getString(WebUI.PHP_LOCALHOST_PREF); } diff --git a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/variable/UrlExpander.java b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/variable/UrlExpander.java index 17cbdf5..5971985 100644 --- a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/variable/UrlExpander.java +++ b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpdt/externaltools/variable/UrlExpander.java @@ -1,6 +1,6 @@ package net.sourceforge.phpdt.externaltools.variable; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; +import net.sourceforge.phpeclipse.externaltools.ExternalToolsPlugin; import net.sourceforge.phpeclipse.ui.WebUI; import org.eclipse.core.runtime.IPath; @@ -30,7 +30,7 @@ public class UrlExpander extends ResourceExpander { //implements IVariableTextEx public String getText(String varTag, String varValue, ExpandVariableContext context) { IPath path = getPath(varTag, varValue, context); if (path != null) { - IPreferenceStore store = PHPeclipsePlugin.getDefault().getPreferenceStore(); + IPreferenceStore store = ExternalToolsPlugin.getDefault().getPreferenceStore(); String localhostURL = path.toString(); String lowerCaseFileName = localhostURL.toLowerCase(); String documentRoot = store.getString(WebUI.PHP_DOCUMENTROOT_PREF); diff --git a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpeclipse/externaltools/ExternalToolsPlugin.java b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpeclipse/externaltools/ExternalToolsPlugin.java index 811948e..314cd05 100644 --- a/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpeclipse/externaltools/ExternalToolsPlugin.java +++ b/net.sourceforge.phpeclipse.externaltools/src/net/sourceforge/phpeclipse/externaltools/ExternalToolsPlugin.java @@ -20,7 +20,6 @@ import net.sourceforge.phpdt.externaltools.internal.registry.ArgumentVariableReg import net.sourceforge.phpdt.externaltools.internal.registry.PathLocationVariableRegistry; import net.sourceforge.phpdt.externaltools.internal.registry.RefreshScopeVariableRegistry; import net.sourceforge.phpdt.externaltools.model.IExternalToolConstants; -import net.sourceforge.phpeclipse.PHPeclipsePlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; @@ -40,6 +39,34 @@ import org.osgi.framework.Bundle; * External tools plug-in class */ public final class ExternalToolsPlugin extends AbstractUIPlugin { + public static final String XAMPP_START_PREF = "_xampp_start_pref"; + + public static final String XAMPP_STOP_PREF = "_xampp_stop_pref"; + + public static final String MYSQL_RUN_PREF = "_mysql_run_pref"; + + public static final String MYSQL_START_BACKGROUND = "_mysql_start_background"; + + public static final String MYSQL_PREF = "__mysql_start"; + + public static final String APACHE_RUN_PREF = "_apache_run_pref"; + + public static final String APACHE_START_BACKGROUND = "_apache_start_background"; + + public static final String APACHE_START_PREF = "__apache_start"; + + public static final String APACHE_STOP_BACKGROUND = "_apache_stop_background"; + + public static final String APACHE_STOP_PREF = "__apache_stop"; + + public static final String APACHE_RESTART_BACKGROUND = "_apache_restart_background"; + + public static final String APACHE_RESTART_PREF = "__apache_restart"; + + public static final String SHOW_OUTPUT_IN_CONSOLE = "_show_output_in_console"; + + public static final String PHP_RUN_PREF = "_php_run_pref"; + /** * Status representing no problems encountered during operation. */ @@ -129,7 +156,11 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin { public void log(String message, Throwable exception) { IStatus status = newErrorStatus(message, exception); // getLog().log(status); - PHPeclipsePlugin.log(status); + ExternalToolsPlugin.log(status); + } + + public static void log(IStatus status) { + getDefault().getLog().log(status); } /** @@ -139,7 +170,7 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin { */ public ImageDescriptor getImageDescriptor(String path) { try { - Bundle bundle = PHPeclipsePlugin.getDefault().getBundle(); + Bundle bundle = ExternalToolsPlugin.getDefault().getBundle(); URL installURL = bundle.getEntry("/"); //$NON-NLS-1$ URL url = new URL(installURL, path); return ImageDescriptor.createFromURL(url); @@ -155,7 +186,7 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin { prefs.setDefault(IPreferenceConstants.PROMPT_FOR_MIGRATION, true); PreferenceConverter.setDefault(prefs, IPreferenceConstants.CONSOLE_ERROR_RGB, new RGB(255, 0, 0)); // red - exactly the same as - // debug Consol + // debug Consol PreferenceConverter.setDefault(prefs, IPreferenceConstants.CONSOLE_WARNING_RGB, new RGB(255, 100, 0)); // orange PreferenceConverter.setDefault(prefs, IPreferenceConstants.CONSOLE_INFO_RGB, new RGB(0, 0, 255)); // blue PreferenceConverter.setDefault(prefs, IPreferenceConstants.CONSOLE_VERBOSE_RGB, new RGB(0, 200, 125)); // green @@ -163,7 +194,7 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin { } public static IWorkbenchWindow getActiveWorkbenchWindow() { - return PHPeclipsePlugin.getDefault().getWorkbench().getActiveWorkbenchWindow(); + return ExternalToolsPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow(); } /** @@ -189,7 +220,7 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin { * @see org.eclipse.core.runtime.Plugin#startup() */ public void startup() throws CoreException { -// super.startup(); + // super.startup(); getStandardDisplay().asyncExec(new Runnable() { public void run() { //initialize the variable context manager @@ -202,7 +233,7 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin { * @see org.eclipse.core.runtime.Plugin#shutdown() */ public void shutdown() throws CoreException { -// super.shutdown(); + // super.shutdown(); ColorManager.getDefault().dispose(); } @@ -211,6 +242,6 @@ public final class ExternalToolsPlugin extends AbstractUIPlugin { */ public static Color getPreferenceColor(String pref) { return ColorManager.getDefault().getColor( - PreferenceConverter.getColor(PHPeclipsePlugin.getDefault().getPreferenceStore(), pref)); + PreferenceConverter.getColor(ExternalToolsPlugin.getDefault().getPreferenceStore(), pref)); } } \ No newline at end of file -- 1.7.1