KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > mountainminds > eclemma > internal > ui > actions > RefreshSessionAction


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: $
7  ******************************************************************************/

8 package com.mountainminds.eclemma.internal.ui.actions;
9
10 import org.eclipse.jface.action.Action;
11
12 import com.mountainminds.eclemma.core.CoverageTools;
13 import com.mountainminds.eclemma.internal.ui.EclEmmaUIPlugin;
14 import com.mountainminds.eclemma.internal.ui.UIMessages;
15
16 /**
17  * This action reloads the active coverage session.
18  *
19  * @author Marc R. Hoffmann
20  * @version $Revision: $
21  */

22 public class RefreshSessionAction extends Action {
23   
24   public RefreshSessionAction() {
25     setText(UIMessages.RefreshSessionAction_label);
26     setToolTipText(UIMessages.RefreshSessionAction_tooltip);
27     setImageDescriptor(EclEmmaUIPlugin.getImageDescriptor(EclEmmaUIPlugin.ELCL_REFRESH));
28     setDisabledImageDescriptor(EclEmmaUIPlugin.getImageDescriptor(EclEmmaUIPlugin.DLCL_REFRESH));
29     setActionDefinitionId("org.eclipse.ui.file.refresh"); //$NON-NLS-1$
30
setEnabled(false);
31   }
32
33   public void run() {
34     CoverageTools.getSessionManager().refreshActiveSession();
35   }
36
37 }
38
Popular Tags