01: /*******************************************************************************
02: * Copyright (c) 2000, 2005 IBM Corporation and others.
03: * All rights reserved. This program and the accompanying materials
04: * are made available under the terms of the Eclipse Public License v1.0
05: * which accompanies this distribution, and is available at
06: * http://www.eclipse.org/legal/epl-v10.html
07: *
08: * Contributors:
09: * IBM Corporation - initial API and implementation
10: *******************************************************************************/package org.eclipse.ui.views.tasklist;
11:
12: import org.eclipse.jface.viewers.TableViewer;
13: import org.eclipse.ui.PlatformUI;
14:
15: /**
16: * This action selects all tasks currently showing in the task list.
17: */
18: class SelectAllTasksAction extends TaskAction {
19:
20: /**
21: * Creates the action.
22: */
23: protected SelectAllTasksAction(TaskList tasklist, String id) {
24: super (tasklist, id);
25: PlatformUI.getWorkbench().getHelpSystem().setHelp(this ,
26: ITaskListHelpContextIds.SELECT_ALL_TASKS_ACTION);
27: }
28:
29: /**
30: * Selects all resources in the view.
31: */
32: public void run() {
33: getTaskList().cancelEditing();
34: TableViewer viewer = getTaskList().getTableViewer();
35: viewer.getTable().selectAll();
36: // force viewer selection change
37: viewer.setSelection(viewer.getSelection());
38: }
39: }
|