javafx: allow include tags inside define (IDEA-103324)

(cherry picked from commit b7ed509)
This commit is contained in:
anna
2013-03-21 10:40:31 +01:00
parent 1f5b4e2040
commit d123ff6bd2
3 changed files with 24 additions and 0 deletions
@@ -209,6 +209,16 @@ public class JavaFXHighlightingTest extends DaemonAnalyzerTestCase {
doDoTest(false, false);
}
public void testWrongBindingType() throws Exception {
configureByFiles(null, getTestName(true) + ".fxml", getTestName(false) + ".java");
doDoTest(false, false);
}
public void testAllowIncludeTagInsideDefine() throws Exception {
configureByFiles(null, getTestName(true) + ".fxml", "btn.fxml");
doDoTest(false, false);
}
public void testValueOfAcceptance() throws Exception {
doTest();
}
@@ -68,6 +68,9 @@ public class JavaFxDefaultPropertyElementDescriptor implements XmlElementDescrip
public XmlElementDescriptor getElementDescriptor(XmlTag childTag, XmlTag contextTag) {
final String name = childTag.getName();
if (myName.equals(FxmlConstants.FX_DEFINE)) {
if (name.equals(FxmlConstants.FX_INCLUDE)) {
return new JavaFxDefaultPropertyElementDescriptor(name, childTag);
}
return new JavaFxClassBackedElementDescriptor(name, childTag);
}
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.layout.*?>
<?import javafx.scene.image.*?>
<AnchorPane xmlns:fx="http://javafx.com/fxml">
<fx:define>
<fx:include source="btn.fxml"/>
<fx:include source="<error descr="Cannot resolve file 'btn1.fxml'">btn1.fxml</error>"/>
</fx:define>
</AnchorPane>