From 729d4c2fcb419fa3a57f348ddd5a8580e2165cb4 Mon Sep 17 00:00:00 2001 From: Sean Evoy Date: Thu, 20 May 2004 14:57:43 +0000 Subject: [PATCH] Added a constructor (was silently inheriting from super class) --- .../internal/ui/ManagedBuilderUIPlugin.java | 48 ++++++++++++------- 1 file changed, 31 insertions(+), 17 deletions(-) diff --git a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java index 535ac88fb55..9b32e9765d3 100644 --- a/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java +++ b/build/org.eclipse.cdt.managedbuilder.ui/src/org/eclipse/cdt/managedbuilder/internal/ui/ManagedBuilderUIPlugin.java @@ -30,7 +30,19 @@ public class ManagedBuilderUIPlugin extends AbstractUIPlugin { private static ManagedBuilderUIPlugin plugin; // Unique ID of the plugin private static final String PLUGIN_ID = "org.eclipse.cdt.managedbuilder.ui"; //$NON-NLS-1$ + + /** + * The constructor + */ + public ManagedBuilderUIPlugin() { + super(); + plugin = this; + } + + /** + * @return + */ public static Shell getActiveWorkbenchShell() { IWorkbenchWindow window = getActiveWorkbenchWindow(); if (window != null) { @@ -47,26 +59,12 @@ public class ManagedBuilderUIPlugin extends AbstractUIPlugin { } /** - * Returns the shared instance. + * Returns the singleton instance of the plugin */ public static ManagedBuilderUIPlugin getDefault() { return plugin; } - /** - * Answers the Shell associated with the active workbench, or - * one of the windows associated with the workbench. - * @return - */ - public Shell getShell() { - if (getActiveWorkbenchShell() != null) { - return getActiveWorkbenchShell(); - } else { - IWorkbenchWindow[] windows = getDefault().getWorkbench().getWorkbenchWindows(); - return windows[0].getShell(); - } - } - /** * Convenience method which returns the unique identifier of this plugin. */ @@ -108,6 +106,14 @@ public class ManagedBuilderUIPlugin extends AbstractUIPlugin { ErrorDialog.openError(shell, title, message, status); } + + /** + * @return + */ + public static IWorkspace getWorkspace() { + return ResourcesPlugin.getWorkspace(); + } + /** * Convenience method to log an exception without displaying a * message dialog @@ -150,10 +156,18 @@ public class ManagedBuilderUIPlugin extends AbstractUIPlugin { } /** + * Answers the Shell associated with the active workbench, or + * one of the windows associated with the workbench. * @return */ - public static IWorkspace getWorkspace() { - return ResourcesPlugin.getWorkspace(); + public Shell getShell() { + if (getActiveWorkbenchShell() != null) { + return getActiveWorkbenchShell(); + } else { + IWorkbenchWindow[] windows = getDefault().getWorkbench().getWorkbenchWindows(); + return windows[0].getShell(); + } } + }