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:
  1. Right-click in the Source editor pane.
  2. Select Source > Override/Implement Methods.
  3. Under RcpTransformation, check postRender().
  4. Click OK.
Add the following code to the postRender() method:
final RcpContextAttributes attrs = (RcpContextAttributes) getContextAttributes();
		button.addSelectionListener(new SelectionListener()
		{
			public void widgetDefaultSelected(SelectionEvent event) {				
			}
			
			public void widgetSelected(SelectionEvent event) {
				attrs.getSessionService().sendCommand("[enter]");
			}
		});