Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimeon Andreev2017-09-13 07:37:54 -0400
committerSimeon Andreev2017-09-13 09:42:26 -0400
commitc97aed7988185ec813c6f07c648ff5131f0c75dd (patch)
treeb2eeb769d0a81e1dd78ffffc4e3e1855166e8789 /org.eclipse.ui.console
parent41c2ec5532e75817763b85c0f208471a37182092 (diff)
downloadeclipse.platform.debug-c97aed7988185ec813c6f07c648ff5131f0c75dd.tar.gz
eclipse.platform.debug-c97aed7988185ec813c6f07c648ff5131f0c75dd.tar.xz
eclipse.platform.debug-c97aed7988185ec813c6f07c648ff5131f0c75dd.zip
Bug 268608 - find/replace action disabled on first opening of consoleI20170915-1030
Whenever a new console page is opened, a FindReplaceAction is registered for this console page. The target of this action is set before the new console page is set as active. This results in either a disabled find/edit action, if there was no previous console page, or an action which targets the previously active console page. I.e. the user either cannot search in the new console page, or searches in an old one. This change ensures that the created FindReplaceAction has the correct target page: the target page is updated once the console page is activated by the ConsoleView. This fixes the bug. Change-Id: Ib59be79b361b91949e7ace4f4e1803b4039cad95 Signed-off-by: Simeon Andreev <simeon.danailov.andreev@gmail.com>
Diffstat (limited to 'org.eclipse.ui.console')
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java7
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java3
2 files changed, 4 insertions, 6 deletions
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java
index 78634dd0c..c23bcd145 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java
@@ -18,7 +18,6 @@ import java.util.Map;
import java.util.ResourceBundle;
import org.eclipse.core.runtime.IAdaptable;
-
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
@@ -26,23 +25,19 @@ import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.resource.JFaceResources;
-
import org.eclipse.jface.text.IDocument;
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.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.SelectionChangedEvent;
-
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Menu;
import org.eclipse.swt.widgets.Widget;
-
import org.eclipse.ui.IActionBars;
import org.eclipse.ui.ISharedImages;
import org.eclipse.ui.IWorkbenchActionConstants;
@@ -57,7 +52,6 @@ import org.eclipse.ui.internal.console.FollowHyperlinkAction;
import org.eclipse.ui.internal.console.IConsoleHelpContextIds;
import org.eclipse.ui.part.IPageBookViewPage;
import org.eclipse.ui.part.IPageSite;
-
import org.eclipse.ui.texteditor.FindReplaceAction;
import org.eclipse.ui.texteditor.IUpdate;
@@ -241,6 +235,7 @@ public class TextConsolePage implements IPageBookViewPage, IPropertyChangeListen
public void setFocus() {
if (fViewer != null) {
fViewer.getTextWidget().setFocus();
+ updateAction(ActionFactory.FIND.getId());
}
}
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java
index 0f68c92e7..692f10219 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java
@@ -185,6 +185,9 @@ public class ConsoleView extends PageBookView implements IConsoleView, IConsoleL
if (page instanceof IOConsolePage) {
((IOConsolePage) page).setWordWrap(fWordWrap);
}
+ if (page != null) {
+ page.setFocus();
+ }
}
/**

Back to the top