当前位置: 首页>>代码示例>>Java>>正文


Java ContributionContextTypeRegistry类代码示例

本文整理汇总了Java中org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry的典型用法代码示例。如果您正苦于以下问题:Java ContributionContextTypeRegistry类的具体用法?Java ContributionContextTypeRegistry怎么用?Java ContributionContextTypeRegistry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ContributionContextTypeRegistry类属于org.eclipse.ui.editors.text.templates包,在下文中一共展示了ContributionContextTypeRegistry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getTemplateContextRegistry

import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:eclipse,项目名称:che,代码行数:28,代码来源:JavaPlugin.java

示例2: start

import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry; //导入依赖的package包/类
@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);
		}
	}
 
开发者ID:RichardBirenheide,项目名称:brainfuck,代码行数:19,代码来源:BfActivator.java

示例3: getTemplateContextRegistry

import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:28,代码来源:JavaPlugin.java

示例4: SilverStripeTemplatesPreferencePage

import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry; //导入依赖的package包/类
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);
}
 
开发者ID:UndefinedOffset,项目名称:eclipse-silverstripedt,代码行数:21,代码来源:SilverStripeTemplatesPreferencePage.java

示例5: SilverStripeCATemplatesPreferencePage

import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry; //导入依赖的package包/类
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);
}
 
开发者ID:UndefinedOffset,项目名称:eclipse-silverstripedt,代码行数:18,代码来源:SilverStripeCATemplatesPreferencePage.java

示例6: getContextTypeRegistry

import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry; //导入依赖的package包/类
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;
}
 
开发者ID:grosenberg,项目名称:fluentmark,代码行数:15,代码来源:CustomTemplateAccess.java

示例7: getTemplateContextRegistry

import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:angelozerr,项目名称:typescript.java,代码行数:15,代码来源:JSDTTypeScriptUIPlugin.java

示例8: getTemplateContextRegistry

import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:eteration,项目名称:glassmaker,代码行数:16,代码来源:GlassmakerUIPlugin.java

示例9: getNewClassContextRegistry

import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:UndefinedOffset,项目名称:eclipse-silverstripedt,代码行数:16,代码来源:SilverStripePDTPlugin.java

示例10: getTemplateContextRegistry

import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:UndefinedOffset,项目名称:eclipse-silverstripedt,代码行数:18,代码来源:SilverStripePDTPlugin.java

示例11: getCATemplateContextRegistry

import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry; //导入依赖的package包/类
/**
 * 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;
}
 
开发者ID:UndefinedOffset,项目名称:eclipse-silverstripedt,代码行数:19,代码来源:SilverStripePDTPlugin.java

示例12: createContributionContextTypeRegistry

import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry; //导入依赖的package包/类
protected ContextTypeRegistry createContributionContextTypeRegistry() {
	final ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
	for(String id : getRegisteredContextTypeIds()) {
		registry.addContextType(id);
	}
	return registry;
}
 
开发者ID:GoClipse,项目名称:goclipse,代码行数:8,代码来源:TemplateRegistry.java

示例13: getTemplateContextType

import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry; //导入依赖的package包/类
private TemplateContextType getTemplateContextType() {
	ContributionContextTypeRegistry registry = new ContributionContextTypeRegistry();
	registry.addContextType(FtcContextType.TYPE);
	return registry.getContextType(FtcContextType.TYPE);
}
 
开发者ID:curiosag,项目名称:ftc,代码行数:6,代码来源:FtcCompletionProcessor.java

示例14: registerJavaContext

import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry; //导入依赖的package包/类
/**
 * 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());
}
 
开发者ID:eclipse,项目名称:che,代码行数:15,代码来源:JavaPlugin.java

示例15: registerJavaContext

import org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry; //导入依赖的package包/类
/**
 * 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());
}
 
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:15,代码来源:JavaPlugin.java


注:本文中的org.eclipse.ui.editors.text.templates.ContributionContextTypeRegistry类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。