/ui/src/com/bluemarsh/jswat/ui/actions/ResumeDebuggeeAction.java
Java | 77 lines | 37 code | 9 blank | 31 comment | 1 complexity | 36a832b6642a6a9f453fe887c0b8628e MD5 | raw file
Possible License(s): MPL-2.0-no-copyleft-exception
1/* 2 * The contents of this file are subject to the terms of the Common Development 3 * and Distribution License (the License). You may not use this file except in 4 * compliance with the License. 5 * 6 * You can obtain a copy of the License at http://www.netbeans.org/cddl.html 7 * or http://www.netbeans.org/cddl.txt. 8 * 9 * When distributing Covered Code, include this CDDL Header Notice in each file 10 * and include the License file at http://www.netbeans.org/cddl.txt. 11 * If applicable, add the following below the CDDL Header, with the fields 12 * enclosed by brackets [] replaced by your own identifying information: 13 * "Portions Copyrighted [year] [name of copyright owner]" 14 * 15 * The Original Software is JSwat. The Initial Developer of the Original 16 * Software is Nathan L. Fiedler. Portions created by Nathan L. Fiedler 17 * are Copyright (C) 2004-2010. All Rights Reserved. 18 * 19 * Contributor(s): Nathan L. Fiedler. 20 * 21 * $Id: ResumeDebuggeeAction.java 288 2010-11-21 02:59:13Z nathanfiedler $ 22 */ 23package com.bluemarsh.jswat.ui.actions; 24 25import com.bluemarsh.jswat.core.session.Session; 26import com.bluemarsh.jswat.core.session.SessionProvider; 27import com.bluemarsh.jswat.ui.ActionEnabler; 28import org.openide.util.HelpCtx; 29import org.openide.util.NbBundle; 30import org.openide.util.actions.CallableSystemAction; 31 32/** 33 * Resumes the debuggee, if it is active. 34 * 35 * @author Nathan Fiedler 36 */ 37public class ResumeDebuggeeAction extends CallableSystemAction { 38 39 /** silence the compiler warnings */ 40 private static final long serialVersionUID = 1L; 41 42 /** 43 * Creates a new instance of ResumeDebuggeeAction. 44 */ 45 public ResumeDebuggeeAction() { 46 ActionEnabler ae = ActionEnabler.getDefault(); 47 ae.registerSuspendedAction(this); 48 } 49 50 @Override 51 protected boolean asynchronous() { 52 return false; 53 } 54 55 @Override 56 public HelpCtx getHelpCtx() { 57 return new HelpCtx("jswat-resume-debuggee"); 58 } 59 60 @Override 61 public String getName() { 62 return NbBundle.getMessage(getClass(), "LBL_ResumeDebuggeeAction"); 63 } 64 65 @Override 66 protected String iconResource() { 67 return NbBundle.getMessage(getClass(), "IMG_ResumeDebuggeeAction"); 68 } 69 70 @Override 71 public void performAction() { 72 Session session = SessionProvider.getSessionManager().getCurrent(); 73 if (session.isConnected()) { 74 session.resumeVM(); 75 } 76 } 77}