This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 262304 - FXML Editor giving error when parsing an element that use @NamedArg in constructor.
Summary: FXML Editor giving error when parsing an element that use @NamedArg in constr...
Status: NEW
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.1
Hardware: PC Mac OS X
: P3 normal with 1 vote (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-06-02 09:19 UTC by ugurkara
Modified: 2016-06-02 09:19 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description ugurkara 2016-06-02 09:19:53 UTC
When i use my own  element that use @NamedArg, XML editor showing error that "... can not be created by FXML Loader".

public class MySymbol extends StackPane {



    @Override
    public final ObservableList<Node> getChildren() {
        return super.getChildren();
    }

    public MySymbol(@NamedArg("url") String url) {
        try {
            FXMLLoader loader = new FXMLLoader(new URL(url));
            loader.setRoot(this);
            loader.setController(this);
            loader.load();
        } catch (IOException ex) {
            Logger.getLogger(MySymbol.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

}



Here is sub FXML component,


<fx:root type="StackPane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="117.0" prefWidth="94.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1">
    <children>
        <Rectangle arcHeight="5.0" arcWidth="5.0" fill="DODGERBLUE" height="89.0" stroke="BLACK" strokeType="INSIDE" width="63.0" />
        <Text strokeType="OUTSIDE" strokeWidth="0.0" text="Tank 1" />
    </children>
</fx:root>



And Main document that use sub nodes

<AnchorPane id="AnchorPane" prefHeight="337.0" prefWidth="453.0" xmlns="http://javafx.com/javafx/8" xmlns:fx="http://javafx.com/fxml/1" fx:controller="test01.FXMLDocumentController">
    <children>
        <MySymbol url="@MySymbol2.fxml"></MySymbol>
    </children>
</AnchorPane>


when i run this application isOK, but in xml editor showing error.