}
IWorkbenchPage page = activeWorkbenchWindow
.getActivePage();
if (page == null)
return;
LaunchView view = (LaunchView) page
.findView(IDebugUIConstants.ID_DEBUG_VIEW);
if (view == null)
return;
try {
// build the tree path
// LaunchManager->Launch->DebugTarget->PHPThread->PHPStackFrame
IDebugTarget target = currentLaunches[0]
.getDebugTarget();
if (target == null)
return;
if (target.getThreads() == null
|| target.getThreads().length == 0)
return;
IThread thread = target.getThreads()[0];
IStackFrame frame = thread.getTopStackFrame();
if (frame == null)
return;
Object[] segments = new Object[5];
segments[0] = DebugPlugin.getDefault()
.getLaunchManager();
segments[1] = currentLaunches[0];
segments[2] = target;
segments[3] = thread;
segments[4] = frame;
TreePath treePath = new TreePath(segments);
// set the current launch as the LaunchViewer
// selection.
((InternalTreeModelViewer) view.getViewer())
.setSelection(new TreeSelection(treePath),
true, true);
} catch (DebugException e) {
}
}