Java 类com.intellij.util.xml.DomBundle 实例源码

项目:intellij-ce-playground    文件:RemoveDomElementQuickFix.java   
@Override
@NotNull
public String getName() {
  return myIsTag ?
         DomBundle.message("remove.element.fix.name", myName) :
         DomBundle.message("remove.attribute.fix.name", myName);
}
项目:intellij-ce-playground    文件:NumberValueConverter.java   
@Override
public String getErrorMessage(@Nullable final String s, final ConvertContext context) {
  if (s == null) return super.getErrorMessage(s, context);

  return  s.trim().length() == 0 ?
        DomBundle.message("value.converter.format.exception.empty.string", myNumberClass.getName()) :
        DomBundle.message("value.converter.format.exception", s, myNumberClass.getName());
}
项目:tools-idea    文件:NumberValueConverter.java   
public String getErrorMessage(@Nullable final String s, final ConvertContext context) {
  if (s == null) return super.getErrorMessage(s, context);

  return  s.trim().length() == 0 ?
        DomBundle.message("value.converter.format.exception.empty.string", myNumberClass.getName()) :
        DomBundle.message("value.converter.format.exception", s, myNumberClass.getName());
}
项目:consulo-xml    文件:NumberValueConverter.java   
public String getErrorMessage(@Nullable final String s, final ConvertContext context) {
  if (s == null) return super.getErrorMessage(s, context);

  return  s.trim().length() == 0 ?
        DomBundle.message("value.converter.format.exception.empty.string", myNumberClass.getName()) :
        DomBundle.message("value.converter.format.exception", s, myNumberClass.getName());
}
项目:intellij-ce-playground    文件:AddDomElementQuickFix.java   
private String computeName() {
  final String name = myElement.getXmlElementName();
  return isTag() ?
         DomBundle.message("add.element.fix.name", name) :
         DomBundle.message("add.attribute.fix.name", name);
}
项目:intellij-ce-playground    文件:AddDomElementQuickFix.java   
@Override
@NotNull
public String getFamilyName() {
  return DomBundle.message("quick.fixes.family");
}
项目:intellij-ce-playground    文件:RemoveDomElementQuickFix.java   
@Override
@NotNull
public String getFamilyName() {
  return DomBundle.message("quick.fixes.family");
}
项目:intellij-ce-playground    文件:CharacterValueConverter.java   
@Override
public String getErrorMessage(@Nullable final String s, final ConvertContext context) {
 return DomBundle.message("value.converter.format.exception", s, "char");
}
项目:intellij-ce-playground    文件:BooleanValueConverter.java   
@Override
public String getErrorMessage(@Nullable final String s, final ConvertContext context) {
  return DomBundle.message("value.converter.format.exception", s, BOOLEAN);
}
项目:tools-idea    文件:AddDomElementQuickFix.java   
private String computeName() {
  final String name = myElement.getXmlElementName();
  return isTag() ?
         DomBundle.message("add.element.fix.name", name) :
         DomBundle.message("add.attribute.fix.name", name);
}
项目:tools-idea    文件:AddDomElementQuickFix.java   
@NotNull
public String getFamilyName() {
  return DomBundle.message("quick.fixes.family");
}
项目:tools-idea    文件:RemoveDomElementQuickFix.java   
@NotNull
public String getName() {
  return myIsTag ?
         DomBundle.message("remove.element.fix.name", myName) :
         DomBundle.message("remove.attribute.fix.name", myName);
}
项目:tools-idea    文件:RemoveDomElementQuickFix.java   
@NotNull
public String getFamilyName() {
  return DomBundle.message("quick.fixes.family");
}
项目:tools-idea    文件:CharacterValueConverter.java   
public String getErrorMessage(@Nullable final String s, final ConvertContext context) {
 return DomBundle.message("value.converter.format.exception", s, "char");
}
项目:tools-idea    文件:BooleanValueConverter.java   
public String getErrorMessage(@Nullable final String s, final ConvertContext context) {
  return DomBundle.message("value.converter.format.exception", s, BOOLEAN);
}
项目:consulo-xml    文件:AddDomElementQuickFix.java   
private String computeName() {
  final String name = myElement.getXmlElementName();
  return isTag() ?
         DomBundle.message("add.element.fix.name", name) :
         DomBundle.message("add.attribute.fix.name", name);
}
项目:consulo-xml    文件:AddDomElementQuickFix.java   
@NotNull
public String getFamilyName() {
  return DomBundle.message("quick.fixes.family");
}
项目:consulo-xml    文件:ResolvingElementQuickFix.java   
@NotNull
public String getName() {
  return DomBundle.message("create.new.element", myTypeName, myNewName);
}
项目:consulo-xml    文件:ResolvingElementQuickFix.java   
@NotNull
public String getFamilyName() {
  return DomBundle.message("quick.fixes.family");
}
项目:consulo-xml    文件:RemoveDomElementQuickFix.java   
@NotNull
public String getName() {
  return myIsTag ?
         DomBundle.message("remove.element.fix.name", myName) :
         DomBundle.message("remove.attribute.fix.name", myName);
}
项目:consulo-xml    文件:RemoveDomElementQuickFix.java   
@NotNull
public String getFamilyName() {
  return DomBundle.message("quick.fixes.family");
}
项目:consulo-xml    文件:CharacterValueConverter.java   
public String getErrorMessage(@Nullable final String s, final ConvertContext context) {
 return DomBundle.message("value.converter.format.exception", s, "char");
}
项目:consulo-xml    文件:BooleanValueConverter.java   
public String getErrorMessage(@Nullable final String s, final ConvertContext context) {
  return DomBundle.message("value.converter.format.exception", s, BOOLEAN);
}
项目:consulo-java    文件:ExtendsClassChecker.java   
@NotNull
public static List<DomElementProblemDescriptor> checkExtendClass(final GenericDomValue element, final PsiClass value, final String name,
                                                                 final boolean instantiatable, final boolean canBeDecorator, final boolean allowInterface,
                                                                 final boolean allowNonPublic,
                                                                 final boolean allowAbstract,
                                                                 final boolean allowEnum,
                                                                 final DomElementAnnotationHolder holder) {
  final Project project = element.getManager().getProject();
  PsiClass extendClass = JavaPsiFacade.getInstance(project).findClass(name, GlobalSearchScope.allScope(project));
  final SmartList<DomElementProblemDescriptor> list = new SmartList<DomElementProblemDescriptor>();
  if (extendClass != null) {
    if (!name.equals(value.getQualifiedName()) && !value.isInheritor(extendClass, true)) {
      String message = DomBundle.message("class.is.not.a.subclass", value.getQualifiedName(), extendClass.getQualifiedName());
      list.add(holder.createProblem(element, message));
    }
  }

  if (instantiatable) {
    if (value.hasModifierProperty(PsiModifier.ABSTRACT)) {
      list.add(holder.createProblem(element, DomBundle.message("class.is.not.concrete", value.getQualifiedName())));
    }
    else if (!allowNonPublic && !value.hasModifierProperty(PsiModifier.PUBLIC)) {
      list.add(holder.createProblem(element, DomBundle.message("class.is.not.public", value.getQualifiedName())));
    }
    else if (!PsiUtil.hasDefaultConstructor(value, true)) {
      if (canBeDecorator) {
        boolean hasConstructor = false;

        for (PsiMethod method : value.getConstructors()) {
          final PsiParameterList psiParameterList = method.getParameterList();
          if (psiParameterList.getParametersCount() != 1) continue;
          PsiTypeElement typeElement = psiParameterList.getParameters()[0].getTypeElement();
          if (typeElement != null) {
            final PsiType psiType = typeElement.getType();
            if (psiType instanceof PsiClassType) {
              final PsiClass psiClass = ((PsiClassType)psiType).resolve();
              if (psiClass != null && InheritanceUtil.isInheritorOrSelf(psiClass, extendClass, true)) {
                hasConstructor = true;
                break;
              }
            }
          }
        }
        if (!hasConstructor) {
          list.add(holder.createProblem(element, DomBundle.message("class.decorator.or.has.default.constructor", value.getQualifiedName())));
        }
      }
      else {
        list.add(holder.createProblem(element, DomBundle.message("class.has.no.default.constructor", value.getQualifiedName())));
      }
    }
  }
  if (!allowInterface && value.isInterface()) {
    list.add(holder.createProblem(element, DomBundle.message("interface.not.allowed", value.getQualifiedName())));
  }
  if (!allowEnum && value.isEnum()) {
    list.add(holder.createProblem(element, DomBundle.message("enum.not.allowed", value.getQualifiedName())));
  }
  if (!allowAbstract && value.hasModifierProperty(PsiModifier.ABSTRACT) && !value.isInterface()) {
    list.add(holder.createProblem(element, DomBundle.message("abstract.class.not.allowed", value.getQualifiedName())));
  }
  return list;
}