|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 package com.nokia.s60tools.hticonnection.actions; |
|
20 |
|
21 import org.eclipse.jface.action.IAction; |
|
22 |
|
23 import com.nokia.s60tools.hticonnection.resources.ImageKeys; |
|
24 import com.nokia.s60tools.hticonnection.resources.Messages; |
|
25 import com.nokia.s60tools.hticonnection.ui.views.main.MainView; |
|
26 |
|
27 /** |
|
28 * Action for setting scroll lock for console. |
|
29 */ |
|
30 public class ScrollLockAction extends S60ToolsBaseAction { |
|
31 |
|
32 /** |
|
33 * Viewer that is target for action. |
|
34 */ |
|
35 private final MainView mainView; |
|
36 |
|
37 /** |
|
38 * Constructor |
|
39 * @param mainView Viewer that is target for action. |
|
40 */ |
|
41 public ScrollLockAction(MainView mainView) { |
|
42 super(Messages.getString("ScrollLockAction.ScrollLock_Action_Text"), //$NON-NLS-1$ |
|
43 Messages.getString("ScrollLockAction.ScrollLock_Action_Tooltip"), //$NON-NLS-1$ |
|
44 IAction.AS_CHECK_BOX, |
|
45 ImageKeys.IMG_SCROLL_LOCK); |
|
46 this.mainView = mainView; |
|
47 } |
|
48 |
|
49 |
|
50 /* (non-Javadoc) |
|
51 * @see org.eclipse.jface.action.Action#run() |
|
52 */ |
|
53 public void run() { |
|
54 // Setting scroll lock on if action is checked. |
|
55 mainView.getMainTextViewer().setScrollLock(isChecked()); |
|
56 } |
|
57 } |