本文整理汇总了Java中org.eclipse.debug.core.model.IDebugTarget.getAdapter方法的典型用法代码示例。如果您正苦于以下问题:Java IDebugTarget.getAdapter方法的具体用法?Java IDebugTarget.getAdapter怎么用?Java IDebugTarget.getAdapter使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.debug.core.model.IDebugTarget
的用法示例。
在下文中一共展示了IDebugTarget.getAdapter方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
}
}
}
}
示例2: getDebugTarget
import org.eclipse.debug.core.model.IDebugTarget; //导入方法依赖的package包/类
protected Object getDebugTarget() {
IDebugTarget[] debugTargets = DebugPlugin.getDefault().getLaunchManager().getDebugTargets();
for (IDebugTarget iDebugTarget : debugTargets) {
if (iDebugTarget.isTerminated())
continue;
if (iDebugTarget.getAdapter(ISimulationEngine.class) == this)
return iDebugTarget;
}
return null;
}
示例3: activeTargetChanged
import org.eclipse.debug.core.model.IDebugTarget; //导入方法依赖的package包/类
protected void activeTargetChanged(final IDebugTarget debugTarget) {
openEditorForTarget(debugTarget);
updateTypeSystem(debugTarget);
ISimulationEngine engine = (ISimulationEngine) debugTarget.getAdapter(ISimulationEngine.class);
timeScheduler = (DefaultTimeTaskScheduler) engine.getTimeTaskScheduler();
setViewerInput(engine.getExecutionContext());
updateActions();
updateSessionDropdownInput(debugTarget);
}
示例4: openEditorForTarget
import org.eclipse.debug.core.model.IDebugTarget; //导入方法依赖的package包/类
protected void openEditorForTarget(final IDebugTarget debugTarget) {
if (this.debugTarget != null) {
EObject adapter = debugTarget.getAdapter(EObject.class);
if (adapter instanceof Statechart) {
Statechart statechart = (Statechart) adapter;
Diagram diagram = DiagramPartitioningUtil.getDiagramContaining(statechart);
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
DiagramPartitioningUtil.openEditor(diagram);
}
});
}
}
}