X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java index f3a86d2..dc81130 100644 --- a/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java +++ b/net.sourceforge.phpeclipse/src/net/sourceforge/phpeclipse/PHPeclipsePlugin.java @@ -16,12 +16,19 @@ import java.util.ResourceBundle; import net.sourceforge.phpeclipse.phpeditor.PHPDocumentProvider; import net.sourceforge.phpeclipse.phpeditor.util.PHPColorProvider; +import net.sourceforge.phpeclipse.resourcesview.*; + +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.jface.preference.PreferenceConverter; import org.eclipse.swt.widgets.Shell; @@ -47,8 +54,10 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon /** * The id of the PHP plugin (value "net.sourceforge.phpeclipse"). */ - public static final String ID_PLUGIN = "net.sourceforge.phpeclipse"; //$NON-NLS-1$ - + public static final String PLUGIN_ID = "net.sourceforge.phpeclipse"; //$NON-NLS-1$ + public final static String PHP_NATURE_ID = PLUGIN_ID + ".phpnature"; + public static final String PHP_RESOURCES_VIEW_ID = PLUGIN_ID + ".resourcesview.ViewPHPResources"; //$NON-NLS-1$ + //The shared instance. private static PHPeclipsePlugin plugin; //Resource bundle. @@ -188,7 +197,10 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon // public static void log(Throwable e) { // log(new Status(IStatus.ERROR, getPluginId(), JavaStatusConstants.INTERNAL_ERROR, JavaUIMessages.getString("JavaPlugin.internal_error"), e)); //$NON-NLS-1$ // } - + + public static void log(Throwable e) { + log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, "PHPeclipsePlugin.internalErrorOccurred", e)); //$NON-NLS-1$ + } public static boolean isDebug() { return getDefault().isDebugging(); } @@ -247,7 +259,7 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon } - store.setDefault(PHP_PARSER_DEFAULT, "true"); + store.setDefault(PHP_PARSER_DEFAULT, PHP_INTERNAL_PARSER); store.setDefault(PHP_INTERNAL_PARSER, "true"); store.setDefault(PHP_EXTERNAL_PARSER, "false"); @@ -258,8 +270,16 @@ public class PHPeclipsePlugin extends AbstractUIPlugin implements IPreferenceCon PreferenceConverter.setDefault(store, PHP_KEYWORD, PHPColorProvider.KEYWORD); PreferenceConverter.setDefault(store, PHP_VARIABLE, PHPColorProvider.VARIABLE); PreferenceConverter.setDefault(store, PHP_FUNCTIONNAME, PHPColorProvider.FUNCTION_NAME); - PreferenceConverter.setDefault(store, PHP_STRING, PHPColorProvider.STRING); + PreferenceConverter.setDefault(store, PHP_STRING, PHPColorProvider.STRING); PreferenceConverter.setDefault(store, PHP_DEFAULT, PHPColorProvider.DEFAULT); + PreferenceConverter.setDefault(store, LINKED_POSITION_COLOR, PHPColorProvider.LINKED_POSITION_COLOR); } + + public void startup() throws CoreException { + super.startup(); + IAdapterManager manager= Platform.getAdapterManager(); + manager.registerAdapters(new PHPElementAdapterFactory(), PHPElement.class); + manager.registerAdapters(new ResourceAdapterFactory(), IResource.class); + } } \ No newline at end of file