1 11 package org.eclipse.ui.internal.console; 12 13 import org.eclipse.jface.action.Action; 14 import org.eclipse.ui.PlatformUI; 15 import org.eclipse.ui.console.IConsoleView; 16 17 22 public class ScrollLockAction extends Action { 23 24 private IConsoleView fConsoleView; 25 26 public ScrollLockAction(IConsoleView consoleView) { 27 super(ConsoleMessages.ScrollLockAction_0); 28 fConsoleView = consoleView; 29 30 setToolTipText(ConsoleMessages.ScrollLockAction_1); 31 setHoverImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_LCL_LOCK)); 32 setDisabledImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_DLCL_LOCK)); 33 setImageDescriptor(ConsolePluginImages.getImageDescriptor(IInternalConsoleConstants.IMG_ELCL_LOCK)); 34 PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IConsoleHelpContextIds.CONSOLE_SCROLL_LOCK_ACTION); 35 boolean checked = fConsoleView.getScrollLock(); 36 setChecked(checked); 37 } 38 39 42 public void run() { 43 fConsoleView.setScrollLock(isChecked()); 44 } 45 46 public void dispose() { 47 fConsoleView = null; 48 } 49 50 } 51 52 | Popular Tags |