6.1. IAction versus IActionDelegateAn Eclipse action is composed of several parts, including the XML declaration of the action in the plug-in's manifest, the IAction object instantiated by the Eclipse UI to represent the action, and the IActionDelegate defined in the plug-in library containing the code to perform the action (see Figure 6-1). Figure 6-1. Action versus IActionDelegate.This separation of the IAction object, defined and instantiated by the Eclipse user interface based on the plug-in's manifest and the IActionDelegate defined in the plug-in's library, allows Eclipse to represent the action in a menu or toolbar without loading the plug-in that contains the operation until the user selects a specific menu item or clicks on the toolbar. Again, this approach represents one of the overarching themes of Eclipse: lazy plug-in initialization. There are several interesting subtypes of IActionDelegate.
|