The HostKey class
The com.ibm.hats.rcp.transform.HostKey class represents an individual
host key either as a button (org.eclipse.swt.widgets.Button class)
or a link (org.eclipse.swt.widgets.Link class). Multiple keys cannot
be included in one HostKey instance. If you need to have two or more
keys, define multiple HostKey instances. The following code sample
shows a HostKey that is displayed as a button
that sends [PF1] to the host when pressed:
hostKey = new HostKey(this, SwtTransformationConstants.BUTTON);
hostKey.setText("F1");
hostKey.setCommand("[pf1]");
hostKey.addSelectionListener(new org.eclipse.swt.events.SelectionListener() {
public void widgetSelected(org.eclipse.swt.events.SelectionEvent e) {
com.ibm.hats.runtime.services.ISessionService
sessionService = getSessionService();
if (sessionService != null) {
sessionService.sendCommand(hostKey.getCommand());
}
}
public void widgetDefaultSelected(org.eclipse.swt.events.SelectionEvent e) {
}
});