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 221015 - Attributes in fx:include element
Summary: Attributes in fx:include element
Status: RESOLVED FIXED
Alias: None
Product: javafx
Classification: Unclassified
Component: Editor (show other bugs)
Version: 7.3
Hardware: PC Windows 7
: P3 normal (vote)
Assignee: Svata Dedic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-29 12:10 UTC by Stepan Zebra
Modified: 2012-11-07 03:38 UTC (History)
1 user (show)

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 Stepan Zebra 2012-10-29 12:10:01 UTC
Product Version: NetBeans IDE Dev (Build 201210290001)
Java: 1.7.0_10-ea; Java HotSpot(TM) 64-Bit Server VM 23.6-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_10-ea-b11
System: Windows 7 version 6.1 running on amd64; Cp1252; en_US (nb)

'fx:id' and all other attributes in 'fx:include' other than 'source' are marked as unexpected. Does the editor examine the source to determine a list of possible attributes? If no and doesn't plant to do so, then it shouldn't show any of these hints.
Comment 1 Svata Dedic 2012-10-29 12:22:07 UTC
You mean to examine the included source, whether an attribute corresponds to some property on the included object ?
Comment 2 Stepan Zebra 2012-10-29 12:58:30 UTC
To avoid the error hints for valid attributes, I was thinking that checking which class is the root element of the included source would be enough. Then make the list of available attributes for that class also available on the 'fx:include' element.

Same property can be set both in source and on 'fx:include' element and I believe in such case only relation between them is that the value from the source is overridden by the value on 'fx:include', but that's a different problem...

Should I attach some examples of what I mean?
Comment 3 Svata Dedic 2012-10-29 13:10:25 UTC
no ;) you clarified the issue enough. I'd be a little careful to crawl along fx:includes - I have no support (yet) to limit the include resolution to just 1 level and I'd like to avoid performance issues going through whole fx:include closure. 
For now, I just disable the check for attributes outside fx: namespace.
Comment 4 Svata Dedic 2012-10-29 13:12:30 UTC
Changeset: 4463cd073a28
Author:    Svata Dedic <sdedic@netbeans.org>
Date:      2012-10-29 14:12
Message:   Added support for fx:id and potentially additional attributes
Comment 5 Quality Engineering 2012-10-31 02:54:39 UTC
Integrated into 'main-golden', will be available in build *201210310001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/4463cd073a28
User: Svata Dedic <sdedic@netbeans.org>
Log: Issue #221015 - Attributes in fx:include element: fixed
Added support for fx:id and potentially additional attributes
Comment 6 Stepan Zebra 2012-10-31 10:28:06 UTC
The list of valid attributes on fx:include element now seems to be enhanced/restricted to what is available on the root element - the root of the document which contains the fx:include element to be clear.
Since the source for given fx:include can be any kind of Node (or Tab), there will still be improper error hints.

Example:

MyCheck.fxml
<?import javafx.scene.control.*?>
<CheckBox text="Tick It"/>

Page.fxml
<?import javafx.scene.layout.*?>
<FlowPane xmlns:fx="http://javafx.com/fxml">
 <children>
  <fx:include fx:id="mcDefault" source="MyCheck.fxml"/>
  <fx:include fx:id="mcTicked" source="MyCheck.fxml" selected="true"/>
 </children>
</FlowPane>

'selected' is CheckBox specific property and is marked with error hint that FlowPane doesn't support it
Comment 7 Svata Dedic 2012-10-31 10:42:24 UTC
My bad; I altered hierarchy for the FxInclude model, and forgot to change model tree visitor support accordingly.
Comment 8 Svata Dedic 2012-10-31 12:10:49 UTC
Changeset: 19e5006c8a75
Author:    Svata Dedic <sdedic@netbeans.org>
Date:      2012-10-31 13:10
Message:   Included bean is processed as instance.
Comment 9 Quality Engineering 2012-11-07 03:38:52 UTC
Integrated into 'main-golden', will be available in build *201211070001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/19e5006c8a75
User: Svata Dedic <sdedic@netbeans.org>
Log: Issue #221015 - Attributes in fx:include element: fixed
Included bean is processed as instance.