mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
javafx: accept imports in fx:root tags (IDEA-147975)
This commit is contained in:
+4
@@ -256,6 +256,10 @@ public class JavaFXHighlightingTest extends AbstractJavaFXTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testRootTagWithImport() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testReadOnly() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
+1
-2
@@ -18,7 +18,6 @@ package org.jetbrains.plugins.javaFX.fxml.descriptors;
|
||||
import com.intellij.codeInsight.daemon.Validator;
|
||||
import com.intellij.openapi.project.Project;
|
||||
import com.intellij.psi.*;
|
||||
import com.intellij.psi.search.GlobalSearchScope;
|
||||
import com.intellij.psi.util.PsiTreeUtil;
|
||||
import com.intellij.psi.util.PsiUtil;
|
||||
import com.intellij.psi.xml.XmlAttribute;
|
||||
@@ -220,7 +219,7 @@ public class JavaFxDefaultPropertyElementDescriptor implements XmlElementDescrip
|
||||
if (typeAttr != null) {
|
||||
final String rootClassName = typeAttr.getValue();
|
||||
final Project project = context.getProject();
|
||||
final PsiClass rootClass = rootClassName != null ? JavaPsiFacade.getInstance(project).findClass(rootClassName, GlobalSearchScope.allScope(project)) : null;
|
||||
final PsiClass rootClass = rootClassName != null ?JavaFxPsiUtil.findPsiClass(rootClassName, context) : null;
|
||||
if (rootClass != null) {
|
||||
return new JavaFxClassBackedElementDescriptor(getName(), rootClass);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?import javafx.scene.control.TextField?>
|
||||
<?import javafx.scene.control.Label?>
|
||||
<?import javafx.scene.layout.BorderPane?>
|
||||
|
||||
<fx:root type = "BorderPane" minHeight="7" xmlns:fx="http://javafx.com/fxml">
|
||||
<TextField fx:id="textField" text=""/>
|
||||
<Label text="Hello"/>
|
||||
</fx:root>
|
||||
Reference in New Issue
Block a user