org.crsh.shell
Interface InteractionContext<E>
- Type Parameters:
E
- the element generic type
- All Superinterfaces:
- Consumer<E>, Flushable, ScreenContext<E>
- All Known Subinterfaces:
- CommandContext<P>, InvocationContext<P>, ShellProcessContext
- All Known Implementing Classes:
- ClientProcessContext, CRaSHProcessContext, InnerInvocationContext, InvocationContextImpl, JLineProcessContext, Pipe, PipeFilter, PipeFilter.Chunkizer, PipeFilter.Noop, PipeFilter.Sink, ProcessContext, SSHInlineShellProcessContext
-
public interface InteractionContext<E>
- extends ScreenContext<E>
-
The interaction context extends the screen context and provides interaction with the client.
Method Summary |
String |
getProperty(String propertyName)
Returns a generic property, usually this property is resolved by the shell client. |
String |
readLine(String msg, boolean echo)
Display a message and read a line on the console. |
boolean |
releaseAlternateBuffer()
Release control of the alternate buffer. |
boolean |
takeAlternateBuffer()
Take control of the alternate buffer. |
Methods inherited from interface java.io.Flushable |
flush |
takeAlternateBuffer
boolean takeAlternateBuffer()
throws IOException
-
Take control of the alternate buffer. When the alternate buffer is already used nothing happens. The buffer switch should occur when then
Flushable.flush()
method is invoked.
-
-
- Returns:
- true if the alternate buffer is shown
- Throws:
IOException
releaseAlternateBuffer
boolean releaseAlternateBuffer()
throws IOException
-
Release control of the alternate buffer. When the normal buffer is already used nothing happens. The buffer switch should occur when then
Flushable.flush()
method is invoked.
-
-
- Returns:
- true if the usual buffer is shown
- Throws:
IOException
getProperty
String getProperty(String propertyName)
-
Returns a generic property, usually this property is resolved by the shell client.
-
-
- Parameters:
propertyName
- the property name
- Returns:
- the property value
readLine
String readLine(String msg,
boolean echo)
-
Display a message and read a line on the console. If no line can be read then null is returned.
-
-
- Parameters:
msg
- the message to display before reading a line
echo
- wether or not the line read should be echoed when typing
- Returns:
- the line read
Copyright © 2014 eXo Platform SAS. All Rights Reserved.