/ui/src/com/bluemarsh/jswat/ui/actions/ResumeDebuggeeAction.java

http://jswat.googlecode.com/ · Java · 77 lines · 37 code · 9 blank · 31 comment · 1 complexity · 36a832b6642a6a9f453fe887c0b8628e MD5 · raw file

  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. */
  23. package com.bluemarsh.jswat.ui.actions;
  24. import com.bluemarsh.jswat.core.session.Session;
  25. import com.bluemarsh.jswat.core.session.SessionProvider;
  26. import com.bluemarsh.jswat.ui.ActionEnabler;
  27. import org.openide.util.HelpCtx;
  28. import org.openide.util.NbBundle;
  29. import org.openide.util.actions.CallableSystemAction;
  30. /**
  31. * Resumes the debuggee, if it is active.
  32. *
  33. * @author Nathan Fiedler
  34. */
  35. public class ResumeDebuggeeAction extends CallableSystemAction {
  36. /** silence the compiler warnings */
  37. private static final long serialVersionUID = 1L;
  38. /**
  39. * Creates a new instance of ResumeDebuggeeAction.
  40. */
  41. public ResumeDebuggeeAction() {
  42. ActionEnabler ae = ActionEnabler.getDefault();
  43. ae.registerSuspendedAction(this);
  44. }
  45. @Override
  46. protected boolean asynchronous() {
  47. return false;
  48. }
  49. @Override
  50. public HelpCtx getHelpCtx() {
  51. return new HelpCtx("jswat-resume-debuggee");
  52. }
  53. @Override
  54. public String getName() {
  55. return NbBundle.getMessage(getClass(), "LBL_ResumeDebuggeeAction");
  56. }
  57. @Override
  58. protected String iconResource() {
  59. return NbBundle.getMessage(getClass(), "IMG_ResumeDebuggeeAction");
  60. }
  61. @Override
  62. public void performAction() {
  63. Session session = SessionProvider.getSessionManager().getCurrent();
  64. if (session.isConnected()) {
  65. session.resumeVM();
  66. }
  67. }
  68. }