2016-09-11 8 views
1

スカラー2.11 + JavaFXプロジェクトが2.12.0-RC1に更新されました。コードはJava @FXML注釈を集中的に使用します。実行時に注釈情報がスカラーで失われる2.12 trait

trait MainController { 
    @FXML def onRun(event: ActionEvent) { 
    val script = currentEngine.executeScript("editor.getValue()").toString 
    runScript(script) 
    } 
} 

<MenuItem mnemonicParsing="false" onAction="#onRun" text="Run"> 
    <accelerator> 
     <KeyCodeCombination alt="UP" code="R" control="UP" meta="UP" shift="UP" shortcut="DOWN"/> 
    </accelerator> 
</MenuItem> 

FXMLLoader.loadを実行中に、エラーがスローされます。

javafx.fxml.LoadException: Error resolving onAction='#onRun', either the event handler is not in the Namespace or there is an error in the script. 

@FXML注釈情報は、コンパイル時に失われているようです。私は、2.12ではすべての特性がインターフェースにコンパイルされていると聞いていますが、この変更がどのように問題を引き起こしていますか?回避策はありますか?

答えて

0

理由は不明ですが、この問題はscala-2.12.0-RC2で解決されています。スカラチームに感謝します。

関連する問題