Search in sources :

Example 1 with Widget

use of org.jline.reader.Widget in project felix by apache.

the class Builtin method widget.

public void widget(final CommandSession session, String[] argv) throws Exception {
    java.util.function.Function<String, Widget> creator = func -> () -> {
        try {
            session.execute(func);
        } catch (Exception e) {
            // TODO: log exception ?
            return false;
        }
        return true;
    };
    Process process = Process.Utils.current();
    Commands.widget(Shell.getReader(session), process.out(), process.err(), creator, argv);
}
Also used : Job(org.apache.felix.service.command.Job) Arrays(java.util.Arrays) ByteArrayOutputStream(java.io.ByteArrayOutputStream) Commands(org.jline.builtins.Commands) Shell.getCommands(org.apache.felix.gogo.jline.Shell.getCommands) CommandSession(org.apache.felix.service.command.CommandSession) ParsedLine(org.jline.reader.ParsedLine) Constructor(java.lang.reflect.Constructor) TreeSet(java.util.TreeSet) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) Process(org.apache.felix.service.command.Process) Matcher(java.util.regex.Matcher) ByteArrayInputStream(java.io.ByteArrayInputStream) Map(java.util.Map) Method(java.lang.reflect.Method) Path(java.nio.file.Path) FilesCompleter(org.jline.builtins.Completers.FilesCompleter) LinkedHashSet(java.util.LinkedHashSet) Options(org.jline.builtins.Options) Terminal(org.jline.terminal.Terminal) PrintStream(java.io.PrintStream) DirectoriesCompleter(org.jline.builtins.Completers.DirectoriesCompleter) LineReader(org.jline.reader.LineReader) Files(java.nio.file.Files) BufferedWriter(java.io.BufferedWriter) OpenOption(java.nio.file.OpenOption) StringWriter(java.io.StringWriter) StandardOpenOption(java.nio.file.StandardOpenOption) Candidate(org.jline.reader.Candidate) Set(java.util.Set) IOException(java.io.IOException) Field(java.lang.reflect.Field) InputStreamReader(java.io.InputStreamReader) StandardCharsets(java.nio.charset.StandardCharsets) InvocationTargetException(java.lang.reflect.InvocationTargetException) List(java.util.List) Converter(org.apache.felix.service.command.Converter) TreeMap(java.util.TreeMap) Widget(org.jline.reader.Widget) Entry(java.util.Map.Entry) Function(org.apache.felix.service.command.Function) BufferedReader(java.io.BufferedReader) Pattern(java.util.regex.Pattern) Collections(java.util.Collections) CommandSessionImpl(org.apache.felix.gogo.runtime.CommandSessionImpl) Widget(org.jline.reader.Widget) Process(org.apache.felix.service.command.Process) IOException(java.io.IOException) InvocationTargetException(java.lang.reflect.InvocationTargetException)

Aggregations

BufferedReader (java.io.BufferedReader)1 BufferedWriter (java.io.BufferedWriter)1 ByteArrayInputStream (java.io.ByteArrayInputStream)1 ByteArrayOutputStream (java.io.ByteArrayOutputStream)1 IOException (java.io.IOException)1 InputStreamReader (java.io.InputStreamReader)1 PrintStream (java.io.PrintStream)1 StringWriter (java.io.StringWriter)1 Constructor (java.lang.reflect.Constructor)1 Field (java.lang.reflect.Field)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1 StandardCharsets (java.nio.charset.StandardCharsets)1 Files (java.nio.file.Files)1 OpenOption (java.nio.file.OpenOption)1 Path (java.nio.file.Path)1 StandardOpenOption (java.nio.file.StandardOpenOption)1 ArrayList (java.util.ArrayList)1 Arrays (java.util.Arrays)1 Collections (java.util.Collections)1