1 19 20 package org.netbeans.modules.httpserver; 21 22 import javax.swing.Action ; 23 24 import org.openide.NotifyDescriptor; 25 import org.openide.DialogDisplayer; 26 import org.openide.util.HelpCtx; 27 import org.openide.util.NbBundle; 28 import org.openide.util.actions.CallableSystemAction; 29 30 34 public class StopHttpServerAction extends CallableSystemAction { 35 36 public void performAction () { 37 HttpServerSettings s = HttpServerModule.httpserverSettings (); 38 if (!s.isRunning ()) { 39 DialogDisplayer.getDefault ().notify ( 40 new NotifyDescriptor.Message ( 41 NbBundle.getMessage (StopHttpServerAction.class, "MSG_ServerAlreadyStopped"), 42 NotifyDescriptor.INFORMATION_MESSAGE 43 ) 44 ); 45 } 46 else { 47 s.setRunning (false); 48 } 49 } 50 51 public String getName () { 52 return NbBundle.getMessage (StopHttpServerAction.class, "LBL_StopHttpServerAction"); 53 } 54 55 60 61 public HelpCtx getHelpCtx () { 62 return HelpCtx.DEFAULT_HELP; 63 } 65 66 68 protected void initialize () { 69 super.initialize (); 70 putProperty (Action.SHORT_DESCRIPTION, NbBundle.getMessage (StopHttpServerAction.class, "HINT_StopHttpServerAction")); 71 } 72 73 protected boolean asynchronous() { 74 return false; 75 } 76 77 } 78 | Popular Tags |