mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
javafx: accept references inside define
This commit is contained in:
+4
@@ -295,6 +295,10 @@ public class JavaFXHighlightingTest extends AbstractJavaFXTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testAcceptReferenceInsideDefine() throws Exception {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testIncludedForm() throws Exception {
|
||||
myFixture.addFileToProject("sample.fxml", "<?import javafx.scene.layout.GridPane?>\n" +
|
||||
"<fx:root type=\"javafx.scene.layout.GridPane\" xmlns:fx=\"http://javafx.com/fxml\"/>\n");
|
||||
|
||||
+3
-3
@@ -76,14 +76,14 @@ public class JavaFxDefaultPropertyElementDescriptor implements XmlElementDescrip
|
||||
@Override
|
||||
public XmlElementDescriptor getElementDescriptor(XmlTag childTag, XmlTag contextTag) {
|
||||
final String name = childTag.getName();
|
||||
if (myName.equals(FxmlConstants.FX_DEFINE)) {
|
||||
if (name.equals(FxmlConstants.FX_INCLUDE)) {
|
||||
if (FxmlConstants.FX_DEFINE.equals(myName)) {
|
||||
if (FxmlConstants.FX_INCLUDE.equals(name) || FxmlConstants.FX_REFERENCE.equals(name)) {
|
||||
return new JavaFxDefaultPropertyElementDescriptor(name, childTag);
|
||||
}
|
||||
return new JavaFxClassBackedElementDescriptor(name, childTag);
|
||||
}
|
||||
|
||||
if (myName.equals(FxmlConstants.FX_ROOT)) {
|
||||
if (FxmlConstants.FX_ROOT.equals(myName)) {
|
||||
final JavaFxClassBackedElementDescriptor tagDescriptor = getRootTagDescriptor(contextTag);
|
||||
if (tagDescriptor != null) {
|
||||
return tagDescriptor.getElementDescriptor(childTag, contextTag);
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
<?import javafx.scene.layout.GridPane?>
|
||||
<?import javafx.scene.control.Button?>
|
||||
<GridPane xmlns:fx="http://javafx.com/fxml">
|
||||
<Button fx:id="btn1"/>
|
||||
<fx:define>
|
||||
<fx:reference source="btn1"/>
|
||||
</fx:define>
|
||||
</GridPane>
|
||||
Reference in New Issue
Block a user