1 19 20 package org.netbeans.modules.websvc.jaxrpc.actions; 21 22 23 import org.openide.NotifyDescriptor; 24 import org.openide.DialogDisplayer; 25 import org.openide.nodes.Node; 26 import org.openide.loaders.DataObject; 27 import org.openide.util.HelpCtx; 28 import org.openide.util.actions.NodeAction; 29 30 31 import org.netbeans.modules.websvc.api.client.WebServicesClientSupport; 32 33 37 public class RefreshClientsAction extends NodeAction { 38 39 protected boolean enable(Node[] activatedNodes) { 40 return true; 41 } 42 43 public HelpCtx getHelpCtx() { 44 return HelpCtx.DEFAULT_HELP; 46 } 47 48 public String getName() { 49 return "Refresh View"; 50 } 51 52 protected void performAction(Node[] activatedNodes) { 53 54 assert (activatedNodes != null && activatedNodes.length == 1); 55 56 WebServicesClientSupport clientSupport = null; 59 60 DataObject dobj = (DataObject) activatedNodes[0].getLookup().lookup(DataObject.class); 62 if(dobj != null) { 63 clientSupport = WebServicesClientSupport.getWebServicesClientSupport(dobj.getPrimaryFile()); 64 } 65 66 if(clientSupport == null) { 67 String mes = "Can't locate web services client support for Node: " + activatedNodes[0]; 68 NotifyDescriptor desc = new NotifyDescriptor.Message(mes, NotifyDescriptor.Message.ERROR_MESSAGE); 69 DialogDisplayer.getDefault().notify(desc); 70 return; 71 } 72 73 String mes = "Not Implemented Yet"; 74 NotifyDescriptor desc = new NotifyDescriptor.Message(mes, NotifyDescriptor.Message.ERROR_MESSAGE); 75 DialogDisplayer.getDefault().notify(desc); 76 } 77 78 protected boolean asynchronous() { 79 return false; 80 } 81 } 82 | Popular Tags |