Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDani Megert2018-02-19 11:03:02 -0500
committerDani Megert2018-02-19 11:03:02 -0500
commit7a86de81d5a962da1995c7641e722f74f458266d (patch)
treeacb8072fe8875d0d95917a940755c47d093441f9
parentd1f97f64e7962451e851095d52726adbbc861cf4 (diff)
downloadeclipse.platform.debug-I20180222-2000.tar.gz
eclipse.platform.debug-I20180222-2000.tar.xz
eclipse.platform.debug-I20180222-2000.zip
Reverted fix for bug 268608: [console] find/replace action in MessageConsole disabled on first opening of console viewI20180225-2000I20180224-1500I20180223-2000I20180222-2000I20180221-2000I20180220-2000I20180219-2000
-rw-r--r--org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ConsoleTests.java48
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/console/TextConsolePage.java22
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleView.java26
3 files changed, 31 insertions, 65 deletions
diff --git a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ConsoleTests.java b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ConsoleTests.java
index 98272afdb..0a8413576 100644
--- a/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ConsoleTests.java
+++ b/org.eclipse.debug.tests/src/org/eclipse/debug/tests/console/ConsoleTests.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2017 Andreas Loth and others.
+ * Copyright (c) 2017, 2018 Andreas Loth and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -14,23 +14,15 @@ package org.eclipse.debug.tests.console;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
-import org.eclipse.core.commands.Command;
-import org.eclipse.debug.tests.AbstractDebugTest;
-import org.eclipse.debug.tests.TestUtil;
import org.eclipse.jface.text.IDocument;
-import org.eclipse.ui.IViewPart;
-import org.eclipse.ui.IWorkbenchCommandConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.commands.ICommandService;
-import org.eclipse.ui.console.ConsolePlugin;
-import org.eclipse.ui.console.IConsole;
+
import org.eclipse.ui.console.IConsoleConstants;
-import org.eclipse.ui.console.IConsoleManager;
-import org.eclipse.ui.console.IOConsole;
import org.eclipse.ui.console.IOConsoleOutputStream;
import org.eclipse.ui.console.MessageConsole;
+import org.eclipse.debug.tests.AbstractDebugTest;
+import org.eclipse.debug.tests.TestUtil;
+
import junit.framework.TestCase;
@@ -154,34 +146,4 @@ public class ConsoleTests extends AbstractDebugTest {
}
}
- /**
- * Validate that we can use find and replace after opening a console in the
- * Console View.
- *
- * @see <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=268608">bug
- * 268608</a>
- */
- public void testFindReplaceIsEnabledOnConsoleOpen() throws Exception {
- IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IViewPart consoleView = activePage.showView(IConsoleConstants.ID_CONSOLE_VIEW);
-
- IOConsole console = new IOConsole("Test Console 7", IConsoleConstants.MESSAGE_CONSOLE_TYPE, null, true); //$NON-NLS-1$
- console.getDocument().set("some text"); //$NON-NLS-1$
-
- IConsoleManager consoleManager = ConsolePlugin.getDefault().getConsoleManager();
- IConsole[] consoles = { console };
-
- try {
- consoleManager.addConsoles(consoles);
- consoleManager.showConsoleView(console);
- TestUtil.waitForJobs(getName(), 100, 3000);
-
- ICommandService commandService = PlatformUI.getWorkbench().getService(ICommandService.class);
- Command command = commandService.getCommand(IWorkbenchCommandConstants.EDIT_FIND_AND_REPLACE);
- TestCase.assertTrue("expected FindReplace command to be enabled after opening console", command.isEnabled());
- } finally {
- consoleManager.removeConsoles(consoles);
- activePage.hideView(consoleView);
- }
- }
}
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 ef372d18a..df08b019c 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
@@ -17,7 +17,13 @@ import java.util.HashMap;
import java.util.Map;
import java.util.ResourceBundle;
+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.core.runtime.IAdaptable;
+
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
@@ -25,19 +31,17 @@ 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.util.IPropertyChangeListener;
+import org.eclipse.jface.util.PropertyChangeEvent;
+import org.eclipse.jface.viewers.ISelectionChangedListener;
+import org.eclipse.jface.viewers.SelectionChangedEvent;
+
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;
@@ -52,6 +56,7 @@ 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;
@@ -235,7 +240,6 @@ 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 ff7c5f18e..6f4af49a2 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
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2000, 2016 IBM Corporation and others.
+ * Copyright (c) 2000, 2018 IBM Corporation and others.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -17,9 +17,20 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+
import org.eclipse.core.runtime.ISafeRunnable;
import org.eclipse.core.runtime.ListenerList;
import org.eclipse.core.runtime.SafeRunner;
+
import org.eclipse.jface.action.ActionContributionItem;
import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IToolBarManager;
@@ -29,15 +40,7 @@ import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.IBasicPropertyConstants;
-import org.eclipse.swt.custom.StyledText;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Event;
-import org.eclipse.swt.widgets.ToolBar;
-import org.eclipse.swt.widgets.ToolItem;
+
import org.eclipse.ui.IPartListener2;
import org.eclipse.ui.IViewReference;
import org.eclipse.ui.IViewSite;
@@ -185,9 +188,6 @@ 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