Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Rennie2007-05-23 16:18:48 +0000
committerMichael Rennie2007-05-23 16:18:48 +0000
commitf1e1f0d08a5cdb4ab26408338a4f5a6eedf2368c (patch)
tree705b2251f9bc19539048a51b61ddad0e2b63f0b2 /org.eclipse.debug.ui
parentb8500b76a3fbd365725f732152a3e1d258e7361d (diff)
downloadeclipse.platform.debug-f1e1f0d08a5cdb4ab26408338a4f5a6eedf2368c.tar.gz
eclipse.platform.debug-f1e1f0d08a5cdb4ab26408338a4f5a6eedf2368c.tar.xz
eclipse.platform.debug-f1e1f0d08a5cdb4ab26408338a4f5a6eedf2368c.zip
Bug 187684
Slow to show debug drop-down
Diffstat (limited to 'org.eclipse.debug.ui')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ClosedProjectFilter.java20
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeletedProjectFilter.java21
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java64
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java39
4 files changed, 82 insertions, 62 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ClosedProjectFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ClosedProjectFilter.java
index a8eeaef66..d36c2e406 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ClosedProjectFilter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/ClosedProjectFilter.java
@@ -47,19 +47,17 @@ public class ClosedProjectFilter extends ViewerFilter {
if(element instanceof ILaunchConfiguration) {
try {
ILaunchConfiguration config = (ILaunchConfiguration)element;
- if(config.exists()) {
- IResource[] resources = config.getMappedResources();
- //if it has no mapping, it might not have migration delegate, so let it pass
- if(resources == null) {
+ IResource[] resources = config.getMappedResources();
+ //if it has no mapping, it might not have migration delegate, so let it pass
+ if(resources == null) {
+ return true;
+ }
+ for(int i = 0; i < resources.length; i++) {
+ IProject project= resources[i].getProject();
+ //we don't want overlap with the deleted projects filter, so we need to allow projects that don't exist through
+ if(project != null && (project.isOpen() || !project.exists())) {
return true;
}
- for(int i = 0; i < resources.length; i++) {
- IProject project= resources[i].getProject();
- //we don't want overlap with the deleted projects filter, so we need to allow projects that don't exist through
- if(project != null && (project.isOpen() || !project.exists())) {
- return true;
- }
- }
}
}
catch (CoreException e) {}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeletedProjectFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeletedProjectFilter.java
index 7c7681975..11c6ba709 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeletedProjectFilter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/DeletedProjectFilter.java
@@ -15,7 +15,6 @@ import org.eclipse.core.resources.IResource;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.debug.core.ILaunchConfiguration;
import org.eclipse.debug.core.ILaunchConfigurationType;
-import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.jface.viewers.Viewer;
import org.eclipse.jface.viewers.ViewerFilter;
@@ -47,22 +46,18 @@ public class DeletedProjectFilter extends ViewerFilter {
if(element instanceof ILaunchConfiguration) {
try {
ILaunchConfiguration config = (ILaunchConfiguration)element;
- if(config.exists()) {
- IResource[] resources = config.getMappedResources();
- if(resources == null) {
+ IResource[] resources = config.getMappedResources();
+ if(resources == null) {
+ return true;
+ }
+ for(int i = 0; i < resources.length; i++) {
+ IProject project= resources[i].getProject();
+ if(project != null && project.exists()) {
return true;
}
- for(int i = 0; i < resources.length; i++) {
- IProject project= resources[i].getProject();
- if(project != null && project.exists()) {
- return true;
- }
- }
}
}
- catch(CoreException e) {
- DebugUIPlugin.log(e);
- }
+ catch(CoreException e) {}
}
return false;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java
index a4e55fca9..31e0e1be6 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/launchConfigurations/WorkingSetsFilter.java
@@ -42,42 +42,40 @@ public class WorkingSetsFilter extends ViewerFilter {
}
if(element instanceof ILaunchConfiguration) {
ILaunchConfiguration config = (ILaunchConfiguration)element;
- if(config.exists()) {
- try {
- IResource[] resources = config.getMappedResources();
- if(resources == null) {
- return true;
- }
- IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
- if(window == null) {
- return true;
- }
- IWorkbenchPage page = window.getActivePage();
- if(page == null) {
- return true;
- }
- IWorkingSet[] wsets = page.getWorkingSets();
- if(wsets.length < 1) {
- return true;
- }
- //remove breakpoint workingsets
- ArrayList ws = new ArrayList();
- for (int i = 0; i < wsets.length; i++) {
- if(!wsets[i].getId().equals(IInternalDebugUIConstants.ID_BREAKPOINT_WORKINGSET)) {
- ws.add(wsets[i]);
- }
+ try {
+ IResource[] resources = config.getMappedResources();
+ if(resources == null) {
+ return true;
+ }
+ IWorkbenchWindow window = DebugUIPlugin.getActiveWorkbenchWindow();
+ if(window == null) {
+ return true;
+ }
+ IWorkbenchPage page = window.getActivePage();
+ if(page == null) {
+ return true;
+ }
+ IWorkingSet[] wsets = page.getWorkingSets();
+ if(wsets.length < 1) {
+ return true;
+ }
+ //remove breakpoint workingsets
+ ArrayList ws = new ArrayList();
+ for (int i = 0; i < wsets.length; i++) {
+ if(!wsets[i].getId().equals(IInternalDebugUIConstants.ID_BREAKPOINT_WORKINGSET)) {
+ ws.add(wsets[i]);
}
- if(ws.isEmpty()) {
+ }
+ if(ws.isEmpty()) {
+ return true;
+ }
+ for (int i = 0; i < resources.length; i++) {
+ if(workingSetContains((IWorkingSet[]) ws.toArray(new IWorkingSet[ws.size()]), resources[i])) {
return true;
}
- for (int i = 0; i < resources.length; i++) {
- if(workingSetContains((IWorkingSet[]) ws.toArray(new IWorkingSet[ws.size()]), resources[i])) {
- return true;
- }
- }
- }
- catch (CoreException e) {DebugUIPlugin.log(e);}
- }
+ }
+ }
+ catch (CoreException e) {}
}
return false;
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java
index ad076456c..57e1f7ed7 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/actions/AbstractLaunchHistoryAction.java
@@ -166,19 +166,46 @@ public abstract class AbstractLaunchHistoryAction implements IWorkbenchWindowPul
}
/**
- * Updates this action's tool-tip to correspond to the most recent launch.
+ * Updates this action's tool-tip. The tooltip is based on user preference settings
+ * for launching - either the previous launch, or based on the selection and which
+ * configuration will be launched.
+ * <p>
+ * Subclasses may override as required.
+ * </p>
*/
protected void updateTooltip() {
- getAction().setToolTipText(getToolTip(getLastLaunch()));
+ getAction().setToolTipText(getToolTip());
}
/**
- * Returns the tool-tip specific to a configuration.
+ * Returns the tooltip specific to a configuration.
*
* @param configuration a <code>ILauncConfiguration</code>
* @return the string for the tool tip
*/
protected String getToolTip(ILaunchConfiguration configuration) {
+ String launchName= configuration.getName();
+ String mode= getMode();
+ String label;
+ if (mode.equals(ILaunchManager.RUN_MODE)) {
+ label= ActionMessages.AbstractLaunchHistoryAction_1;
+ } else if (mode.equals(ILaunchManager.DEBUG_MODE)){
+ label= ActionMessages.AbstractLaunchHistoryAction_2;
+ } else if (mode.equals(ILaunchManager.PROFILE_MODE)){
+ label= ActionMessages.AbstractLaunchHistoryAction_3;
+ } else {
+ label= ActionMessages.AbstractLaunchHistoryAction_4;
+ }
+ return MessageFormat.format(ActionMessages.AbstractLaunchHistoryAction_0, new String[] {label, launchName});
+ }
+
+ /**
+ * Returns this action's tooltip. The tooltip is retrieved from the launch resource manager
+ * which builds tool tips asynchronously for context launching support.
+ *
+ * @return the string for the tool tip
+ */
+ private String getToolTip() {
String launchName = getLaunchingResourceManager().getLaunchLabel(fLaunchGroup);
if(launchName == null) {
return DebugUIPlugin.removeAccelerators(internalGetHistory().getLaunchGroup().getLabel());
@@ -201,7 +228,7 @@ public abstract class AbstractLaunchHistoryAction implements IWorkbenchWindowPul
return MessageFormat.format(ActionMessages.AbstractLaunchHistoryAction_0, new String[] {label, launchName});
}
}
-
+
/**
* @see ILaunchHistoryChangedListener#launchHistoryChanged()
*/
@@ -342,7 +369,9 @@ public abstract class AbstractLaunchHistoryAction implements IWorkbenchWindowPul
* @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(org.eclipse.ui.IWorkbenchWindow)
*/
public void init(IWorkbenchWindow window) {
- getLaunchingResourceManager().addLaunchLabelUpdateListener(fLabelListener);
+ if (this instanceof AbstractLaunchToolbarAction) {
+ getLaunchingResourceManager().addLaunchLabelUpdateListener(fLabelListener);
+ }
}
/**

Back to the top