本文整理汇总了Java中org.eclipse.jface.text.templates.TemplateContextType.resolvers方法的典型用法代码示例。如果您正苦于以下问题:Java TemplateContextType.resolvers方法的具体用法?Java TemplateContextType.resolvers怎么用?Java TemplateContextType.resolvers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.text.templates.TemplateContextType
的用法示例。
在下文中一共展示了TemplateContextType.resolvers方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getHoverInfo
import org.eclipse.jface.text.templates.TemplateContextType; //导入方法依赖的package包/类
public String getHoverInfo(ITextViewer textViewer, IRegion subject) {
try {
IDocument doc= textViewer.getDocument();
int offset= subject.getOffset();
if (offset >= 2 && "${".equals(doc.get(offset-2, 2))) { //$NON-NLS-1$
String varName= doc.get(offset, subject.getLength());
TemplateContextType contextType= fProcessor.getContextType();
if (contextType != null) {
Iterator iter= contextType.resolvers();
while (iter.hasNext()) {
TemplateVariableResolver var= (TemplateVariableResolver) iter.next();
if (varName.equals(var.getType())) {
return var.getDescription();
}
}
}
}
} catch (BadLocationException e) {
}
return null;
}
示例2: getHoverInfo
import org.eclipse.jface.text.templates.TemplateContextType; //导入方法依赖的package包/类
public String getHoverInfo(ITextViewer textViewer, IRegion subject) {
try {
IDocument doc= textViewer.getDocument();
int offset= subject.getOffset();
if (offset >= 2 && "${".equals(doc.get(offset-2, 2))) { //$NON-NLS-1$
String varName= doc.get(offset, subject.getLength());
TemplateContextType contextType= fProcessor.getContextType();
if (contextType != null) {
Iterator<TemplateVariableResolver> iter= contextType.resolvers();
while (iter.hasNext()) {
TemplateVariableResolver var= iter.next();
if (varName.equals(var.getType())) {
return var.getDescription();
}
}
}
}
} catch (BadLocationException e) {
}
return null;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:22,代码来源:CodeTemplateSourceViewerConfiguration.java
示例3: registerJavaContext
import org.eclipse.jface.text.templates.TemplateContextType; //导入方法依赖的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());
}
示例4: registerJavaContext
import org.eclipse.jface.text.templates.TemplateContextType; //导入方法依赖的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());
}