Search in sources :

Example 1 with JavaFxRootTagDescriptor

use of org.jetbrains.plugins.javaFX.fxml.descriptors.JavaFxRootTagDescriptor in project intellij-community by JetBrains.

the class JavaFxNamespaceDescriptor method getElementDescriptor.

@Nullable
@Override
public XmlElementDescriptor getElementDescriptor(@NotNull XmlTag tag) {
    final XmlTag parentTag = tag.getParentTag();
    if (parentTag != null) {
        final XmlElementDescriptor descriptor = parentTag.getDescriptor();
        return descriptor != null ? descriptor.getElementDescriptor(tag, parentTag) : null;
    }
    final String name = tag.getName();
    if (FxmlConstants.FX_ROOT.equals(name)) {
        return new JavaFxRootTagDescriptor(tag);
    }
    return new JavaFxClassTagDescriptor(name, tag);
}
Also used : JavaFxRootTagDescriptor(org.jetbrains.plugins.javaFX.fxml.descriptors.JavaFxRootTagDescriptor) JavaFxClassTagDescriptor(org.jetbrains.plugins.javaFX.fxml.descriptors.JavaFxClassTagDescriptor) XmlElementDescriptor(com.intellij.xml.XmlElementDescriptor) XmlTag(com.intellij.psi.xml.XmlTag) Nullable(org.jetbrains.annotations.Nullable)

Aggregations

XmlTag (com.intellij.psi.xml.XmlTag)1 XmlElementDescriptor (com.intellij.xml.XmlElementDescriptor)1 Nullable (org.jetbrains.annotations.Nullable)1 JavaFxClassTagDescriptor (org.jetbrains.plugins.javaFX.fxml.descriptors.JavaFxClassTagDescriptor)1 JavaFxRootTagDescriptor (org.jetbrains.plugins.javaFX.fxml.descriptors.JavaFxRootTagDescriptor)1