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ではすべての特性がインターフェースにコンパイルされていると聞いていますが、この変更がどのように問題を引き起こしていますか?回避策はありますか?