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

Java XmlAttributeValueImpl类代码示例

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

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



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

示例1: isAvailable

import com.intellij.psi.impl.source.xml.XmlAttributeValueImpl; //导入依赖的package包/类
@Override
public boolean isAvailable(@NotNull Project project, Editor editor, @NotNull PsiElement element) {
    if (!element.isWritable()) return false;
    boolean isTwigFile = GravFileTemplateUtil.isTwigTemplateFile(element.getContainingFile()) || element.getContainingFile() instanceof HtmlFileImpl;
    boolean isXmlAttribute = false;
    if (!isTwigFile) return false;
    if (element.getParent() instanceof XmlAttributeValueImpl) {
        XmlAttributeValueImpl parent0 = ((XmlAttributeValueImpl) element.getParent());
        boolean hasTwigElement = PsiTreeUtil.findChildOfType(parent0, OuterLanguageElement.class) != null;
        if (!hasTwigElement && parent0.getParent() instanceof XmlAttributeImpl) {
            XmlAttributeImpl parent1 = (XmlAttributeImpl) parent0.getParent();
            if (parent1.getName().equalsIgnoreCase("href") || parent1.getName().equalsIgnoreCase("src"))
                isXmlAttribute = true;
        }
    }
    return isXmlAttribute;
}
 
开发者ID:PioBeat,项目名称:GravSupport,代码行数:18,代码来源:ConvertTwigResource.java


示例2: getLanguagesToInject

import com.intellij.psi.impl.source.xml.XmlAttributeValueImpl; //导入依赖的package包/类
public void getLanguagesToInject(@NotNull MultiHostRegistrar registrar, @NotNull PsiElement context) {
  final XmlAttribute attribute = (XmlAttribute)context;
  if (!XsltSupport.isXPathAttribute(attribute)) return;

  XmlAttributeValueImpl value = (XmlAttributeValueImpl)attribute.getValueElement();
  if (value == null) return;
  ASTNode type = value.findChildByType(XmlElementType.XML_ENTITY_REF);
  if (type != null) return; // workaround for inability to inject into text with entity refs (e.g. IDEA-72972) TODO: fix it

  final XsltChecker.LanguageLevel languageLevel = XsltSupport.getXsltLanguageLevel(attribute.getContainingFile());
  final TextRange[] ranges = getInjectionRanges(attribute, languageLevel);
  for (TextRange range : ranges) {
    // workaround for http://www.jetbrains.net/jira/browse/IDEA-10096
    TextRange rangeInsideHost;
    String prefix;
    if (range instanceof AVTRange) {
      if (((AVTRange)range).myComplete) {
        rangeInsideHost = range.shiftRight(2).grown(-2);
        prefix = "";
      }
      else {
        // we need to keep the "'}' expected" parse error
        rangeInsideHost = range.shiftRight(2).grown(-1);
        prefix = "{";
      }
    }
    else {
      rangeInsideHost = range;
      prefix = "";
    }
    if (value.getTextRange().contains(rangeInsideHost.shiftRight(value.getTextRange().getStartOffset()))) {
      registrar.startInjecting(languageLevel.getXPathVersion().getLanguage())
              .addPlace(prefix, "", value, rangeInsideHost)
              .doneInjecting();
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:38,代码来源:XPathLanguageInjector.java


示例3: isAsControllerRef

import com.intellij.psi.impl.source.xml.XmlAttributeValueImpl; //导入依赖的package包/类
public static boolean isAsControllerRef(PsiReference ref, PsiElement parent) {
    if (parent instanceof EmberJSAsExpression && ref == parent.getFirstChild()) {
        return true;
    }
    final InjectedLanguageManager injector = InjectedLanguageManager.getInstance(parent.getProject());
    final PsiLanguageInjectionHost host = injector.getInjectionHost(parent);
    final PsiElement hostParent = host instanceof XmlAttributeValueImpl ? host.getParent() : null;
    final String normalized = hostParent instanceof XmlAttribute ?
            ComponentUtil.getAttributeName(((XmlAttribute) hostParent).getName()) : null;

    // TODO: Do some kind of test
    return true;
    // return "ng-controller".equals(normalized);
}
 
开发者ID:kristianmandrup,项目名称:emberjs-plugin,代码行数:15,代码来源:EmberJSAsExpression.java


示例4: XmlAttributeLiteralEscaper

import com.intellij.psi.impl.source.xml.XmlAttributeValueImpl; //导入依赖的package包/类
public XmlAttributeLiteralEscaper(XmlAttributeValueImpl host) {
  super(host);
  PsiElement parent = host.getParent();
  myXmlAttribute = parent instanceof XmlAttribute ? (XmlAttribute)parent :
                   XmlElementFactory.getInstance(host.getProject()).createXmlAttribute("a", host.getValue());
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:7,代码来源:XmlAttributeLiteralEscaper.java


示例5: elementsToInjectIn

import com.intellij.psi.impl.source.xml.XmlAttributeValueImpl; //导入依赖的package包/类
@NotNull
@Override
public List<? extends Class<? extends PsiElement>> elementsToInjectIn() {
    return Arrays.asList(XmlTextImpl.class, XmlAttributeValueImpl.class);
}
 
开发者ID:idok,项目名称:react-templates-plugin,代码行数:6,代码来源:RTJSInjector.java


示例6: XmlAttributeLiteralEscaper

import com.intellij.psi.impl.source.xml.XmlAttributeValueImpl; //导入依赖的package包/类
public XmlAttributeLiteralEscaper(XmlAttributeValueImpl host) {
  super(host);
  myXmlAttribute = (XmlAttribute)host.getParent();
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:5,代码来源:XmlAttributeLiteralEscaper.java


示例7: injectLanguages

import com.intellij.psi.impl.source.xml.XmlAttributeValueImpl; //导入依赖的package包/类
@Override
public void injectLanguages(@NotNull MultiHostRegistrar registrar, @NotNull PsiElement context)
{
	final XmlAttribute attribute = (XmlAttribute) context;
	if(!XsltSupport.isXPathAttribute(attribute))
	{
		return;
	}

	XmlAttributeValueImpl value = (XmlAttributeValueImpl) attribute.getValueElement();
	if(value == null)
	{
		return;
	}
	ASTNode type = value.findChildByType(XmlElementType.XML_ENTITY_REF);
	if(type != null)
	{
		return; // workaround for inability to inject into text with entity refs (e.g. IDEA-72972) TODO: fix it
	}

	final XsltChecker.LanguageLevel languageLevel = XsltSupport.getXsltLanguageLevel(attribute.getContainingFile());
	final TextRange[] ranges = getInjectionRanges(attribute, languageLevel);
	for(TextRange range : ranges)
	{
		// workaround for http://www.jetbrains.net/jira/browse/IDEA-10096
		TextRange rangeInsideHost;
		String prefix;
		if(range instanceof AVTRange)
		{
			if(((AVTRange) range).myComplete)
			{
				rangeInsideHost = range.shiftRight(2).grown(-2);
				prefix = "";
			}
			else
			{
				// we need to keep the "'}' expected" parse error
				rangeInsideHost = range.shiftRight(2).grown(-1);
				prefix = "{";
			}
		}
		else
		{
			rangeInsideHost = range;
			prefix = "";
		}
		if(value.getTextRange().contains(rangeInsideHost.shiftRight(value.getTextRange().getStartOffset())))
		{
			registrar.startInjecting(languageLevel.getXPathVersion().getLanguage()).addPlace(prefix, "", value, rangeInsideHost).doneInjecting();
		}
	}
}
 
开发者ID:consulo,项目名称:consulo-xslt,代码行数:53,代码来源:XPathLanguageInjector.java


示例8: XmlAttributeLiteralEscaper

import com.intellij.psi.impl.source.xml.XmlAttributeValueImpl; //导入依赖的package包/类
public XmlAttributeLiteralEscaper(XmlAttributeValueImpl host)
{
	super(host);
	PsiElement parent = host.getParent();
	myXmlAttribute = parent instanceof XmlAttribute ? (XmlAttribute) parent : XmlElementFactory.getInstance(host.getProject()).createAttribute("a", host.getValue(), parent);
}
 
开发者ID:consulo,项目名称:consulo-xml,代码行数:7,代码来源:XmlAttributeLiteralEscaper.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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