本文整理汇总了Java中org.eclipse.jdt.internal.corext.template.java.JavaContextType类的典型用法代码示例。如果您正苦于以下问题:Java JavaContextType类的具体用法?Java JavaContextType怎么用?Java JavaContextType使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
JavaContextType类属于org.eclipse.jdt.internal.corext.template.java包,在下文中一共展示了JavaContextType类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTemplateContextRegistry
import org.eclipse.jdt.internal.corext.template.java.JavaContextType; //导入依赖的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;
}
示例2: getTemplateContextRegistry
import org.eclipse.jdt.internal.corext.template.java.JavaContextType; //导入依赖的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;
}
示例3: TemplateCompletionProposalComputer
import org.eclipse.jdt.internal.corext.template.java.JavaContextType; //导入依赖的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);
}
示例4: getContextTypeIds
import org.eclipse.jdt.internal.corext.template.java.JavaContextType; //导入依赖的package包/类
/**
* Get the active contexts for the given position in the document.
* <p>
* FIXME: should trigger code assist to get the context.
* </p>
*
* @param document the document
* @param offset the offset
* @return an array of valid context id
*/
@Override
protected String[] getContextTypeIds(IDocument document, int offset) {
try {
String partition= TextUtilities.getContentType(document, IJavaPartitions.JAVA_PARTITIONING, offset, true);
String[] ids= new String[] { JavaContextType.ID_ALL, JavaContextType.ID_MEMBERS, JavaContextType.ID_STATEMENTS, SWTContextType.ID_ALL, SWTContextType.ID_STATEMENTS, SWTContextType.ID_MEMBERS};
if (partition.equals(IJavaPartitions.JAVA_DOC))
ids= new String[] { JavaDocContextType.ID };
return ids;
} catch (BadLocationException e) {
return new String[0];
}
}
示例5: TemplateCompletionProposalComputer
import org.eclipse.jdt.internal.corext.template.java.JavaContextType; //导入依赖的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