1 11 package org.eclipse.ui.internal.console; 12 13 import org.eclipse.jface.action.Action; 14 import org.eclipse.ui.console.IConsole; 15 import org.eclipse.ui.console.IConsoleView; 16 17 20 public class ShowConsoleAction extends Action { 21 22 private IConsole fConsole; 23 private IConsoleView fView; 24 25 28 public void run() { 29 if (!fConsole.equals(fView.getConsole())) { 30 boolean pinned = fView.isPinned(); 31 if (pinned) { 32 fView.setPinned(false); 33 } 34 fView.display(fConsole); 35 if (pinned) { 36 fView.setPinned(true); 37 } 38 } 39 } 40 41 47 public ShowConsoleAction(IConsoleView view, IConsole console) { 48 super(console.getName(), AS_RADIO_BUTTON); 49 fConsole = console; 50 fView = view; 51 setImageDescriptor(console.getImageDescriptor()); 52 } 53 } 54 | Popular Tags |