The first sample project creates a new view in the CICS Explorer®, and populates it using a selection listener.
The sample project is included with the CICS Explorer SDK. See the topic Introduction for more information.
The sample class com.ibm.cics.explorer.sdk.demo1.views.DemoView1 is included in the sample plug-in com.ibm.cics.explorer.sdk.demo1. This uses the org.eclipse.ui.views extension to declare a view that listens to workbench selection and, if a CICS® region is selected, shows a selection of its attributes in a table. The purpose is to show the notification mechanism whereby objects selected in CICS Explorer views are propagated around the workbench.
The interfaces making up the CICS Explorer API for CICS objects are in the package com.ibm.cics.model. The Demo1View class imports the interface com.ibm.cics.model.IRegion and adds a selection listener to the view site, checking, whenever a selection event occurs, whether the object is an IRegion instance and, if so, retrieving attributes through the public methods to create an item to add to the tree.
The first three columns in the table show data retrieved from the region through public getter methods, while the fourth column is a derived value showing the variation in the number of total tasks if the region that was selected is the same as the previous one. This could form the basis for the beginning of an application to see workload throughput over time.
To open the view, include the plug-in com.ibm.cics.explorer.sdk.demo1 in your launch configuration's list of plug-ins and open the view using Window>Show View selecting Sample Category and Sample View.
A video of this demo, with some minor variations, is available on YouTube at the following location: SDK sample 1 video