KickJava   Java API By Example, From Geeks To Geeks.

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


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.window.Window;
15 import org.eclipse.ui.PlatformUI;
16
17 /**
18  * This action opens an editor for the resource
19  * associated with the selected marker, and
20  * jumps to the marker's location in the editor.
21  */

22 class FiltersAction extends TaskAction {
23
24     /**
25      * Creates the action.
26      * @param tasklist the task list
27      * @param id the id
28      */

29     public FiltersAction(TaskList tasklist, String JavaDoc id) {
30         super(tasklist, id);
31         PlatformUI.getWorkbench().getHelpSystem().setHelp(this,
32                 ITaskListHelpContextIds.FILTERS_ACTION);
33     }
34
35     /**
36      * Performs this action.
37      */

38     public void run() {
39         FiltersDialog dialog = new FiltersDialog(getShell());
40         TasksFilter filter = getTaskList().getFilter();
41         dialog.setFilter(filter);
42         int result = dialog.open();
43         if (result == Window.OK) {
44             getTaskList().filterChanged();
45         }
46     }
47
48 }
49
Popular Tags