本文整理匯總了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);
}
示例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];
}
示例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];
}
示例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;
}
示例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());
}
}
}
示例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());
}
}
示例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());
}
}
}