本文整理汇总了Java中com.intellij.psi.PsiBundle.message方法的典型用法代码示例。如果您正苦于以下问题:Java PsiBundle.message方法的具体用法?Java PsiBundle.message怎么用?Java PsiBundle.message使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.psi.PsiBundle
的用法示例。
在下文中一共展示了PsiBundle.message方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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()));
}
}
}
示例2: 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()));
}
}
}
示例3: 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;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例7: 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;
}
示例8: getDisplayName
import com.intellij.psi.PsiBundle; //导入方法依赖的package包/类
@NotNull
@Override
public String getDisplayName() {
return PsiBundle.message("psi.search.scope.production.files");
}
示例9: getDisplayName
import com.intellij.psi.PsiBundle; //导入方法依赖的package包/类
@NotNull
public String getDisplayName() {
return PsiBundle.message("search.scope.unknown");
}
示例10: getDisplayName
import com.intellij.psi.PsiBundle; //导入方法依赖的package包/类
@NotNull
@Override
public String getDisplayName() {
return hasOption(COMPILE) ? PsiBundle.message("search.scope.module", myModule.getName())
: PsiBundle.message("search.scope.module.runtime", myModule.getName());
}
示例11: getDisplayName
import com.intellij.psi.PsiBundle; //导入方法依赖的package包/类
@NotNull
@Override
public String getDisplayName() {
return PsiBundle.message("psi.search.scope.project");
}
示例12: getExpectedText
import com.intellij.psi.PsiBundle; //导入方法依赖的package包/类
public String getExpectedText(final PrattBuilder builder) {
return PsiBundle.message("0.expected", toString());
}
示例13: getDisplayName
import com.intellij.psi.PsiBundle; //导入方法依赖的package包/类
@Override
public String getDisplayName() {
return PsiBundle.message("psi.search.scope.production.files");
}
示例14: getDisplayName
import com.intellij.psi.PsiBundle; //导入方法依赖的package包/类
public String getDisplayName() {
return PsiBundle.message("search.scope.unknown");
}
示例15: getDisplayName
import com.intellij.psi.PsiBundle; //导入方法依赖的package包/类
@Override
public String getDisplayName() {
return hasOption(COMPILE) ? PsiBundle.message("search.scope.module", myModule.getName())
: PsiBundle.message("search.scope.module.runtime", myModule.getName());
}