@Override protected final org.eclipse.jface.text.templates.ContextTypeRegistry getRegistry() { ContextTypeRegistry registry= super.getRegistry(); if (registry == null) { return null; } org.eclipse.jface.text.templates.ContextTypeRegistry res= new org.eclipse.jface.text.templates.ContextTypeRegistry(); registry.contextTypes().forEachRemaining(t -> res.addContextType(t)); return res; }
public ContextTypeRegistry getContextTypeRegistry() { if (registry == null) { if (WikiTextUiPlugin.getDefault() != null) { ContributionContextTypeRegistry contributionRegistry = new ContributionContextTypeRegistry(); contributionRegistry.addContextType(SourceTemplateContextType.ID); registry = contributionRegistry; } else { ContextTypeRegistry contextTypeRegistry = new ContextTypeRegistry(); contextTypeRegistry.addContextType(new SourceTemplateContextType()); registry = contextTypeRegistry; } } return registry; }