Fan-In pluglet details

All the relevant information in this sample is in the FanAction Java class. You can see from the sample that a variety of UML 2.0 and model extensibility classes are used. The sample initiates in the plugletMain method, which iterates through the user selections.

From a workbench perspective you can write the statement Platform.getWorkbench() and gain complete access to the entire workbench and its parts. From a modeling perspective, the UMLModeler class allows you access to a model and its contents. For example, this pluglet sample calculates the fan-in metric for a class. The fan-in metric represents the number of references that a class has when selected in the Project Explorer view.

If a selection is an instance of a UML 2.0 class, then the calcFanIn method is called. In this method, the model is accessed through the execute method of the ResourceSetReadOperation class. The class references are calculated using methods getReferencingClassesByOperation and getReferencingClassesByProperty. These two methods execute through the use of the IEObjectHelper.getReferencers method.


Feedback