From 6e51d1f0d2d549063fa1334148c97e4abfd2e699 Mon Sep 17 00:00:00 2001 From: anna Date: Fri, 22 Mar 2013 20:21:20 +0100 Subject: [PATCH] javafx: include property class into completion (cherry picked from commit 95d73a61aee18342e97aeeecb7d35108f966e0a1) --- .../plugins/javaFX/fxml/JavaFxCompletionTest.java | 4 ++++ .../fxml/descriptors/JavaFxPropertyElementDescriptor.java | 1 + .../testData/completion/allowPropertyTypeClass.fxml | 8 ++++++++ .../testData/completion/allowPropertyTypeClass_after.fxml | 8 ++++++++ 4 files changed, 21 insertions(+) create mode 100644 plugins/javaFX/testData/completion/allowPropertyTypeClass.fxml create mode 100644 plugins/javaFX/testData/completion/allowPropertyTypeClass_after.fxml diff --git a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFxCompletionTest.java b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFxCompletionTest.java index 0d4d2dc0a01b..6aa4235ec361 100644 --- a/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFxCompletionTest.java +++ b/plugins/javaFX/javaFX-CE/testSrc/org/jetbrains/plugins/javaFX/fxml/JavaFxCompletionTest.java @@ -148,6 +148,10 @@ public class JavaFxCompletionTest extends LightFixtureCompletionTestCase { doTest("layoutY"); } + public void testAllowPropertyTypeClass() throws Exception { + doTest("ColumnConstraints"); + } + public void testReadOnly() throws Exception { configureByFile(getTestName(true) + ".fxml"); assertTrue(myItems.length > 0); diff --git a/plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/descriptors/JavaFxPropertyElementDescriptor.java b/plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/descriptors/JavaFxPropertyElementDescriptor.java index 150a8a2db80a..abae636d8bc3 100644 --- a/plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/descriptors/JavaFxPropertyElementDescriptor.java +++ b/plugins/javaFX/src/org/jetbrains/plugins/javaFX/fxml/descriptors/JavaFxPropertyElementDescriptor.java @@ -85,6 +85,7 @@ public class JavaFxPropertyElementDescriptor implements XmlElementDescriptor { return true; } }); + descriptors.add(new JavaFxClassBackedElementDescriptor(aClass.getName(), aClass)); } } else if (InheritanceUtil.isInheritor(psiType, JavaFxCommonClassNames.JAVAFX_BEANS_PROPERTY)) { final PsiType propertyType = JavaFxPsiUtil.getPropertyType(psiType, project); diff --git a/plugins/javaFX/testData/completion/allowPropertyTypeClass.fxml b/plugins/javaFX/testData/completion/allowPropertyTypeClass.fxml new file mode 100644 index 000000000000..4a8aa968f84e --- /dev/null +++ b/plugins/javaFX/testData/completion/allowPropertyTypeClass.fxml @@ -0,0 +1,8 @@ + + + + + + < + + \ No newline at end of file diff --git a/plugins/javaFX/testData/completion/allowPropertyTypeClass_after.fxml b/plugins/javaFX/testData/completion/allowPropertyTypeClass_after.fxml new file mode 100644 index 000000000000..ee4d67f86282 --- /dev/null +++ b/plugins/javaFX/testData/completion/allowPropertyTypeClass_after.fxml @@ -0,0 +1,8 @@ + + + + + + + \ No newline at end of file