Hello Francesco,
It's good to hear that you've mastered the RSE Tutorial, and
created some sample
actions.
WIth respect to the SWT Shell It looks like there is a
misunderstanding. In the
context of SWT, a "Shell" is just any root window. This has
nothing to do with
the contents of that window, or with what we understand when
talking about a
"remote shell" in the sense of a terminal. Read the Javadocs of
SWT Shell for
more insight.
Look at what the RSE code does for the action "Launch Shell",
see
SystemCommandAction.RunShellJob
to understand
how to programmatically open a View like the Remote Commands
View.
Don't try to
write into / read from an SWT TextArea. Instead of that
TextArea,
you'll want
to use the org.eclipse.tm.terminal widget instead. It's similar to a
TextArea, but
it will interpret VT100 terminal commands for you. That's
the
whole goal of
this project -- getting an SWT View hooked up to RSE, that
interprets
Terminal control sequences.
For managing "SSH-Shells and Telnet-Shells", RSE will do it
automatically
for you when you work on an
IRemoteCmdSubSystem as you've done.
Depending on how the user
configured his connection, the
IRemoteCmdSubSystem
will actually run on the
IShelLService configured by the user.
If you have any more questions,
just let me know.
Cheers, -- Martin Oberhuber Wind River Systems, Inc. Target
Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm
Hello Martin,
after have perused the online documentation
"RSE developer Guide", these are the things that I have done until
now:
1) I have implemented a new plugin (with relatives classes) with
the extensions for subsystem, popmenu and property
page.
Some classes are:
Activator.java that extends "SystemBasePlugin" with methods
to manage the file .properties
PropertyPage.java that extends SystemBasePropertyPage with methods to create
buttons, textarea or many other components that I'll include
it.
PopupMenu class, that show Terminal
in the "IRemoteFile" connections
Now a new subsystem doesn't
appear yet in the connections for a generic "Remote Systems View" but my
"Raw Terminal" (for now) starts from the choice in the "IRemoteFile" popupmenu
(method run(IAction action) in the PopupMenu class).
2)I have
used the "packages org.eclipse.rse.services.shell" and "org.eclipse.rse.subsystems.shells.core" to manage the commands
that the user insert into Terminal and I have created some useful classes
about it. In particular to execute a generic command I have used the followed
code:
.....
IRemoteCmdSubSystem cmdss = getRemoteCmdSubSystem();
if (cmdss instanceof IShellServiceSubSystem) {
IShellService shellService =
((IShellServiceSubSystem) cmdss).getShellService();
String[]
env=shellService.getHostEnvironment();
String workDir =
selectedFile.getAbsolutePath();
IHostShell hostShell =
shellService.launchShell(workDir, env, new NullProgressMonitor());
hostShell.addOutputListener(new StdOutOutputListener()); // to get
the output command
hostShell.writeToShell("mem"); // a command for example
}
.....
public class
StdOutOutputListener implements IHostShellOutputListener {
public void
shellOutputChanged(IHostShellChangeEvent event) {
IHostOutput[] lines =
event.getLines();
for (int i = 0; i < lines.length; i++)
{
System.out.println(lines[i].getString());
shellOut=lines[i].getString();
display.asyncExec (new Runnable () {
public void run () {
shell.setTextArea(shellOut+"\n"); // shell is my "SWT Terminal
View" with a Text to show the output command and allow insert
command
}
});
}
}
} .....
I have tried to execute a command in a
local shell and he works! At this point my question is:
In this way can
I execute a generic command in a "generic Remote System View"?
3) After
that, in this moment I'm creating the new User Interface Terminal View with
SWT libraries. I have created a new SWT shell that extends Shell. For
example:
... Display display =
Display.getDefault();
ExampleShell shell = new ExampleShell(display,
SWT.SHELL_TRIM);
shell.open();
shell.layout();
while (!shell.isDisposed()) {
if
(!display.readAndDispatch())
display.sleep();
} ...
this shell-window appears when I
click "My Terminal Shell" in the IremoteFile popupmenu. But this window isn't
in a "tabbed pane" like old classic "Remote Shell". How do i do to show as
tabbed windows my Terminal View?
I allow user to insert command and
show its output using the same "textArea". I have thought to place the cursor
in the "text Area lenght +1" position and forbidden user to edit character
before the (textArea lenght +1) position. When I read
the character with keycode=13 it menas that enter button is pressed than
I send the new command to the methods see above and I show relative
output.
Furthermore, how I manage "SSH-Shells and Telnet-Shells"
services?
For other questions I'll write you.
Thanks and
greetings,
Crivelli Francesco
Subject: RE: Target Management Project - Undergraduate Level thesis to
Politecnico di Milano Date: Wed, 14 Nov 2007 23:48:24 +0100 From:
Martin.Oberhuber@xxxxxxxxxxxxx To: francescocriv@xxxxxxxxxxx
Hello Francesco,
how is it going? Are you actively working on this
project?
Any questions that I could help with?
Cheers, -- Martin Oberhuber Wind
River Systems, Inc. Target Management Project Lead, DSDP PMC Member http://www.eclipse.org/dsdp/tm
Con Windows Live Messenger condividi file senza limiti di peso! Windows Live
Messenger
|