Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Rennie2013-07-10 13:56:03 -0400
committerMike Rennie2013-07-10 13:56:03 -0400
commit2123eb384fbb6bfe61a03e40ffe6836b2daf4696 (patch)
tree0daf6e31d4947765a76186950def6d7a1c28a79e
parentff806bed25131ecc9187492c04a0dbc8dd12e3d6 (diff)
downloadeclipse.platform.debug-2123eb384fbb6bfe61a03e40ffe6836b2daf4696.tar.gz
eclipse.platform.debug-2123eb384fbb6bfe61a03e40ffe6836b2daf4696.tar.xz
eclipse.platform.debug-2123eb384fbb6bfe61a03e40ffe6836b2daf4696.zip
Bug 412658 - console view: - don't use widgets, use console managerI20130716-0800
-rw-r--r--org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDropDownAction.java39
1 files changed, 13 insertions, 26 deletions
diff --git a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDropDownAction.java b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDropDownAction.java
index fcddf63d2..d578e0e9e 100644
--- a/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDropDownAction.java
+++ b/org.eclipse.ui.console/src/org/eclipse/ui/internal/console/ConsoleDropDownAction.java
@@ -17,11 +17,9 @@ import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
import org.eclipse.jface.action.Action;
import org.eclipse.jface.action.ActionContributionItem;
-import org.eclipse.jface.action.IAction;
import org.eclipse.jface.action.IMenuCreator;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Menu;
-import org.eclipse.swt.widgets.MenuItem;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.console.ConsolePlugin;
import org.eclipse.ui.console.IConsole;
@@ -121,31 +119,20 @@ class ConsoleDropDownAction extends Action implements IMenuCreator, IConsoleList
if (pinned) {
consoleView.setPinned(false);
}
- //we should be switching over the console views as ordered in the drop down
- //not based on the internal view stack, which changes as new console are opened / brought to top
- int size = fMenu.getItemCount();
- if(fMenu != null && size > 1) {
- int idx = 0;
- MenuItem[] items = fMenu.getItems();
- for (int i = 0; i < items.length; i++) {
- idx = i;
- if(items[i].getSelection()) {
- break;
- }
+ IConsole[] consoles = ConsolePlugin.getDefault().getConsoleManager().getConsoles();
+ IConsole current = fView.getConsole();
+ int idx = 0;
+ for (int i = 0; i < consoles.length; i++) {
+ idx = i;
+ if(consoles[i] == current) {
+ break;
}
- int next = idx+1;
- if(next >= size) {
- next = 0;
- }
- Object data = items[next].getData();
- if(data instanceof ActionContributionItem) {
- //we have to set the selection because unless the sub-menu is shown it does not update
- items[idx].setSelection(false);
- items[next].setSelection(true);
- IAction action = ((ActionContributionItem)data).getAction();
- action.run();
- }
- }
+ }
+ int next = idx+1;
+ if(next >= consoles.length) {
+ next = 0;
+ }
+ fView.display(consoles[next]);
}
finally {
if (pinned) {

Back to the top