| 1 | /* -*- Mode: java; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- |
| 2 | * |
| 3 | * This Source Code Form is subject to the terms of the Mozilla Public |
| 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
| 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
| 6 | |
| 7 | package org.mozilla.javascript.tools.shell; |
| 8 | |
| 9 | import java.io.InputStream; |
| 10 | import java.nio.charset.Charset; |
| 11 | |
| 12 | import org.mozilla.javascript.Scriptable; |
| 13 | |
| 14 | /** |
| 15 | * Provides a specialized input stream for consoles to handle line |
| 16 | * editing, history and completion. Relies on the JLine library (see |
| 17 | * <http://jline.sourceforge.net>). |
| 18 | */ |
| 19 | @Deprecated |
| 20 | public class ShellLine { |
| 21 | @Deprecated |
| 22 | public static InputStream getStream(Scriptable scope) { |
| 23 | ShellConsole console = ShellConsole.getConsole(scope, |
| 24 | Charset.defaultCharset()); |
| 25 | return (console != null ? console.getIn() : null); |
| 26 | } |
| 27 | } |