name = name.substring(0, i);
}
final FunctionRef ref = new FunctionRef(name, f.getFunctionName(), f.getArity());
final IWorkbenchWindow dw = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
final IWorkbenchPage page = dw.getActivePage();
final AsyncCaller<CallHierarchyView> ac = new AsyncCaller<CallHierarchyView>(100) {
@Override
protected CallHierarchyView prepare() {
try {
final IViewPart p = page.showView("org.erlide.ui.callhierarchy");
final CallHierarchyView cvh = (CallHierarchyView) p
.getAdapter(CallHierarchyView.class);
cvh.setMessage("<searching... project "
+ ErlangEngine.getInstance().getModelUtilService()
.getProject(module).getName() + ">");
return cvh;
} catch (final PartInitException e) {
ErlLogger.error("could not open Call hierarchy view: ",
e.getMessage());
return null;
}
}
@Override
protected RpcFuture call() throws BackendException {
final RpcFuture result = xrefService.addProject(ErlangEngine
.getInstance().getModelUtilService().getProject(module));
return result;
}
@Override
protected void handleResult(final CallHierarchyView context,
final RpcFuture result) {
page.activate(context);
try {
context.setRoot(ErlangEngine.getInstance().getModel()
.findFunction(ref));
} catch (final ErlModelException e) {
ErlLogger.error(e);