Lesson 2: Use the plug-in editor to add and modify extensions
Plug-in project extensions can be used to modify actions that are associated with CARMA. The extension that you will create in this lesson will be used to disable the Delete and Open With menu options.
About this task
To create this extension:
Procedure
- From the Plug-in Editor, click the Extensions tab from the bottom menu of options.
- 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.
- Select the extension matching your search query, and click Finish.
You see the extension that is listed in the panel under All
Extensions. Beneath the extension listing, you should
also see a (ram) listing similar to:
- Highlight the RAM. To the right, you should see two text fields appear, ramId and uniqueId.
- If you know the particular ID for the RAM you would like to modify with your plug-in, you can enter that in the ramId text field.
- If you know which RAM you would like to modify with your
plug-in, but do not know the particular ID associated with it, use
the uniqueId option.
- Open the CARMA Repositories view by selecting from the file menu, Window (on Windows) or IBM® Developer for z/OS® (on macOS) > Show View > CARMA Repositories. You can have to select Other and browse for the particular view if it is not in the main menu.
- If you do not have a connection to your host system already setup, you have to do that now. Open the Remote Systems Explorer view and follow the instructions in Connecting to CARMA.
- Expand the host system, and right-click on the particular RAM you want to modify with your plug-in. For this tutorial, the examples use the sample PDS RAM. Select Properties.
- In the dialog box that opens, take note of the Unique Identification value.
- Return to the Plug-in Editor and in the uniqueId text field, enter the unique identification value that you just found.
- 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.
- The values available for actionId correspond to the five actions that can be performed in CARMA: new, open, open with, remove, and refresh.
- The values available for state correspond to the three states that these actions can be in: enabled, disabled, and hidden.
- 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 disables the Delete option in the RAM's pop-up menu. - Next, you want to create a second action. In the left panel of the Plugin Editor, click the Add button.
- In the New Extension dialog box that appears, enter the filter com.ibm.carma.action.ramBrowserAction. Select the matching extension, and click Finish.
- Expand the extension, and update the ramId or uniqueId to the appropriate value for your RAM.
- 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, selectdisabled
. This allows for the option Open With to be seen by the user, but will not allow it to be selected. - Save the changes that you made in the Plug-in Editor and resolve any errors.