KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > ant > internal > ui > views > actions > FilterInternalTargetsAction


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 package org.eclipse.ant.internal.ui.views.actions;
12
13 import org.eclipse.ant.internal.ui.AntUIImages;
14 import org.eclipse.ant.internal.ui.IAntUIConstants;
15 import org.eclipse.ant.internal.ui.views.AntView;
16 import org.eclipse.jface.action.Action;
17
18 /**
19  * An action which toggles filtering of internal targets from the Ant view.
20  */

21 public class FilterInternalTargetsAction extends Action {
22
23     private AntView fView;
24     
25     public FilterInternalTargetsAction(AntView view) {
26         super(AntViewActionMessages.FilterInternalTargetsAction_0);
27         fView = view;
28         setImageDescriptor(AntUIImages.getImageDescriptor(IAntUIConstants.IMG_FILTER_INTERNAL_TARGETS));
29         setToolTipText(AntViewActionMessages.FilterInternalTargetsAction_0);
30         setChecked(fView.isFilterInternalTargets());
31     }
32     
33     /**
34      * Toggles the filtering of internal targets from the Ant view
35      * @see org.eclipse.jface.action.IAction#run()
36      */

37     public void run() {
38         fView.setFilterInternalTargets(isChecked());
39     }
40 }
41
Popular Tags