Skip to main content


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 13:16 Go to next message
Simon L. is currently offline Simon L.Friend
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 19:52 Go to previous message
Simon L. is currently offline Simon L.Friend
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:how to set contents for different instances of the same view
Next Topic:where did the structure compare go?
Goto Forum:
  


Current Time: Thu Apr 25 03:53:43 GMT 2024

Powered by FUDForum. Page generated in 0.03542 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top