public void gotoMethodDefinition(String className, String methodName,
Descriptor desc) {
try {
ClassIndex ci = SystemFacade.getInstance().getClassIndex();
ClassLocator cl = ci.getLocator(className);
if (cl != null && cl.getFileSet().equals(this.openProject.getFileSet())) {
ClassFile cf = SystemFacade.getInstance().getClassFile(cl);
List methods = cf.getMethods();
Method method = null;
for (int i = 0; i < methods.size(); i++) {
Method m = (Method) methods.get(i);
if (m.getName().equals(methodName)
&& m.getDescriptor().equals(desc)) {
method = m;
break;
}
}
if (method != null) {
Link link = new Link();
link.setText("Method definition : " + className + "." + methodName);
link.setAnchor(Link.ANCHOR_METHOD_DEF);
link.setProject(this.openProject);
link.setFile(cl.getFile());
link.setTab(Tab.EDITOR);
link.setMethod(method);
SystemFacade.getInstance().goTo(link);
}