本文整理汇总了Java中com.intellij.lang.findUsages.LanguageFindUsages类的典型用法代码示例。如果您正苦于以下问题:Java LanguageFindUsages类的具体用法?Java LanguageFindUsages怎么用?Java LanguageFindUsages使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LanguageFindUsages类属于com.intellij.lang.findUsages包,在下文中一共展示了LanguageFindUsages类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: isEnabled
import com.intellij.lang.findUsages.LanguageFindUsages; //导入依赖的package包/类
private static boolean isEnabled(DataContext dataContext) {
Project project = CommonDataKeys.PROJECT.getData(dataContext);
if (project == null) {
return false;
}
Editor editor = CommonDataKeys.EDITOR.getData(dataContext);
if (editor == null) {
UsageTarget[] target = UsageView.USAGE_TARGETS_KEY.getData(dataContext);
return target != null && target.length > 0;
}
else {
PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
if (file == null) {
return false;
}
Language language = PsiUtilBase.getLanguageInEditor(editor, project);
if (language == null) {
language = file.getLanguage();
}
return !(LanguageFindUsages.INSTANCE.forLanguage(language) instanceof EmptyFindUsagesProvider);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:25,代码来源:FindUsagesInFileAction.java
示例2: getElementDescription
import com.intellij.lang.findUsages.LanguageFindUsages; //导入依赖的package包/类
@Override
public String getElementDescription(@NotNull final PsiElement element, @NotNull final ElementDescriptionLocation location) {
if (location instanceof DeleteTypeDescriptionLocation) {
final boolean plural = ((DeleteTypeDescriptionLocation)location).isPlural();
final int count = plural ? 2 : 1;
if (element instanceof PsiFileSystemItem && PsiUtilBase.isSymLink((PsiFileSystemItem)element)) {
return IdeBundle.message("prompt.delete.symlink", count);
}
if (element instanceof PsiFile) {
return IdeBundle.message("prompt.delete.file", count);
}
if (element instanceof PsiDirectory) {
return IdeBundle.message("prompt.delete.directory", count);
}
if (!plural) {
return LanguageFindUsages.INSTANCE.forLanguage(element.getLanguage()).getType(element);
}
return "elements";
}
return null;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:22,代码来源:DeleteTypeDescriptionLocation.java
示例3: isEnabled
import com.intellij.lang.findUsages.LanguageFindUsages; //导入依赖的package包/类
private static boolean isEnabled(DataContext dataContext) {
Project project = PlatformDataKeys.PROJECT.getData(dataContext);
if (project == null) {
return false;
}
Editor editor = PlatformDataKeys.EDITOR.getData(dataContext);
if (editor == null) {
UsageTarget[] target = UsageView.USAGE_TARGETS_KEY.getData(dataContext);
return target != null && target.length > 0;
}
else {
PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
if (file == null) {
return false;
}
Language language = PsiUtilBase.getLanguageInEditor(editor, project);
if (language == null) {
language = file.getLanguage();
}
return !(LanguageFindUsages.INSTANCE.forLanguage(language) instanceof EmptyFindUsagesProvider);
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:25,代码来源:FindUsagesInFileAction.java
示例4: isEnabled
import com.intellij.lang.findUsages.LanguageFindUsages; //导入依赖的package包/类
private static boolean isEnabled(DataContext dataContext) {
Project project = dataContext.getData(CommonDataKeys.PROJECT);
if (project == null) {
return false;
}
Editor editor = dataContext.getData(PlatformDataKeys.EDITOR);
if (editor == null) {
UsageTarget[] target = dataContext.getData(UsageView.USAGE_TARGETS_KEY);
return target != null && target.length > 0;
}
else {
PsiFile file = PsiDocumentManager.getInstance(project).getPsiFile(editor.getDocument());
if (file == null) {
return false;
}
Language language = PsiUtilBase.getLanguageInEditor(editor, project);
if (language == null) {
language = file.getLanguage();
}
return !(LanguageFindUsages.INSTANCE.forLanguage(language) instanceof EmptyFindUsagesProvider);
}
}
开发者ID:consulo,项目名称:consulo,代码行数:25,代码来源:FindUsagesInFileAction.java
示例5: getElementDescription
import com.intellij.lang.findUsages.LanguageFindUsages; //导入依赖的package包/类
@Override
public String getElementDescription(@Nonnull final PsiElement element, @Nonnull final ElementDescriptionLocation location) {
if (location instanceof DeleteTypeDescriptionLocation) {
final boolean plural = ((DeleteTypeDescriptionLocation)location).isPlural();
final int count = plural ? 2 : 1;
if (element instanceof PsiFileSystemItem && PsiUtilBase.isSymLink((PsiFileSystemItem)element)) {
return IdeBundle.message("prompt.delete.symlink", count);
}
if (element instanceof PsiFile) {
return IdeBundle.message("prompt.delete.file", count);
}
if (element instanceof PsiDirectory) {
return IdeBundle.message("prompt.delete.directory", count);
}
if (!plural) {
return LanguageFindUsages.INSTANCE.forLanguage(element.getLanguage()).getType(element);
}
return "elements";
}
return null;
}
开发者ID:consulo,项目名称:consulo,代码行数:22,代码来源:DeleteTypeDescriptionLocation.java
示例6: formatType
import com.intellij.lang.findUsages.LanguageFindUsages; //导入依赖的package包/类
private static String formatType(@NotNull PsiVariable variable) {
FindUsagesProvider provider = LanguageFindUsages.INSTANCE.forLanguage(variable.getLanguage());
final String type = provider.getType(variable);
if (StringUtil.isNotEmpty(type)) {
return type;
}
return TypePresentationService.getService().getTypePresentableName(variable.getClass());
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:VariableArrayTypeFix.java
示例7: calcText
import com.intellij.lang.findUsages.LanguageFindUsages; //导入依赖的package包/类
public static String calcText(PsiModifierListOwner modifierListOwner, @NotNull String annotation) {
final String shortName = annotation.substring(annotation.lastIndexOf('.') + 1);
if (modifierListOwner instanceof PsiNamedElement) {
final String name = ((PsiNamedElement)modifierListOwner).getName();
if (name != null) {
FindUsagesProvider provider = LanguageFindUsages.INSTANCE.forLanguage(modifierListOwner.getLanguage());
return CodeInsightBundle
.message("inspection.i18n.quickfix.annotate.element.as", provider.getType(modifierListOwner), name, shortName);
}
}
return CodeInsightBundle.message("inspection.i18n.quickfix.annotate.as", shortName);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:13,代码来源:AddAnnotationPsiFix.java
示例8: getElementDescription
import com.intellij.lang.findUsages.LanguageFindUsages; //导入依赖的package包/类
@Override
public String getElementDescription(@NotNull final PsiElement psiElement, @NotNull final ElementDescriptionLocation location) {
if (!(location instanceof UsageViewTypeLocation)) return null;
if (psiElement instanceof PsiMetaOwner) {
final PsiMetaData metaData = ((PsiMetaOwner)psiElement).getMetaData();
if (metaData instanceof PsiPresentableMetaData) {
return ((PsiPresentableMetaData)metaData).getTypeName();
}
}
if (psiElement instanceof PsiFile) {
return LangBundle.message("terms.file");
}
if (psiElement instanceof PsiDirectory) {
return LangBundle.message("terms.directory");
}
final Language lang = psiElement.getLanguage();
FindUsagesProvider provider = LanguageFindUsages.INSTANCE.forLanguage(lang);
final String type = provider.getType(psiElement);
if (StringUtil.isNotEmpty(type)) {
return type;
}
return TypePresentationService.getService().getTypePresentableName(psiElement.getClass());
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:28,代码来源:UsageViewTypeLocation.java
示例9: getFileTypeIndexer
import com.intellij.lang.findUsages.LanguageFindUsages; //导入依赖的package包/类
@Nullable
public static FileTypeIdIndexer getFileTypeIndexer(FileType fileType) {
final FileTypeIdIndexer idIndexer = ourIdIndexers.get(fileType);
if (idIndexer != null) {
return idIndexer;
}
final FileTypeIdIndexer extIndexer = IdIndexers.INSTANCE.forFileType(fileType);
if (extIndexer != null) {
return extIndexer;
}
final WordsScanner customWordsScanner = CacheBuilderRegistry.getInstance().getCacheBuilder(fileType);
if (customWordsScanner != null) {
return new WordsScannerFileTypeIdIndexerAdapter(customWordsScanner);
}
if (fileType instanceof LanguageFileType) {
final Language lang = ((LanguageFileType)fileType).getLanguage();
final FindUsagesProvider findUsagesProvider = LanguageFindUsages.INSTANCE.forLanguage(lang);
WordsScanner scanner = findUsagesProvider == null ? null : findUsagesProvider.getWordsScanner();
if (scanner == null) {
scanner = new SimpleWordsScanner();
}
return new WordsScannerFileTypeIdIndexerAdapter(scanner);
}
if (fileType instanceof CustomSyntaxTableFileType) {
return new WordsScannerFileTypeIdIndexerAdapter(createCustomFileTypeScanner(((CustomSyntaxTableFileType)fileType).getSyntaxTable()));
}
return null;
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:IdTableBuilding.java
示例10: canFindUsages
import com.intellij.lang.findUsages.LanguageFindUsages; //导入依赖的package包/类
@Override
public boolean canFindUsages(@NotNull final PsiElement element) {
if (element instanceof PsiFileSystemItem) {
if (((PsiFileSystemItem)element).getVirtualFile() == null) return false;
}
else if (!LanguageFindUsages.INSTANCE.forLanguage(element.getLanguage()).canFindUsagesFor(element)) {
return false;
}
return element.isValid();
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:DefaultFindUsagesHandlerFactory.java
示例11: ApplicationEnvironment
import com.intellij.lang.findUsages.LanguageFindUsages; //导入依赖的package包/类
public ApplicationEnvironment(CoreApplicationEnvironment appEnvironment) {
appEnvironment.registerFileType(HtmlFileType.INSTANCE, "html;htm;sht;shtm;shtml");
appEnvironment.registerFileType(XHtmlFileType.INSTANCE, "xhtml");
appEnvironment.registerFileType(DTDFileType.INSTANCE, "dtd;ent;mod;elt");
appEnvironment.registerFileType(XmlFileType.INSTANCE, "xml;xsd;tld;xsl;jnlp;wsdl;jhm;ant;xul;xslt;rng;fxml");
SyntaxHighlighterFactory.LANGUAGE_FACTORY.addExplicitExtension(XMLLanguage.INSTANCE, new XmlSyntaxHighlighterFactory());
SyntaxHighlighterFactory.LANGUAGE_FACTORY.addExplicitExtension(DTDLanguage.INSTANCE, new DtdSyntaxHighlighterFactory());
SyntaxHighlighterFactory.LANGUAGE_FACTORY.addExplicitExtension(HTMLLanguage.INSTANCE, new HtmlSyntaxHighlighterFactory());
SyntaxHighlighterFactory.LANGUAGE_FACTORY.addExplicitExtension(XHTMLLanguage.INSTANCE, new XhtmlSyntaxHighlighterFactory());
appEnvironment.addExplicitExtension(LanguageParserDefinitions.INSTANCE, XMLLanguage.INSTANCE, new XMLParserDefinition());
appEnvironment.addExplicitExtension(LanguageParserDefinitions.INSTANCE, DTDLanguage.INSTANCE, new DTDParserDefinition());
appEnvironment.addExplicitExtension(LanguageParserDefinitions.INSTANCE, HTMLLanguage.INSTANCE, new HTMLParserDefinition());
appEnvironment.addExplicitExtension(LanguageParserDefinitions.INSTANCE, XHTMLLanguage.INSTANCE, new XHTMLParserDefinition());
appEnvironment.addExplicitExtension(IdIndexers.INSTANCE, XmlFileType.INSTANCE, new XmlIdIndexer());
appEnvironment.addExplicitExtension(IdIndexers.INSTANCE, DTDFileType.INSTANCE, new XmlIdIndexer());
appEnvironment.addExplicitExtension(TodoIndexers.INSTANCE, XmlFileType.INSTANCE, new XmlTodoIndexer());
appEnvironment.addExplicitExtension(TodoIndexers.INSTANCE, DTDFileType.INSTANCE, new XmlTodoIndexer());
appEnvironment.addExplicitExtension(TodoIndexers.INSTANCE, XHtmlFileType.INSTANCE, new XHtmlTodoIndexer());
appEnvironment.addExtension(MetaDataContributor.EP_NAME, new XmlApplicationComponent());
appEnvironment.addExtension(FileBasedIndexExtension.EXTENSION_POINT_NAME, new XmlNamespaceIndex());
appEnvironment.addExtension(FileBasedIndexExtension.EXTENSION_POINT_NAME, new SchemaTypeInheritanceIndex());
appEnvironment.addExtension(FileBasedIndexExtension.EXTENSION_POINT_NAME, new XmlTagNamesIndex());
appEnvironment.addExtension(StandardResourceProvider.EP_NAME, new InternalResourceProvider());
appEnvironment.registerApplicationComponent(PathMacros.class, new PathMacrosImpl());
appEnvironment.registerApplicationService(ExternalResourceManager.class, new ExternalResourceManagerExImpl());
appEnvironment.registerApplicationService(XmlFoldingSettings.class, new XmlFoldingSettings());
Language[] myLanguages = new Language[]{XMLLanguage.INSTANCE, HTMLLanguage.INSTANCE, XHTMLLanguage.INSTANCE, DTDLanguage.INSTANCE};
for (Language myLanguage : myLanguages) {
appEnvironment.addExplicitExtension(LanguageFolding.INSTANCE, myLanguage, new XmlFoldingBuilder());
appEnvironment.addExplicitExtension(LanguageFindUsages.INSTANCE, myLanguage, new XmlFindUsagesProvider());
appEnvironment.addExplicitExtension(LanguageASTFactory.INSTANCE, myLanguage, new XmlASTFactory());
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:40,代码来源:XmlCoreEnvironment.java
示例12: ApplicationEnvironment
import com.intellij.lang.findUsages.LanguageFindUsages; //导入依赖的package包/类
public ApplicationEnvironment(CoreApplicationEnvironment appEnvironment) {
appEnvironment.registerFileType(PropertiesFileType.INSTANCE, "properties");
appEnvironment.addExplicitExtension(SyntaxHighlighterFactory.LANGUAGE_FACTORY, PropertiesLanguage.INSTANCE,
new PropertiesSyntaxHighlighterFactory());
appEnvironment.addExplicitExtension(LanguageParserDefinitions.INSTANCE, PropertiesLanguage.INSTANCE, new PropertiesParserDefinition());
appEnvironment.addExtension(FileBasedIndexExtension.EXTENSION_POINT_NAME, new XmlPropertiesIndex());
appEnvironment.addExtension(StubIndexExtension.EP_NAME, new PropertyKeyIndex());
appEnvironment.registerApplicationService(PropertiesQuickFixFactory.class, new EmptyPropertiesQuickFixFactory());
appEnvironment.registerApplicationService(PropertiesRefactoringSettings.class, new PropertiesRefactoringSettings());
appEnvironment.addExplicitExtension(LanguageAnnotators.INSTANCE, PropertiesLanguage.INSTANCE, new PropertiesAnnotator());
appEnvironment.addExplicitExtension(LanguageFindUsages.INSTANCE, PropertiesLanguage.INSTANCE, new PropertiesFindUsagesProvider());
appEnvironment.addExplicitExtension(LanguageASTFactory.INSTANCE, PropertiesLanguage.INSTANCE, new PropertiesASTFactory());
appEnvironment.addExplicitExtension(LanguageFolding.INSTANCE, PropertiesLanguage.INSTANCE, new PropertiesFoldingBuilder());
appEnvironment.addExplicitExtension(ElementManipulators.INSTANCE, PropertyImpl.class, new PropertyManipulator());
appEnvironment.addExplicitExtension(ElementManipulators.INSTANCE, PropertyKeyImpl.class, new PropertyKeyManipulator());
appEnvironment.addExplicitExtension(ElementManipulators.INSTANCE, PropertyValueImpl.class, new PropertyValueManipulator());
final StubElementTypeHolderEP stubElementTypeHolderBean = new StubElementTypeHolderEP();
stubElementTypeHolderBean.holderClass = PropertiesElementTypes.class.getName();
appEnvironment.addExtension(StubElementTypeHolderEP.EP_NAME, stubElementTypeHolderBean);
appEnvironment.addExplicitExtension(LanguageCommenters.INSTANCE, PropertiesLanguage.INSTANCE, new PropertiesCommenter());
appEnvironment.addExplicitExtension(IdIndexers.INSTANCE, PropertiesFileType.INSTANCE, new PropertiesIdIndexer());
appEnvironment.addExplicitExtension(TodoIndexers.INSTANCE, PropertiesFileType.INSTANCE, new PropertiesTodoIndexer());
appEnvironment.addExtension(IconProvider.EXTENSION_POINT_NAME, new XmlPropertiesIconProvider());
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:PropertiesCoreEnvironment.java
示例13: getFileTypeIndexer
import com.intellij.lang.findUsages.LanguageFindUsages; //导入依赖的package包/类
@Nullable
public static FileTypeIdIndexer getFileTypeIndexer(FileType fileType) {
final FileTypeIdIndexer idIndexer = ourIdIndexers.get(fileType);
if (idIndexer != null) {
return idIndexer;
}
final FileTypeIdIndexer extIndexer = IdIndexers.INSTANCE.forFileType(fileType);
if (extIndexer != null) {
return extIndexer;
}
final WordsScanner customWordsScanner = CacheBuilderRegistry.getInstance().getCacheBuilder(fileType);
if (customWordsScanner != null) {
return new WordsScannerFileTypeIdIndexerAdapter(customWordsScanner);
}
if (fileType instanceof LanguageFileType) {
final Language lang = ((LanguageFileType)fileType).getLanguage();
final FindUsagesProvider findUsagesProvider = LanguageFindUsages.INSTANCE.forLanguage(lang);
WordsScanner scanner = findUsagesProvider == null ? null : findUsagesProvider.getWordsScanner();
if (scanner == null) {
scanner = new SimpleWordsScanner();
}
return new WordsScannerFileTypeIdIndexerAdapter(scanner);
}
if (fileType instanceof CustomSyntaxTableFileType) {
return new WordsScannerFileTypeIdIndexerAdapter(createWordScanner((CustomSyntaxTableFileType)fileType));
}
return null;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:35,代码来源:IdTableBuilding.java
示例14: getText
import com.intellij.lang.findUsages.LanguageFindUsages; //导入依赖的package包/类
@NotNull
@Override
public String getText(@Nullable UsageView usageView)
{
T element = myPointer.getElement();
if(element == null)
{
return "INVALID";
}
return LanguageFindUsages.INSTANCE.forKey(CSharpLanguage.INSTANCE).get(0).getNodeText(element, false);
}
开发者ID:consulo,项目名称:consulo-csharp,代码行数:12,代码来源:CSharpBaseGroupingRule.java
示例15: getFileTypeIndexer
import com.intellij.lang.findUsages.LanguageFindUsages; //导入依赖的package包/类
@javax.annotation.Nullable
public static IdIndexer getFileTypeIndexer(FileType fileType) {
final IdIndexer idIndexer = ourIdIndexers.get(fileType);
if (idIndexer != null) {
return idIndexer;
}
final IdIndexer extIndexer = IdIndexers.INSTANCE.forFileType(fileType);
if (extIndexer != null) {
return extIndexer;
}
final WordsScanner customWordsScanner = CacheBuilderRegistry.getInstance().getCacheBuilder(fileType);
if (customWordsScanner != null) {
return new WordsScannerFileTypeIdIndexerAdapter(customWordsScanner);
}
if (fileType instanceof LanguageFileType) {
final Language lang = ((LanguageFileType)fileType).getLanguage();
final FindUsagesProvider findUsagesProvider = LanguageFindUsages.INSTANCE.forLanguage(lang);
WordsScanner scanner = findUsagesProvider == null ? null : findUsagesProvider.getWordsScanner();
if (scanner == null) {
scanner = new SimpleWordsScanner();
}
return new WordsScannerFileTypeIdIndexerAdapter(scanner);
}
if (fileType instanceof CustomSyntaxTableFileType) {
return new WordsScannerFileTypeIdIndexerAdapter(createWordScanner((CustomSyntaxTableFileType)fileType));
}
return null;
}
开发者ID:consulo,项目名称:consulo,代码行数:35,代码来源:IdTableBuilding.java
示例16: getElementDescription
import com.intellij.lang.findUsages.LanguageFindUsages; //导入依赖的package包/类
@Override
public String getElementDescription(@Nonnull final PsiElement psiElement, @Nonnull final ElementDescriptionLocation location) {
if (!(location instanceof UsageViewTypeLocation)) return null;
if (psiElement instanceof PsiMetaOwner) {
final PsiMetaData metaData = ((PsiMetaOwner)psiElement).getMetaData();
if (metaData instanceof PsiPresentableMetaData) {
return ((PsiPresentableMetaData)metaData).getTypeName();
}
}
if (psiElement instanceof PsiFile) {
return LangBundle.message("terms.file");
}
if (psiElement instanceof PsiDirectory) {
return LangBundle.message("terms.directory");
}
final Language lang = psiElement.getLanguage();
FindUsagesProvider provider = LanguageFindUsages.INSTANCE.forLanguage(lang);
final String type = provider.getType(psiElement);
if (StringUtil.isNotEmpty(type)) {
return type;
}
return TypePresentationService.getInstance().getTypePresentableName(psiElement.getClass());
}
开发者ID:consulo,项目名称:consulo,代码行数:28,代码来源:UsageViewTypeLocation.java
示例17: canFindUsages
import com.intellij.lang.findUsages.LanguageFindUsages; //导入依赖的package包/类
@Override
public boolean canFindUsages(@Nonnull final PsiElement element) {
if (element instanceof PsiFileSystemItem) {
if (((PsiFileSystemItem)element).getVirtualFile() == null) return false;
}
else if (!LanguageFindUsages.INSTANCE.forLanguage(element.getLanguage()).canFindUsagesFor(element)) {
return false;
}
return element.isValid();
}
开发者ID:consulo,项目名称:consulo,代码行数:11,代码来源:DefaultFindUsagesHandlerFactory.java
示例18: buildProblemWithStaticDescription
import com.intellij.lang.findUsages.LanguageFindUsages; //导入依赖的package包/类
@NotNull
static String buildProblemWithStaticDescription(@NotNull PsiElement refElement)
{
String type = LanguageFindUsages.INSTANCE.forLanguage(JavaLanguage.INSTANCE).getType(refElement);
String name = HighlightMessageUtil.getSymbolName(refElement, PsiSubstitutor.EMPTY);
return JavaErrorMessages.message("non.static.symbol.referenced.from.static.context", type, name);
}
开发者ID:consulo,项目名称:consulo-java,代码行数:8,代码来源:HighlightUtil.java
示例19: formatType
import com.intellij.lang.findUsages.LanguageFindUsages; //导入依赖的package包/类
private static String formatType(@NotNull PsiVariable variable)
{
FindUsagesProvider provider = LanguageFindUsages.INSTANCE.forLanguage(variable.getLanguage());
final String type = provider.getType(variable);
if(StringUtil.isNotEmpty(type))
{
return type;
}
return TypePresentationService.getInstance().getTypePresentableName(variable.getClass());
}
开发者ID:consulo,项目名称:consulo-java,代码行数:12,代码来源:VariableArrayTypeFix.java
示例20: calcText
import com.intellij.lang.findUsages.LanguageFindUsages; //导入依赖的package包/类
public static String calcText(PsiModifierListOwner modifierListOwner, @NotNull String annotation)
{
final String shortName = annotation.substring(annotation.lastIndexOf('.') + 1);
if(modifierListOwner instanceof PsiNamedElement)
{
final String name = ((PsiNamedElement) modifierListOwner).getName();
if(name != null)
{
FindUsagesProvider provider = LanguageFindUsages.INSTANCE.forLanguage(modifierListOwner.getLanguage());
return CodeInsightBundle.message("inspection.i18n.quickfix.annotate.element.as", provider.getType(modifierListOwner), name, shortName);
}
}
return CodeInsightBundle.message("inspection.i18n.quickfix.annotate.as", shortName);
}
开发者ID:consulo,项目名称:consulo-java,代码行数:15,代码来源:AddAnnotationPsiFix.java
注:本文中的com.intellij.lang.findUsages.LanguageFindUsages类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论