mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-07-23 00:45:28 +02:00
Added a constructor (was silently inheriting from super class)
This commit is contained in:
parent
9dec664073
commit
729d4c2fcb
1 changed files with 31 additions and 17 deletions
|
@ -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 <code>Shell</code> 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 <code>Shell</code> 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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue