Creating a custom composite for use with the Show action

SWT Composites referenced in a Show Composite Action should implement the com.ibm.hats.rcp.transform.IRenderable interface. If the SWT Composite implements com.ibm.hats.rcp.transform.IRenderable, it will have access to the RcpContextAttributes that contains, among other things, the ISessionService for the session the composite is being shown in. A sendContinue() method on the ISessionService can be called to resume executing the ZIETrans application.

To create a composite using the Window Builder (see Editing transformations):
  1. Select File > New > Other > Java™ > Visual Class to start the New Java Visual Class wizard.
  2. Select the src folder for your plug-in project, and enter a name for the new composite class, for example, MyComposite
  3. In the Style tree, select SWT > Composite.
  4. Click Add, and select the com.ibm.hats.rcp.transform.IRenderable interface.
  5. Click Finish to create the class.
To add a continue button to the composite using the Window Builder (see Editing transformations):
  1. From the Palette view, open the Controls drawer and select Button.
  2. Drag and drop the button on the composite. If prompted, accept the default name for the variable.
  3. Right-click the selected button and select Set Text. Enter a caption for the button. For example, enter OK or Submit. Click OK.
  4. Right-click the button again and select Events > Add Events. Select Selection > widgetSelected and click Finish.
  5. Replace the temporary contents of the widgetSelected(SelectionEvent) method with the following:
    	RcpContextAttributes contextAttributes = 
                              (RcpContextAttributes)getContextAttributes();
    	ISessionService sessionService = contextAttributes.getSessionService();
    	                                 sessionService.sendContinue();
Note: You might need to update the import section of your class. To do this, press CTRL+SHIFT+O or right-click in the source of your class and select Source > Organize Imports.