Sending a key from a button
Using the palette, add a SWT Button widget to your transformation.
Override the postRender() method of the RcpTransformation
class.
Note: To override the postRender() method,
follow these steps:
Add the following code to the postRender() method:
- Right-click in the Source editor pane.
- Select Source > Override/Implement Methods.
- Under RcpTransformation, check postRender().
- Click OK.
final RcpContextAttributes attrs = (RcpContextAttributes) getContextAttributes();
button.addSelectionListener(new SelectionListener()
{
public void widgetDefaultSelected(SelectionEvent event) {
}
public void widgetSelected(SelectionEvent event) {
attrs.getSessionService().sendCommand("[enter]");
}
});