use of org.erlide.backend.debug.model.ErlangDebugElement in project erlide_eclipse by erlang.
the class InterpretedModulesView method contextActivated.
private void contextActivated(final ISelection selection) {
if (!isAvailable() || !isVisible()) {
return;
}
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;
erlangDebugTarget = edn.getErlangDebugTarget();
}
} else if (o instanceof RuntimeProcess) {
final RuntimeProcess ep = (RuntimeProcess) o;
final ILaunch launch = ep.getLaunch();
final IDebugTarget target = launch.getDebugTarget();
if (target instanceof IErlangDebugNode) {
final IErlangDebugNode edn = (IErlangDebugNode) target;
erlangDebugTarget = edn.getErlangDebugTarget();
}
}
if (erlangDebugTarget == null) {
ErlLogger.debug("no debug target found for " + selection);
return;
}
final ILaunchConfiguration launchConfiguration = erlangDebugTarget.getLaunch().getLaunchConfiguration();
setViewerInput(launchConfiguration);
try {
final EnumSet<ErlDebugFlags> debugFlags = ErlDebugFlags.makeSet(launchConfiguration.getAttribute(ErlRuntimeAttributes.DEBUG_FLAGS, ErlDebugFlags.getFlag(ErlDebugFlags.DEFAULT_DEBUG_FLAGS)));
distributed = debugFlags.contains(ErlDebugFlags.DISTRIBUTED_DEBUG);
} catch (final CoreException e1) {
distributed = false;
}
}
listViewer.refresh();
showViewer();
// updateAction(VARIABLES_FIND_ELEMENT_ACTION);
// updateAction(FIND_ACTION);
}
use of org.erlide.backend.debug.model.ErlangDebugElement in project erlide_eclipse by erlang.
the class ErlangTracingAction method selectionChanged.
@Override
public void selectionChanged(final IAction action, final ISelection selection) {
fLaunch = null;
if (selection instanceof IStructuredSelection) {
final IStructuredSelection ss = (IStructuredSelection) selection;
for (final Object o : ss.toArray()) {
if (o instanceof ErlangDebugElement) {
final ErlangDebugElement d = (ErlangDebugElement) o;
fLaunch = d.getLaunch();
} else if (o instanceof ILaunch) {
fLaunch = (ILaunch) o;
} else if (o instanceof IProcess) {
final IProcess p = (IProcess) o;
fLaunch = p.getLaunch();
}
}
}
}
Aggregations