Skip to content

Plugins

Christian Lück edited this page Jul 25, 2022 · 6 revisions

Plugins

oXbytei makes use of a system of Java plugins for different functions of the editor. E.g. a function may be the generation of suggestions for content completion, e.g. suggestions for attribute values; or the presentation of a UI dialog. For each type of function, there is a Java interface, that defines the function. Then, there may be an arbitrary number of implementations that provide this type of function, i.e. implement the Java interface. These implementations are what we call plugins. We a plugin is called, it is (can be) configured with arguments specific for the current editing context.

Editor functions / Plugin interfaces

  • ILabelledEntriesProvider (de.wwu.scdh.teilsp.services.extensions.ILabelledEntriesProvider) :: This type of plugin generates suggestions for content completion or a list of what we call labelled entries. Usally these labelled entries are presented in a UI dialog which lets the user choose. Their name indicates, that the labels presented to the user may differ from the actual value (key). There are plugins for accessing XML data via XQuery, XSLT etc. or CSV data. A plugin for accessing RDF endpoints is planned.

  • ISelectionDialog (de.wwu.scdh.teilsp.ui.ISelectionDialog) :: This type of plugin brings a dialog up on the UI. There are plugins for combo boxes, editable combo boxes, multi-select dialogs based on check boxes or lists. The default dialog is an editable combo box.

Functions planned:

  • IAnnotationFinder, find annotations referencing the current context.

  • IXMLOperation, re-implementation of some author mode operations based on a mode-agnostic manner.

Configuration binds everything together

The above mentioned functions are configurable functions. I.e. when the user requests a function in a specific editing context, plugins configured for this function in this editing context are looked up in the configuration. The plugins found are then initialized for this specific editing context. E.g. when we are on rdg/@wit and request labelled entries, a XSLT plugin may be found that generates labelled entries from a witness catalogue file. When we also request a user dialog for this context, again the configuration is looked up for a plugin that provides a dialog for this kind of context, e.g. check boxes for multiple selection of witnesses.

Plugins for labelled entries

Plugins for selection dialogs

  • de.wwu.scdh.teilsp.ui.CheckBoxSelectDialog :: multiple selections based on check boxes

  • de.wwu.scdh.teilsp.ui.ComboBoxSelectDialog :: single selection based on a combo box

  • de.wwu.scdh.teilsp.ui.EditableComboBoxSelectDialog :: single selection based on an editable combo box. This is the default dialog and will be presented if no other dialog is configured.

  • de.wwu.scdh.teilsp.ui.ComboBoxSelectDialog :: single selection based on a combo box

  • de.wwu.scdh.teilsp.ui.ListSelectDialog :: single or multiple selections based on a list dialog

  • de.wwu.scdh.teilsp.ui.FilteringListSelectDialog :: single or multiple selections based on a list dialog. This offers filtering of the suggestions through a filter text field. State: Experimental. Does not scroll to the selected item yet.

Developing plugins

The plugin code is completely decoupled from oXygen. It is part of a project, that is intended to be used in any editor via LSP in the future. So, it's worth developing plugins, because their're not bound to oXygen.

The plugins are loaded using Java's service provider interface (SPI). This makes the plugin system super extensible.