ボタンからのキーの送信

パレットを使用して、SWT ボタン・ウィジェットを変換に追加します。RcpTransformation クラスの postRender() メソッドをオーバーライドします。
注: postRender() メソッドをオーバーライドするには、以下の手順を実行します。
  1. ソース・エディター・ペインで右クリックします。
  2. 「ソース」>「メソッドのオーバーライド/実装」を選択します。
  3. RcpTransformation の下にある postRender() にチェック・マークを付けます。
  4. 「OK」をクリックします。
postRender() メソッドに、以下のコードを追加します。
final RcpContextAttributes attrs = (RcpContextAttributes) getContextAttributes();
		button.addSelectionListener(new SelectionListener()
		{
			public void widgetDefaultSelected(SelectionEvent event) {				
			}
			
			public void widgetSelected(SelectionEvent event) {
				attrs.getSessionService().sendCommand("[enter]");
			}
		});