Search in sources :

Example 1 with UIHelper

use of org.csstudio.autocomplete.ui.util.UIHelper in project yamcs-studio by yamcs.

the class AutoCompleteUIPlugin method readExtensionRegistry.

private void readExtensionRegistry() throws Exception {
    // Registry lookup
    final IExtensionRegistry registry = RegistryFactory.getRegistry();
    final IConfigurationElement[] configs = registry.getConfigurationElementsFor(EXT_ID);
    if (configs.length > 1)
        throw new Exception("Found " + configs.length + " Auto-Complete UI Helper implementations, expecting at most one");
    if (configs.length == 1) {
        // Use implementations from extension point
        Logger.getLogger(getClass().getName()).config("UI Helper provided by " + configs[0].getContributor().getName());
        AutoCompleteUIPlugin.ui = (UIHelper) configs[0].createExecutableExtension("ui");
    } else {
        // Use default implementations
        AutoCompleteUIPlugin.ui = new UIHelper();
    }
}
Also used : UIHelper(org.csstudio.autocomplete.ui.util.UIHelper) IConfigurationElement(org.eclipse.core.runtime.IConfigurationElement) IExtensionRegistry(org.eclipse.core.runtime.IExtensionRegistry)

Aggregations

UIHelper (org.csstudio.autocomplete.ui.util.UIHelper)1 IConfigurationElement (org.eclipse.core.runtime.IConfigurationElement)1 IExtensionRegistry (org.eclipse.core.runtime.IExtensionRegistry)1