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 242234 - Can't create a new FXML file with a space in the name.
Summary: Can't create a new FXML file with a space in the name.
Status: VERIFIED FIXED
Alias: None
Product: javafx
Classification: Unclassified
Component: Project (show other bugs)
Version: 8.0
Hardware: PC All
: P3 normal (vote)
Assignee: Roman Svitanic
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-02-22 22:41 UTC by swpalmer
Modified: 2014-07-20 19:16 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screenshot showing warning and truncated label "FXML Na..." (61.62 KB, image/png)
2014-02-22 22:41 UTC, swpalmer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description swpalmer 2014-02-22 22:41:49 UTC
Created attachment 145497 [details]
Screenshot showing warning and truncated label "FXML Na..."

NB 8.0 RC1

The New File wizard for an Empty FXML file does not allow a space in the FXML filename.

I could find no references in FXML documentation that indicated this was illegal.


(Note also from the attached screenshot that the label for the filename field is truncated on OS X.)
Comment 1 Lou Dasaro 2014-02-23 08:09:01 UTC
JavaFX Scene Builder certainly allows spaces in the middle of an FXML filename, and NetBeans accepts an FXML file with spaces in it's filename; you can build and run with same. I suspect it's only over-zealous validation in the Wizard that is at issue. I confirmed this with:

JavaFX Scene Builder, Version: 2.0-b14
Product Version: NetBeans IDE 8.0 RC1 (Build 201402202300)
Java: 1.8.0; Java HotSpot(TM) Client VM 25.0-b69
Runtime: Java(TM) SE Runtime Environment 1.8.0-b129
System: Windows 8 version 6.2 running on x86; Cp1252; en_US (nb)
Comment 2 SIvakin 2014-02-24 10:37:50 UTC
The same for Windows XP.
Comment 3 SIvakin 2014-02-24 10:39:39 UTC
In some test cases it's pointed "FXML filename" and in others "FXMLfilename", that's why I probably missed this issue before. Thanks to Scott again!
Comment 4 Roman Svitanic 2014-02-24 11:01:37 UTC
The wizard checks whether given name is valid Java identifier (which doesn't allow spaces). If we remove this constraint, then it'll break the current implementation of "Make controller" action, which by default creates a controller with name in form: {FXML_NAME}Controller.

I am not sure whether this is even P3 issue, seems to me more as P4...
Comment 5 swpalmer 2014-02-24 12:20:29 UTC
I suspected it was related to the naming of the controller.  I agree that this could possibly be a P4.

The restriction should still be removed as it is in the wrong place.  The method that makes the default name for the controller should simply filter out illegal characters from the filename and camelCase the result to come up with the initial name. (or something similar)
Comment 6 Roman Svitanic 2014-06-13 13:06:53 UTC
fixed in jet-main:
http://hg.netbeans.org/jet-main/rev/aafa2cad5060
Comment 7 Quality Engineering 2014-06-19 02:35:47 UTC
Integrated into 'main-silver', will be available in build *201406190001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/aafa2cad5060
User: Roman Svitanic <rsvitanic@netbeans.org>
Log: #242234: Can't create a new FXML file with a space in the name - fixed
Comment 8 Lou Dasaro 2014-07-20 19:16:05 UTC
Verified FIXED using:

Product Version: NetBeans IDE Dev (Build 201407200001)
Java: 1.8.0_20-ea; Java HotSpot(TM) Client VM 25.20-b20
Runtime: Java(TM) SE Runtime Environment 1.8.0_20-ea-b21
System: Windows 8 version 6.2 running on x86; Cp1252; en_US (nb)

Note: Must use JavaFX Scene Builder 2.0 or greater to handle spaces in filenames...