Search in sources :

Example 1 with ServiceClassNameResolver

use of com.liferay.ide.ui.templates.ServiceClassNameResolver in project liferay-ide by liferay.

the class LiferayUIPlugin method _registerResolvers.

private void _registerResolvers() {
    ContextTypeRegistry templateContextRegistry = JavaPlugin.getDefault().getTemplateContextRegistry();
    Iterator<?> ctIter = templateContextRegistry.contextTypes();
    while (ctIter.hasNext()) {
        Object next = ctIter.next();
        if (next instanceof TemplateContextType) {
            TemplateContextType contextType = (TemplateContextType) next;
            if (contextType.getId().equals("java")) {
                contextType.addResolver(new ServiceClassNameResolver());
            }
        }
    }
}
Also used : ServiceClassNameResolver(com.liferay.ide.ui.templates.ServiceClassNameResolver) ContextTypeRegistry(org.eclipse.jface.text.templates.ContextTypeRegistry) TemplateContextType(org.eclipse.jface.text.templates.TemplateContextType)

Aggregations

ServiceClassNameResolver (com.liferay.ide.ui.templates.ServiceClassNameResolver)1 ContextTypeRegistry (org.eclipse.jface.text.templates.ContextTypeRegistry)1 TemplateContextType (org.eclipse.jface.text.templates.TemplateContextType)1