diff options
author | Darin Wright | 2003-09-05 18:42:25 +0000 |
---|---|---|
committer | Darin Wright | 2003-09-05 18:42:25 +0000 |
commit | 36b5a28c56992f8bf72db6b464c55655f4267945 (patch) | |
tree | 9a32c9408b08ab3323b98f783310911487adc37a /org.eclipse.debug.ui | |
parent | 29fbf882d045796d61ae97ff99d3134e43249171 (diff) | |
download | eclipse.platform.debug-36b5a28c56992f8bf72db6b464c55655f4267945.tar.gz eclipse.platform.debug-36b5a28c56992f8bf72db6b464c55655f4267945.tar.xz eclipse.platform.debug-36b5a28c56992f8bf72db6b464c55655f4267945.zip |
bug 42184 - Edit->Find action for the console is only enabled after some text is selected
Diffstat (limited to 'org.eclipse.debug.ui')
2 files changed, 16 insertions, 8 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleViewer.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleViewer.java index 230da465d..d406455f3 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleViewer.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ConsoleViewer.java @@ -177,13 +177,6 @@ public class ConsoleViewer extends TextViewer implements IPropertyChangeListener } /** - * @see IFindReplaceTarget#canPerformFind() - */ - protected boolean canPerformFind() { - return (getTextWidget() != null && getVisibleDocument() != null && getVisibleDocument().getLength() > 0); - } - - /** * @see IPropertyChangeListener#propertyChange(PropertyChangeEvent) */ public void propertyChange(PropertyChangeEvent event) { diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePage.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePage.java index a66841613..fa0fab8b1 100644 --- a/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePage.java +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/internal/ui/views/console/ProcessConsolePage.java @@ -40,7 +40,9 @@ import org.eclipse.jface.action.IToolBarManager; import org.eclipse.jface.action.MenuManager; import org.eclipse.jface.action.Separator; import org.eclipse.jface.text.IFindReplaceTarget; +import org.eclipse.jface.text.ITextListener; import org.eclipse.jface.text.ITextOperationTarget; +import org.eclipse.jface.text.TextEvent; import org.eclipse.jface.viewers.ISelection; import org.eclipse.jface.viewers.ISelectionChangedListener; import org.eclipse.jface.viewers.SelectionChangedEvent; @@ -73,7 +75,7 @@ import org.eclipse.ui.texteditor.IUpdate; * * @since 3.0 */ -public class ProcessConsolePage implements IPageBookViewPage, ISelectionListener, IAdaptable, IShowInSource, IShowInTargetList, IDebugEventSetListener { +public class ProcessConsolePage implements IPageBookViewPage, ISelectionListener, IAdaptable, IShowInSource, IShowInTargetList, IDebugEventSetListener, ITextListener { //page site private IPageSite fSite = null; @@ -158,6 +160,7 @@ public class ProcessConsolePage implements IPageBookViewPage, ISelectionListener getSite().getPage().addSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, this); fViewer.getSelectionProvider().addSelectionChangedListener(fTextListener); + fViewer.addTextListener(this); } /** @@ -199,6 +202,7 @@ public class ProcessConsolePage implements IPageBookViewPage, ISelectionListener DebugPlugin.getDefault().removeDebugEventListener(this); getSite().getPage().removeSelectionListener(IDebugUIConstants.ID_DEBUG_VIEW, this); fViewer.getSelectionProvider().removeSelectionChangedListener(fTextListener); + fViewer.removeTextListener(this); if (fRemoveTerminated != null) { fRemoveTerminated.dispose(); @@ -466,4 +470,15 @@ public class ProcessConsolePage implements IPageBookViewPage, ISelectionListener return getControl() != null; } + /* (non-Javadoc) + * @see org.eclipse.jface.text.ITextListener#textChanged(org.eclipse.jface.text.TextEvent) + */ + public void textChanged(TextEvent event) { + // update the find replace action if the document length is > 0 + IUpdate findReplace = (IUpdate)fGlobalActions.get(IWorkbenchActionConstants.FIND); + if (findReplace != null) { + findReplace.update(); + } + } + } |