Rational Developer for System z


Lesson 2: Use the plugin editor to add and modify extensions

Plug-in project extensions can be used to modify actions associated with CARMA. The extension you will create in this lesson will be used to disable the Delete and Open With context menu options.
You will also specify the particular RAM with which you would like to associate your plug-in project.

To create this extension:

  1. From the Plug-in Editor, click on the Extensions tab from the bottom menu of options.
  2. Click the Add button to the right of the panel. In the New Extension dialog box that opens, enter com.ibm.carma.ui.ramBrowserActions in the text field.
  3. Select the extension matching your search query, and click Finish. You will see the extension listed in the panel under All Extensions. Beneath the extension listing, you should also see a (ram) listing similar to:
  4. Highlight the RAM. To the right, you should see two text fields appear, ramId and uniqueId.
  5. If you know the particular ID for the RAM you'd like to modify with your plug-in, you can enter that in the ramId text field.
  6. If you know which RAM you'd like to modify with your plug-in, but do not know the particular ID associated with it, you will use the uniqueId option.
    1. Open the CARMA Repositories view by selecting from the file menu, Window > Show View > CARMA Repositories. You may have to select Other and browse for the particular view if it is not in the main menu.
    2. If you do not have a connection to your host system already set up, you will have to do that now. Open the Remote Systems Explorer view and follow the instructions in Connecting to CARMA.
    3. Expand the host system, and right click on the particular RAM you wish to modify with your plug-in. For this tutorial, the examples use the sample PDS RAM. Select Properties.
    4. In the dialog box that opens, take note of the Unique Identification value.
    5. Return to the Plug-in Editor and in the uniqueId text field, enter the unique identification value you just found.
  7. Below the ram is an action. Highlight the action, and you will see two drop down menus appear on the right hand side, actionId and state.
    1. The values available for actionId correspond to the five actions that can be performed in CARMA: new, open, open with, remove, and refresh.
    2. The values available for state correspond to the three states that these actions can be in: enabled, disabled, and hidden.
  8. With the first action item under the RAM highlighted, use the dropdown actionId menu to select: com.ibm.carma.action.remove. Use the dropdown state menu to select: disable. This will disable the Delete option in the RAM'scontext menu.
  9. Next, you want to create a second action. In the left panel of the Plugin Editor, click the Add button.
  10. In the New Extension dialog box that appears, enter the filter com.ibm.carma.action.ramBrowserAction. Select the matching extension, and click Finish.
  11. Expand the extension, and update the ramId or uniqueId to the appropriate value for your RAM.
  12. Select the action below the ram. On the right hand side, in the actionID dropdown menu, select com.ibm.carma.action.openWith. In the state dropdown menu, select disabled. This will allow for the option Open With to be seen by the user, but will not allow it to be selected.
  13. Save the changes you made in the Plug-in Editor and resolve any errors.

Feedback