当前位置: 首页>>代码示例>>Java>>正文


Java PsiBundle类代码示例

本文整理汇总了Java中com.intellij.psi.PsiBundle的典型用法代码示例。如果您正苦于以下问题:Java PsiBundle类的具体用法?Java PsiBundle怎么用?Java PsiBundle使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PsiBundle类属于com.intellij.psi包,在下文中一共展示了PsiBundle类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildLibrariesScope

import com.intellij.psi.PsiBundle; //导入依赖的package包/类
@NotNull
@Override
public GlobalSearchScope buildLibrariesScope() {
  ProjectAndLibrariesScope result = new ProjectAndLibrariesScope(myProject) {
    @Override
    public boolean contains(@NotNull VirtualFile file) {
      return myProjectFileIndex.isInLibrarySource(file) || myProjectFileIndex.isInLibraryClasses(file);
    }

    @Override
    public boolean isSearchInModuleContent(@NotNull Module aModule) {
      return false;
    }
  };
  result.setDisplayName(PsiBundle.message("psi.search.scope.libraries"));
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:ProjectScopeBuilderImpl.java

示例2: checkWritable

import com.intellij.psi.PsiBundle; //导入依赖的package包/类
public static void checkWritable(@NotNull final PsiElement element) throws IncorrectOperationException {
  if (!element.isWritable()) {
    if (element instanceof PsiDirectory) {
      throw new IncorrectOperationException(
        PsiBundle.message("cannot.modify.a.read.only.directory", ((PsiDirectory)element).getVirtualFile().getPresentableUrl()));
    }
    else {
      PsiFile file = element.getContainingFile();
      if (file == null) {
        throw new IncorrectOperationException();
      }
      final VirtualFile virtualFile = file.getVirtualFile();
      if (virtualFile == null) {
        throw new IncorrectOperationException();
      }
      throw new IncorrectOperationException(PsiBundle.message("cannot.modify.a.read.only.file", virtualFile.getPresentableUrl()));
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:CheckUtil.java

示例3: execute

import com.intellij.psi.PsiBundle; //导入依赖的package包/类
@Override
public boolean execute(@NotNull final SearchParameters parameters, @NotNull final Processor<DotNetTypeDeclaration> consumer)
{
	final String baseVmQName = parameters.getVmQName();
	final SearchScope searchScope = parameters.getScope();

	TypeInheritorsSearch.LOGGER.assertTrue(searchScope != null);

	ProgressIndicator progress = ProgressIndicatorProvider.getGlobalProgressIndicator();
	if(progress != null)
	{
		progress.pushState();
		progress.setText(PsiBundle.message("psi.search.inheritors.of.class.progress", baseVmQName));
	}

	boolean result = processInheritors(consumer, baseVmQName, searchScope, parameters);

	if(progress != null)
	{
		progress.popState();
	}

	return result;
}
 
开发者ID:consulo,项目名称:consulo-dotnet,代码行数:25,代码来源:TypeInheritorsSearch.java

示例4: checkWritable

import com.intellij.psi.PsiBundle; //导入依赖的package包/类
public static void checkWritable(@Nonnull final PsiElement element) throws IncorrectOperationException {
  if (!element.isWritable()) {
    if (element instanceof PsiDirectory) {
      throw new IncorrectOperationException(
        PsiBundle.message("cannot.modify.a.read.only.directory", ((PsiDirectory)element).getVirtualFile().getPresentableUrl()));
    }
    else {
      PsiFile file = element.getContainingFile();
      if (file == null) {
        throw new IncorrectOperationException();
      }
      final VirtualFile virtualFile = file.getVirtualFile();
      if (virtualFile == null) {
        throw new IncorrectOperationException();
      }
      throw new IncorrectOperationException(PsiBundle.message("cannot.modify.a.read.only.file", virtualFile.getPresentableUrl()));
    }
  }
}
 
开发者ID:consulo,项目名称:consulo,代码行数:20,代码来源:CheckUtil.java

示例5: getErrorDescription

import com.intellij.psi.PsiBundle; //导入依赖的package包/类
@NotNull
public static String getErrorDescription(@NotNull PsiReference reference)
{
	String message;
	if(reference instanceof EmptyResolveMessageProvider)
	{
		message = ((EmptyResolveMessageProvider) reference).getUnresolvedMessagePattern();
	}
	else
	{
		//noinspection UnresolvedPropertyKey
		message = PsiBundle.message("cannot.resolve.symbol");
	}

	String description;
	try
	{
		description = BundleBase.format(message, reference.getCanonicalText()); // avoid double formatting
	}
	catch(IllegalArgumentException ex)
	{
		// unresolvedMessage provided by third-party reference contains wrong format string (e.g. {}), tolerate it
		description = message;
	}
	return description;
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:27,代码来源:XmlHighlightVisitor.java

示例6: getJavaSymbolContainerText

import com.intellij.psi.PsiBundle; //导入依赖的package包/类
@Nullable
private static String getJavaSymbolContainerText(final PsiElement element) {
  final String result;
  PsiElement container = PsiTreeUtil.getParentOfType(element, PsiMember.class, PsiFile.class);

  if (container instanceof PsiClass) {
    String qName = ((PsiClass)container).getQualifiedName();
    if (qName != null) {
      result = qName;
    }
    else {
      result = ((PsiClass)container).getName();
    }
  }
  else if (container instanceof PsiJavaFile) {
    result = ((PsiJavaFile)container).getPackageName();
  }
  else {//TODO: local classes
    result = null;
  }
  if (result != null) {
    return PsiBundle.message("aux.context.display", result);
  }
  return null;
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:26,代码来源:JavaPresentationUtil.java

示例7: getOptionsTemplate

import com.intellij.psi.PsiBundle; //导入依赖的package包/类
@NotNull
public TaskOptions getOptionsTemplate() {

    TaskOptions options = new TaskOptions();
    options.setName(LiveScriptFileType.LIVE_SCRIPT_LANGUAGE.getDisplayName());
    options.setDescription("Compiles .ls files into .js files");
    options.setFileExtension("ls");
    options.setScopeName(PsiBundle.message("psi.search.scope.project", new Object[0]));

    options.setWorkingDir("$" + new FileDirMacro().getName() + "$");

    options.setArguments("--compile $" + new FileNameMacro().getName() + "$");
    options.setOutput("$" + new FileNameWithoutExtension().getName() + "$.js");

    return options;

}
 
开发者ID:racklin,项目名称:livescript-idea,代码行数:18,代码来源:LiveScriptTaskConsumer.java

示例8: getDisplayName

import com.intellij.psi.PsiBundle; //导入依赖的package包/类
@NotNull
@Override
public String getDisplayName() {
  if (myDisplayName == null) {
    return PsiBundle.message("psi.search.scope.intersection", myScope1.getDisplayName(), myScope2.getDisplayName());
  }
  return myDisplayName;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:GlobalSearchScope.java

示例9: getDisplayName

import com.intellij.psi.PsiBundle; //导入依赖的package包/类
@Override
public String getDisplayName() {
  if (myDisplayName == null) {
    return PsiBundle.message("psi.search.scope.intersection", myScope1.getDisplayName(), myScope2.getDisplayName());
  }
  return myDisplayName;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:8,代码来源:GlobalSearchScope.java

示例10: save

import com.intellij.psi.PsiBundle; //导入依赖的package包/类
public void save(File dir) throws WriteExternalException{
  Element newElement = new Element(CODE_SCHEME);
  newElement.setAttribute(NAME, getName());
  (this).writeExternal(newElement);

  String filePath = dir.getAbsolutePath() + File.separator + getName() + XML_EXTENSION;
  try {
    JDOMUtil.writeDocument(new Document(newElement), filePath, getCodeStyleSettings().getLineSeparator());
  }
  catch (IOException e) {
    Messages.showErrorDialog(PsiBundle.message("codestyle.cannot.save.scheme.file", filePath, e.getLocalizedMessage()), CommonBundle.getErrorTitle());
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:CodeStyleSchemeImpl.java

示例11: getDir

import com.intellij.psi.PsiBundle; //导入依赖的package包/类
@Nullable
private static File getDir(boolean create) {
  String directoryPath = PathManager.getConfigPath() + File.separator + CODESTYLES_DIRECTORY;
  File directory = new File(directoryPath);
  if (!directory.exists()) {
    if (!create) return null;
    if (!directory.mkdir()) {
      Messages.showErrorDialog(PsiBundle.message("codestyle.cannot.save.settings.directory.cant.be.created.message", directoryPath),
                               PsiBundle.message("codestyle.cannot.save.settings.directory.cant.be.created.title"));
      return null;
    }
  }
  return directory;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:15,代码来源:PersistableCodeStyleSchemes.java

示例12: getDisplayName

import com.intellij.psi.PsiBundle; //导入依赖的package包/类
@Nonnull
@Override
public String getDisplayName() {
  if (myDisplayName == null) {
    return PsiBundle.message("psi.search.scope.intersection", myScope1.getDisplayName(), myScope2.getDisplayName());
  }
  return myDisplayName;
}
 
开发者ID:consulo,项目名称:consulo,代码行数:9,代码来源:GlobalSearchScope.java

示例13: processQuery

import com.intellij.psi.PsiBundle; //导入依赖的package包/类
@Override
public void processQuery(@NotNull ClassInheritorsSearch.SearchParameters parameters, @NotNull Processor<PsiClass> consumer)
{
	final PsiClass baseClass = parameters.getClassToProcess();
	final SearchScope searchScope = parameters.getScope();

	LOG.assertTrue(searchScope != null);

	ProgressIndicator progress = ProgressIndicatorProvider.getGlobalProgressIndicator();
	if(progress != null)
	{
		progress.pushState();
		String className = ApplicationManager.getApplication().runReadAction(new Computable<String>()
		{
			@Override
			public String compute()
			{
				return baseClass.getName();
			}
		});
		progress.setText(className != null ? PsiBundle.message("psi.search.inheritors.of.class.progress", className) : PsiBundle.message("psi.search.inheritors.progress"));
	}

	processInheritors(consumer, baseClass, searchScope, parameters);

	if(progress != null)
	{
		progress.popState();
	}
}
 
开发者ID:consulo,项目名称:consulo-java,代码行数:31,代码来源:JavaClassInheritorsSearcher.java

示例14: getDisplayName

import com.intellij.psi.PsiBundle; //导入依赖的package包/类
@NotNull
@Override
public String getDisplayName() {
  return PsiBundle.message("psi.search.scope.production.files");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:GlobalSearchScopesCore.java

示例15: getDisplayName

import com.intellij.psi.PsiBundle; //导入依赖的package包/类
@NotNull
public String getDisplayName() {
  return PsiBundle.message("search.scope.unknown");
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:SearchScope.java


注:本文中的com.intellij.psi.PsiBundle类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。