1 19 package org.netbeans.modules.xml.core.actions; 20 21 import org.openide.nodes.*; 22 import org.openide.util.HelpCtx; 23 import org.openide.util.actions.CookieAction; 24 25 import org.netbeans.modules.xml.core.actions.CollectXMLAction; 26 27 import org.netbeans.api.xml.cookies.*; 28 29 36 public class CheckEntityAction extends CookieAction implements CollectXMLAction.XMLAction { 37 38 39 private static final long serialVersionUID = -4617456591768900199L; 40 41 42 protected Class [] cookieClasses () { 43 return new Class [] { CheckXMLCookie.class }; 44 } 45 46 47 protected int mode () { 48 return MODE_ALL; 49 } 50 51 52 protected void performAction (Node[] nodes) { 53 54 if (nodes == null) return; 55 56 InputOutputReporter console = new InputOutputReporter(); 57 58 for (int i = 0; i<nodes.length; i++) { 59 Node node = nodes[i]; 60 CheckXMLCookie cake = (CheckXMLCookie) node.getCookie(CheckXMLCookie.class); 61 if (cake == null) continue; 62 console.setNode(node); cake.checkXML(console); 64 } 65 66 console.message(Util.THIS.getString("MSG_XML_entity_check_end")); 67 console.moveToFront(true); 68 } 69 70 71 public String getName() { 72 return Util.THIS.getString("NAME_Check_XML_entity"); 73 } 74 75 76 protected String iconResource () { 77 return null; 78 } 79 80 81 public HelpCtx getHelpCtx () { 82 return new HelpCtx (CheckEntityAction.class); 83 } 84 85 } 86 | Popular Tags |