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


Java DebugEvent类代码示例

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


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

示例1: handleResumingReply

import org.eclipse.debug.core.DebugEvent; //导入依赖的package包/类
/**
 * Handles the given {@link ResumingReply}.
 * 
 * @param resumingReply
 *            the {@link ResumingReply}
 */
private void handleResumingReply(ResumingReply resumingReply) {
	final Thread eThread = DebugTargetUtils.getThread(getHost(), resumingReply.getThreadName());
	if (resumingReply instanceof StepIntoResumingReply) {
		// EMF model change
		factory.getModelUpdater().stepIntoReply(eThread);
		// Eclipse change
		factory.getThread(eThread).fireResumeEvent(DebugEvent.STEP_INTO);
	} else if (resumingReply instanceof StepOverResumingReply) {
		// EMF model change
		factory.getModelUpdater().stepOverReply(eThread);
		// Eclipse change
		factory.getThread(eThread).fireResumeEvent(DebugEvent.STEP_OVER);
	} else if (resumingReply instanceof StepReturnResumingReply) {
		// EMF model change
		factory.getModelUpdater().stepReturnReply(eThread);
		// Eclipse change
		factory.getThread(eThread).fireResumeEvent(DebugEvent.STEP_RETURN);
	} else {
		// EMF model change
		factory.getModelUpdater().resumedReply(eThread);
		// Eclipse change
		factory.getThread(eThread).fireResumeEvent(DebugEvent.CLIENT_REQUEST);
	}
	fireChangeEvent(DebugEvent.STATE);
}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:32,代码来源:DSLDebugTargetAdapter.java

示例2: handleSuspendReply

import org.eclipse.debug.core.DebugEvent; //导入依赖的package包/类
/**
 * Handles the given {@link SuspendedReply}.
 * 
 * @param suspendReply
 *            the {@link SuspendedReply}
 */
private void handleSuspendReply(SuspendedReply suspendReply) {
	final Thread eThread = DebugTargetUtils.getThread(getHost(), suspendReply.getThreadName());
	final DSLThreadAdapter thread = factory.getThread(eThread);

	// EMF model change
	factory.getModelUpdater().suspendedReply(eThread);
	// Eclipse change
	if (suspendReply instanceof SteppedReply) {
		thread.fireSuspendEvent(DebugEvent.STEP_END);
	} else if (suspendReply instanceof BreakpointReply) {
		thread.fireSuspendEvent(DebugEvent.BREAKPOINT);
	} else {
		thread.fireSuspendEvent(DebugEvent.CLIENT_REQUEST);
	}
	fireChangeEvent(DebugEvent.STATE);
	// notify our suspend listeners

}
 
开发者ID:eclipse,项目名称:gemoc-studio-modeldebugging,代码行数:25,代码来源:DSLDebugTargetAdapter.java

示例3: serverChanged

import org.eclipse.debug.core.DebugEvent; //导入依赖的package包/类
@Override
public void serverChanged(ServerEvent event) {
  Preconditions.checkState(server == event.getServer());
  switch (event.getState()) {
    case IServer.STATE_STARTED:
      openBrowserPage(server);
      fireChangeEvent(DebugEvent.STATE);
      return;

    case IServer.STATE_STOPPED:
      server.removeServerListener(serverEventsListener);
      fireTerminateEvent();
      try {
        logger.fine("Server stopped; terminating launch"); //$NON-NLS-1$
        launch.terminate();
      } catch (DebugException ex) {
        logger.log(Level.WARNING, "Unable to terminate launch", ex); //$NON-NLS-1$
      }
      return;

    default:
      fireChangeEvent(DebugEvent.STATE);
      return;
  }
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:26,代码来源:LocalAppEngineServerLaunchConfigurationDelegate.java

示例4: handleDebugEvent

import org.eclipse.debug.core.DebugEvent; //导入依赖的package包/类
protected void handleDebugEvent(DebugEvent debugEvent) {
	updateActions();
	switch (debugEvent.getKind()) {
		case DebugEvent.TERMINATE :
			setViewerInput(null);
			break;
		case DebugEvent.SUSPEND :
			break;
		case DebugEvent.RESUME :
			break;
	}
	Display.getDefault().asyncExec(() -> {
		if (debugEvent.getSource() != null) {
			sessionDropdown.refresh();
			targets.removeIf(dt -> dt.isTerminated());
		}
	});
}
 
开发者ID:Yakindu,项目名称:statecharts,代码行数:19,代码来源:SimulationView.java

示例5: onBreakpointHit

import org.eclipse.debug.core.DebugEvent; //导入依赖的package包/类
public void onBreakpointHit(ProductMessage productMessage) {
  System.out.println("MontoDebugTarget.onBreakpointHit()");
  HitBreakpoint hitBreakpoint = GsonMonto.fromJson(productMessage, HitBreakpoint.class);

  if (productMessage.getSource().equals(sessionSource)) {
    isSuspended = true;

    MontoThread hitThread = convertMontoToEclipseThread(this, hitBreakpoint.getHitThread());
    threads.clear();
    threads.add(hitThread);
    for (Thread montoThread : hitBreakpoint.getOtherThreads()) {
      threads.add(convertMontoToEclipseThread(this, montoThread));
    }
    threads.forEach(thread -> thread.fireSuspendEvent(DebugEvent.BREAKPOINT));
  }
}
 
开发者ID:monto-editor,项目名称:monto-eclipse,代码行数:17,代码来源:MontoDebugTarget.java

示例6: onProcessTerminatedProduct

import org.eclipse.debug.core.DebugEvent; //导入依赖的package包/类
void onProcessTerminatedProduct(ProductMessage productMessage) {
  if (productMessage.getSource().equals(sessionSource)) {
    ProcessTerminated processTerminated =
        GsonMonto.fromJson(productMessage, ProcessTerminated.class);

    terminated = true;
    exitCode = processTerminated.getExitCode();
    System.out.println("Process " + sessionId + " terminated");
    DebugPlugin.getDefault()
        .fireDebugEventSet(new DebugEvent[] {new DebugEvent(this, DebugEvent.TERMINATE)});

    // deregister product listeners

    // Deregistration needs to happen is separate thread, because removing listeners in this
    // callback method, which is called from the SinkDemultiplexer thread, causes a
    // ConcurrentModification exception in the SinkDemultiplexer thread, because the listener
    // map/list is SinkDemultiplexer is modified, before all listeners are called
    CompletableFuture.runAsync(() -> {
      Activator.getDefault().getDemultiplexer().removeProductListener(Products.PROCESS_TERMINATED,
          this);
      Activator.getDefault().getDemultiplexer().removeProductListener(Products.STREAM_OUTPUT,
          this);
    });
  }
}
 
开发者ID:monto-editor,项目名称:monto-eclipse,代码行数:26,代码来源:MontoProcess.java

示例7: start

import org.eclipse.debug.core.DebugEvent; //导入依赖的package包/类
/**
 * When a Server runtime server is started and terminated, and the project has a GWT Facet, start and stop the GWT
 * Super Dev Mode Code Server with runtime server.
 */
@Override
public void start(BundleContext context) throws Exception {
  super.start(context);

  // Observe launch events that are from the WTP server
  serverProcessListener = new IDebugEventSetListener() {
    @Override
    public void handleDebugEvents(DebugEvent[] events) {
      if (events != null) {
        onDebugEvents(events);
      }
    }
  };
  DebugPlugin.getDefault().addDebugEventListener(serverProcessListener);
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:20,代码来源:GwtWtpPlugin.java

示例8: onAfterCodeServerStarted

import org.eclipse.debug.core.DebugEvent; //导入依赖的package包/类
private void onAfterCodeServerStarted(DebugEvent event) {
  if (!(event.getSource() instanceof IProcess)) {
    return;
  }

  IProcess runtimeProcess = (IProcess) event.getSource();
  final ILaunch launch = runtimeProcess.getLaunch();
  IProcess[] processes = launch.getProcesses();
  final IProcess process = processes[0];

  // Look for the links in the sdm console output
  consoleStreamListenerCodeServer = new IStreamListener() {
    @Override
    public void streamAppended(String text, IStreamMonitor monitor) {
      displayCodeServerUrlInDevMode(launch, text);
    }
  };

  // Listen to Console output
  streamMonitorCodeServer = process.getStreamsProxy().getOutputStreamMonitor();
  streamMonitorCodeServer.addListener(consoleStreamListenerCodeServer);
}
 
开发者ID:gwt-plugins,项目名称:gwt-eclipse-plugin,代码行数:23,代码来源:GwtWtpPlugin.java

示例9: interpreterSuspended

import org.eclipse.debug.core.DebugEvent; //导入依赖的package包/类
@Override
public void interpreterSuspended(InterpreterState state, List<EventReason> eventReasons) {
	this.suspendedState = state;
	this.isSuspended = true;
	synchronized (this.debugElements) {
		for (DebugElement element : this.debugElements) {
			if (eventReasons.contains(EventReason.BreakPoint) || eventReasons.contains(EventReason.WatchPoint)) {
				element.fireSuspendEvent(DebugEvent.BREAKPOINT);
			}
			if (eventReasons.contains(EventReason.ClientRequest)) {
				element.fireSuspendEvent(DebugEvent.CLIENT_REQUEST);
			}
			if (eventReasons.contains(EventReason.StepEnd)) {
				element.fireSuspendEvent(DebugEvent.STEP_END);
			}
		}
	}
}
 
开发者ID:RichardBirenheide,项目名称:brainfuck,代码行数:19,代码来源:BfProcess.java

示例10: interpreterFinished

import org.eclipse.debug.core.DebugEvent; //导入依赖的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

示例11: handleDebugEvents

import org.eclipse.debug.core.DebugEvent; //导入依赖的package包/类
public void handleDebugEvents(DebugEvent[] events) {
  for (DebugEvent event : events) {
    switch (event.getKind()) {
      case DebugEvent.TERMINATE:
        if (event.getSource().equals(getDebugTarget())) {
          DebugPlugin.getDefault().getExpressionManager().removeExpression(this);
        }
        break;
      case DebugEvent.SUSPEND:
        if (event.getDetail() != DebugEvent.EVALUATION_IMPLICIT &&
            event.getSource() instanceof IDebugElement) {
          IDebugElement source = (IDebugElement) event.getSource();
          if (source.getDebugTarget().equals(getDebugTarget())) {
            DebugPlugin.getDefault().fireDebugEventSet(new DebugEvent[] {
                new DebugEvent(this, DebugEvent.CHANGE, DebugEvent.CONTENT) });
          }
        }
        break;
    }
  }
}
 
开发者ID:jbosstools,项目名称:chromedevtools,代码行数:22,代码来源:JsInspectExpression.java

示例12: multipleSessionsAreTracked

import org.eclipse.debug.core.DebugEvent; //导入依赖的package包/类
@Test
public void multipleSessionsAreTracked() {
	FakePlugin fp = new FakePlugin();
	RuntimeSessionTracker rst = new RuntimeSessionTracker(null, fp);
	assertThat("The session should be alive", fp.shutdownWasCalled, is(0));
	rst.handleDebugEvents(new DebugEvent[] {new DebugEvent(new FakeProcess(), DebugEvent.CREATE)});
	rst.handleDebugEvents(new DebugEvent[] {new DebugEvent(new FakeProcess(), DebugEvent.CREATE)});
	assertThat("The session should be alive", fp.shutdownWasCalled, is(0));
	rst.handleDebugEvents(new DebugEvent[] {new DebugEvent(new FakeProcess(), DebugEvent.TERMINATE)});
	assertThat("The session should be alive", fp.shutdownWasCalled, is(0));
	rst.handleDebugEvents(new DebugEvent[] {new DebugEvent(new FakeProcess(), DebugEvent.CREATE)});
	rst.handleDebugEvents(new DebugEvent[] {new DebugEvent(new FakeProcess(), DebugEvent.TERMINATE)});
	assertThat("The session should be alive", fp.shutdownWasCalled, is(0));
	rst.handleDebugEvents(new DebugEvent[] {new DebugEvent(new FakeProcess(), DebugEvent.TERMINATE)});
	assertThat("The session should be over", fp.shutdownWasCalled, is(1));
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:17,代码来源:RuntimeSessionTrackerTest.java

示例13: handleDebugEvents

import org.eclipse.debug.core.DebugEvent; //导入依赖的package包/类
@Override
public void handleDebugEvents(DebugEvent[] events) {
	for (DebugEvent debugEvent : events) {
		if (debugEvent.getSource() instanceof IProcess &&
				((IProcess)debugEvent.getSource()).getLaunch() == trackedLaunch) {
			if (debugEvent.getKind() == DebugEvent.CREATE) {
				liveProcessCount++;
				assert liveProcessCount > 0;
			}
			else if (debugEvent.getKind() == DebugEvent.TERMINATE) {
				liveProcessCount--;
				assert liveProcessCount >= 0;
				if (liveProcessCount == 0) {
					dispose();
				}
			}
		}
	}
}
 
开发者ID:ELTE-Soft,项目名称:txtUML,代码行数:20,代码来源:RuntimeSessionTracker.java

示例14: handleDebugEvents

import org.eclipse.debug.core.DebugEvent; //导入依赖的package包/类
@Override
public void handleDebugEvents(final DebugEvent[] events) {
    for (final DebugEvent event : events) {
        if (event.getSource().equals(process)) {
            if (event.getKind() == DebugEvent.TERMINATE) {
                if (shellConnection != null) {
                    try {
                        shellConnection.disconnect();
                    } catch (final IOException e) {
                        KarafUIPluginActivator.getLogger().error("Unable to disconnect from SSH server", e);
                    }
                }
                DebugPlugin.getDefault().removeDebugEventListener(this);

                resetName();
            }
        }
    }
}
 
开发者ID:apache,项目名称:karaf-eik,代码行数:20,代码来源:KarafRemoteConsole.java

示例15: handleDebugEvents

import org.eclipse.debug.core.DebugEvent; //导入依赖的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


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