Search in sources :

Example 1 with DBGPDebugFrame

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);
            }
        }
    };
}
Also used : IServiceProvider(com.servoy.j2db.IServiceProvider) NGClientWebsocketSessionWindows(com.servoy.j2db.server.ngclient.eventthread.NGClientWebsocketSessionWindows) NGClient(com.servoy.j2db.server.ngclient.NGClient) DBGPDebugFrame(org.eclipse.dltk.rhino.dbgp.DBGPDebugFrame)

Example 2 with DBGPDebugFrame

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();
    }
}
Also used : DBGPDebugFrame(org.eclipse.dltk.rhino.dbgp.DBGPDebugFrame)

Example 3 with DBGPDebugFrame

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;
}
Also used : DBGPDebugFrame(org.eclipse.dltk.rhino.dbgp.DBGPDebugFrame)

Aggregations

DBGPDebugFrame (org.eclipse.dltk.rhino.dbgp.DBGPDebugFrame)3 IServiceProvider (com.servoy.j2db.IServiceProvider)1 NGClient (com.servoy.j2db.server.ngclient.NGClient)1 NGClientWebsocketSessionWindows (com.servoy.j2db.server.ngclient.eventthread.NGClientWebsocketSessionWindows)1