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 240037

Summary: [80cat] "Make Controller" action does not update the controller after FXML has been edited externally (in SceneBuilder)
Product: javafx Reporter: Lou Dasaro <mr_lou_d>
Component: EditorAssignee: Svata Dedic <sdedic>
Status: RESOLVED DUPLICATE    
Severity: normal CC: err, rsvitanic
Priority: P3    
Version: 8.0   
Hardware: PC   
OS: All   
Issue Type: DEFECT Exception Reporter:

Description Lou Dasaro 2014-01-06 17:41:21 UTC
Created a Maven JavaFX project. 
Opened Scene.fxml and added a button with an fx:id and a controller for onAction.
Saved Scene.fxml, and returned to NetBeans
Invoked the popup menu on Scene.fxml
Clicked "Make Controller"... Nothing happens.

This is different from Bug 239995, where at least there is navigation to the controller file. In this (Maven) scenario, nothing at all happens. 

Tested with: 
Product Version: NetBeans IDE Dev (Build 201401060002)
Java: 1.8.0-ea; Java HotSpot(TM) Client VM 25.0-b63
Runtime: Java(TM) SE Runtime Environment 1.8.0-ea-b121
System: Windows 8 version 6.2 running on x86; Cp1252; en_US (nb)

Using JavaFX Scene Builder Version: 2.0-b09, Changeset: 12f988d79fe6
Date: 2013-12-19 09:33  Java 1.8.0-ea-b120, Oracle Corporation
Comment 1 Roman Svitanic 2014-01-07 10:21:52 UTC
From the description of the problem it seems that you are opening and editing the fxml file in SceneBuilder. After that you return to the IDE and select "Make Controller" action on fxml file's node and nothing happens.

I assume it's only in case that you haven't focused fxml in editor or reopened it in IDE after editing in SceneBuilder (or haven't selected "Source > Scan for External Changes").

IDE is not aware of the change, therefore it does not generate/update the controller.
Comment 2 Lou Dasaro 2014-01-07 21:22:22 UTC
Yes, I open the fxml file in SceneBuilder and add a button and controller. After that I return to the IDE and select "Make Controller" action on fxml file's node and nothing happens. It sounds like you're saying NB isn't checking to see if it has an updated fxml when Make Controller is invoked.
Comment 3 Roman Svitanic 2014-01-08 12:26:48 UTC
*** Bug 239995 has been marked as a duplicate of this bug. ***
Comment 4 Lou Dasaro 2014-01-09 18:01:44 UTC
Just FYI, I created separate bug reports because this one originated from a JavaFX FXML project, while Bug 240037 originated from a Maven JavaFX project. It's okay by me though...
Comment 5 Roman Svitanic 2014-01-10 08:28:57 UTC
(In reply to Lou Dasaro from comment #4)
> Just FYI, I created separate bug reports because this one originated from a
> JavaFX FXML project, while Bug 240037 originated from a Maven JavaFX
> project. It's okay by me though...

In this case this issue (and its root cause) is not dependent on project type.
Comment 6 swpalmer 2014-02-14 15:27:58 UTC
I find that when this happens if I load the FXML into a NetBeans editor with by right-clicking and selected Edit, that then MakeController will work.
Comment 7 Lou Dasaro 2014-02-14 18:07:16 UTC
That extra step is the work-around. There are problems, in general, that occur because the file has been edited externally and NB doesn't "know" about it (UNTIL you select it into the editor).
Comment 8 Svata Dedic 2014-03-28 09:10:32 UTC

*** This bug has been marked as a duplicate of bug 241839 ***
Comment 9 Lou Dasaro 2014-03-31 17:02:45 UTC
Svata, how is this a duplicate? In the instant case,  "Make Controller" action does not update the controller after FXML has been edited externally when the FXML file has not focus in the editor.

This is clearly different from Bug 241839 which deletes code when "Make Controller" is invoked. Perhaps I am missing something?
Comment 10 Roman Svitanic 2015-03-30 09:51:45 UTC
*** Bug 251475 has been marked as a duplicate of this bug. ***