Java 类org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry 实例源码

项目:che    文件:JavaPlugin.java   
/**
 * 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;
}
项目:brainfuck    文件:BfActivator.java   
@Override
    public void start(BundleContext context) throws Exception {
        super.start(context);
        instance = this;

        this.registry = new ContributionContextTypeRegistry(BfTemplateType.REGISTRY_ID);
//      this.registry.addContextType(new BfTemplateType("org.birenheide.bf.brainfuck.p1", "1 Parameter"));
        for (ParametrizedTemplateTypeDescriptor desc : ParametrizedTemplateTypeDescriptor.values()) {
            this.registry.addContextType(desc.templateType);
        }
        this.templateStore = new ContributionTemplateStore(registry, this.getPreferenceStore(), BfPreferenceInitializer.TEMPLATE_KEY);
        try {
            this.templateStore.load();
        } 
        catch (IOException e) {
            logError("Templates coud not be loaded", e);
        }
    }
项目:Eclipse-Postfix-Code-Completion    文件:JavaPlugin.java   
/**
 * 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(JavaUI.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;
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaPlugin.java   
/**
 * 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(JavaUI.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;
}
项目:eclipse-silverstripedt    文件:SilverStripeTemplatesPreferencePage.java   
public SilverStripeTemplatesPreferencePage() {
    setPreferenceStore(SilverStripePDTPlugin.getDefault().getPreferenceStore());

    //Build registry
    Iterator contexts=SilverStripePDTPlugin.getDefault().getTemplateContextRegistry().contextTypes();
    ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
    registry.addContextType(new CodeTemplateContextType(NewSilverStripeClassWizardTemplatePage.NEW_CLASS_CONTEXTTYPE));
    while(contexts.hasNext()) {
        registry.addContextType((TemplateContextType) contexts.next());
    }

    setTemplateStore(new SilverStripeTemplateStore(registry, this.getPreferenceStore(), "ca.edchipman.silverstripepdt.SilverStripe.templates"));
    try {
        this.getTemplateStore().load();
    } catch (IOException e) {
        e.printStackTrace();
    }

    setContextTypeRegistry(registry);
}
项目:eclipse-silverstripedt    文件:SilverStripeCATemplatesPreferencePage.java   
public SilverStripeCATemplatesPreferencePage() {
    setPreferenceStore(SilverStripePDTPlugin.getDefault().getPreferenceStore());
    setTemplateStore(SilverStripePDTPlugin.getDefault().getCATemplateStore());

    //Build registry
    ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
    registry.addContextType(new CodeTemplateContextType(SSTemplateCompletionProcessor.TEMPLATE_CONTEXT_ID));

    setTemplateStore(new SilverStripeTemplateStore(registry, this.getPreferenceStore(),"ca.edchipman.silverstripepdt.contentassist.templates"));
    try {
        this.getTemplateStore().load();
    } catch (IOException e) {
        e.printStackTrace();
    }

    setContextTypeRegistry(registry);
}
项目:fluentmark    文件:CustomTemplateAccess.java   
public ContextTypeRegistry getContextTypeRegistry() {
    if (registry == null) {
        if (FluentMkUI.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;
}
项目:typescript.java    文件:JSDTTypeScriptUIPlugin.java   
/**
 * Returns the template context type registry for the java plug-in.
 * 
 * @return the template context type registry for the java plug-in
 * 
 */
public ContextTypeRegistry getTemplateContextRegistry() {
    if (fContextTypeRegistry == null) {
        ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry(CONTEXT_TYPE_REGISTRY_ID);
        fContextTypeRegistry = registry;
    }

    return fContextTypeRegistry;
}
项目:glassmaker    文件:GlassmakerUIPlugin.java   
/**
 * Returns the template context type registry for the html plugin.
 * 
 * @return the template context type registry for the html plugin
 */
public ContextTypeRegistry getTemplateContextRegistry() {
    if (fContextTypeRegistry == null) {
        ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
        registry.addContextType(CardContextType.CONTEXT_TYPE);

        fContextTypeRegistry = registry;
    }

    return fContextTypeRegistry;
}
项目:eclipse-silverstripedt    文件:SilverStripePDTPlugin.java   
/**
 * Returns the template context type registry for creating SilverStripe classes.
 * @return the template context type registry for creating SilverStripe classes
 */
public ContextTypeRegistry getNewClassContextRegistry() {
    if (fClassContextTypeRegistry == null) {
        ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();

        registry.addContextType(new CodeTemplateContextType(NewSilverStripeClassWizardTemplatePage.NEW_CLASS_CONTEXTTYPE));

        fClassContextTypeRegistry = registry;
    }

    return fClassContextTypeRegistry;
}
项目:eclipse-silverstripedt    文件:SilverStripePDTPlugin.java   
/**
 * Returns the template context type registry for SilverStripe template files.
 * @return the template context type registry for SilverStripe template files
 */
public ContextTypeRegistry getTemplateContextRegistry() {
    if (fContextTypeRegistry == null) {
        ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();

        registry.addContextType(new CodeTemplateContextType(NewSilverStripeTemplatesWizardPage.NEW_SS_TEMPLATE_CONTEXTTYPE));
        registry.addContextType(new CodeTemplateContextType(NewSilverStripeTemplatesWizardPage.NEW_SS_30_TEMPLATE_CONTEXTTYPE));
        registry.addContextType(new CodeTemplateContextType(NewSilverStripeProjectWizard.NEW_SS_PROJECT_TEMPLATE_CONTEXTTYPE));

        fContextTypeRegistry = registry;
    }

    return fContextTypeRegistry;
}
项目:eclipse-silverstripedt    文件:SilverStripePDTPlugin.java   
/**
 * Returns the content assist template context type registry for the xml plugin.
 * 
 * @return the content assist template context type registry for the xml plugin
 */
public ContextTypeRegistry getCATemplateContextRegistry() {
    if (caContextTypeRegistry == null) {
        ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();

        registry.addContextType(new CodeTemplateContextType(SSTemplateCompletionProcessor.TEMPLATE_CONTEXT_ID));
        registry.addContextType(new CodeTemplateContextType(NewSilverStripeTemplatesWizardPage.NEW_SS_TEMPLATE_CONTEXTTYPE));
        registry.addContextType(new CodeTemplateContextType(NewSilverStripeTemplatesWizardPage.NEW_SS_30_TEMPLATE_CONTEXTTYPE));

        caContextTypeRegistry = registry;
    }

    return caContextTypeRegistry;
}
项目:goclipse    文件:TemplateRegistry.java   
protected ContextTypeRegistry createContributionContextTypeRegistry() {
    final ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
    for(String id : getRegisteredContextTypeIds()) {
        registry.addContextType(id);
    }
    return registry;
}
项目:ftc    文件:FtcCompletionProcessor.java   
private TemplateContextType getTemplateContextType() {
    ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
    registry.addContextType(FtcContextType.TYPE);
    return registry.getContextType(FtcContextType.TYPE);
}
项目:che    文件:JavaPlugin.java   
/**
 * Registers the given Java template context.
 *
 * @param registry the template context type registry
 * @param id the context type id
 * @param parent the parent context type
 * @since 3.4
 */
private static void registerJavaContext(
    ContributionContextTypeRegistry registry, String id, TemplateContextType parent) {
  TemplateContextType contextType = registry.getContextType(id);
  Iterator<TemplateVariableResolver> iter = parent.resolvers();
  while (iter.hasNext()) contextType.addResolver(iter.next());
}
项目:Eclipse-Postfix-Code-Completion    文件:JavaPlugin.java   
/**
 * Registers the given Java template context.
 *
 * @param registry the template context type registry
 * @param id the context type id
 * @param parent the parent context type
 * @since 3.4
 */
private static void registerJavaContext(ContributionContextTypeRegistry registry, String id, TemplateContextType parent) {
    TemplateContextType contextType= registry.getContextType(id);
    Iterator<TemplateVariableResolver> iter= parent.resolvers();
    while (iter.hasNext())
        contextType.addResolver(iter.next());
}
项目:Eclipse-Postfix-Code-Completion-Juno38    文件:JavaPlugin.java   
/**
 * Registers the given Java template context.
 *
 * @param registry the template context type registry
 * @param id the context type id
 * @param parent the parent context type
 * @since 3.4
 */
private static void registerJavaContext(ContributionContextTypeRegistry registry, String id, TemplateContextType parent) {
    TemplateContextType contextType= registry.getContextType(id);
    Iterator<TemplateVariableResolver> iter= parent.resolvers();
    while (iter.hasNext())
        contextType.addResolver(iter.next());
}