use of org.eclipse.ui.console.IOConsoleInputStream in project abstools by abstools.
the class ConsoleManager method newConsole.
/**
* Create a new Console with the specified title and adds it to the console view
* @param title The desired title of the console
* @return The new Message Console
*/
public static MsgConsole newConsole(String title) {
MsgConsole mc = new MsgConsole(title, null);
addConsole((IConsole) mc);
System.setOut(new PrintStream(mc.getOutputStream(MessageType.MESSAGE_INFO)));
// try {
IOConsoleInputStream str = mc.getInputStream();
// str.reset();
System.setIn(str);
// defaultConsole = mc;
return mc;
}
use of org.eclipse.ui.console.IOConsoleInputStream in project sts4 by spring-projects.
the class ConsoleUtil method getConsole.
public Console getConsole(String title) {
final IOConsole console = new IOConsole(title, null);
final IOConsoleInputStream in = console.getInputStream();
final IOConsoleOutputStream out = console.newOutputStream();
final IOConsoleOutputStream err = console.newOutputStream();
in.setColor(getInputColor());
out.setColor(getOutputColor());
err.setColor(getErrorColor());
add(console);
return new Console(in, out, err);
}
use of org.eclipse.ui.console.IOConsoleInputStream in project core by jcryptool.
the class IOConsoleShell method readUserInput.
private void readUserInput() {
IOConsoleInputStream in = stream;
IOConsoleInputStreamWrapper wrapperStream = new IOConsoleInputStreamWrapper(in);
BufferedReader bufReader = null;
try {
bufReader = new BufferedReader(new InputStreamReader(wrapperStream, IConstants.UTF8_ENCODING));
} catch (UnsupportedEncodingException ex) {
LogUtil.logError(CommandsUIPlugin.PLUGIN_ID, ex);
}
int charOut = 0;
// $NON-NLS-1$
String output = "";
try {
while ((charOut = bufReader.read()) != -1) {
output = output.concat(String.valueOf(Character.valueOf((char) charOut)));
}
} catch (IOException e) {
// $NON-NLS-1$
if (!e.getMessage().equals("Input Stream Closed"))
LogUtil.logError(CommandsUIPlugin.PLUGIN_ID, e);
}
String line = processRawInputString(output);
addLine(line);
}
Aggregations