8
Design Editor Plugins
A plugin is an application that adds extra capability to a main application, or to another plugin. A plugin that is implemented with the design editor (DE) plugin infrastructure is called a DE plugin. The DE plugin is not a DE subapplication. Infact, it is an add-on to a DE main application, such as schematic or layout.
Two major advantages of a DE plugin over a subapplication are as follows:
- Runs without replacing the main application
- Co-exists with other plugins that are not being replaced
However, a limitation of a DE plugin is that you cannot register a plugin with an appName and/or a className that has already been taken.
You can create a DE plugin by defining a subclass of the DE base class, DEPlugin and re-implementing certain public methods of the class that can be overridden, if required.
The public methods that can be overridden are named with the prefix deo, where the character o indicates override. You should not reimplement methods that are not prefixed with deo.
For more information about defining a plugin subclass andthe three main types of public methods that can be overridden in the DE Plugin subclass, see
Features of a Design Editor Plugin
A DE plugin has the following main features:
- Can own menus, toolbars, assistants, and bindkeys
- Can customize banner menus and toolbars of other applications
- Can co-exist with multiple plugins
- Does not replace the running application when installed
- Does not have its own workspace
You can also create and use your own DE plugins. To be able to do this, you need to create, register, and then install the DE plugin.
Defining and Customizing New Toolbars
You can choose to create new toolbars for your plugin or customize existing toolbars of a main application, or those of another plugin.
- Define a new toolbar for your plugin by providing a toolbar definition file for the plugin in the same way as you would provide for a DE main application.
-
Inherit toolbars from super plugin class by using the
inheritToolbarsFromoption of the toolbar definition file.
When installing a plugin, DE loads the toolbars specified by the toolbar file of the plugin, including those inherited through the inheritToolbarsFrom option. DE does not read the toolbar file of its super-plugin-class(es), unless it happens to be included by the inheritToolbarsFrom option.
Support Bindkeys in DE Plugin
To support bindkeys for your plugin, DE calls hiSetBindkeys by using the value returned by the deoGetBindKeys method when a plugin is installed.
The returned list should append more specific key-bindings after those inherited from super-application(s). This is because if the same t_key appears more than once in its argument list, hiSetBindKeys, uses the last key-binding definition to override the one(s) defined previously.
Banner Menus
You can create a plugin for customizing the banner menu of an application window.
When installing a plugin, DE calls the deoMenuTrigger defined by the plugin. The menu trigger should not install the menus itself; this is done by DE.
The menu trigger merely returns a list of the menus that are to be installed. The menu trigger is passed trigger arguments to customize the menu list according to data specified as trigger arguments.
Workspace Defined by DE Plugin
A workspace is a property of a DE main application. A plugin does not have its own workspace. However, a main application workspace can contain assistants and toolbars defined by a plugin. When saving a workspace of a main application to a workspace file, the workspace includes information of all plugins active at that time.
When the saved workspace is re-applied later, all plugins contained in the workspace are reinstalled. If a plugin is not defined at that time, a warning message is issued.
When a plugin, which has either assistant or toolbar, is installed on top of a main application, the window is considered to be a different application. The workspace applied to this window can be different from the workspace applied to another window that has the same main application but no plugin or different plugin(s) installed.
Related Topics
Accessing a Design Editor Plugin
Return to top