Search in sources :

Example 1 with IBackendShell

use of org.erlide.runtime.shell.IBackendShell in project erlide_eclipse by erlang.

the class BackendShellManager method dispose.

@Override
public void dispose() {
    final Collection<BackendShell> c = fShells.values();
    for (final IBackendShell backendShell : c) {
        backendShell.close();
    }
    fShells.clear();
}
Also used : IBackendShell(org.erlide.runtime.shell.IBackendShell) IBackendShell(org.erlide.runtime.shell.IBackendShell)

Example 2 with IBackendShell

use of org.erlide.runtime.shell.IBackendShell in project erlide_eclipse by erlang.

the class BackendShellManager method openShell.

public synchronized IBackendShell openShell(final String id) {
    BackendShell shell = getShell(id);
    if (shell == null) {
        OtpErlangPid server = null;
        try {
            server = new ErlideReshd().start(backend.getRuntime());
        } catch (final Exception e) {
            ErlLogger.warn(e);
        }
        shell = new BackendShell(backend, id, server);
        shell.open();
        fShells.put(id, shell);
    }
    return shell;
}
Also used : OtpErlangPid(com.ericsson.otp.erlang.OtpErlangPid) IBackendShell(org.erlide.runtime.shell.IBackendShell)

Example 3 with IBackendShell

use of org.erlide.runtime.shell.IBackendShell in project erlide_eclipse by erlang.

the class Backend method getShell.

@Override
public IBackendShell getShell(final String id) {
    final IBackendShell shell = shellManager.openShell(id);
    final IStreamsProxy proxy = getStreamsProxy();
    if (proxy != null) {
        final IStreamMonitor errorStreamMonitor = proxy.getErrorStreamMonitor();
        errorStreamMonitor.addListener(new IStreamListener() {

            @Override
            public void streamAppended(final String text, final IStreamMonitor monitor) {
                shell.add(text, IoRequestKind.STDERR);
            }
        });
        final IStreamMonitor outputStreamMonitor = proxy.getOutputStreamMonitor();
        outputStreamMonitor.addListener(new IStreamListener() {

            @Override
            public void streamAppended(final String text, final IStreamMonitor monitor) {
                shell.add(text, IoRequestKind.STDOUT);
            }
        });
    }
    return shell;
}
Also used : IStreamMonitor(org.eclipse.debug.core.model.IStreamMonitor) IStreamListener(org.eclipse.debug.core.IStreamListener) IBackendShell(org.erlide.runtime.shell.IBackendShell) IStreamsProxy(org.eclipse.debug.core.model.IStreamsProxy)

Example 4 with IBackendShell

use of org.erlide.runtime.shell.IBackendShell in project erlide_eclipse by erlang.

the class BackendShellManager method closeShell.

public synchronized void closeShell(final String id) {
    final IBackendShell shell = getShell(id);
    if (shell != null) {
        fShells.remove(id);
        shell.close();
    }
}
Also used : IBackendShell(org.erlide.runtime.shell.IBackendShell)

Aggregations

IBackendShell (org.erlide.runtime.shell.IBackendShell)4 OtpErlangPid (com.ericsson.otp.erlang.OtpErlangPid)1 IStreamListener (org.eclipse.debug.core.IStreamListener)1 IStreamMonitor (org.eclipse.debug.core.model.IStreamMonitor)1 IStreamsProxy (org.eclipse.debug.core.model.IStreamsProxy)1