Element Inspector Text

Replace the default text collapsible section content in the Element Inspector.

The console will show a warning if multiple extensions are found for a given vertex, name, and key. The extension used is non-deterministic.

Tutorial

Web Plugin

Register the resources needed.

app.registerJavaScript("/org/visallo/examples/detail_text/plugin.js", true);
app.registerJavaScriptComponent("/org/visallo/examples/detail_text/Example.jsx");
app.registerResourceBundle("/org/visallo/examples/detail_text/messages.properties");

Register Extension

Now, register the text extension for all text properties.

visallo.registry.registerExtension('org.visallo.detail.text', {
    shouldReplaceTextSectionForVertex: function(vertex, name, key) {
        return true;
    },
    componentPath: 'org/visallo/examples/detail_text/Example'
});

Component

The component can be React or Flight, here is a React example that prints the name, key pair.

render() {
    const { vertex, propertyName, propertyKey } = this.props;
    return (
        <dl>
            <dt>Name</dt>
            <dd><code>{propertyName}</code></dd>
            <dt>Key</dt>
            <dd><code>{propertyKey}</code></dd>
        </dl>
    )
}

results matching ""

    No results matching ""