0
|
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.Messages;
|
|
24 |
import com.nokia.s60tools.hticonnection.ui.views.main.MainView;
|
|
25 |
|
|
26 |
/**
|
|
27 |
* Action for selecting all in text viewer.
|
|
28 |
*/
|
|
29 |
public class SelectAllAction extends S60ToolsBaseAction {
|
|
30 |
|
|
31 |
/**
|
|
32 |
* Viewer that is target for action.
|
|
33 |
*/
|
|
34 |
private final MainView mainView;
|
|
35 |
|
|
36 |
/**
|
|
37 |
* Constructor
|
|
38 |
* @param mainView Viewer that is target for action.
|
|
39 |
*/
|
|
40 |
public SelectAllAction(MainView mainView) {
|
|
41 |
super(Messages.getString("SelectAllAction.SelectAll_Action_Text"), //$NON-NLS-1$
|
|
42 |
Messages.getString("SelectAllAction.SelectAll_Action_Tooltip"), //$NON-NLS-1$
|
|
43 |
IAction.AS_PUSH_BUTTON, null);
|
|
44 |
this.mainView = mainView;
|
|
45 |
}
|
|
46 |
|
|
47 |
|
|
48 |
/* (non-Javadoc)
|
|
49 |
* @see org.eclipse.jface.action.Action#run()
|
|
50 |
*/
|
|
51 |
public void run() {
|
|
52 |
mainView.getMainTextViewer().selectAllText();
|
|
53 |
}
|
|
54 |
} |