1 11 package org.eclipse.ui.internal.console; 12 13 import org.eclipse.jface.action.Action; 14 import org.eclipse.jface.action.IAction; 15 import org.eclipse.ui.PlatformUI; 16 import org.eclipse.ui.console.IConsoleView; 17 import org.eclipse.ui.texteditor.IUpdate; 18 19 22 public class PinConsoleAction extends Action implements IUpdate { 23 24 private IConsoleView fView = null; 25 26 29 public PinConsoleAction(IConsoleView view) { 30 super(ConsoleMessages.PinConsoleAction_0, IAction.AS_CHECK_BOX); 31 setToolTipText(ConsoleMessages.PinConsoleAction_1); 32 setImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_ELCL_PIN)); 33 setDisabledImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_DLCL_PIN)); 34 setHoverImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_LCL_PIN)); 35 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IConsoleHelpContextIds.CONSOLE_PIN_CONSOLE_ACITON); 36 fView = view; 37 update(); 38 } 39 40 43 public void run() { 44 fView.setPinned(isChecked()); 45 } 46 47 50 public void update() { 51 setEnabled(fView.getConsole() != null); 52 setChecked(fView.isPinned()); 53 } 54 } 55 | Popular Tags |