1 19 20 25 26 package org.netbeans.test.java.eventfiring; 27 28 import org.openide.nodes.Node.Handle; 29 30 35 public class MyListener extends org.openide.nodes.AbstractNode implements org.openide.cookies.ConnectionCookie.Listener { 36 37 public static final String RESULT_KEY = "ResultKey"; 38 static MyListener me = null; 39 public MyListener(){ 40 super(org.openide.nodes.Children.LEAF); 41 getCookieSet().add(this); 42 me=this; 43 } 44 45 public void notify (org.openide.cookies.ConnectionCookie.Event ev) { 46 System.setProperty(RESULT_KEY,System.getProperty(RESULT_KEY)+"\nJavaConnection: "+getTextFromType(ev.getType())); 47 } 48 49 public Handle getHandle() { 50 return new org.netbeans.test.java.eventfiring.MyListener.NodeHandle(); 51 } 52 private static class NodeHandle implements Handle { 54 public NodeHandle () { 55 } 56 public org.openide.nodes.Node getNode() throws java.io.IOException { 57 if (me!=null) return me; 58 else return new MyListener (); 59 } 60 } 61 String getTextFromType(org.openide.cookies.ConnectionCookie.Type type){ 62 63 String result=""; 65 for (int i=1,j=0; i<=0x200000; i<<=1,j++){ 66 } 68 return result; 69 } 70 71 String [] tab= { 72 " TYPE_FIELDS_ADD", 73 " TYPE_FIELDS_REMOVE", 74 " TYPE_FIELDS_CHANGE", 75 "", 76 " TYPE_METHODS_ADD", 77 " TYPE_METHODS_REMOVE", 78 " TYPE_METHODS_CHANGE", 79 "", 80 " TYPE_CLASSES_ADD", 81 " TYPE_CLASSES_REMOVE", 82 " TYPE_CLASSES_CHANGE", 83 "", 84 " TYPE_CONSTRUCTORS_ADD", 85 " TYPE_CONSTRUCTORS_REMOVE", 86 " TYPE_CONSTRUCTORS_CHANGE", 87 "", 88 " TYPE_INITIALIZERS_ADD", 89 " TYPE_INITIALIZERS_REMOVE", 90 " TYPE_INITIALIZERS_CHANGE", 91 }; 92 } 93 | Popular Tags |