当前位置: 首页>>代码示例>>Java>>正文


Java JavaFxClassBackedElementDescriptor类代码示例

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


JavaFxClassBackedElementDescriptor类属于org.jetbrains.plugins.javaFX.fxml.descriptors包,在下文中一共展示了JavaFxClassBackedElementDescriptor类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: checkClass

import org.jetbrains.plugins.javaFX.fxml.descriptors.JavaFxClassBackedElementDescriptor; //导入依赖的package包/类
private static PsiClass checkClass(XmlTag tag) {
  if (tag != null) {
    final XmlElementDescriptor descriptor = tag.getDescriptor();
    if (descriptor instanceof JavaFxClassBackedElementDescriptor) {
      final PsiElement declaration = descriptor.getDeclaration();
      if (declaration instanceof PsiClass) {
        return (PsiClass)declaration;
      }
    } else if (descriptor instanceof JavaFxDefaultPropertyElementDescriptor) {
      final XmlTag includedRoot = JavaFxDefaultPropertyElementDescriptor.getIncludedRoot(tag);
      if (includedRoot != null && !includedRoot.equals(tag)) {
        return checkClass(includedRoot);
      }
    }
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:JavaFxUnresolvedFxIdReferenceInspection.java

示例2: isAvailable

import org.jetbrains.plugins.javaFX.fxml.descriptors.JavaFxClassBackedElementDescriptor; //导入依赖的package包/类
@Override
public boolean isAvailable(@NotNull Project project, Editor editor, @NotNull PsiElement element) {
  if (element instanceof XmlToken && ((XmlToken)element).getTokenType() == XmlTokenType.XML_NAME && element.getParent() instanceof XmlTag) {
    final XmlTag tag = (XmlTag)element.getParent();
    for (XmlTag xmlTag : tag.getSubTags()) {
      if (xmlTag.getAttribute(FxmlConstants.FX_VALUE) == null) return false;
    }
    final XmlTag parentTag = tag.getParentTag();
    if (parentTag != null &&
        tag.getDescriptor() instanceof JavaFxPropertyElementDescriptor &&
        parentTag.getDescriptor() instanceof JavaFxClassBackedElementDescriptor) {

      setText("Collapse tag '" + tag.getName() + "' to attribute");
      return true;
    }
  }
  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:JavaFxCollapseSubTagToAttributeIntention.java

示例3: getElementDescriptor

import org.jetbrains.plugins.javaFX.fxml.descriptors.JavaFxClassBackedElementDescriptor; //导入依赖的package包/类
@Nullable
@Override
public XmlElementDescriptor getElementDescriptor(@NotNull XmlTag tag) {
  final String name = tag.getName();

  if (tag.getName().equals(FxmlConstants.FX_ROOT)) {
    return new JavaFxDefaultPropertyElementDescriptor(name, tag);
  }
  final XmlTag parentTag = tag.getParentTag();
  if (parentTag != null) {
    final XmlElementDescriptor descriptor = parentTag.getDescriptor();
    if (descriptor != null) {
      return descriptor.getElementDescriptor(tag, parentTag);
    }
  }
  return new JavaFxClassBackedElementDescriptor(name, tag);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:JavaFXNSDescriptor.java

示例4: getRootElementsDescriptors

import org.jetbrains.plugins.javaFX.fxml.descriptors.JavaFxClassBackedElementDescriptor; //导入依赖的package包/类
@NotNull
@Override
public XmlElementDescriptor[] getRootElementsDescriptors(@Nullable XmlDocument document) {
  if (document != null) {
    final Project project = document.getProject();
    final PsiClass paneClass = JavaPsiFacade.getInstance(project).findClass(JavaFxCommonClassNames.JAVAFX_SCENE_LAYOUT_PANE, GlobalSearchScope.allScope(project));
    if (paneClass != null) {
      final ArrayList<XmlElementDescriptor> result = new ArrayList<XmlElementDescriptor>();
      ClassInheritorsSearch.search(paneClass, paneClass.getUseScope(), true, true, false).forEach(new Processor<PsiClass>() {
        @Override
        public boolean process(PsiClass psiClass) {
          result.add(new JavaFxClassBackedElementDescriptor(psiClass.getName(), psiClass));
          return true;
        }
      });
      return result.toArray(new XmlElementDescriptor[result.size()]);
    }
  }
  return new XmlElementDescriptor[0];
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:JavaFXNSDescriptor.java

示例5: checkContext

import org.jetbrains.plugins.javaFX.fxml.descriptors.JavaFxClassBackedElementDescriptor; //导入依赖的package包/类
protected static PsiClass checkContext(final XmlAttributeValue attributeValue) {
  if (attributeValue == null) return null;
  final PsiElement parent = attributeValue.getParent();
  if (parent instanceof XmlAttribute) {
    final XmlTag tag = ((XmlAttribute)parent).getParent();
    if (tag != null) {
      final XmlElementDescriptor descriptor = tag.getDescriptor();
      if (descriptor instanceof JavaFxClassBackedElementDescriptor) {
        final PsiElement declaration = descriptor.getDeclaration();
        if (declaration instanceof PsiClass) {
          return (PsiClass)declaration;
        }
      }
    }
  }
  return null;
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:18,代码来源:JavaFxUnresolvedFxIdReferenceInspection.java

示例6: getRootElementsDescriptors

import org.jetbrains.plugins.javaFX.fxml.descriptors.JavaFxClassBackedElementDescriptor; //导入依赖的package包/类
@NotNull
@Override
public XmlElementDescriptor[] getRootElementsDescriptors(@Nullable XmlDocument document) {
  if (document != null) {
    final Project project = document.getProject();
    final PsiClass paneClass = JavaPsiFacade.getInstance(project).findClass(JavaFxCommonClassNames.JAVAFX_SCENE_LAYOUT_PANE, GlobalSearchScope.allScope(project));
    if (paneClass != null) {
      final ArrayList<XmlElementDescriptor> result = new ArrayList<XmlElementDescriptor>();
      ClassInheritorsSearch.search(paneClass).forEach(new Processor<PsiClass>() {
        @Override
        public boolean process(PsiClass psiClass) {
          result.add(new JavaFxClassBackedElementDescriptor(psiClass.getName(), psiClass));
          return true;
        }
      });
      return result.toArray(new XmlElementDescriptor[result.size()]);
    }
  }
  return new XmlElementDescriptor[0];
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:21,代码来源:JavaFXNSDescriptor.java

示例7: checkContext

import org.jetbrains.plugins.javaFX.fxml.descriptors.JavaFxClassBackedElementDescriptor; //导入依赖的package包/类
protected static PsiClass checkContext(final XmlAttributeValue attributeValue)
{
	if(attributeValue == null)
	{
		return null;
	}
	final PsiElement parent = attributeValue.getParent();
	if(parent instanceof XmlAttribute)
	{
		final XmlTag tag = ((XmlAttribute) parent).getParent();
		if(tag != null)
		{
			final XmlElementDescriptor descriptor = tag.getDescriptor();
			if(descriptor instanceof JavaFxClassBackedElementDescriptor)
			{
				final PsiElement declaration = descriptor.getDeclaration();
				if(declaration instanceof PsiClass)
				{
					return (PsiClass) declaration;
				}
			}
		}
	}
	return null;
}
 
开发者ID:consulo,项目名称:consulo-javafx,代码行数:26,代码来源:JavaFxUnresolvedFxIdReferenceInspection.java

示例8: visitXmlTag

import org.jetbrains.plugins.javaFX.fxml.descriptors.JavaFxClassBackedElementDescriptor; //导入依赖的package包/类
@Override
public void visitXmlTag(XmlTag tag) {
  super.visitXmlTag(tag);
  final XmlElementDescriptor descriptor = tag.getDescriptor();
  if (descriptor instanceof JavaFxClassBackedElementDescriptor) {
    appendClassName(descriptor.getDeclaration());
  } else if (descriptor instanceof JavaFxPropertyElementDescriptor && ((JavaFxPropertyElementDescriptor)descriptor).isStatic()) {
    final PsiElement declaration = descriptor.getDeclaration();
    if (declaration instanceof PsiMember) {
      appendClassName(((PsiMember)declaration).getContainingClass());
    }
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:14,代码来源:JavaFxImportsOptimizer.java

示例9: handleInsert

import org.jetbrains.plugins.javaFX.fxml.descriptors.JavaFxClassBackedElementDescriptor; //导入依赖的package包/类
@Override
public void handleInsert(InsertionContext context, LookupElement item) {
  super.handleInsert(context, item);
  final Object object = item.getObject();
  if (object instanceof JavaFxClassBackedElementDescriptor) {
    final XmlFile xmlFile = (XmlFile)context.getFile();
    final String shortName = ((JavaFxClassBackedElementDescriptor)object).getName();
    context.commitDocument();
    JavaFxPsiUtil.insertImportWhenNeeded(xmlFile, shortName, ((JavaFxClassBackedElementDescriptor)object).getQualifiedName());
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:12,代码来源:JavaFxCompletionContributor.java

示例10: visitXmlTag

import org.jetbrains.plugins.javaFX.fxml.descriptors.JavaFxClassBackedElementDescriptor; //导入依赖的package包/类
@Override
public void visitXmlTag(XmlTag tag) {
  super.visitXmlTag(tag);
  final XmlElementDescriptor descriptor = tag.getDescriptor();
  if (descriptor instanceof JavaFxClassBackedElementDescriptor) {
    appendClassName(descriptor.getDeclaration());
  } else if (descriptor instanceof JavaFxPropertyElementDescriptor && ((JavaFxPropertyElementDescriptor)descriptor).isStatic()) {
    final PsiElement declaration = descriptor.getDeclaration();
    if (declaration instanceof PsiMember) {
      appendClassName((PsiElement)((PsiMember)declaration).getContainingClass());
    }
  }
}
 
开发者ID:lshain-android-source,项目名称:tools-idea,代码行数:14,代码来源:JavaFxImportsOptimizer.java


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