Chapter 3. Creating toolkit extensions for custom UI widgets
Prev |  | Next

# Chapter 3. Creating toolkit extensions for custom UI widgets

When developing graphical applications, it is often necessary or convenient to alter or combine the functionality of existing toolkit components, or even to write entirely new ones, as the requirements or concept of the software may dictate. These new components generally cannot be tested "out of the box", as the behavior of custom components cannot be predicted, or they may deviate from established standards of "look and feel". In order to overcome this limitation, there is an extension API, which you can use to be able to test your custom components.

The following sections describe the steps involved in writing extensions.

AUTs are started, controlled and observed using its remote control component. In order for the AUT Agent to know how to control each element of a GUI, we have outfitted the AUT Agent with a pluggable interface for graphic components. An adapter factory containing one or more components must be implemented for and deployed with the AUT. On the client side, each GUI toolkit that the ITE supports is described in a toolkit plug-in.

We have opened up an interface to our users to allow flexible customizations. You can extend existing functionality, or provide support for in-house graphic components by implementing your own Tester Classes.

The following chapter describes the general steps to take for creating an ITE toolkit extension with custom defined components and actions. This chapter begins by listing the requirements followed by showing the necessary steps for creating an ITE and remote control extension. The ITE toolkit extension is described in Section 3.2, “ITE extension” and the implementation for the remote control extension in Section 3.3, “Remote control extension”. Additionally the Section 3.4, “Addressing custom controls via the client API” describes the usage of custom CAPs within the context of the client API.

Extension examples with source code can be found in the p2-repository "development/org.eclipse.jubla.repo.zip" of the installation.

In general you always have to extend two things:

- The ITE toolkit extension – by writing your own toolkit plug-in: This will tell the ITE which new components and actions are available.

- The remote control extension – by writing your own fragment: This part actually performs the actions on the new components.

In this chapter all used directory names are located in the installation directory as long as nothing else is specified.

Wizard for creating an extension

Making it simpler to create the plugins for the extension, you can also use the Extension Wizard we provide for eclipse. This wizard is leading you through the generation process for one component so you just have to implement the testing logic. To install the wizard use ""development/org.eclipse.jubula.extensions.wizard.repo.zip" as a software site and install the Jubula Extension Wizard. After you have installed the wizard you can just create a new Jubula extension project. Follow the instructions from the wizard and you will get the complete structure of the needed plugins,classes and component configuration.