Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Standard Widget Toolkit (SWT) » "Console" widget using pure SWT?
"Console" widget using pure SWT? [message #467602] Wed, 01 February 2006 18:54 Go to next message
Steve is currently offline SteveFriend
Messages: 29
Registered: July 2009
Junior Member
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 #467606 is a reply to message #467602] Wed, 01 February 2006 19:08 Go to previous messageGo to next message
Daniel Spiewak is currently offline Daniel SpiewakFriend
Messages: 263
Registered: July 2009
Senior Member
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.
Re: "Console" widget using pure SWT? [message #467665 is a reply to message #467606] Fri, 03 February 2006 12:55 Go to previous message
Konstantin Scheglov is currently offline Konstantin ScheglovFriend
Messages: 555
Registered: July 2009
Senior Member
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)


Konstantin Scheglov,
Google, Inc.
Previous Topic:executing an Action from Intro view
Next Topic:Cannot save image without data loss
Goto Forum:
  


Current Time: Tue Apr 16 11:05:06 GMT 2024

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

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

Back to the top