public void run() {
clear();
if (itemLookup != null) {
DebugService svc = model.getDebugService();
synchronized (svc) {
DebugSession session = svc.getCurrentSession();
if (session != null) {
decorateWithSessionInfo(session);
}
}
}
}
private void decorateWithSessionInfo(DebugSession session) {
IntegrationEntity debuggee = itemLookup.getEntity(session.getDebugeeId());
if (debuggee != null) {
setDebuggee(debuggee);
switch (session.getState()) {
case PAUSED:
writePausedInfo(session);
break;
case RUNNING:
writeRunning();
break;
case DONE:
case IDLE:
// Nothing to do
}
}
}
private void writeRunning() {
postfix.setText("[running]");
}
private void writePausedInfo(DebugSession session) {
String text = "[" + getBreakLocationInfo(session) + "]";
postfix.setText(text);
}
private String getBreakLocationInfo(DebugSession session) {
return getLabelBuilder(session).build();
}
private BreakLocation getBreakLocation(DebugSession session) {
TestResult result = session.getResult();
if (result != null) {
BreakLocation[] callstack = result.getCallStack();
if (callstack != null && callstack.length > 0) {
return callstack[0];
}