Search in sources :

Example 6 with ContextTypeRegistry

use of org.eclipse.jface.text.templates.ContextTypeRegistry in project egit by eclipse.

the class Activator method registerTemplateVariableResolvers.

private void registerTemplateVariableResolvers() {
    if (hasJavaPlugin()) {
        final ContextTypeRegistry codeTemplateContextRegistry = JavaPlugin.getDefault().getCodeTemplateContextRegistry();
        final Iterator<?> ctIter = codeTemplateContextRegistry.contextTypes();
        while (ctIter.hasNext()) {
            final TemplateContextType contextType = (TemplateContextType) ctIter.next();
            contextType.addResolver(new GitTemplateVariableResolver(// $NON-NLS-1$
            "git_config", UIText.GitTemplateVariableResolver_GitConfigDescription));
        }
    }
}
Also used : ContextTypeRegistry(org.eclipse.jface.text.templates.ContextTypeRegistry) GitTemplateVariableResolver(org.eclipse.egit.ui.internal.variables.GitTemplateVariableResolver) TemplateContextType(org.eclipse.jface.text.templates.TemplateContextType)

Example 7 with ContextTypeRegistry

use of org.eclipse.jface.text.templates.ContextTypeRegistry in project webtools.sourceediting by eclipse.

the class HTMLTemplateCompletionProcessor method getContextType.

protected TemplateContextType getContextType(ITextViewer viewer, IRegion region) {
    TemplateContextType type = null;
    ContextTypeRegistry registry = getTemplateContextRegistry();
    if (registry != null)
        type = registry.getContextType(fContextTypeId);
    return type;
}
Also used : ContextTypeRegistry(org.eclipse.jface.text.templates.ContextTypeRegistry) TemplateContextType(org.eclipse.jface.text.templates.TemplateContextType)

Example 8 with ContextTypeRegistry

use of org.eclipse.jface.text.templates.ContextTypeRegistry in project webtools.sourceediting by eclipse.

the class CSSTemplateCompletionProcessor method getContextType.

protected TemplateContextType getContextType(ITextViewer viewer, IRegion region) {
    TemplateContextType type = null;
    ContextTypeRegistry registry = getTemplateContextRegistry();
    if (registry != null)
        type = registry.getContextType(fContextTypeId);
    return type;
}
Also used : ContextTypeRegistry(org.eclipse.jface.text.templates.ContextTypeRegistry) TemplateContextType(org.eclipse.jface.text.templates.TemplateContextType)

Example 9 with ContextTypeRegistry

use of org.eclipse.jface.text.templates.ContextTypeRegistry in project webtools.sourceediting by eclipse.

the class JSPTemplateCompletionProcessor method getContextType.

protected TemplateContextType getContextType(ITextViewer viewer, IRegion region) {
    TemplateContextType type = null;
    ContextTypeRegistry registry = getTemplateContextRegistry();
    if (registry != null)
        type = registry.getContextType(fContextTypeId);
    return type;
}
Also used : ContextTypeRegistry(org.eclipse.jface.text.templates.ContextTypeRegistry) TemplateContextType(org.eclipse.jface.text.templates.TemplateContextType)

Example 10 with ContextTypeRegistry

use of org.eclipse.jface.text.templates.ContextTypeRegistry in project webtools.sourceediting by eclipse.

the class XSLTemplateCompletionProcessor method getContextType.

@Override
protected TemplateContextType getContextType(ITextViewer viewer, IRegion region) {
    TemplateContextType type = null;
    ContextTypeRegistry registry = getTemplateContextRegistry();
    if (registry != null) {
        type = registry.getContextType(fContextTypeId);
    }
    return type;
}
Also used : ContextTypeRegistry(org.eclipse.jface.text.templates.ContextTypeRegistry) TemplateContextType(org.eclipse.jface.text.templates.TemplateContextType)

Aggregations

ContextTypeRegistry (org.eclipse.jface.text.templates.ContextTypeRegistry)19 TemplateContextType (org.eclipse.jface.text.templates.TemplateContextType)17 TemplateVariableResolver (org.eclipse.jface.text.templates.TemplateVariableResolver)5 ContextTypeIdHelper (org.eclipse.xtext.ui.editor.templates.ContextTypeIdHelper)5 StyledString (org.eclipse.jface.viewers.StyledString)4 IInspectableTemplateVariableResolver (org.eclipse.xtext.ui.codetemplates.ui.resolvers.IInspectableTemplateVariableResolver)4 ICompletionProposal (org.eclipse.jface.text.contentassist.ICompletionProposal)2 TemplateStore (org.eclipse.jface.text.templates.persistence.TemplateStore)2 Grammar (org.eclipse.xtext.Grammar)2 Codetemplate (org.eclipse.xtext.ui.codetemplates.templates.Codetemplate)2 Codetemplates (org.eclipse.xtext.ui.codetemplates.templates.Codetemplates)2 Variable (org.eclipse.xtext.ui.codetemplates.templates.Variable)2 ConfigurableCompletionProposal (org.eclipse.xtext.ui.editor.contentassist.ConfigurableCompletionProposal)2 NewLayoutTplDataModelProvider (com.liferay.ide.layouttpl.core.operation.NewLayoutTplDataModelProvider)1 LayoutTplUI (com.liferay.ide.layouttpl.ui.LayoutTplUI)1 NewVaadinPortletClassDataModelProvider (com.liferay.ide.portlet.vaadin.core.operation.NewVaadinPortletClassDataModelProvider)1 ServiceClassNameResolver (com.liferay.ide.ui.templates.ServiceClassNameResolver)1 JsonDocument (com.reprezen.swagedit.core.editor.JsonDocument)1 Model (com.reprezen.swagedit.core.model.Model)1 GitTemplateVariableResolver (org.eclipse.egit.ui.internal.variables.GitTemplateVariableResolver)1