Skip to content

Dialogs

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

Dialogues

User interface dialogs for selecting content completion suggestions are configurable for an editing context. E.g. we can declare in the configuration, that we want a dialog for with check boxes for selecting multiple witnesses when we are in rdg/@wit or lem/@wit. If a plugins that provides labelled entries is configured for this context, too, then the dialog will be populated with the entries that this plugin provides.

Technically, such configurable dialogues are plugins. See plugins for a list of dialog plugins.

All dialog plugins may be configurated with the arguments title and icon as shown in the example below. Such dialogs, that can be used for multiple or single selection also may be configured using the argument multiple with the value true to enable multiple selections.

Where are these configurable dialogs active?

This includes all actions in oXbytei for setting an attribute, except language which is rather old.

Sample configuration

This declares, that we want a check box select dialog for editing rdg/@wit.

        <plugin>
            <class>de.wwu.scdh.teilsp.ui.CheckBoxSelectDialog</class>
            <type>de.wwu.scdh.teilsp.ui.ISelectionDialog</type>
            <configurations>
                <configuration>
                    <conditions>
                        <condition domain="context">self::*:lem | self::*:rdg</condition>
                        <condition domain="priority">10</condition>
                        <condition domain="nodeName">wit</condition>
                        <condition domain="nodeType">attributeValue</condition>
                    </conditions>
                    <arguments>
                        <argument name="title">Select witnesses</argument>
                        <argument name="icon">${framework(oXbytei)}/images/sheetsquestion-24.png</argument>
                    </arguments>
                </configuration>
            </configurations>
        </plugin>

If we also have a provider for labelled entries, the check box dialog is populated with these entries. Here we use an XSLT plugin.

        <plugin>
            <class>de.wwu.scdh.teilsp.extensions.LabelledEntriesXSLTWithContext</class>
            <type>de.wwu.scdh.teilsp.services.extensions.ILabelledEntriesProvider</type>
            <configurations>
                <configuration>
                    <conditions>
                        <condition domain="context">self::*:lem | self::*:rdg</condition>
                        <condition domain="priority">10</condition>
                        <condition domain="nodeName">wit</condition>
                        <condition domain="nodeType">attributeValue</condition>
                    </conditions>
                    <arguments>
                        <argument name="script">${pdu}/resources/xsl/witnesses-context.xsl</argument>
                        <argument name="parameters">witness-catalog=${pdu}/WitnessCatalogue.xml</argument>
                    </arguments>
                </configuration>
            </configurations>
        </plugin>

Clone this wiki locally