1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Add PLUGIN_ID to MakeUIPlugin

This commit is contained in:
Andrew Gvozdev 2013-06-25 22:52:21 -04:00
parent 4ff53dfb05
commit ce7c36ae04

View file

@ -1,5 +1,5 @@
/******************************************************************************* /*******************************************************************************
* Copyright (c) 2000, 2009 QNX Software Systems and others. * Copyright (c) 2000, 2013 QNX Software Systems and others.
* All rights reserved. This program and the accompanying materials * All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0 * are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at * which accompanies this distribution, and is available at
@ -46,6 +46,7 @@ import org.osgi.framework.BundleContext;
* The main plugin class to be used in the desktop. * The main plugin class to be used in the desktop.
*/ */
public class MakeUIPlugin extends AbstractUIPlugin { public class MakeUIPlugin extends AbstractUIPlugin {
public static final String PLUGIN_ID = "org.eclipse.cdt.make.ui"; //$NON-NLS-1$
//The shared instance. //The shared instance.
private static MakeUIPlugin plugin; private static MakeUIPlugin plugin;
//Resource bundle. //Resource bundle.
@ -75,7 +76,7 @@ public class MakeUIPlugin extends AbstractUIPlugin {
} }
/** /**
* Returns the Uniqu idenetifier for this plugin. * Returns the Unique identifier for this plugin.
*/ */
public static String getPluginId() { public static String getPluginId() {
return getDefault().getBundle().getSymbolicName(); return getDefault().getBundle().getSymbolicName();
@ -135,14 +136,14 @@ public class MakeUIPlugin extends AbstractUIPlugin {
} }
/** /**
* Convenience method which returns the unique identifier of this plugin. * Convenience method which returns the unique identifier of this plugin.
*/ */
public static String getUniqueIdentifier() { public static String getUniqueIdentifier() {
if (getDefault() == null) { if (getDefault() == null) {
// If the default instance is not yet initialized, // If the default instance is not yet initialized,
// return a static identifier. This identifier must // return a static identifier. This identifier must
// match the plugin id defined in plugin.xml // match the plugin id defined in plugin.xml
return "org.eclipse.cdt.make.ui"; //$NON-NLS-1$ return PLUGIN_ID;
} }
return getDefault().getBundle().getSymbolicName(); return getDefault().getBundle().getSymbolicName();
} }
@ -159,7 +160,7 @@ public class MakeUIPlugin extends AbstractUIPlugin {
} }
public static void logErrorMessage(String message) { public static void logErrorMessage(String message) {
log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, message, null)); log(new Status(IStatus.ERROR, PLUGIN_ID, IStatus.ERROR, message, null));
} }
public static void logException(Throwable e, final String title, String message) { public static void logException(Throwable e, final String title, String message) {
@ -174,7 +175,7 @@ public class MakeUIPlugin extends AbstractUIPlugin {
message = e.getMessage(); message = e.getMessage();
if (message == null) if (message == null)
message = e.toString(); message = e.toString();
status = new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.OK, message, e); status = new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, message, e);
} }
ResourcesPlugin.getPlugin().getLog().log(status); ResourcesPlugin.getPlugin().getLog().log(status);
Display display; Display display;
@ -201,7 +202,7 @@ public class MakeUIPlugin extends AbstractUIPlugin {
if (e instanceof CoreException) if (e instanceof CoreException)
status = ((CoreException) e).getStatus(); status = ((CoreException) e).getStatus();
else else
status = new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.OK, e.getMessage(), e); status = new Status(IStatus.ERROR, PLUGIN_ID, IStatus.OK, e.getMessage(), e);
log(status); log(status);
} }
@ -232,7 +233,7 @@ public class MakeUIPlugin extends AbstractUIPlugin {
message = null; message = null;
} }
} else { } else {
status = new Status(IStatus.ERROR, MakeUIPlugin.getUniqueIdentifier(), -1, "Internal Error: ", t); //$NON-NLS-1$ status = new Status(IStatus.ERROR, MakeUIPlugin.PLUGIN_ID, -1, "Internal Error: ", t); //$NON-NLS-1$
} }
ErrorDialog.openError(shell, title, message, status); ErrorDialog.openError(shell, title, message, status);
} }
@ -290,9 +291,6 @@ public class MakeUIPlugin extends AbstractUIPlugin {
new MakeStartup().schedule(); new MakeStartup().schedule();
} }
/* (non-Javadoc)
* @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
*/
@Override @Override
public void stop(BundleContext context) throws Exception { public void stop(BundleContext context) throws Exception {
if (fWorkingCopyManager != null) { if (fWorkingCopyManager != null) {