当前位置: 首页>>代码示例>>Java>>正文


Java IDebugTarget类代码示例

本文整理汇总了Java中org.eclipse.debug.core.model.IDebugTarget的典型用法代码示例。如果您正苦于以下问题:Java IDebugTarget类的具体用法?Java IDebugTarget怎么用?Java IDebugTarget使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IDebugTarget类属于org.eclipse.debug.core.model包,在下文中一共展示了IDebugTarget类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: hotCodeReplaceFailed

import org.eclipse.debug.core.model.IDebugTarget; //导入依赖的package包/类
public void hotCodeReplaceFailed(final List<IDebugTarget> targets) {
	final Display display = Display.getDefault();
	try {
		final String title = "Model changed during simulation";
		display.asyncExec(new Runnable() {
			public void run() {
				if (display.isDisposed()) {
					return;
				}
				SimulationLaunchErrorDialog dialog = new SimulationLaunchErrorDialog(
						DebugUIPlugin.getShell(), title, MESSAGE, status,
						targets);
				dialog.setBlockOnOpen(false);
				dialog.open();
			}
		});
	} catch (Exception ex) {
		ex.printStackTrace();
	}
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:21,代码来源:HotModelReplacementListener.java

示例2: handleCloseEvent

import org.eclipse.debug.core.model.IDebugTarget; //导入依赖的package包/类
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();
				}
			}
		}
	}
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:17,代码来源:SCTHotModelReplacementManager.java

示例3: handleHotModelReplacement

import org.eclipse.debug.core.model.IDebugTarget; //导入依赖的package包/类
private void handleHotModelReplacement() {
	// first implementation: If the underlying model does not change
	// semantically, no notification is required...

	List<IDebugTarget> targets = getAffectedTargets();
	List<IDebugTarget> modelReplacementFailedTargets = new ArrayList<IDebugTarget>();
	for (IDebugTarget sctDebugTarget : targets) {
		// Reload the Statechart form the changes resource
		Statechart newStatechart = ResourceUtil.loadStatechart(((SCTDebugElement) sctDebugTarget)
				.getResourceString());
		if (!EcoreUtil.equals(newStatechart, (EObject) sctDebugTarget.getAdapter(EObject.class))) {
			// The model semantically changed, we have to create a
			// notificiation for that....
			modelReplacementFailedTargets.add(sctDebugTarget);
		}
	}

	if (modelReplacementFailedTargets.size() > 0) {
		notifyHotModelReplacementFailed(targets);
	}

}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:23,代码来源:SCTHotModelReplacementManager.java

示例4: getAffectedTargets

import org.eclipse.debug.core.model.IDebugTarget; //导入依赖的package包/类
private List<IDebugTarget> getAffectedTargets() {
	List<IDebugTarget> targets = new ArrayList<IDebugTarget>();
	synchronized (activeTargets) {
		for (IDebugTarget debugTarget : activeTargets) {
			if (debugTarget instanceof SCTDebugTarget) {
				String resourceString = ((SCTDebugElement) debugTarget).getResourceString();
				IResource resource = ResourcesPlugin.getWorkspace().getRoot().findMember(resourceString);
				if (changedFiles.contains(resource)) {
					targets.add(debugTarget);
				}
			}
		}
	}
	return targets;

}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:17,代码来源:SCTHotModelReplacementManager.java

示例5: interpreterFinished

import org.eclipse.debug.core.model.IDebugTarget; //导入依赖的package包/类
@Override
public void interpreterFinished(InterpreterState state, List<EventReason> reasons) {
	this.isStopped = true;
	this.isSuspended = false;
	IDebugTarget target = null;
	if (DebugPlugin.getDefault() != null) {
		synchronized (this.debugElements) {
			for (DebugElement element : this.debugElements) {
				element.fireTerminateEvent();
				target = element.getDebugTarget();
			}
		}
		DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[]{new DebugEvent(BfProcess.this, DebugEvent.TERMINATE)});
		if (target != null && target instanceof BfDebugTarget) {
			((BfDebugTarget) target).fireTerminateEvent();
		}
	}
}
 
开发者ID:RichardBirenheide,项目名称:brainfuck,代码行数:19,代码来源:BfProcess.java

示例6: getAllConnectedTargetDatas

import org.eclipse.debug.core.model.IDebugTarget; //导入依赖的package包/类
public static List<ConnectedTargetData> getAllConnectedTargetDatas() {
  IDebugTarget[] array = DebugPlugin.getDefault().getLaunchManager().getDebugTargets();
  List<ConnectedTargetData> result = new ArrayList<ConnectedTargetData>(array.length);
  for (IDebugTarget target : array) {
    if (target instanceof DebugTargetImpl == false) {
      continue;
    }
    if (target.getLaunch().isTerminated()) {
      continue;
    }
    DebugTargetImpl debugTargetImpl = (DebugTargetImpl) target;

    ConnectedTargetData connectedData = debugTargetImpl.getConnectedDataOrNull();

    if (connectedData == null) {
      continue;
    }

    result.add(connectedData);
  }
  return result;
}
 
开发者ID:jbosstools,项目名称:chromedevtools,代码行数:23,代码来源:DebugTargetImpl.java

示例7: getConnectionTargetData

import org.eclipse.debug.core.model.IDebugTarget; //导入依赖的package包/类
public static ConnectedTargetData getConnectionTargetData(Object element) {
  IDebugTarget debugTarget;
  if (element instanceof ILaunch) {
    ILaunch launch = (ILaunch) element;
    debugTarget = launch.getDebugTarget();
  } else if (element instanceof IDebugElement) {
    IDebugElement debugElement = (IDebugElement) element;
    debugTarget = debugElement.getDebugTarget();
  } else {
    return null;
  }
  if (debugTarget instanceof DebugTargetImpl == false) {
    return null;
  }
  DebugTargetImpl debugTargetImpl = (DebugTargetImpl) debugTarget;
  return debugTargetImpl.getConnectedOrNull();
}
 
开发者ID:jbosstools,项目名称:chromedevtools,代码行数:18,代码来源:SynchronizeBreakpoints.java

示例8: handleDebugEvents

import org.eclipse.debug.core.model.IDebugTarget; //导入依赖的package包/类
@Override
public void handleDebugEvents(DebugEvent[] events) {
	for (DebugEvent event : events) {
		switch (event.getKind()) {
		case DebugEvent.CREATE:
			if (event.getSource() instanceof IDebugTarget) {
				WatchDogEventType.START_DEBUG.process(this);
			}
			break;

		case DebugEvent.TERMINATE:
			if (event.getSource() instanceof IDebugTarget) {
				WatchDogEventType.END_DEBUG.process(this);
			}
			break;

		default:
			break;
		}
	}
}
 
开发者ID:TestRoots,项目名称:watchdog,代码行数:22,代码来源:DebuggerListener.java

示例9: PyDebugTargetServer

import org.eclipse.debug.core.model.IDebugTarget; //导入依赖的package包/类
public PyDebugTargetServer(ILaunch launch, IPath[] file, RemoteDebuggerServer debugger) {
    this.file = file;
    this.debugger = debugger;
    this.threads = new PyThread[0];
    this.launch = launch;

    if (launch != null) {
        for (IDebugTarget target : launch.getDebugTargets()) {
            if (target instanceof PyDebugTargetServer && target.isTerminated()) {
                launch.removeDebugTarget(target);
            }
        }
        launch.addDebugTarget(this);
    }

    debugger.addTarget(this);
    PyExceptionBreakPointManager.getInstance().addListener(this);
    PyPropertyTraceManager.getInstance().addListener(this);

    IBreakpointManager breakpointManager = DebugPlugin.getDefault().getBreakpointManager();
    breakpointManager.addBreakpointListener(this);
    // we have to know when we get removed, so that we can shut off the debugger
    DebugPlugin.getDefault().getLaunchManager().addLaunchListener(this);
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:25,代码来源:PyDebugTargetServer.java

示例10: checkFinishedLine

import org.eclipse.debug.core.model.IDebugTarget; //导入依赖的package包/类
/**
 * Checks if the last thing entered was a new line, and if it was, notifies clients about it.
 */
private void checkFinishedLine() {
    String s = this.toString();
    this.reset();
    char c;
    if (s.length() > 0 && ((c = s.charAt(s.length() - 1)) == '\n' || c == '\r')) {
        IAdaptable context = DebugUITools.getDebugContext();
        if (context != null) {
            s = StringUtils.rightTrim(s);
            Object adapter = context.getAdapter(IDebugTarget.class);
            if (adapter instanceof AbstractDebugTarget) {
                AbstractDebugTarget target = (AbstractDebugTarget) adapter;

                for (IConsoleInputListener listener : participants) {
                    listener.newLineReceived(s, target);
                }
            }
        }
    }
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:23,代码来源:ProcessServerOutputStream.java

示例11: getEncodingFromFrame

import org.eclipse.debug.core.model.IDebugTarget; //导入依赖的package包/类
public static String getEncodingFromFrame(PyStackFrame selectedFrame) {
    try {
        IDebugTarget adapter = (IDebugTarget) selectedFrame.getAdapter(IDebugTarget.class);
        if (adapter == null) {
            return "UTF-8";
        }
        IProcess process = adapter.getProcess();
        if (process == null) {
            return "UTF-8";
        }
        ILaunch launch = process.getLaunch();
        if (launch == null) {
            Log.log("Unable to get launch for: " + process);
            return "UTF-8";
        }
        return getEncodingFromLaunch(launch);
    } catch (Exception e) {
        Log.log(e);
        return "UTF-8";
    }
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:22,代码来源:PydevIProcessFactory.java

示例12: setLaunchAndRelatedInfo

import org.eclipse.debug.core.model.IDebugTarget; //导入依赖的package包/类
public void setLaunchAndRelatedInfo(ILaunch launch) {
    this.setLaunch(launch);
    if (launch != null) {
        IDebugTarget debugTarget = launch.getDebugTarget();
        IInterpreterInfo projectInterpreter = null;
        if (debugTarget instanceof PyDebugTarget) {
            PyDebugTarget pyDebugTarget = (PyDebugTarget) debugTarget;
            PythonNature nature = PythonNature.getPythonNature(pyDebugTarget.project);
            if (nature != null) {
                ArrayList<IPythonNature> natures = new ArrayList<>(1);
                natures.add(nature);
                this.setNaturesUsed(natures);
                try {
                    projectInterpreter = nature.getProjectInterpreter();
                    this.setInterpreterInfo(projectInterpreter);
                } catch (Throwable e1) {
                    Log.log(e1);
                }
            }
        }
    }

}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:24,代码来源:PydevConsoleInterpreter.java

示例13: onSetTreeInput

import org.eclipse.debug.core.model.IDebugTarget; //导入依赖的package包/类
@Override
protected void onSetTreeInput() {
    IDebugTarget[] debugTargets = DebugPlugin.getDefault().getLaunchManager().getDebugTargets();
    List<AbstractDebugTarget> targets = new ArrayList<AbstractDebugTarget>();
    if (debugTargets.length > 0) {
        for (IDebugTarget iDebugTarget : debugTargets) {
            if (iDebugTarget instanceof AbstractDebugTarget) {
                AbstractDebugTarget debugTarget = (AbstractDebugTarget) iDebugTarget;
                if (!debugTarget.isTerminated() && !debugTarget.isDisconnected()) {
                    if (debugTarget.hasCurrExceptions()) {
                        targets.add(debugTarget);
                    }
                }
            }
        }
    }
    viewer.setInput(targets);
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:19,代码来源:CurrentExceptionView.java

示例14: getEditorInput

import org.eclipse.debug.core.model.IDebugTarget; //导入依赖的package包/类
@Override
public IEditorInput getEditorInput(Object element) {
    IEditorInput edInput = null;
    if (element instanceof PyStackFrame) {
        PyStackFrame pyStackFrame = (PyStackFrame) element;
        IPath path = pyStackFrame.getPath();

        // get the project of the file that is being debugged
        Object target = pyStackFrame.getAdapter(IDebugTarget.class);
        if (target instanceof PyDebugTarget) {
            lastProject = ((PyDebugTarget) target).project;
        }

        if (path != null && !path.toString().startsWith("<")) {
            edInput = locatorBase.createEditorInput(path, true, pyStackFrame, lastProject);
        }

    }
    return edInput;
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:21,代码来源:PySourceLocator.java

示例15: getCompletions

import org.eclipse.debug.core.model.IDebugTarget; //导入依赖的package包/类
/**
 * Gets the completions at the passed offset.
 */
@Override
public ICompletionProposal[] getCompletions(String text, String actTok, int offset,
        boolean showForTabCompletion)
        throws Exception {
    this.text = text;
    this.actTok = actTok;
    this.offset = offset;
    PyStackFrame stackFrame = currentPyStackFrameForConsole.getLastSelectedFrame();

    if (stackFrame != null) {
        AbstractDebugTarget target = (AbstractDebugTarget) stackFrame.getAdapter(IDebugTarget.class);
        if (target != null) {
            GetCompletionsCommand cmd = new GetCompletionsCommand(target, actTok, stackFrame.getLocalsLocator()
                    .getPyDBLocation());
            cmd.setCompletionListener(this);
            target.postCommand(cmd);
        }
        return waitForCommand();
    }
    return EMPTY_COMPLETION_PROPOSALS;
}
 
开发者ID:fabioz,项目名称:Pydev,代码行数:25,代码来源:ConsoleCompletionsPageParticipant.java


注:本文中的org.eclipse.debug.core.model.IDebugTarget类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。