本文整理汇总了Java中org.eclipse.jface.text.templates.ContextTypeRegistry类的典型用法代码示例。如果您正苦于以下问题:Java ContextTypeRegistry类的具体用法?Java ContextTypeRegistry怎么用?Java ContextTypeRegistry使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ContextTypeRegistry类属于org.eclipse.jface.text.templates包,在下文中一共展示了ContextTypeRegistry类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: createContentAssistProcessor
import org.eclipse.jface.text.templates.ContextTypeRegistry; //导入依赖的package包/类
protected JsonContentAssistProcessor createContentAssistProcessor(ContentAssistant ca) {
return new JsonContentAssistProcessor(ca, null){
@Override
protected TemplateStore getTemplateStore() {
return null;
}
@Override
protected ContextTypeRegistry getContextTypeRegistry() {
return null;
}
@Override
protected String getContextTypeId(Model model, String path) {
return null;
}};
}
开发者ID:RepreZen,项目名称:KaiZen-OpenAPI-Editor,代码行数:19,代码来源:JsonSourceViewerConfiguration.java
示例2: registerContextTypes
import org.eclipse.jface.text.templates.ContextTypeRegistry; //导入依赖的package包/类
public static void registerContextTypes(ContextTypeRegistry registry) {
registry.addContextType(new CodeTemplateContextType(CodeTemplateContextType.CATCHBLOCK_CONTEXTTYPE));
registry.addContextType(new CodeTemplateContextType(CodeTemplateContextType.METHODBODY_CONTEXTTYPE));
registry.addContextType(new CodeTemplateContextType(CodeTemplateContextType.CONSTRUCTORBODY_CONTEXTTYPE));
registry.addContextType(new CodeTemplateContextType(CodeTemplateContextType.GETTERBODY_CONTEXTTYPE));
registry.addContextType(new CodeTemplateContextType(CodeTemplateContextType.SETTERBODY_CONTEXTTYPE));
registry.addContextType(new CodeTemplateContextType(CodeTemplateContextType.NEWTYPE_CONTEXTTYPE));
registry.addContextType(new CodeTemplateContextType(CodeTemplateContextType.CLASSBODY_CONTEXTTYPE));
registry.addContextType(new CodeTemplateContextType(CodeTemplateContextType.INTERFACEBODY_CONTEXTTYPE));
registry.addContextType(new CodeTemplateContextType(CodeTemplateContextType.ENUMBODY_CONTEXTTYPE));
registry.addContextType(new CodeTemplateContextType(CodeTemplateContextType.ANNOTATIONBODY_CONTEXTTYPE));
registry.addContextType(new CodeTemplateContextType(CodeTemplateContextType.FILECOMMENT_CONTEXTTYPE));
registry.addContextType(new CodeTemplateContextType(CodeTemplateContextType.TYPECOMMENT_CONTEXTTYPE));
registry.addContextType(new CodeTemplateContextType(CodeTemplateContextType.FIELDCOMMENT_CONTEXTTYPE));
registry.addContextType(new CodeTemplateContextType(CodeTemplateContextType.METHODCOMMENT_CONTEXTTYPE));
registry.addContextType(new CodeTemplateContextType(CodeTemplateContextType.CONSTRUCTORCOMMENT_CONTEXTTYPE));
registry.addContextType(new CodeTemplateContextType(CodeTemplateContextType.OVERRIDECOMMENT_CONTEXTTYPE));
registry.addContextType(new CodeTemplateContextType(CodeTemplateContextType.DELEGATECOMMENT_CONTEXTTYPE));
registry.addContextType(new CodeTemplateContextType(CodeTemplateContextType.GETTERCOMMENT_CONTEXTTYPE));
registry.addContextType(new CodeTemplateContextType(CodeTemplateContextType.SETTERCOMMENT_CONTEXTTYPE));
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:23,代码来源:CodeTemplateContextType.java
示例3: getTemplateContextRegistry
import org.eclipse.jface.text.templates.ContextTypeRegistry; //导入依赖的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: createProjectLayout
import org.eclipse.jface.text.templates.ContextTypeRegistry; //导入依赖的package包/类
/**
* Performs the SilverStripe version specific tasks when creating new project layout project
* @param project Destination project
* @param monitor Monitor to update when creating the layout
* @param templateRegistry Template registry to look through
* @param isFrameworkLayout If the project is a framework only project this is set to true
* @throws CoreException
*/
public void createProjectLayout(Wizard wizard, IProject project, IProgressMonitor monitor, ContextTypeRegistry templateRegistry, TemplateStore templateStore, boolean isFrameworkLayout) throws CoreException {
//Generate the Page.php file
if(isFrameworkLayout==false) {
Template pageTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss30.defaultpage");
PHPTemplateStore.CompiledTemplate pageTemplate=PHPTemplateStore.compileTemplate(templateRegistry, pageTemplateToCompile, project.getName()+"/code", "Page.php");
new SilverStripeFileCreator().createFile(wizard, project.getName()+"/code", "Page.php", monitor, pageTemplate.string, pageTemplate.offset);
}
//Generate the _config.php file
Template configTemplateToCompile;
if(isFrameworkLayout) {
configTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss30.framework.config");
}else {
configTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss30.config");
}
PHPTemplateStore.CompiledTemplate configTemplate=PHPTemplateStore.compileTemplate(templateRegistry, configTemplateToCompile, project.getName(), "_config.php");
new SilverStripeFileCreator().createFile(wizard, project.getName(), "_config.php", monitor, configTemplate.string, configTemplate.offset, true);
}
开发者ID:UndefinedOffset,项目名称:eclipse-silverstripedt,代码行数:29,代码来源:NewSilverStripeProjectCreator.java
示例5: ConfigurableTemplateStore
import org.eclipse.jface.text.templates.ContextTypeRegistry; //导入依赖的package包/类
@SuppressWarnings("PMD.ConstructorCallsOverridableMethod")
@Inject
public ConfigurableTemplateStore(final ContextTypeRegistry registry, final IPreferenceStore store, @Named(Constants.LANGUAGE_NAME) final String key, final AbstractUIPlugin plugin) {
super(registry, store, key + ".templates"); //$NON-NLS-1$
this.res = getTemplateFileURL(plugin);
this.preferenceStore = store;
this.key = key + ".sharedTemplates"; //$NON-NLS-1$
try {
load();
} catch (IOException e) {
LOG.error(e.getMessage(), e);
}
}
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:14,代码来源:ConfigurableTemplateStore.java
示例6: getContextTypeRegistry
import org.eclipse.jface.text.templates.ContextTypeRegistry; //导入依赖的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: FluentMkTemplateCompletionProcessor
import org.eclipse.jface.text.templates.ContextTypeRegistry; //导入依赖的package包/类
public FluentMkTemplateCompletionProcessor(ITextEditor editor, String partition) {
ContextTypeRegistry contextTypeRegistry = CustomTemplateAccess.getInstance().getContextTypeRegistry();
contextType = (SourceTemplateContextType) contextTypeRegistry.getContextType(SourceTemplateContextType.ID);
if (contextType == null) {
throw new IllegalStateException();
}
}
开发者ID:grosenberg,项目名称:fluentmark,代码行数:8,代码来源:FluentMkTemplateCompletionProcessor.java
示例8: getTemplateContextRegistry
import org.eclipse.jface.text.templates.ContextTypeRegistry; //导入依赖的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
示例9: XtextTemplateStore
import org.eclipse.jface.text.templates.ContextTypeRegistry; //导入依赖的package包/类
@Inject
public XtextTemplateStore(ContextTypeRegistry registry, IPreferenceStore store, @Named(Constants.LANGUAGE_NAME) String key,
AbstractUIPlugin plugin) {
super(registry, store, key + ".templates");
res = getTemplateFileURL(plugin);
try {
load();
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
开发者ID:cplutte,项目名称:bts,代码行数:12,代码来源:XtextTemplateStore.java
示例10: KaizenTemplatePreferences
import org.eclipse.jface.text.templates.ContextTypeRegistry; //导入依赖的package包/类
public KaizenTemplatePreferences(SourceViewerConfiguration sourceViewerConfiguration,
IPreferenceStore preferenceStore, TemplateStore templateStore, ContextTypeRegistry contextTypeRegistry) {
this.sourceViewerConfiguration = sourceViewerConfiguration;
setPreferenceStore(preferenceStore);
setTemplateStore(templateStore);
setContextTypeRegistry(contextTypeRegistry);
}
开发者ID:RepreZen,项目名称:KaiZen-OpenAPI-Editor,代码行数:8,代码来源:KaizenTemplatePreferences.java
示例11: getContextType
import org.eclipse.jface.text.templates.ContextTypeRegistry; //导入依赖的package包/类
@Override
protected TemplateContextType getContextType(ITextViewer viewer, IRegion region) {
Model model = null;
if (viewer.getDocument() instanceof JsonDocument) {
model = ((JsonDocument)viewer.getDocument()).getModel();
}
String contextType = getContextTypeId(model, currentPath.toString());
ContextTypeRegistry registry = getContextTypeRegistry();
if (registry != null) {
return registry.getContextType(contextType);
} else {
return null;
}
}
开发者ID:RepreZen,项目名称:KaiZen-OpenAPI-Editor,代码行数:15,代码来源:JsonContentAssistProcessor.java
示例12: addResolver
import org.eclipse.jface.text.templates.ContextTypeRegistry; //导入依赖的package包/类
/**
* This method adds the given {@link TemplateVariableResolver} to each registered
* {@link TemplateContextType}.
*
* @param javaPlugin is the {@link JavaPlugin}.
* @param resolver is the {@link TemplateVariableResolver} to add.
*/
@SuppressWarnings({ "rawtypes" })
private void addResolver(JavaPlugin javaPlugin, TemplateVariableResolver resolver) {
Assert.isNotNull(javaPlugin);
Assert.isNotNull(resolver);
ContextTypeRegistry codeTemplateContextRegistry = javaPlugin.getCodeTemplateContextRegistry();
Assert.isNotNull(codeTemplateContextRegistry);
Iterator ctIter = codeTemplateContextRegistry.contextTypes();
while (ctIter.hasNext()) {
TemplateContextType contextType = (TemplateContextType) ctIter.next();
contextType.addResolver(resolver);
}
}
开发者ID:m-m-m,项目名称:eclipse-templatevariables,代码行数:21,代码来源:TemplateVariablesStartup.java
示例13: removeResolver
import org.eclipse.jface.text.templates.ContextTypeRegistry; //导入依赖的package包/类
/**
* This method removes the given {@link TemplateVariableResolver} to each registered
* {@link TemplateContextType}.
*
* @param javaPlugin is the {@link JavaPlugin}.
* @param resolver is the {@link TemplateVariableResolver} to remove.
*/
@SuppressWarnings({ "rawtypes" })
private void removeResolver(JavaPlugin javaPlugin, TemplateVariableResolver resolver) {
Assert.isNotNull(javaPlugin);
Assert.isNotNull(resolver);
ContextTypeRegistry codeTemplateContextRegistry = javaPlugin.getCodeTemplateContextRegistry();
Assert.isNotNull(codeTemplateContextRegistry);
Iterator ctIter = codeTemplateContextRegistry.contextTypes();
while (ctIter.hasNext()) {
TemplateContextType contextType = (TemplateContextType) ctIter.next();
contextType.removeResolver(resolver);
}
}
开发者ID:m-m-m,项目名称:eclipse-templatevariables,代码行数:21,代码来源:TemplateVariablesStartup.java
示例14: SWTTemplateCompletionProposalComputer
import org.eclipse.jface.text.templates.ContextTypeRegistry; //导入依赖的package包/类
public SWTTemplateCompletionProposalComputer() {
ContextTypeRegistry templateContextRegistry= JavaPlugin.getDefault().getTemplateContextRegistry();
fSWTTemplateEngine= createTemplateEngine(templateContextRegistry, SWTContextType.ID_ALL);
fSWTMembersTemplateEngine= createTemplateEngine(templateContextRegistry, SWTContextType.ID_MEMBERS);
fSWTStatementsTemplateEngine= createTemplateEngine(templateContextRegistry, SWTContextType.ID_STATEMENTS);
JavaCore.addElementChangedListener(new BuildPathChangeListener());
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:9,代码来源:SWTTemplateCompletionProposalComputer.java
示例15: TemplateCompletionProposalComputer
import org.eclipse.jface.text.templates.ContextTypeRegistry; //导入依赖的package包/类
public TemplateCompletionProposalComputer() {
ContextTypeRegistry templateContextRegistry= JavaPlugin.getDefault().getTemplateContextRegistry();
fJavaTemplateEngine= createTemplateEngine(templateContextRegistry, JavaContextType.ID_ALL);
fJavaMembersTemplateEngine= createTemplateEngine(templateContextRegistry, JavaContextType.ID_MEMBERS);
fJavaStatementsTemplateEngine= createTemplateEngine(templateContextRegistry, JavaContextType.ID_STATEMENTS);
fJavadocTemplateEngine= createTemplateEngine(templateContextRegistry, JavaDocContextType.ID);
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:8,代码来源:TemplateCompletionProposalComputer.java
示例16: getContextTypeRegistry
import org.eclipse.jface.text.templates.ContextTypeRegistry; //导入依赖的package包/类
/**
* Returns this plug-in's context type registry.
*
* @return the context type registry for this plug-in instance
*/
public ContextTypeRegistry getContextTypeRegistry()
{
if (mContextTypeRegistry == null) {
mContextTypeRegistry= new ContributionContextTypeRegistry();
mContextTypeRegistry.addContextType(NSISTemplateContextType.NSIS_TEMPLATE_CONTEXT_TYPE);
}
return mContextTypeRegistry;
}
开发者ID:henrikor2,项目名称:eclipsensis,代码行数:14,代码来源:EclipseNSISPlugin.java
示例17: JFaceCompletionProposalComputer
import org.eclipse.jface.text.templates.ContextTypeRegistry; //导入依赖的package包/类
public JFaceCompletionProposalComputer() {
final ContextTypeRegistry templateContextRegistry = JavaPlugin.getDefault().getTemplateContextRegistry();
jFaceTemplateEngine = createTemplateEngine(templateContextRegistry, JFaceContextType.ID_ALL);
jFaceMembersTemplateEngine = createTemplateEngine(templateContextRegistry, JFaceContextType.ID_MEMBERS);
jFaceStatementsTemplateEngine = createTemplateEngine(templateContextRegistry, JFaceContextType.ID_STATEMENTS);
JavaCore.addElementChangedListener(new BuildPathChangeListener());
}
开发者ID:vogellacompany,项目名称:saneclipse,代码行数:9,代码来源:JFaceCompletionProposalComputer.java
示例18: getTemplateContextRegistry
import org.eclipse.jface.text.templates.ContextTypeRegistry; //导入依赖的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
示例19: createProjectLayout
import org.eclipse.jface.text.templates.ContextTypeRegistry; //导入依赖的package包/类
/**
* Performs the SilverStripe version specific tasks when creating new project layout project
* @param project Destination project
* @param monitor Monitor to update when creating the layout
* @param templateRegistry Template registry to look through
* @param isFrameworkLayout If the project is a framework only project this is set to true
* @throws CoreException
*/
public void createProjectLayout(Wizard wizard, IProject project, IProgressMonitor monitor, ContextTypeRegistry templateRegistry, TemplateStore templateStore, boolean isFrameworkLayout) throws CoreException {
//Generate the Page.php file
Template pageTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.defaultpage");
PHPTemplateStore.CompiledTemplate pageTemplate=PHPTemplateStore.compileTemplate(templateRegistry, pageTemplateToCompile, project.getName()+"/code", "Page.php");
new SilverStripeFileCreator().createFile(wizard, project.getName()+"/code", "Page.php", monitor, pageTemplate.string, pageTemplate.offset);
//Generate the _config.php file
Template configTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.config");
PHPTemplateStore.CompiledTemplate configTemplate=PHPTemplateStore.compileTemplate(templateRegistry, configTemplateToCompile, project.getName(), "_config.php");
new SilverStripeFileCreator().createFile(wizard, project.getName(), "_config.php", monitor, configTemplate.string, configTemplate.offset, true);
}
开发者ID:UndefinedOffset,项目名称:eclipse-silverstripedt,代码行数:21,代码来源:NewSilverStripeProjectCreator.java
示例20: createProjectLayout
import org.eclipse.jface.text.templates.ContextTypeRegistry; //导入依赖的package包/类
/**
* Performs the SilverStripe version specific tasks when creating new project layout project
* @param project Destination project
* @param monitor Monitor to update when creating the layout
* @param templateRegistry Template registry to look through
* @param isFrameworkLayout If the project is a framework only project this is set to true
* @throws CoreException
*/
public void createProjectLayout(Wizard wizard, IProject project, IProgressMonitor monitor, ContextTypeRegistry templateRegistry, TemplateStore templateStore, boolean isFrameworkLayout) throws CoreException {
//Generate the Page.php file
Template pageTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.defaultpage");
PHPTemplateStore.CompiledTemplate pageTemplate=PHPTemplateStore.compileTemplate(templateRegistry, pageTemplateToCompile, project.getName()+"/code", "Page.php");
new SilverStripeFileCreator().createFile(wizard, project.getName()+"/code", "Page.php", monitor, pageTemplate.string, pageTemplate.offset);
//Generate the _config.php file
Template configTemplateToCompile=templateStore.findTemplateById("ca.edchipman.silverstripepdt.SilverStripe.templates.newssproject.ss23.config");
PHPTemplateStore.CompiledTemplate configTemplate=PHPTemplateStore.compileTemplate(templateRegistry, configTemplateToCompile, project.getName(), "_config.php");
new SilverStripeFileCreator().createFile(wizard, project.getName(), "_config.php", monitor, configTemplate.string, configTemplate.offset, true);
}
开发者ID:UndefinedOffset,项目名称:eclipse-silverstripedt,代码行数:21,代码来源:NewSilverStripeProjectCreator.java
注:本文中的org.eclipse.jface.text.templates.ContextTypeRegistry类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论