mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
javafx: do not treat library root tag type as controller
This commit is contained in:
@@ -20,6 +20,8 @@ import com.intellij.openapi.application.PluginPathManager;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.plugins.javaFX.fxml.codeInsight.inspections.JavaFxUnresolvedFxIdReferenceInspection;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* User: anna
|
||||
* Date: 1/10/13
|
||||
@@ -35,6 +37,12 @@ public class JavaFXUnresolvedFxIdReferenceInspectionTest extends AbstractJavaFXQ
|
||||
doTest("Controller");
|
||||
}
|
||||
|
||||
public void testRootType() throws Exception {
|
||||
myFixture.configureByFiles(getTestName(true) + ".fxml");
|
||||
final List<IntentionAction> intentionActions = myFixture.filterAvailableIntentions(getHint("unknown"));
|
||||
assertEmpty(intentionActions);
|
||||
}
|
||||
|
||||
private void doTest(final String controllerName) {
|
||||
myFixture.configureByFiles(getTestName(true) + ".fxml", controllerName + ".java");
|
||||
final IntentionAction singleIntention = myFixture.findSingleIntention(getHint("unknown"));
|
||||
|
||||
@@ -252,7 +252,8 @@ public class JavaFxPsiUtil {
|
||||
private static PsiClass findControllerClass(PsiFile containingFile, Project project, XmlAttribute attribute) {
|
||||
final String attributeValue = attribute.getValue();
|
||||
if (!StringUtil.isEmptyOrSpaces(attributeValue)) {
|
||||
return JavaPsiFacade.getInstance(project).findClass(attributeValue, containingFile.getResolveScope());
|
||||
final GlobalSearchScope customScope = GlobalSearchScope.projectScope(project).intersectWith(containingFile.getResolveScope());
|
||||
return JavaPsiFacade.getInstance(project).findClass(attributeValue, customScope);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
<?import javafx.scene.control.Label?>
|
||||
<fx:root type="javafx.scene.layout.GridPane" xmlns:fx="http://javafx.com/fxml">
|
||||
<Label fx:id="unkno<caret>wn"/>
|
||||
</fx:root>
|
||||
Reference in New Issue
Block a user