Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DSDP - Target Management » Programatically creating a connection?
Programatically creating a connection? [message #569767] Thu, 16 August 2007 20:10
Bryan Hunt is currently offline Bryan HuntFriend
Messages: 366
Registered: July 2009
Senior Member
I need to programatically show a terminal and create a connection
without user input except for maybe a password and even that's a maybe.
I've managed to get an ssh connection to work but I had to modify the Here are my changes:

public void load(ISettingsStore store)
fHost = store.get("Host");//$NON-NLS-1$
fUser = store.get("User");//$NON-NLS-1$
fPort = store.get("Port");//$NON-NLS-1$
fPassword = store.get("Password");//$NON-NLS-1$
fTimeout = store.get("Timeout");//$NON-NLS-1$

And here is how I'm creating my terminal view:

package test.terminal;

import org.eclipse.swt.widgets.Composite;
import l;
import Factory;
import nnectorInfo;
import nectorExtension;
import te;
import org.eclipse.ui.part.ViewPart;

public class TrackerTerminal extends ViewPart implements ITerminalListener
public void setState(TerminalState state)
if (state == TerminalState.CONNECTED)
terminal.pasteString("cd /tmp\n");

public void createPartControl(Composite parent)
ITerminalConnectorInfo[] connectors =
terminal = TerminalViewControlFactory.makeControl(this, parent, connectors);
TerminalSettings settings = new TerminalSettings();
settings.put("Host", "****************");
settings.put("User", "*****");
settings.put("Password", "********");
settings.put("Port", "22");
settings.put("Timeout", "0");

for (ITerminalConnectorInfo element : connectors)
(element.getId().equals(" "))



void setFocus()
// TODO Auto-generated method stub


public void setTerminalTitle(String title)

private ITerminalViewControl terminal;

package test.terminal;

import java.util.Properties;

import ore;

public class TerminalSettings implements ISettingsStore

public String get(String key)
return properties.getProperty(key);

public String get(String key, String defaultValue)
return properties.getProperty(key, defaultValue);

public void put(String key, String value)
properties.put(key, value);

private final Properties properties = new Properties();

As you can see, I'm using the API in a completely non-normal way. Is
there a better way to do this?

Previous Topic:RSE 2.0.0 (TM 2.0.1) FTP STOR ignores ASCII/binary preferences saving remote files
Next Topic:slow connection to Linux sever
Goto Forum:

Current Time: Tue May 22 00:44:10 GMT 2018

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

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

Back to the top