use of org.eclipse.dltk.rhino.dbgp.DBGPDebugFrame in project servoy-client by Servoy.
the class ServoyDebugger method getFrame.
/**
* @see org.eclipse.dltk.rhino.dbgp.DBGPDebugger#getFrame(org.mozilla.javascript.Context, org.mozilla.javascript.debug.DebuggableScript)
*/
@Override
public DebugFrame getFrame(Context cx, DebuggableScript fnOrScript) {
final IServiceProvider client = J2DBGlobals.getServiceProvider();
if (profilelisteners.size() > 0) {
ProfileInfo info = profileInfo.get();
return new ServoyDebugFrame(cx, fnOrScript, this, info != null ? info.peek() : null);
}
return new DBGPDebugFrame(cx, fnOrScript, this) {
@Override
public Object eval(String value) {
if (client != null && J2DBGlobals.getServiceProvider() == null) {
J2DBGlobals.setServiceProvider(client);
}
boolean reset = false;
try {
if (client instanceof NGClient && !CurrentWindow.exists()) {
// make sure that for an NGClient the current window is set.
CurrentWindow.set(new NGClientWebsocketSessionWindows(((NGClient) client).getWebsocketSession()));
reset = true;
}
return super.eval(value);
} finally {
if (reset)
CurrentWindow.set(null);
}
}
};
}
use of org.eclipse.dltk.rhino.dbgp.DBGPDebugFrame in project servoy-client by Servoy.
the class DebugNGClient method onStopSubAction.
@Override
public void onStopSubAction(Pair<Integer, Integer> perfId) {
super.onStopSubAction(perfId);
DBGPDebugFrame stackFrame = getStackFrame();
if (stackFrame instanceof ServoyDebugFrame) {
ServoyDebugFrame servoyDebugFrame = (ServoyDebugFrame) stackFrame;
servoyDebugFrame.onExitSubAction();
}
}
use of org.eclipse.dltk.rhino.dbgp.DBGPDebugFrame in project servoy-client by Servoy.
the class DebugNGClient method onStartSubAction.
@Override
public Pair<Integer, Integer> onStartSubAction(String serviceName, String functionName, WebObjectFunctionDefinition apiFunction, Object[] args) {
Pair<Integer, Integer> result = super.onStartSubAction(serviceName, functionName, apiFunction, args);
DBGPDebugFrame stackFrame = getStackFrame();
if (stackFrame instanceof ServoyDebugFrame) {
ServoyDebugFrame servoyDebugFrame = (ServoyDebugFrame) stackFrame;
servoyDebugFrame.onEnterSubAction(serviceName + "." + functionName, args);
}
return result;
}
Aggregations