Java Code Examples for org.aesh.readline.util.Parser#fromCodePoints()

The following examples show how to use org.aesh.readline.util.Parser#fromCodePoints() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Readline.java    From aesh-readline with Apache License 2.0 5 votes vote down vote up
@Override
public void setReturnValue(int[] in) {
    String input = Parser.fromCodePoints(in);
    if(preProcessors != null && preProcessors.size() > 0) {
        preProcessors.forEach(pre -> pre.apply(input).ifPresent(v -> returnValue = v));
    }
    if(returnValue == null)
        returnValue = input;
}
 
Example 2
Source File: BufferTest.java    From aesh-readline with Apache License 2.0 5 votes vote down vote up
@Test
public void redrawWithEmptyPrompt() {
    Buffer buffer = new Buffer(new Prompt(""));
    List<int[]> outConsumer = new ArrayList<>();
    buffer.insert(outConsumer::add, "foo", 100);
    outConsumer.clear();
    buffer.replace(outConsumer::add, "foo",100);

    //first move back width
    String out = Parser.fromCodePoints(buffer.moveNumberOfColumns(100, 'D'));
    //then erase
    out = out + Parser.fromCodePoints(ANSI.ERASE_LINE_FROM_CURSOR);

    assertEquals(out+"foo",Parser.fromCodePoints(outConsumer.get(0)));
}
 
Example 3
Source File: Buffer.java    From aesh-readline with Apache License 2.0 4 votes vote down vote up
public String asString() {
    return Parser.fromCodePoints(multiLine());
}
 
Example 4
Source File: TestConnection.java    From aesh-readline with Apache License 2.0 4 votes vote down vote up
public String getPrompt() {
    return Parser.fromCodePoints(prompt.getPromptAsString());
}