"Console" widget using pure SWT? [message #467602] |
Wed, 01 February 2006 13:54  |
Eclipse User |
|
|
|
I'm building a small GUI front-end for a command-line utility. I
need the front-end to run the command-line utility in a background
thread... piping the output to a GUI widget, and piping any user
input from that widget back to the utility. Basically, I need to
mimic a simple command-prompt console in a GUI widget.
I know that the full-blown Eclipse framework has utility classes
for doing this sort of thing. However, my needs aren't so
feature-rich, and I'm really hoping to avoid having to ship with the
entire Eclipse framework. I would prefer limiting my dependencies
to vanilla SWT if possible, maybe even compiling the app natively
with GCJ for deployment.
Has anyone seen any applications or code examples of such a
console-passthrough widget in SWT? Thanks in advance!
|
|
|
|
Re: "Console" widget using pure SWT? [message #467665 is a reply to message #467606] |
Fri, 03 February 2006 07:55  |
Eclipse User |
|
|
|
Daniel Spiewak wrote:
> I've never seen anything quite like that, you'll probably have to roll your own solution.
>
> Considering that you'll probably want to lock certain portions of the window for editing, you'll want to roll your own text box. For that you can look at StyledText for inspiration. The console pass through can be done using streams and the Process class.
I have some experience with this (in my telnet/ssh client ShellGuard).
Console is not so easy task.
You should interpret ESC sequences that move cursor, change
background and foreground colors, erase parts of screen, insert rows,
etc. I recommend you startd from Canvas and implement all drawing
yourself. Editing text is not client side task, but server task. Server
will tell you (using ESC sequences) how to draw this.
Of course all this is in general case, in simple cases more simple
solution is possible.
--
SY, Konstantin.
Advanced Eclipse SWT Designer (http://www.swt-designer.com)
|
|
|
Powered by
FUDForum. Page generated in 0.06521 seconds