Creating an activity to specify the layout

The jump-start sample shows different layouts for different users. To specify the layout perspectives, you can extend com.ibm.btt.rcp.perspective.perspectiveDef using the plug-in editor.

Do the following steps to extend the com.ibm.btt.rcp.perspective.perspectiveDef extension point:

  1. Right-click plugin.xml file in the BTTJumpStartSampleRCPClient project and select Open With > Plug-in Manifest Editor, and click the Extensions tab.
  2. Click com.ibm.btt.rcp.activity.activities > PerspectiveActivity.
  3. In the Extension Element Details panel, enter com.ibm.btt.jumpstart.sample.activity.PerspectiveActivity to the class field.
  4. Right-click the BTTJumpStartSampleRCPClient Project, and select New > package. In the dialog box that pops up, enter com.ibm.btt.jumpstart.sample in the Package field, and then click Finish.
  5. Right-click the BTTJumpStartSampleRCPClient Project, and select New > package. In the dialog box that pops up, enter com.ibm.btt.jumpstart.sample.activity in the Package field, and click Finish. Copy the PerspectiveActivity.java from <toolkit_root>\samples\BTTJumpStartSampleRCPClient.zip\ BTTJumpStartSampleRCPClient/src/com/ibm/btt/jumpstart/sample/activity to the BTTJumpStartSampleRCPClient Project. PerspectiveActivity.java is called in the RCP initialization. It initializes the Sign In Dialog, and uses different perspective definition file based on different user name.
  6. Do the following changes to the code:
    1. In com.ibm.btt.jumpstart.sample.activity.PerspectiveActivity.java, change import com.ibm.btt.jumpstart.sample.Activator to import com.ibm.btt.tools.aw.sample.Activator.
    2. In com.ibm.btt.tools.aw.sample.Activator.java, change public static final String PLUGIN_ID = "helloWorldRichClient" to public static final String PLUGIN_ID = "BTTJumpStartSampleRCPClient".
  7. Copy these configuration files from <toolkit_root>\samples\BTTJumpStartSampleRCPClient.zip\ BTTJumpStartSampleRCPClient to the root of BTTJumpStartSampleRCPClient Project:
    • supervisor.xml
    • supervisor02.xml
    • user01.xml
    • user02.xml