KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mountainminds > eclemma > internal > ui > coverageview > SelectCounterModeAction


1 /*******************************************************************************
2  * Copyright (c) 2006 Mountainminds GmbH & Co. KG
3  * This software is provided under the terms of the Eclipse Public License v1.0
4  * See http://www.eclipse.org/legal/epl-v10.html.
5  *
6  * $Id: SelectCounterModeAction.java 12 2006-08-28 20:07:13Z mho $
7  ******************************************************************************/

8 package com.mountainminds.eclemma.internal.ui.coverageview;
9
10 import org.eclipse.jface.action.Action;
11
12 /**
13  * Action to select the counter mode. Internally used by the coverage view.
14  *
15  * @author Marc R. Hoffmann
16  * @version $Revision: 12 $
17  */

18 class SelectCounterModeAction extends Action {
19
20   private final int modeidx;
21   private final ViewSettings settings;
22   private final CoverageView view;
23   
24   SelectCounterModeAction(int modeidx, ViewSettings settings, CoverageView view) {
25     super(ViewSettings.COUNTERMODES[modeidx].getActionLabel(), AS_RADIO_BUTTON);
26     this.modeidx = modeidx;
27     this.settings = settings;
28     this.view = view;
29     setChecked(modeidx == settings.getCounterMode().getIdx());
30   }
31
32   public void run() {
33     settings.setCounterMode(modeidx);
34     view.updateColumnHeaders();
35     view.refreshViewer();
36   }
37
38 }
39
Popular Tags