KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > eclipse > jdt > internal > junit > ui > EnableStackFilterAction


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.jdt.internal.junit.ui;
12
13
14 import org.eclipse.jface.action.Action;
15 import org.eclipse.ui.PlatformUI;
16
17 /**
18  * Action to enable/disable stack trace filtering.
19  */

20 public class EnableStackFilterAction extends Action {
21
22     private FailureTrace fView;
23     
24     public EnableStackFilterAction(FailureTrace view) {
25         super(JUnitMessages.EnableStackFilterAction_action_label);
26         setDescription(JUnitMessages.EnableStackFilterAction_action_description);
27         setToolTipText(JUnitMessages.EnableStackFilterAction_action_tooltip);
28         
29         setDisabledImageDescriptor(JUnitPlugin.getImageDescriptor("dlcl16/cfilter.gif")); //$NON-NLS-1$
30
setHoverImageDescriptor(JUnitPlugin.getImageDescriptor("elcl16/cfilter.gif")); //$NON-NLS-1$
31
setImageDescriptor(JUnitPlugin.getImageDescriptor("elcl16/cfilter.gif")); //$NON-NLS-1$
32
PlatformUI.getWorkbench().getHelpSystem().setHelp(this, IJUnitHelpContextIds.ENABLEFILTER_ACTION);
33
34         fView= view;
35         setChecked(JUnitPreferencePage.getFilterStack());
36     }
37
38     /*
39      * @see Action#actionPerformed
40      */

41     public void run() {
42         JUnitPreferencePage.setFilterStack(isChecked());
43         fView.refresh();
44     }
45 }
46
Popular Tags