• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java GenericDomValue类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getReferenceCanonicalText

import com.intellij.util.xml.GenericDomValue; //导入依赖的package包/类
public static String getReferenceCanonicalText(final String name, @Nullable final AbstractMethodParams methodParams) {
  StringBuilder sb = new StringBuilder(name);
  if (methodParams == null) {
    sb.append("()");
  }
  else if (methodParams.getXmlTag() != null) {
    sb.append("(");
    final List<GenericDomValue<PsiType>> list = methodParams.getMethodParams();
    boolean first = true;
    for (GenericDomValue<PsiType> value : list) {
      if (first) first = false;
      else sb.append(", ");
      sb.append(value.getStringValue());
    }
    sb.append(")");
  }
  return sb.toString();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:AbstractMethodResolveConverter.java


示例2: checkDomElement

import com.intellij.util.xml.GenericDomValue; //导入依赖的package包/类
/**
 * The default implementations checks for resolve problems (if {@link #shouldCheckResolveProblems(com.intellij.util.xml.GenericDomValue)}
 * returns true), then runs annotators (see {@link com.intellij.util.xml.DomFileDescription#createAnnotator()}),
 * checks for {@link com.intellij.util.xml.Required} and {@link com.intellij.util.xml.ExtendClass} annotation
 * problems, checks for name identity (see {@link com.intellij.util.xml.NameValue} annotation) and custom annotation
 * checkers (see {@link com.intellij.util.xml.highlighting.DomCustomAnnotationChecker}).
 *
 * @param element element to check
 * @param holder  a place to add problems to
 * @param helper  helper object
 */
@Override
protected void checkDomElement(DomElement element, DomElementAnnotationHolder holder, DomHighlightingHelper helper) {
  final int oldSize = holder.getSize();
  if (element instanceof GenericDomValue) {
    final GenericDomValue genericDomValue = (GenericDomValue) element;
    if (shouldCheckResolveProblems(genericDomValue)) {
      helper.checkResolveProblems(genericDomValue, holder);
    }
  }
  for (final Class<? extends T> aClass : getDomClasses()) {
    helper.runAnnotators(element, holder, aClass);
  }
  if (oldSize != holder.getSize()) return;

  if (!helper.checkRequired(element, holder).isEmpty()) return;
  if (!(element instanceof GenericAttributeValue) && !GenericDomValue.class.equals(ReflectionUtil.getRawType(element.getDomElementType()))) {
    if (!helper.checkNameIdentity(element, holder).isEmpty()) return;
  }

  helper.checkCustomAnnotations(element, holder);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:33,代码来源:BasicDomElementsInspection.java


示例3: createReferences

import com.intellij.util.xml.GenericDomValue; //导入依赖的package包/类
@NotNull
@Override
public PsiReference[] createReferences(GenericDomValue value, final PsiElement element, final ConvertContext context) {
  return new PsiReference[]{new WebReference(element) {
    @NotNull
    @Override
    public Object[] getVariants() {
      Module module = context.getModule();

      if (module != null) {
        String name = MavenRepositoriesProvider.getInstance().getRepositoryUrl(getRepositoryId(context));
        if (!StringUtil.isEmptyOrSpaces(name)) return new Object[]{name};
      }
      return super.getVariants();
    }
  }};
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:MavenRepositoryConverter.java


示例4: getConverter

import com.intellij.util.xml.GenericDomValue; //导入依赖的package包/类
@Override
public Converter getConverter(@NotNull GenericDomValue element) {
  StyleItem item = (StyleItem)element;
  String name = item.getName().getValue();
  if (name != null) {
    String[] strs = name.split(":");
    if (strs.length == 1 || strs.length == 2) {
      AndroidFacet facet = AndroidFacet.getInstance(element);
      if (facet != null) {
        String namespacePrefix = strs.length == 2 ? strs[0] : null;
        String localName = strs[strs.length - 1];
        return findConverterForAttribute(namespacePrefix, localName, facet, element);
      }
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:StyleItemConverter.java


示例5: registerConverter

import com.intellij.util.xml.GenericDomValue; //导入依赖的package包/类
public void registerConverter(@NotNull Converter<?> provider, @NotNull Class type) {
  final String name = type.getCanonicalName();
  registerConverter(provider, new Condition<Pair<PsiType, GenericDomValue>>() {
    public boolean value(final Pair<PsiType, GenericDomValue> pair) {
      return pair.first != null && Comparing.equal(name, pair.first.getCanonicalText());
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:9,代码来源:GenericDomValueConvertersRegistry.java


示例6: createDomTarget

import com.intellij.util.xml.GenericDomValue; //导入依赖的package包/类
protected DomTarget createDomTarget(DomElement parent, DomElement nameElement) {
  if (parent instanceof AntDomElement && nameElement.equals(((AntDomElement)parent).getId())) { // id attrib is defined
    return DomTarget.getTarget(parent, (GenericDomValue)nameElement);
  }
  if (parent instanceof AntDomProperty && nameElement.equals(((AntDomProperty)parent).getEnvironment())) { // environment attrib is defined
    return DomTarget.getTarget(parent, (GenericDomValue)nameElement);
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:AntDomDeclarationSearcher.java


示例7: GenericDomValuePattern

import com.intellij.util.xml.GenericDomValue; //导入依赖的package包/类
protected GenericDomValuePattern(final Class<T> aClass) {
  super(new InitialPatternCondition(aClass) {
    @Override
    public boolean accepts(@Nullable final Object o, final ProcessingContext context) {
      return o instanceof GenericDomValue && aClass.equals(DomUtil.getGenericValueParameter(((GenericDomValue)o).getDomElementType()));
    }

  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:GenericDomValuePattern.java


示例8: createGenericValueControl

import com.intellij.util.xml.GenericDomValue; //导入依赖的package包/类
@NotNull
private static BaseControl createGenericValueControl(final Type type, final GenericDomValue<?> element, boolean commitOnEveryChange) {
  final DomStringWrapper stringWrapper = new DomStringWrapper(element);
  final Class rawType = ReflectionUtil.getRawType(type);
  if (type instanceof Class && Enum.class.isAssignableFrom(rawType)) {
    return new ComboControl(stringWrapper, rawType);
  }
  if (DomElement.class.isAssignableFrom(rawType)) {
    final ComboControl control = new ComboControl(element);
    final Required annotation = element.getAnnotation(Required.class);
    if (annotation == null || !annotation.value() || !annotation.nonEmpty()) {
      control.setNullable(true);
    }
    return control;
  }

  final DomFixedWrapper wrapper = new DomFixedWrapper(element);
  if (type.equals(boolean.class) || type.equals(Boolean.class)) {
    return new BooleanControl(wrapper);
  }
  if (type.equals(String.class)) {
    return getDomUIFactory().createTextControl(wrapper, commitOnEveryChange);
  }

  final BaseControl customControl = getDomUIFactory().createCustomControl(type, stringWrapper, commitOnEveryChange);
  if (customControl != null) return customControl;

  return getDomUIFactory().createTextControl(stringWrapper, commitOnEveryChange);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:DomUIFactory.java


示例9: getConverters

import com.intellij.util.xml.GenericDomValue; //导入依赖的package包/类
@NotNull public List<Converter> getConverters(@NotNull GenericDomValue domElement) {
  final String raw = domElement.getRawText();
  if (raw != null) {
    if (raw.contains("${") || raw.contains(File.separator) || (File.separatorChar != '/' && raw.contains("/"))) {
      return Collections.<Converter>singletonList(new AntPathConverter());
    }
  }
  return Collections.emptyList();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:AntDomPropertyValueConverter.java


示例10: getNameElement

import com.intellij.util.xml.GenericDomValue; //导入依赖的package包/类
@Override
@Nullable
protected GenericDomValue getNameElement(final RngDefine element) {
  final GenericAttributeValue<String> id = element.getNameAttr();
  if (id.getXmlElement() != null) {
    return id;
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:RngDefineMetaData.java


示例11: createReferences

import com.intellij.util.xml.GenericDomValue; //导入依赖的package包/类
@NotNull
@Override
public PsiReference[] createReferences(GenericDomValue<ResourceValue> value, PsiElement element, ConvertContext context) {
  if (element instanceof XmlAttributeValue) {
    // parent="" is allowed; it's used to deliberately allow style A.B.C to not be a child of A.B
    XmlAttributeValue attributeValue = (XmlAttributeValue)element;
    if (attributeValue.isValid() && attributeValue.getValue().isEmpty()) {
      return PsiReference.EMPTY_ARRAY;
    }
  }

  final PsiReference[] refsFromSuper = super.createReferences(value, element, context);

  final ResourceValue resValue = value.getValue();

  if (resValue == null || resValue.getPackage() != null) {
    return refsFromSuper;
  }
  final AndroidFacet facet = AndroidFacet.getInstance(context);

  if (facet != null) {
    final PsiReference[] refs = getReferencesInStyleName(value, facet);

    if (refs.length > 0) {
      return ArrayUtil.mergeArrays(refsFromSuper, refs);
    }
  }
  return refsFromSuper;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:30,代码来源:ParentStyleConverter.java


示例12: isElementInsideManagedFile

import com.intellij.util.xml.GenericDomValue; //导入依赖的package包/类
private static boolean isElementInsideManagedFile(GenericDomValue value) {
  VirtualFile virtualFile = DomUtil.getFile(value).getVirtualFile();
  if (virtualFile == null) {
    return false;
  }

  MavenProjectsManager projectsManager = MavenProjectsManager.getInstance(value.getManager().getProject());

  return projectsManager.findProject(virtualFile) != null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:11,代码来源:MavenModelInspection.java


示例13: createReferences

import com.intellij.util.xml.GenericDomValue; //导入依赖的package包/类
@NotNull
@Override
public PsiReference[] createReferences(GenericDomValue<String> value, PsiElement element, ConvertContext context) {
  final int length = element.getTextLength();
  if (length > 1) {
    return new PsiReference[]{new MyReference((XmlAttributeValue)element, new TextRange(1, length - 1))};
  }
  return PsiReference.EMPTY_ARRAY;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:OnClickConverter.java


示例14: createReferences

import com.intellij.util.xml.GenericDomValue; //导入依赖的package包/类
@NotNull
@Override
public PsiReference[] createReferences(GenericDomValue value, PsiElement element, ConvertContext context) {
  if (isClassContext(context)) {
    return myPsiClassConverter.createReferences(value, element, context);
  }

  return myResourceReferenceConverter.createReferences(value, element, context);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:MetadataValueConverter.java


示例15: getReferenceVariants

import com.intellij.util.xml.GenericDomValue; //导入依赖的package包/类
@Override
protected Object[] getReferenceVariants(final ConvertContext context, final GenericDomValue<List<AttributeFormat>> value) {
  List<AttributeFormat> variants = new ArrayList<AttributeFormat>();
  Collections.addAll(variants, AttributeFormat.values());
  filterVariants(variants, value);
  String[] stringVariants = new String[variants.size()];
  for (int i = 0, variantsSize = variants.size(); i < variantsSize; i++) {
    stringVariants[i] = StringUtil.decapitalize(variants.get(i).name());
  }
  return stringVariants;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:FormatConverter.java


示例16: createReferences

import com.intellij.util.xml.GenericDomValue; //导入依赖的package包/类
@NotNull
public PsiReference[] createReferences(GenericDomValue<TargetResolver.Result> value, PsiElement element, ConvertContext context) {
  final XmlElement xmlElement = value.getXmlElement();
  if (!(xmlElement instanceof XmlAttribute)) {
    return PsiReference.EMPTY_ARRAY;
  }
  final XmlAttributeValue valueElement = ((XmlAttribute)xmlElement).getValueElement();
  if (valueElement == null) {
    return PsiReference.EMPTY_ARRAY;
  }
  final String refsString = value.getStringValue();
  if (refsString == null) {
    return PsiReference.EMPTY_ARRAY;
  }
  final List<PsiReference> refs = new ArrayList<PsiReference>();
  final AntDomTargetReference.ReferenceGroup group = new AntDomTargetReference.ReferenceGroup();
  final TextRange wholeStringRange = ElementManipulators.getValueTextRange(valueElement);
  final StringTokenizer tokenizer = new StringTokenizer(refsString, ",", false);
  while (tokenizer.hasMoreTokens()) {
    final String token = tokenizer.nextToken();
    int tokenStartOffset = tokenizer.getCurrentPosition() - token.length();
    final String ref = token.trim();
    if (ref.length() != token.length()) {
      for (int idx = 0; idx < token.length(); idx++) {
        if (Character.isWhitespace(token.charAt(idx))) {
          tokenStartOffset++;
        }
        else {
          break;
        }
      }
    }
    refs.add(new AntDomTargetReference(element, TextRange.from(wholeStringRange.getStartOffset() + tokenStartOffset, ref.length()), group));
  }
  return refs.toArray(new PsiReference[refs.size()]);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:37,代码来源:AntDomTargetDependsListConverter.java


示例17: createClassReferenceProvider

import com.intellij.util.xml.GenericDomValue; //导入依赖的package包/类
@Override
protected JavaClassReferenceProvider createClassReferenceProvider(GenericDomValue<PsiClass> genericDomValue,
                                                                  ConvertContext context,
                                                                  ExtendClass extendClass) {
  final JavaClassReferenceProvider provider = super.createClassReferenceProvider(genericDomValue, context, extendClass);
  provider.setOption(JavaClassReferenceProvider.JVM_FORMAT, Boolean.TRUE);
  provider.setOption(JavaClassReferenceProvider.ALLOW_DOLLAR_NAMES, Boolean.TRUE);
  return provider;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:PluginPsiClassConverter.java


示例18: getPluginResourceBundles

import com.intellij.util.xml.GenericDomValue; //导入依赖的package包/类
private static List<String> getPluginResourceBundles(PsiElement element) {
  final DomElement domElement = DomUtil.getDomElement(element);
  if (domElement == null) return Collections.emptyList();
  final DomElement rootElement = DomUtil.getFileElement(domElement).getRootElement();
  if (!(rootElement instanceof IdeaPlugin)) return Collections.emptyList();

  IdeaPlugin plugin = (IdeaPlugin)rootElement;
  return ContainerUtil.map(plugin.getResourceBundles(), new Function<GenericDomValue<String>, String>() {
    @Override
    public String fun(GenericDomValue<String> value) {
      return value.getStringValue();
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:15,代码来源:PropertyKeyReferenceProvider.java


示例19: getLayout

import com.intellij.util.xml.GenericDomValue; //导入依赖的package包/类
@NotNull
@Required(value = false, nonEmpty = true)
@Convert(MavenRepositoryLayoutConverter.class)
GenericDomValue<String> getLayout();
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:MavenDomRepositoryBase.java


示例20: getUrl

import com.intellij.util.xml.GenericDomValue; //导入依赖的package包/类
@NotNull
@Convert(MavenRepositoryConverter.Url.class)
GenericDomValue<String> getUrl();
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:MavenDomRepositoryBase.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ProbeName类代码示例发布时间:2022-05-22
下一篇:
Java EnumerationUtils类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap