From b90da8adde0c160b392dd63c0935b7928f3f3fb8 Mon Sep 17 00:00:00 2001 From: Michael Rennie Date: Fri, 8 Apr 2011 17:10:08 +0000 Subject: Bug 341142 - LaunchingResourceManager's mouse listener will not be attached in 4.x --- .../contextlaunching/LaunchingResourceManager.java | 43 ++++++++++++---------- 1 file changed, 24 insertions(+), 19 deletions(-) diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java index 4c784fcae..65704a3a7 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/contextlaunching/LaunchingResourceManager.java @@ -41,8 +41,9 @@ import org.eclipse.debug.internal.ui.launchConfigurations.LaunchConfigurationMan import org.eclipse.debug.internal.ui.launchConfigurations.LaunchShortcutExtension; import org.eclipse.debug.internal.ui.stringsubstitution.SelectedResourceManager; import org.eclipse.debug.ui.ILaunchGroup; -import org.eclipse.jface.action.CoolBarManager; +import org.eclipse.debug.ui.ILaunchShortcut; import org.eclipse.jface.action.IContributionItem; +import org.eclipse.jface.action.ICoolBarManager; import org.eclipse.jface.action.ToolBarContributionItem; import org.eclipse.jface.action.ToolBarManager; import org.eclipse.jface.util.IPropertyChangeListener; @@ -160,7 +161,7 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo *
org.eclipse.ui.externaltools.launchGroup
true
if context launching is enabled false
otherwise
*/
public static boolean isContextLaunchEnabled(String launchgroupid) {
@@ -170,9 +171,9 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
/**
* Allows an AbstractLaunchHistoryAction
to register with this manager to be notified
* of a context (IResource
) change and have its updateToolTip(..) method called back to.
- * @param action the action to add
- * @param group the launch group
- * @return true if the AbstractLaunchHistoryAction
was added as a listener, false otherwise
+ * AbstractLaunchHistoryAction
from the listing of registered
* listeners
- * @param action the action to remove
- * @param group the launch group
- * @return true if the action was removed from the listing of AbstractLaunchHistoryAction
listeners,
- * false otherwise
+ * null
- * @param resource
- * @param group
+ *
+ * @param selection the current {@link IStructuredSelection}
+ * @param resource the backing {@link IResource} for the selection
+ * @param shortcuts the list of {@link ILaunchShortcut}s to consider
+ * @param group the {@link ILaunchGroup} to launch using
* @return the label for the resource or the empty string, never null
*/
protected String getLabel(IStructuredSelection selection, IResource resource, List shortcuts, ILaunchGroup group) {
@@ -368,6 +371,8 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
* Prunes the original listing of shortcuts
* @param shortcuts the original listing of LaunchShortcutExtension
s
* @param resource the derived resource
+ * @param mode the mode we are wanting to launch in
+ * @return the list of {@link ILaunchShortcut}s to consider
*
* @since 3.4
*/
@@ -391,8 +396,8 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
/**
* Computes the current resources context, given all of the launch shortcut participants
* and the current selection
- * @param shortcuts
- * @param selection
+ * @param shortcuts the list of {@link ILaunchShortcut} to ask for mapped resources
+ * @param selection the current workbench {@link IStructuredSelection}
* @return The set of resources who care about this launch
*
* @since 3.4
@@ -522,8 +527,8 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
/**
* Adds all of the items in the given object array to the given collection.
* Does nothing if either the collection or array is null
.
- * @param list
- * @param values
+ * @param list the {@link List} to append to
+ * @param values the array of {@link Object}s to add to the list
*/
private void addAllToList(Collection list, Object[] values) {
if(list == null || values == null) {
@@ -628,10 +633,10 @@ public class LaunchingResourceManager implements IPropertyChangeListener, IWindo
/**
* Adds a mouse listener to the launch toolbar
*
- * @param window
+ * @param window the {@link IWorkbenchWindow} to work with
*/
private void addMouseListener(IWorkbenchWindow window) {
- CoolBarManager cmgr = ((WorkbenchWindow)window).getCoolBarManager();
+ ICoolBarManager cmgr = ((WorkbenchWindow)window).getCoolBarManager2();
if(cmgr != null) {
IContributionItem item = cmgr.find("org.eclipse.debug.ui.launchActionSet"); //$NON-NLS-1$
if(item instanceof ToolBarContributionItem) {
--
cgit v1.2.3