/* * Bug.java * * Created on May 16, 2002, 1:37 PM */ package abug; /** * * @author cwebster */ import org.openide.src.*; import org.openide.cookies.SourceCookie; public class Bug { /** Creates a new instance of Bug */ public Bug() { } public void method() {} /** * @param args the command line arguments */ public static void main(String[] args) { ClassElement ce = ClassElement.forName("abug.Bug"); MethodElement me = ce.getMethod(Identifier.create("method"), new Type[0]); SourceCookie.Editor sc = (SourceCookie.Editor) me.getCookie(SourceCookie.Editor.class); if (sc != null) { javax.swing.text.Element e = sc.sourceToText(me); javax.swing.text.Document d = e.getDocument(); System.out.println(d); } } }