erlangDebugTarget = null;
if (selection instanceof IStructuredSelection) {
final IStructuredSelection structuredSelection = (IStructuredSelection) selection;
final Object o = structuredSelection.getFirstElement();
if (o instanceof ErlangDebugElement) {
final ErlangDebugElement e = (ErlangDebugElement) o;
erlangDebugTarget = e.getErlangDebugTarget();
} else if (o instanceof ILaunch) {
final ILaunch launch = (ILaunch) o;
final IDebugTarget target = launch.getDebugTarget();
if (target instanceof IErlangDebugNode) {
final IErlangDebugNode edn = (IErlangDebugNode) target;