Search in sources :

Example 21 with IDebugTarget

use of org.eclipse.debug.core.model.IDebugTarget in project statecharts by Yakindu.

the class SCTHotModelReplacementManager method handleCloseEvent.

private void handleCloseEvent(IResourceChangeEvent event) {
    if (event.getResource() instanceof IProject) {
        IProject project = ((IProject) event.getResource());
        for (IDebugTarget target : activeTargets) {
            EObject object = (EObject) target.getAdapter(EObject.class);
            IFile file = WorkspaceSynchronizer.getFile(object.eResource());
            if (project.equals(file.getProject())) {
                try {
                    target.terminate();
                } catch (DebugException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
Also used : IFile(org.eclipse.core.resources.IFile) EObject(org.eclipse.emf.ecore.EObject) IDebugTarget(org.eclipse.debug.core.model.IDebugTarget) DebugException(org.eclipse.debug.core.DebugException) IProject(org.eclipse.core.resources.IProject)

Example 22 with IDebugTarget

use of org.eclipse.debug.core.model.IDebugTarget in project statecharts by Yakindu.

the class SCTSourceDisplayDispatcher method handleDebugTargetTerminated.

protected void handleDebugTargetTerminated(DebugEvent debugEvent) {
    Object source = debugEvent.getSource();
    if (source instanceof IDebugTarget) {
        IDebugTarget target = (IDebugTarget) source;
        if (target == activeDebugTarget) {
            activeSourceDisplay.terminate(true);
            activeSourceDisplay = null;
        }
    }
}
Also used : IDebugTarget(org.eclipse.debug.core.model.IDebugTarget)

Example 23 with IDebugTarget

use of org.eclipse.debug.core.model.IDebugTarget in project bndtools by bndtools.

the class LaunchThread method getAdapter.

@SuppressWarnings("rawtypes")
@Override
public Object getAdapter(Class adapter) {
    if (adapter.equals(IProcess.class)) {
        return this;
    }
    if (adapter.equals(IDebugTarget.class)) {
        ILaunch launch = getLaunch();
        IDebugTarget[] targets = launch.getDebugTargets();
        for (int i = 0; i < targets.length; i++) {
            if (this.equals(targets[i].getProcess())) {
                return targets[i];
            }
        }
        return null;
    }
    if (adapter.equals(ILaunch.class)) {
        return getLaunch();
    }
    if (adapter.equals(ILaunchConfiguration.class)) {
        return getLaunch().getLaunchConfiguration();
    }
    return null;
}
Also used : ILaunch(org.eclipse.debug.core.ILaunch) IDebugTarget(org.eclipse.debug.core.model.IDebugTarget)

Aggregations

IDebugTarget (org.eclipse.debug.core.model.IDebugTarget)23 DebugException (org.eclipse.debug.core.DebugException)4 ILaunch (org.eclipse.debug.core.ILaunch)4 EObject (org.eclipse.emf.ecore.EObject)3 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)3 IErlangDebugNode (org.erlide.backend.debug.IErlangDebugNode)3 OtpErlangAtom (com.ericsson.otp.erlang.OtpErlangAtom)2 OtpErlangList (com.ericsson.otp.erlang.OtpErlangList)2 ArrayList (java.util.ArrayList)2 Map (java.util.Map)2 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)2 PlatformObject (org.eclipse.core.runtime.PlatformObject)2 IBreakpoint (org.eclipse.debug.core.model.IBreakpoint)2 IProcess (org.eclipse.debug.core.model.IProcess)2 IJavaDebugTarget (org.eclipse.jdt.debug.core.IJavaDebugTarget)2 IVMConnector (org.eclipse.jdt.launching.IVMConnector)2 JAXPDebugTarget (org.eclipse.wst.xsl.jaxp.launching.model.JAXPDebugTarget)2 ErlangLineBreakpoint (org.erlide.backend.debug.ErlangLineBreakpoint)2 OtpErlangLong (com.ericsson.otp.erlang.OtpErlangLong)1 OtpErlangObject (com.ericsson.otp.erlang.OtpErlangObject)1