Search in sources :

Example 1 with ContributionContextTypeRegistry

use of org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry in project che by eclipse.

the class JavaPlugin method getTemplateContextRegistry.

/**
     * Returns the template context type registry for the java plug-in.
     *
     * @return the template context type registry for the java plug-in
     * @since 3.0
     */
public synchronized ContextTypeRegistry getTemplateContextRegistry() {
    if (fContextTypeRegistry == null) {
        ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry(ID_CU_EDITOR);
        TemplateContextType all_contextType = registry.getContextType(JavaContextType.ID_ALL);
        ((AbstractJavaContextType) all_contextType).initializeContextTypeResolvers();
        registerJavaContext(registry, JavaContextType.ID_MEMBERS, all_contextType);
        registerJavaContext(registry, JavaContextType.ID_STATEMENTS, all_contextType);
        //            registerJavaContext(registry, SWTContextType.ID_ALL, all_contextType);
        //            all_contextType= registry.getContextType(SWTContextType.ID_ALL);
        //
        //            registerJavaContext(registry, SWTContextType.ID_MEMBERS, all_contextType);
        //            registerJavaContext(registry, SWTContextType.ID_STATEMENTS, all_contextType);
        fContextTypeRegistry = registry;
    }
    return fContextTypeRegistry;
}
Also used : AbstractJavaContextType(org.eclipse.jdt.internal.corext.template.java.AbstractJavaContextType) ContributionContextTypeRegistry(org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry) TemplateContextType(org.eclipse.jface.text.templates.TemplateContextType) CodeTemplateContextType(org.eclipse.jdt.internal.corext.template.java.CodeTemplateContextType)

Example 2 with ContributionContextTypeRegistry

use of org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry in project linuxtools by eclipse.

the class Activator method getContextTypeRegistry.

public ContextTypeRegistry getContextTypeRegistry() {
    if (fContextTypeRegistry == null) {
        fContextTypeRegistry = new ContributionContextTypeRegistry();
        // $NON-NLS-1$
        fContextTypeRegistry.addContextType("org.eclipse.linuxtools.rpm.ui.editor.preambleSection");
        // $NON-NLS-1$
        fContextTypeRegistry.addContextType("org.eclipse.linuxtools.rpm.ui.editor.preSection");
        // $NON-NLS-1$
        fContextTypeRegistry.addContextType("org.eclipse.linuxtools.rpm.ui.editor.buildSection");
        // $NON-NLS-1$
        fContextTypeRegistry.addContextType("org.eclipse.linuxtools.rpm.ui.editor.installSection");
        // $NON-NLS-1$
        fContextTypeRegistry.addContextType("org.eclipse.linuxtools.rpm.ui.editor.changelogSection");
    }
    return fContextTypeRegistry;
}
Also used : ContributionContextTypeRegistry(org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry)

Example 3 with ContributionContextTypeRegistry

use of org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry in project erlide_eclipse by erlang.

the class ErlangSourceContextTypeComment method getContextTypeRegistry.

/**
 * Returns this plug-in's context type registry.
 *
 * @return the context type registry for this plug-in instance
 */
public ContextTypeRegistry getContextTypeRegistry() {
    if (fRegistry == null) {
        // create an configure the contexts available in the template editor
        fRegistry = new ContributionContextTypeRegistry();
        fRegistry.addContextType(ErlangSourceContextTypeComment.ERLANGSOURCE_CONTEXT_TYPE_COMMENTS);
        fRegistry.addContextType(ErlangSourceContextTypeComment.ERLANGSOURCE_CONTEXT_TYPE_BEHAVIOUR);
        fRegistry.addContextType(ErlangSourceContextTypeComment.ERLANGSOURCE_CONTEXT_TYPE_LAYOUT);
    }
    return fRegistry;
}
Also used : ContributionContextTypeRegistry(org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry)

Example 4 with ContributionContextTypeRegistry

use of org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry in project erlide_eclipse by erlang.

the class ErlideUIPlugin method getContextTypeRegistry.

public ContextTypeRegistry getContextTypeRegistry() {
    if (fContextTypeRegistry == null) {
        // create an configure the contexts available in the template editor
        fContextTypeRegistry = new ContributionContextTypeRegistry();
        fContextTypeRegistry.addContextType(ErlangTemplateContextType.ERLANG_CONTEXT_TYPE_ID);
        fContextTypeRegistry.addContextType(ErlangSourceContextTypeModule.ERLANG_SOURCE_CONTEXT_TYPE_MODULE_ID);
        fContextTypeRegistry.addContextType(ErlangSourceContextTypeModuleElement.ERLANG_SOURCE_CONTEXT_TYPE_MODULE_ELEMENT_ID);
    }
    return fContextTypeRegistry;
}
Also used : ContributionContextTypeRegistry(org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry)

Example 5 with ContributionContextTypeRegistry

use of org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry in project liferay-ide by liferay.

the class KaleoUI method getTemplateContextRegistry.

public ContextTypeRegistry getTemplateContextRegistry() {
    if (_contextTypeRegistry == null) {
        ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
        for (KaleoTemplateContext contextType : KaleoTemplateContext.values()) {
            registry.addContextType(contextType.getContextTypeId());
        }
        _contextTypeRegistry = registry;
    }
    return _contextTypeRegistry;
}
Also used : ContributionContextTypeRegistry(org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry) KaleoTemplateContext(com.liferay.ide.kaleo.ui.xml.KaleoTemplateContext)

Aggregations

ContributionContextTypeRegistry (org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry)23 KaleoTemplateContext (com.liferay.ide.kaleo.ui.xml.KaleoTemplateContext)1 StructuresTemplateContext (com.liferay.ide.portal.ui.templates.StructuresTemplateContext)1 AbstractJavaContextType (org.eclipse.jdt.internal.corext.template.java.AbstractJavaContextType)1 CodeTemplateContextType (org.eclipse.jdt.internal.corext.template.java.CodeTemplateContextType)1 ContextTypeRegistry (org.eclipse.jface.text.templates.ContextTypeRegistry)1 TemplateContextType (org.eclipse.jface.text.templates.TemplateContextType)1