"Console" widget using pure SWT?

S

Steve

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!
 
T

Tris Orendorff

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.

Look at Runtime.getRuntime.exec(), Process.getOutputStream(),
Process.getErrorStream() and Process.setInputStream().
 
S

Steve

Look at Runtime.getRuntime.exec(), Process.getOutputStream(),
Process.getErrorStream() and Process.setInputStream().

Well, that's obviously how I would tie the external process into
the widget. However, what's missing is the widget itself... one
that can smoothly handle the the input and output issues simultaneously.

Since making that original post, I've made some headway by
borrowing the JConsole class from the BeanShell project, and
tweaking it from Swing to using SwingWT (SWT under the covers).
There are still other issues to overcome, but this looks promising.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top