本文整理汇总了Java中com.intellij.psi.impl.source.xml.TagNameReference类的典型用法代码示例。如果您正苦于以下问题:Java TagNameReference类的具体用法?Java TagNameReference怎么用?Java TagNameReference使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
TagNameReference类属于com.intellij.psi.impl.source.xml包,在下文中一共展示了TagNameReference类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addCompletions
import com.intellij.psi.impl.source.xml.TagNameReference; //导入依赖的package包/类
@Override
protected void addCompletions(@NotNull CompletionParameters parameters,
ProcessingContext context,
@NotNull final CompletionResultSet result) {
LegacyCompletionContributor.processReferences(parameters, result, new PairConsumer<PsiReference, CompletionResultSet>() {
@Override
public void consume(PsiReference reference, CompletionResultSet set) {
if (reference instanceof TagNameReference) {
collectCompletionVariants((TagNameReference)reference, set);
}
else if (reference instanceof SchemaPrefixReference) {
TagNameReference tagNameReference = ((SchemaPrefixReference)reference).getTagNameReference();
if (tagNameReference != null && !tagNameReference.isStartTagFlag()) {
set.consume(createClosingTagLookupElement((XmlTag)tagNameReference.getElement(), true, tagNameReference.getNameElement()));
}
}
}
});
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:TagNameReferenceCompletionProvider.java
示例2: addCompletions
import com.intellij.psi.impl.source.xml.TagNameReference; //导入依赖的package包/类
@Override
public void addCompletions(@NotNull CompletionParameters parameters, ProcessingContext context, @NotNull final CompletionResultSet result)
{
LegacyCompletionContributor.processReferences(parameters, result, (reference, set) ->
{
if(reference instanceof TagNameReference)
{
collectCompletionVariants((TagNameReference) reference, set);
}
else if(reference instanceof SchemaPrefixReference)
{
TagNameReference tagNameReference = ((SchemaPrefixReference) reference).getTagNameReference();
if(tagNameReference != null && !tagNameReference.isStartTagFlag())
{
set.consume(createClosingTagLookupElement((XmlTag) tagNameReference.getElement(), true, tagNameReference.getNameElement()));
}
}
});
}
开发者ID:consulo,项目名称:consulo-xml,代码行数:20,代码来源:TagNameReferenceCompletionProvider.java
示例3: collectCompletionVariants
import com.intellij.psi.impl.source.xml.TagNameReference; //导入依赖的package包/类
public static void collectCompletionVariants(TagNameReference tagNameReference, Consumer<LookupElement> consumer)
{
PsiElement element = tagNameReference.getElement();
if(element instanceof XmlTag)
{
if(!tagNameReference.isStartTagFlag())
{
consumer.consume(createClosingTagLookupElement((XmlTag) element, false, tagNameReference.getNameElement()));
}
else
{
XmlTag tag = (XmlTag) element;
for(LookupElement variant : getTagNameVariants(tag, tag.getNamespacePrefix()))
{
consumer.consume(variant);
}
}
}
}
开发者ID:consulo,项目名称:consulo-xml,代码行数:20,代码来源:TagNameReferenceCompletionProvider.java
示例4: completeVariable
import com.intellij.psi.impl.source.xml.TagNameReference; //导入依赖的package包/类
private void completeVariable(Editor editor) {
String prefix = this.myNameSuggestionsField.getEnteredName();
PsiReference reference = this.myTag.getReference();
if(reference instanceof TagNameReference) {
LookupElement[] lookupItems = TagNameReferenceCompletionProvider.getTagNameVariants(this.myTag, this.myTag.getNamespacePrefix());
editor.getCaretModel().moveToOffset(prefix.length());
editor.getSelectionModel().removeSelection();
LookupManager.getInstance(this.getProject()).showLookup(editor, lookupItems, prefix);
}
}
开发者ID:machaval,项目名称:mule-intellij-plugins,代码行数:12,代码来源:FlowRenameDialog.java
示例5: collectCompletionVariants
import com.intellij.psi.impl.source.xml.TagNameReference; //导入依赖的package包/类
public static void collectCompletionVariants(TagNameReference tagNameReference,
Consumer<LookupElement> consumer) {
PsiElement element = tagNameReference.getElement();
if (element instanceof XmlTag) {
if (!tagNameReference.isStartTagFlag()) {
consumer.consume(createClosingTagLookupElement((XmlTag)element, false, tagNameReference.getNameElement()));
}
else {
XmlTag tag = (XmlTag) element;
for(LookupElement variant: getTagNameVariants(tag, tag.getNamespacePrefix())) {
consumer.consume(variant);
}
}
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:16,代码来源:TagNameReferenceCompletionProvider.java
示例6: completeVariable
import com.intellij.psi.impl.source.xml.TagNameReference; //导入依赖的package包/类
private void completeVariable(final Editor editor) {
String prefix = myNameSuggestionsField.getEnteredName();
final PsiReference reference = myTag.getReference();
if (reference instanceof TagNameReference) {
LookupElement[] lookupItems = TagNameReferenceCompletionProvider.getTagNameVariants(myTag, myTag.getNamespacePrefix());
editor.getCaretModel().moveToOffset(prefix.length());
editor.getSelectionModel().removeSelection();
LookupManager.getInstance(getProject()).showLookup(editor, lookupItems, prefix);
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:XmlTagRenameDialog.java
示例7: createTagNameReference
import com.intellij.psi.impl.source.xml.TagNameReference; //导入依赖的package包/类
@Nullable
@Override
public TagNameReference createTagNameReference(ASTNode nameElement, boolean startTagFlag) {
return AndroidXmlReferenceProvider.areReferencesProvidedByReferenceProvider(nameElement)
? null
: new AndroidClassTagNameReference(nameElement, startTagFlag);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:8,代码来源:AndroidXmlExtension.java
示例8: getVariants
import com.intellij.psi.impl.source.xml.TagNameReference; //导入依赖的package包/类
@NotNull
private static Collection<?> getVariants(CompletionParameters parameters) {
if (!MavenDomUtil.isMavenFile(parameters.getOriginalFile())) return Collections.emptyList();
SmartList<?> result = new SmartList<Object>();
for (PsiReference each : getReferences(parameters)) {
if (each instanceof TagNameReference) continue;
if (each instanceof GenericDomValueReference) {
GenericDomValueReference reference = (GenericDomValueReference)each;
Converter converter = reference.getConverter();
if (converter instanceof MavenSmartConverter) {
result.addAll(((MavenSmartConverter)converter).getSmartVariants(reference.getConvertContext()));
}
else if (converter instanceof ResolvingConverter) {
//noinspection unchecked
result.addAll(((ResolvingConverter)converter).getVariants(reference.getConvertContext()));
}
}
else {
//noinspection unchecked
Collections.addAll((Collection)result, each.getVariants());
}
}
return result;
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:30,代码来源:MavenSmartCompletionContributor.java
示例9: completeVariable
import com.intellij.psi.impl.source.xml.TagNameReference; //导入依赖的package包/类
private void completeVariable(final Editor editor)
{
String prefix = myNameSuggestionsField.getEnteredName();
final PsiReference reference = myTag.getReference();
if(reference instanceof TagNameReference)
{
LookupElement[] lookupItems = TagNameReferenceCompletionProvider.getTagNameVariants(myTag, myTag.getNamespacePrefix());
editor.getCaretModel().moveToOffset(prefix.length());
editor.getSelectionModel().removeSelection();
LookupManager.getInstance(getProject()).showLookup(editor, lookupItems, prefix);
}
}
开发者ID:consulo,项目名称:consulo-xml,代码行数:14,代码来源:XmlTagRenameDialog.java
示例10: createTagNameReference
import com.intellij.psi.impl.source.xml.TagNameReference; //导入依赖的package包/类
public TagNameReference createTagNameReference(final ASTNode nameElement, final boolean startTagFlag) {
return new BPMNTagNameReference(nameElement, startTagFlag);
}
开发者ID:Blenta,项目名称:intellij-bpmn-editor,代码行数:4,代码来源:BPMNFileExtension.java
示例11: createTagNameReference
import com.intellij.psi.impl.source.xml.TagNameReference; //导入依赖的package包/类
@Nullable
public TagNameReference createTagNameReference(final ASTNode nameElement, final boolean startTagFlag) {
return new TagNameReference(nameElement, startTagFlag);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:5,代码来源:XmlExtension.java
示例12: registerFixes
import com.intellij.psi.impl.source.xml.TagNameReference; //导入依赖的package包/类
public void registerFixes(@NotNull PsiReference ref, @NotNull QuickFixActionRegistrar registrar) {
if (ref instanceof TagNameReference || ref instanceof AntDomReference) {
registrar.register(new AntChangeContextFix());
}
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:6,代码来源:AntUnresolvedRefsFixProvider.java
示例13: createTagNameReference
import com.intellij.psi.impl.source.xml.TagNameReference; //导入依赖的package包/类
public TagNameReference createTagNameReference(final ASTNode nameElement, final boolean startTagFlag) {
return new JavaFxTagNameReference(nameElement, startTagFlag);
}
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:4,代码来源:JavaFxXmlExtension.java
示例14: registerFixes
import com.intellij.psi.impl.source.xml.TagNameReference; //导入依赖的package包/类
public void registerFixes(PsiReference ref, QuickFixActionRegistrar registrar) {
if (ref instanceof TagNameReference || ref instanceof AntDomReference) {
registrar.register(new AntChangeContextFix());
}
}
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:6,代码来源:AntUnresolvedRefsFixProvider.java
示例15: createTagNameReference
import com.intellij.psi.impl.source.xml.TagNameReference; //导入依赖的package包/类
@Override
public TagNameReference createTagNameReference(final ASTNode nameElement, final boolean startTagFlag) {
return new JavaFxTagNameReference(nameElement, startTagFlag);
}
开发者ID:consulo,项目名称:consulo-javafx,代码行数:5,代码来源:JavaFxXmlExtension.java
示例16: createTagNameReference
import com.intellij.psi.impl.source.xml.TagNameReference; //导入依赖的package包/类
@Nullable
public TagNameReference createTagNameReference(final ASTNode nameElement, final boolean startTagFlag)
{
return new TagNameReference(nameElement, startTagFlag);
}
开发者ID:consulo,项目名称:consulo-xml,代码行数:6,代码来源:XmlExtension.java
注:本文中的com.intellij.psi.impl.source.xml.TagNameReference类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论