Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Platform » Using org.eclipse.ui.console for my RCP -- problem: cant listen to return keys or alike
Using org.eclipse.ui.console for my RCP -- problem: cant listen to return keys or alike [message #647450] Thu, 06 January 2011 08:16 Go to next message
Simon L. is currently offline Simon L.
Messages: 22
Registered: January 2010
Junior Member
Hello,
I am trying to use a console view in my RCp application. Since eclipse has this org.eclipse.ui.console implementations, I added a IOConsole to my workbench. It provides one InputStream to read from it, but I don't know how to be informed when actually there is a need to read from the console, specifically: when the return key was pressed. The only possibility seems to me to permanently read the input stream in a background thread, which seems not elegant to me, and unperformant.

Since there are zero tutorials or documentation further than the javadoc available, I am really stuck here. Can you help me, please?

Thanks!
Re: Using org.eclipse.ui.console for my RCP -- problem: cant listen to return keys or alike [message #647770 is a reply to message #647450] Sat, 08 January 2011 14:52 Go to previous message
Simon L. is currently offline Simon L.
Messages: 22
Registered: January 2010
Junior Member
Me again..
Solved it:
IOConsole.getDocument().addDocumentListener(...), combined with ioConsole.getInputStream.available();

Just watch out, it seems like there is a bug in the IOConsoleOutputStream implementation of available - it throws a IOException sometimes when calling available(), stating that the Stream is closed, even if that's not true. just catch and ignore until fix.
Previous Topic:AIX (PPC64/GTK 2) is for AIX 64bit OS? - please help
Next Topic:where did the structure compare go?
Goto Forum:
  


Current Time: Wed Apr 23 19:53:17 EDT 2014

Powered by FUDForum. Page generated in 0.02357 seconds