KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ui > views > tasklist > SelectAllTasksAction


1 /*******************************************************************************
2  * Copyright (c) 2000, 2005 IBM Corporation and others.
3  * All rights reserved. This program and the accompanying materials
4  * are made available under the terms of the Eclipse Public License v1.0
5  * which accompanies this distribution, and is available at
6  * http://www.eclipse.org/legal/epl-v10.html
7  *
8  * Contributors:
9  * IBM Corporation - initial API and implementation
10  *******************************************************************************/

11
12 package org.eclipse.ui.views.tasklist;
13
14 import org.eclipse.jface.viewers.TableViewer;
15 import org.eclipse.ui.PlatformUI;
16
17 /**
18  * This action selects all tasks currently showing in the task list.
19  */

20 class SelectAllTasksAction extends TaskAction {
21
22     /**
23      * Creates the action.
24      */

25     protected SelectAllTasksAction(TaskList tasklist, String JavaDoc id) {
26         super(tasklist, id);
27         PlatformUI.getWorkbench().getHelpSystem().setHelp(this,
28                 ITaskListHelpContextIds.SELECT_ALL_TASKS_ACTION);
29     }
30
31     /**
32      * Selects all resources in the view.
33      */

34     public void run() {
35         getTaskList().cancelEditing();
36         TableViewer viewer = getTaskList().getTableViewer();
37         viewer.getTable().selectAll();
38         // force viewer selection change
39
viewer.setSelection(viewer.getSelection());
40     }
41 }
42
Popular Tags