X-Git-Url: http://git.phpeclipse.com diff --git a/net.sourceforge.phpeclipse.xdebug.ui/src/net/sourceforge/phpeclipse/xdebug/ui/XDebugUIPlugin.java b/net.sourceforge.phpeclipse.xdebug.ui/src/net/sourceforge/phpeclipse/xdebug/ui/XDebugUIPlugin.java index 03dc4a5..a069314 100644 --- a/net.sourceforge.phpeclipse.xdebug.ui/src/net/sourceforge/phpeclipse/xdebug/ui/XDebugUIPlugin.java +++ b/net.sourceforge.phpeclipse.xdebug.ui/src/net/sourceforge/phpeclipse/xdebug/ui/XDebugUIPlugin.java @@ -3,14 +3,14 @@ package net.sourceforge.phpeclipse.xdebug.ui; import java.util.MissingResourceException; import java.util.ResourceBundle; -import org.eclipse.swt.widgets.Display; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.plugin.*; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.swt.widgets.Display; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.ui.plugin.AbstractUIPlugin; import org.osgi.framework.BundleContext; /** @@ -22,13 +22,12 @@ public class XDebugUIPlugin extends AbstractUIPlugin { private static final ResourceBundle RESOURCE_BUNDLE = ResourceBundle .getBundle(BUNDLE_NAME); - - private static final String PLUGIN_ID ="net.sourceforge.phpeclipse.xdebug.ui"; - - //The shared instance. + private static final String PLUGIN_ID = "net.sourceforge.phpeclipse.xdebug.ui"; + + // The shared instance. private static XDebugUIPlugin plugin; - + /** * The constructor. */ @@ -59,51 +58,57 @@ public class XDebugUIPlugin extends AbstractUIPlugin { } /** - * Returns an image descriptor for the image file at the given - * plug-in relative path. - * - * @param path the path + * Returns an image descriptor for the image file at the given plug-in + * relative path. + * + * @param path + * the path * @return the image descriptor */ public static ImageDescriptor getImageDescriptor(String path) { - return AbstractUIPlugin.imageDescriptorFromPlugin("net.sourceforge.phpeclipse.xdebug.ui", path); + return AbstractUIPlugin.imageDescriptorFromPlugin( + "net.sourceforge.phpeclipse.xdebug.ui", path); } - + /** * Convenience method which returns the unique identifier of this plugin. */ public static String getUniqueIdentifier() { return PLUGIN_ID; } - + /** * Utility method with conventions */ - public static void errorDialog(Shell shell, String title, String message, IStatus s) { - // if the 'message' resource string and the IStatus' message are the same, + public static void errorDialog(Shell shell, String title, String message, + IStatus s) { + // if the 'message' resource string and the IStatus' message are the + // same, // don't show both in the dialog if (s != null && message.equals(s.getMessage())) { - message= null; + message = null; } ErrorDialog.openError(shell, title, message, s); } - /** * Utility method with conventions */ - public static void errorDialog(Shell shell, String title, String message, Throwable t) { + public static void errorDialog(Shell shell, String title, String message, + Throwable t) { IStatus status; if (t instanceof CoreException) { - status= ((CoreException)t).getStatus(); - // if the 'message' resource string and the IStatus' message are the same, + status = ((CoreException) t).getStatus(); + // if the 'message' resource string and the IStatus' message are the + // same, // don't show both in the dialog if (status != null && message.equals(status.getMessage())) { - message= null; + message = null; } } else { - status= new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, "Error within Debug UI: ", t); //$NON-NLS-1$ - log(status); + status = new Status(IStatus.ERROR, getUniqueIdentifier(), + IStatus.ERROR, "Error within Debug UI: ", t); //$NON-NLS-1$ + log(status); } ErrorDialog.openError(shell, title, message, status); } @@ -111,32 +116,35 @@ public class XDebugUIPlugin extends AbstractUIPlugin { /** * Logs the specified status with this plug-in's log. * - * @param status status to log + * @param status + * status to log */ public static void log(IStatus status) { getDefault().getLog().log(status); } - + /** * Logs an internal error with the specified throwable * - * @param e the exception to be logged - */ + * @param e + * the exception to be logged + */ public static void log(Throwable e) { - log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, "Internal Error", e)); + log(new Status(IStatus.ERROR, getUniqueIdentifier(), IStatus.ERROR, + "Internal Error", e)); } - + /** - * Returns the standard display to be used. The method first checks, if - * the thread calling this method has an associated display. If so, this - * display is returned. Otherwise the method returns the default display. + * Returns the standard display to be used. The method first checks, if the + * thread calling this method has an associated display. If so, this display + * is returned. Otherwise the method returns the default display. */ public static Display getStandardDisplay() { Display display; - display= Display.getCurrent(); + display = Display.getCurrent(); if (display == null) - display= Display.getDefault(); - return display; + display = Display.getDefault(); + return display; } public static String getString(String key) { @@ -146,5 +154,5 @@ public class XDebugUIPlugin extends AbstractUIPlugin { return '!' + key + '!'; } } - + }