本文整理汇总了Java中com.intellij.util.xml.DomElement.getXmlTag方法的典型用法代码示例。如果您正苦于以下问题:Java DomElement.getXmlTag方法的具体用法?Java DomElement.getXmlTag怎么用?Java DomElement.getXmlTag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.util.xml.DomElement
的用法示例。
在下文中一共展示了DomElement.getXmlTag方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: _getOrCreateProblemsHolder
import com.intellij.util.xml.DomElement; //导入方法依赖的package包/类
private DomElementsProblemsHolderImpl _getOrCreateProblemsHolder(final DomFileElement element) {
DomElementsProblemsHolderImpl holder;
final DomElement rootElement = element.getRootElement();
final XmlTag rootTag = rootElement.getXmlTag();
if (rootTag == null) return new DomElementsProblemsHolderImpl(element);
holder = rootTag.getUserData(DOM_PROBLEM_HOLDER_KEY);
if (isHolderOutdated(element.getFile()) || holder == null) {
holder = new DomElementsProblemsHolderImpl(element);
rootTag.putUserData(DOM_PROBLEM_HOLDER_KEY, holder);
final CachedValue<Boolean> cachedValue = CachedValuesManager.getManager(myProject).createCachedValue(new CachedValueProvider<Boolean>() {
@Override
public Result<Boolean> compute() {
return new Result<Boolean>(Boolean.FALSE, element, PsiModificationTracker.OUT_OF_CODE_BLOCK_MODIFICATION_COUNT, DomElementAnnotationsManagerImpl.this, ProjectRootManager.getInstance(myProject));
}
}, false);
cachedValue.getValue();
element.getFile().putUserData(CACHED_VALUE_KEY, cachedValue);
}
return holder;
}
示例2: addNamespacePrefix
import com.intellij.util.xml.DomElement; //导入方法依赖的package包/类
public static void addNamespacePrefix(@Nullable DomElement domElement, @NotNull Map<String, String> vars) {
if (domElement != null) {
XmlTag tag = domElement.getXmlTag();
if (tag != null) {
String namespacePrefix = tag.getNamespacePrefix();
if (!StringUtil.isEmptyOrSpaces(namespacePrefix)) {
vars.put(NAMESPACE_PREFIX_VAR, namespacePrefix + ":");
}
}
}
}
示例3: setSelectionInTextEditor
import com.intellij.util.xml.DomElement; //导入方法依赖的package包/类
public void setSelectionInTextEditor(final TextEditor textEditor, final DomElement element) {
if (element != null && element.isValid()) {
final XmlTag tag = element.getXmlTag();
if (tag == null) return;
final PsiFile file = tag.getContainingFile();
if (file == null) return;
final Document document = getDocumentManager().getDocument(file);
if (document == null || !document.equals(textEditor.getEditor().getDocument())) return;
textEditor.getEditor().getCaretModel().moveToOffset(tag.getTextOffset());
textEditor.getEditor().getScrollingModel().scrollToCaret(ScrollType.CENTER);
}
}
示例4: findPropertiesParentTag
import com.intellij.util.xml.DomElement; //导入方法依赖的package包/类
private static XmlTag findPropertiesParentTag(@NotNull PsiElement element) {
DomElement domElement = DomUtil.getDomElement(element);
return domElement instanceof MavenDomProperties ? domElement.getXmlTag() : null;
}