Extending CICS Explorer: Hiding GUI actions
DaveN 06000069E8 Visits (3476)
One of the frequent questions we receive from customers is "How can I customize the CICS Explorer GUI, for instance by removing items that confuse my internal users?"
While removing GUI items is not something we provide support for, because CICS Explorer is built on top of Eclipse technology there is an Eclipse technique you can use to hide some elements of the GUI.
In this blog post I'll walk you through some using an activity to hide a GUI item, techniques for establishing whether a GUI item might be hideable, and how to deploy this into a CICS Explorer instance.
A bit of information you need to know
Firstly - understanding when to hide an item is important. You'll know from Isabel's blog post about using CMCI (htt
Secondly - as part of this technique you'll be looking up internal action IDs for actions provided by CICS Explorer (and maybe Eclipse too!). These IDs might change in future releases. You'll want to incorporate a quick test that things have remained hidden, as part of your CICS Explorer acceptance tests.
What we'll be doing
The broad overview is like this.
Finding action IDs
It's not possible to hide every GUI element - it depends how they were contributed. Most of the context menus on CICS resources should be possible, though. I'll go through the example of the Region shutdown options.
Finding IDs through the GUI
The simplest way of finding the action ID is using a tool called plugin spy. It's part of Eclipse and included with CICS Explorer by default. Open CICS Explorer, connect to a plex and open the Regions view.
To use plugin spy, press Alt+Shift+F2 - you'll see the cursor change to an icon of a document with a magnifying glass. The next time you click on a menu, a window will pop up giving you information about that menu option.
So - you have the Regions view open. Press Alt+Shift+F2 (you'll see the cursor change to a document with a magnifying glass) and right-click on a Region in the Regions view, choose Shutdown and Normal.
Next you'll see the Plugin spy window pop up.
This gives you some information about the selection. We're interested in the action ID - com.
Finding IDs from the plugin files
Most of the CICS Explorer context menus on resources are currently (CICS Explorer 5.2!) declared in an XML file. In your CICS Explorer installations, find the plugins directory and look for the com.
Creating an activity to hide some actions
To create an activity, we must create a plug-in project. A plug-in project can be installed into an Eclipse application like CICS Explorer and contributes to its behaviour at runtime. CICS Explorer itself is just a collection of plug-in projects!
Create a plug-in project using File > New > Other... - "Plug-in Project" will be near the top of the list. Choose Next and give the project a name - perhaps "FilterMenus".
Click Next through to the Templates page. Choose the template "Plug-in with a popup menu" and Finish. Answer yes when you're prompted to switch to the plug-in perspective.
From the Package Explorer, the view on the far left, double-click on plugin.xml to open the plugin metadata editor. Choose the plugin.xml tab (near the far right)
Replace the text in this editor with the following, and save the editor:
<?xml version="1.0" encoding="UTF-8"?> <?eclipse version="3.4"?> <plugin> <extension poin
This XML declares an extension to the Eclipse activities extension point. It defines a category and an activity, binds the activity to the category, and sets up an acti
Testing that our new plug-in works
It's always good to test some code once you've written it! Right-click on the plug-in you created in the Package Explorer
Choose Run As > Eclipse Application. This will start up a *new* copy of CICS Explorer with your plug-in installed, for testing. Make a connection, find the Regions view, and check that Shutdown no longer appears in the context menu.
Deploying the plug-in to our users
The final step is to package the plug-in so that other users can install it into their CICS Explorer instances. To do this you must create a feature containing the plug-in, and export. Have a look at the previous "Extending CICS Explorer" blog post for a full description, in the section "Deploying the new perspective to our users".
For more ideas or background, see the Eclipse infocenter I previously linked to: http
Also, Lars Vogel has a more general description of activities than I provide in this blog post: http
Thanks for reading!