Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarin Wright2005-11-24 17:09:33 +0000
committerDarin Wright2005-11-24 17:09:33 +0000
commitc7a96b0b35918456013075942588fbac0c89906b (patch)
tree406589d4cbc70ece168dff88656b75eb1f2f474e /org.eclipse.debug.ui/ui/org/eclipse/debug
parentb4b9e0b49182f9f917a86ff5dd93afa79ad996ec (diff)
downloadeclipse.platform.debug-c7a96b0b35918456013075942588fbac0c89906b.tar.gz
eclipse.platform.debug-c7a96b0b35918456013075942588fbac0c89906b.tar.xz
eclipse.platform.debug-c7a96b0b35918456013075942588fbac0c89906b.zip
Bug 105955- "Find Variable" action should be renamed to "Find Register" in the Registers View
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug')
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties6
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/FindElementAction.java (renamed from org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/FindVariableAction.java)22
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTreeNavigationDialog.java2
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java19
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java1
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java11
-rw-r--r--org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java54
9 files changed, 76 insertions, 47 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java
index 9bc016d06..4e552e17a 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/IDebugHelpContextIds.java
@@ -47,7 +47,7 @@ public interface IDebugHelpContextIds {
public static final String LOOKUP_SOURCE_ACTION = PREFIX + "lookup_source_context";//$NON-NLS-1$
public static final String SKIP_ALL_BREAKPOINT_ACTION = PREFIX + "skip_all_breakpoints_context"; //$NON-NLS-1$
public static final String AUTO_MANAGE_VIEWS_ACTION = PREFIX + "auto_manage_views_context"; //$NON-NLS-1$
- public static final String FIND_VARIABLE_ACTION = PREFIX + "find_variable_context"; //$NON-NLS-1$
+ public static final String FIND_ELEMENT_ACTION = PREFIX + "find_element_context"; //$NON-NLS-1$
public static final String ASSIGN_VALUE_ACTION = PREFIX + "assign_value_context"; //$NON-NLS-1$
public static final String CONSOLE_TERMINATE_ACTION = PREFIX + "console_terminate_action_context"; //$NON-NLS-1$
public static final String CONSOLE_REMOVE_ALL_TERMINATED = PREFIX + "console_remove_all_terminated_context"; //$NON-NLS-1$
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java
index 9209a1998..73d53ee62 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.java
@@ -137,9 +137,9 @@ public class ActionMessages extends NLS {
public static String ModifyWatchpointAction_1;
public static String LaunchShortcutsAction_0;
public static String LaunchShortcutsAction_1;
- public static String FindVariableDialog_1;
- public static String FindVariableDialog_3;
- public static String FindVariableAction_0;
+ public static String FindDialog_1;
+ public static String FindDialog_3;
+ public static String FindAction_0;
static {
// load message values from bundle file
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties
index ca1099738..ba069d101 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/ActionMessages.properties
@@ -137,6 +137,6 @@ ModifyWatchpointAction_0=Error
ModifyWatchpointAction_1=Failed to modify watchpoint
LaunchShortcutsAction_0={0} As
LaunchShortcutsAction_1=(none applicable)
-FindVariableDialog_1=&Select a variable to display (? = any character, * = any String):
-FindVariableDialog_3=Find Variable
-FindVariableAction_0=&Find Variable...
+FindDialog_1=&Specify an element to select (? = any character, * = any String):
+FindDialog_3=Find
+FindAction_0=&Find...
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/FindVariableAction.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/FindElementAction.java
index e8bbcb229..0030766bc 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/context/FindVariableAction.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/actions/FindElementAction.java
@@ -8,31 +8,29 @@
* Contributors:
* IBM Corporation - initial implementation
*******************************************************************************/
-package org.eclipse.debug.internal.ui.actions.context;
+package org.eclipse.debug.internal.ui.actions;
import org.eclipse.debug.internal.ui.DebugUIPlugin;
import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
-import org.eclipse.debug.internal.ui.actions.ActionMessages;
-import org.eclipse.debug.internal.ui.viewers.AsynchronousTreeViewer;
import org.eclipse.debug.internal.ui.viewers.AsynchronousTreeNavigationDialog;
import org.eclipse.debug.internal.ui.viewers.AsynchronousTreeNavigationModel;
+import org.eclipse.debug.internal.ui.viewers.AsynchronousTreeViewer;
import org.eclipse.jface.action.Action;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.texteditor.IUpdate;
import org.eclipse.ui.texteditor.IWorkbenchActionDefinitionIds;
/**
- * Action which prompts the user to help them find a variable in the variables
- * view.
+ * Action which prompts the user to find/navigate to an element in an async tree.
*/
-public class FindVariableAction extends Action implements IUpdate {
+public class FindElementAction extends Action implements IUpdate {
private AsynchronousTreeViewer fViewer;
- public FindVariableAction(AsynchronousTreeViewer viewer) {
- setText(ActionMessages.FindVariableAction_0);
- setId(DebugUIPlugin.getUniqueIdentifier() + ".FindVariableAction"); //$NON-NLS-1$
- PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.FIND_VARIABLE_ACTION);
+ public FindElementAction(AsynchronousTreeViewer viewer) {
+ setText(ActionMessages.FindAction_0);
+ setId(DebugUIPlugin.getUniqueIdentifier() + ".FindElementAction"); //$NON-NLS-1$
+ PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IDebugHelpContextIds.FIND_ELEMENT_ACTION);
setActionDefinitionId(IWorkbenchActionDefinitionIds.FIND_REPLACE);
fViewer = viewer;
}
@@ -40,8 +38,8 @@ public class FindVariableAction extends Action implements IUpdate {
public void run() {
AsynchronousTreeNavigationModel model = new AsynchronousTreeNavigationModel(fViewer);
AsynchronousTreeNavigationDialog dialog = new AsynchronousTreeNavigationDialog(model);
- dialog.setTitle(ActionMessages.FindVariableDialog_3);
- dialog.setMessage(ActionMessages.FindVariableDialog_1);
+ dialog.setTitle(ActionMessages.FindDialog_3);
+ dialog.setMessage(ActionMessages.FindDialog_1);
dialog.open();
model.dispose();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTreeNavigationDialog.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTreeNavigationDialog.java
index 50b660a40..d6bd0844d 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTreeNavigationDialog.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousTreeNavigationDialog.java
@@ -47,7 +47,7 @@ public class AsynchronousTreeNavigationDialog extends ElementListSelectionDialog
if (elements.length == 1) {
TreeItem item = fLabelProvider.getItem(elements[0]);
TreePath treePath = fViewer.getTreePath(item);
- fViewer.setSelection(new TreeSelection(treePath));
+ fViewer.setSelection(new TreeSelection(treePath), true, true);
}
super.okPressed();
}
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java
index 1ffcf994f..2febe1e97 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/viewers/AsynchronousViewer.java
@@ -645,7 +645,19 @@ public abstract class AsynchronousViewer extends StructuredViewer {
/* (non-Javadoc)
* @see org.eclipse.jface.viewers.Viewer#setSelection(org.eclipse.jface.viewers.ISelection, boolean)
*/
- public synchronized void setSelection(ISelection selection, final boolean reveal) {
+ public synchronized void setSelection(ISelection selection, boolean reveal) {
+ setSelection(selection, reveal, false);
+ }
+
+ /**
+ * Sets the selection in this viewer.
+ *
+ * @param selection new selection
+ * @param reveal whether to reveal the selection
+ * @param force whether to force the selection change without consulting the model
+ * selection policy
+ */
+ public synchronized void setSelection(ISelection selection, final boolean reveal, boolean force) {
Control control = getControl();
if (control == null || control.isDisposed()) {
return;
@@ -653,7 +665,7 @@ public abstract class AsynchronousViewer extends StructuredViewer {
if (!acceptsSelection(selection)) {
selection = getEmptySelection();
}
- if (!overrideSelection(fCurrentSelection, selection)) {
+ if (!force && !overrideSelection(fCurrentSelection, selection)) {
return;
}
fPendingSelection = selection;
@@ -670,7 +682,8 @@ public abstract class AsynchronousViewer extends StructuredViewer {
job.setSystem(true);
job.schedule();
}
- }
+ }
+
/**
* Returns whether the candidate selection should override the current
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
index 850516a53..a6598dcd9 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/expression/ExpressionView.java
@@ -74,6 +74,7 @@ public class ExpressionView extends VariablesView {
menu.add(new Separator(IDebugUIConstants.EMPTY_EXPRESSION_GROUP));
menu.add(new Separator(IDebugUIConstants.EXPRESSION_GROUP));
+ menu.add(getAction(FIND_ELEMENT));
menu.add(getAction("ChangeVariableValue")); //$NON-NLS-1$
IAction action = new AvailableLogicalStructuresAction(this);
if (action.isEnabled()) {
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
index fe0d7c2dd..6e7e767a5 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/launch/LaunchView.java
@@ -15,7 +15,6 @@ import java.util.Iterator;
import org.eclipse.core.commands.util.ListenerList;
import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.IResourceDeltaVisitor;
import org.eclipse.core.runtime.IAdaptable;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.ISafeRunnable;
@@ -40,6 +39,7 @@ import org.eclipse.debug.internal.ui.IDebugHelpContextIds;
import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
import org.eclipse.debug.internal.ui.actions.AddToFavoritesAction;
import org.eclipse.debug.internal.ui.actions.EditLaunchConfigurationAction;
+import org.eclipse.debug.internal.ui.actions.FindElementAction;
import org.eclipse.debug.internal.ui.contexts.DebugContextManager;
import org.eclipse.debug.internal.ui.contexts.IDebugContextListener;
import org.eclipse.debug.internal.ui.contexts.IDebugContextProvider;
@@ -101,12 +101,7 @@ public class LaunchView extends AbstractDebugView implements ISelectionChangedLi
* Whether this view is in the active page of a perspective.
*/
private boolean fIsActive = true;
-
- /**
- * Resource delta visitor
- */
- private IResourceDeltaVisitor fVisitor = null;
-
+
/**
* Editor presentation or <code>null</code> if none
*/
@@ -232,6 +227,7 @@ public class LaunchView extends AbstractDebugView implements ISelectionChangedLi
fAddToFavoritesAction = new AddToFavoritesAction();
fEditSourceAction = new EditSourceLookupPathAction(this);
fLookupAction = new LookupSourceAction(this);
+ setAction(FIND_ACTION, new FindElementAction((AsynchronousTreeViewer) getViewer()));
// submit an async exec to update the selection once the
// view has been created - i.e. auto-expand and select the
@@ -600,6 +596,7 @@ public class LaunchView extends AbstractDebugView implements ISelectionChangedLi
menu.add(new Separator(IDebugUIConstants.EMPTY_EDIT_GROUP));
menu.add(new Separator(IDebugUIConstants.EDIT_GROUP));
+ menu.add(getAction(FIND_ACTION));
menu.add(new Separator(IDebugUIConstants.EMPTY_STEP_GROUP));
menu.add(new Separator(IDebugUIConstants.STEP_GROUP));
menu.add(new GroupMarker(IDebugUIConstants.STEP_INTO_GROUP));
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
index 3a0245f25..bd2721243 100644
--- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
+++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/variables/VariablesView.java
@@ -40,7 +40,7 @@ import org.eclipse.debug.internal.ui.IInternalDebugUIConstants;
import org.eclipse.debug.internal.ui.LazyModelPresentation;
import org.eclipse.debug.internal.ui.VariablesViewModelPresentation;
import org.eclipse.debug.internal.ui.actions.CollapseAllAction;
-import org.eclipse.debug.internal.ui.actions.context.FindVariableAction;
+import org.eclipse.debug.internal.ui.actions.FindElementAction;
import org.eclipse.debug.internal.ui.actions.variables.AssignValueAction;
import org.eclipse.debug.internal.ui.actions.variables.ChangeVariableValueAction;
import org.eclipse.debug.internal.ui.actions.variables.ShowTypesAction;
@@ -124,7 +124,6 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
IValueDetailListener,
IDebugExceptionHandler {
-
/**
* Internal interface for a cursor listener. I.e. aggregation
* of mouse and key listener.
@@ -225,6 +224,31 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
}
/**
+ * Retargets the find action to the details area or tree viewer.
+ *
+ * @since 3.2
+ */
+ class DelegatingFindAction extends Action implements IUpdate {
+ private IAction getFindAction() {
+ if (getDetailViewer().getTextWidget().isFocusControl()) {
+ return getAction("FindReplaceText"); //$NON-NLS-1$
+ } else {
+ return getAction(FIND_ELEMENT);
+ }
+ }
+ public void run() {
+ getFindAction().run();
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.ui.texteditor.IUpdate#update()
+ */
+ public void update() {
+ setEnabled(getFindAction().isEnabled());
+ }
+ }
+
+ /**
* The model presentation used as the label provider for the tree viewer,
* and also as the detail information provider for the detail pane.
*/
@@ -328,6 +352,11 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
public static final String LOGICAL_STRUCTURE_TYPE_PREFIX = "VAR_LS_"; //$NON-NLS-1$
protected static final String SASH_WEIGHTS = DebugUIPlugin.getUniqueIdentifier() + ".variablesView.SASH_WEIGHTS"; //$NON-NLS-1$
+ /**
+ * Key for "Find..." action.
+ */
+ protected static final String FIND_ELEMENT = "FindElement"; //$NON-NLS-1$
+
private StatusLineContributionItem fStatusLineItem;
private ICursorListener fCursorListener;
/**
@@ -790,8 +819,8 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
textAction.setActionDefinitionId(IWorkbenchActionDefinitionIds.PASTE);
setAction(ActionFactory.PASTE.getId(), textAction);
- action= new FindVariableAction(getVariablesViewer());
- setAction("FindVariable", action); //$NON-NLS-1$
+ action= new FindElementAction(getVariablesViewer());
+ setAction(FIND_ELEMENT, action);
// TODO: Still using "old" resource access
ResourceBundle bundle= ResourceBundle.getBundle("org.eclipse.debug.internal.ui.views.variables.VariablesViewMessages"); //$NON-NLS-1$
@@ -799,17 +828,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
action.setActionDefinitionId(IWorkbenchActionDefinitionIds.FIND_REPLACE);
setAction("FindReplaceText", action); //$NON-NLS-1$
- setAction(ActionFactory.FIND.getId(), new Action() {
- public void run() {
- IAction findAction = null;
- if (getDetailViewer().getTextWidget().isFocusControl()) {
- findAction= getAction("FindReplaceText"); //$NON-NLS-1$
- } else {
- findAction= getAction("FindVariable"); //$NON-NLS-1$
- }
- findAction.run();
- }
- });
+ setAction(FIND_ACTION, new DelegatingFindAction());
fSelectionActions.add(ActionFactory.COPY.getId());
fSelectionActions.add(ActionFactory.CUT.getId());
@@ -868,7 +887,7 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
menu.add(new Separator(IDebugUIConstants.EMPTY_VARIABLE_GROUP));
menu.add(new Separator(IDebugUIConstants.VARIABLE_GROUP));
- menu.add(getAction("FindVariable")); //$NON-NLS-1$
+ menu.add(getAction(FIND_ELEMENT));
menu.add(getAction("ChangeVariableValue")); //$NON-NLS-1$
IAction action = new AvailableLogicalStructuresAction(this);
if (action.isEnabled()) {
@@ -1273,7 +1292,8 @@ public class VariablesView extends AbstractDebugView implements IDebugContextLis
showViewer();
updateAction("ContentAssist"); //$NON-NLS-1$
- updateAction("FindVariable"); //$NON-NLS-1$
+ updateAction(FIND_ELEMENT);
+ updateAction(FIND_ACTION);
}
/* (non-Javadoc)

Back to the top