本文整理汇总了Java中org.eclipse.jface.text.templates.TemplateContextType.getName方法的典型用法代码示例。如果您正苦于以下问题:Java TemplateContextType.getName方法的具体用法?Java TemplateContextType.getName怎么用?Java TemplateContextType.getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jface.text.templates.TemplateContextType
的用法示例。
在下文中一共展示了TemplateContextType.getName方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getColumnText
import org.eclipse.jface.text.templates.TemplateContextType; //导入方法依赖的package包/类
public String getColumnText(Object element, int columnIndex) {
TemplatePersistenceData data = (TemplatePersistenceData) element;
Template template= data.getTemplate();
switch (columnIndex) {
case 0:
return template.getName();
case 1:
TemplateContextType type= fContextTypeRegistry.getContextType(template.getContextTypeId());
if (type != null)
return type.getName();
return template.getContextTypeId();
case 2:
return template.getDescription();
case 3:
return template.isAutoInsertable() ? TemplatesMessages.TemplatePreferencePage_on : ""; //$NON-NLS-1$
default:
return ""; //$NON-NLS-1$
}
}
示例2: createContextType
import org.eclipse.jface.text.templates.TemplateContextType; //导入方法依赖的package包/类
private static TemplateContextType createContextType(IConfigurationElement element)
throws CoreException {
String id = element.getAttribute(ID);
try {
TemplateContextType contextType =
(TemplateContextType) element.createExecutableExtension(CLASS);
String name = element.getAttribute(NAME);
if (name == null) name = id;
if (contextType.getId() == null) contextType.setId(id);
if (contextType.getName() == null) contextType.setName(name);
return contextType;
} catch (ClassCastException e) {
throw new CoreException(
new Status(
IStatus.ERROR,
"org.eclipse.ui.editors",
IStatus.OK,
"extension does not implement " + TemplateContextType.class.getName(),
e)); // $NON-NLS-1$
}
}
示例3: getTemplatesLocationMessage
import org.eclipse.jface.text.templates.TemplateContextType; //导入方法依赖的package包/类
protected String getTemplatesLocationMessage() {
ContextTypeRegistry templateContextRegistry = getTemplatesContextTypeRegistry();
if(this._languageProvider==null) {
return "";
}
TemplateContextType templateContextType = templateContextRegistry.getContextType(this._languageProvider.getTemplateContext());
String name = templateContextType.getName();
return NLS.bind("Templates are \"{0}\" found in the <a>SilverStripe Templates</a> preference page.", name);
}
开发者ID:UndefinedOffset,项目名称:eclipse-silverstripedt,代码行数:12,代码来源:NewSilverStripeTemplatesWizardPage.java
示例4: getTemplatesLocationMessage
import org.eclipse.jface.text.templates.TemplateContextType; //导入方法依赖的package包/类
protected String getTemplatesLocationMessage() {
ContextTypeRegistry templateContextRegistry = getTemplatesContextTypeRegistry();
TemplateContextType templateContextType = templateContextRegistry.getContextType(getTemplateContextTypeId());
String name = templateContextType.getName();
return NLS.bind("Templates are \"{0}\" found in the <a>SilverStripe Templates</a> preference page.", name);
}
开发者ID:UndefinedOffset,项目名称:eclipse-silverstripedt,代码行数:8,代码来源:NewSilverStripeClassWizardTemplatePage.java