Provides JavaFx support.
| 25 | |
| 26 | /// Provides JavaFx support. |
| 27 | pub trait JavaFxSupport { |
| 28 | /// Triggers the start of a JavaFX application. |
| 29 | /// When the JavaFX application starts, the `InstanceReceiver` channel will receive an Instance of `javafx.stage.Stage`. |
| 30 | /// |
| 31 | /// The UI may start being built using the provided `Stage` |
| 32 | fn start_javafx_app(&self) -> errors::Result<InstanceReceiver>; |
| 33 | /// Deploys the required dependencies to run a JavaFX application in order to be able to be used by j4rs. |
| 34 | fn deploy_javafx_dependencies(&self) -> errors::Result<()>; |
| 35 | /// Creates an instance receiver that will be receiving `Instance`s of events. |
| 36 | /// The fx_event_type argument is the type of the event that we want to handle and receive Instances for. |
| 37 | /// |
| 38 | /// For example, to create an `InstanceReceiver` for a 'javafx.scene.control.Button', |
| 39 | /// you need to call the method by using the button as the _instance_ argument |
| 40 | /// `FxEventType::ActionEvent_Action` as the fx_event_type argument |
| 41 | fn get_javafx_event_receiver( |
| 42 | &self, |
| 43 | instance: &Instance, |
| 44 | fx_event_type: FxEventType, |
| 45 | ) -> errors::Result<InstanceReceiver>; |
| 46 | /// Creates an instance receiver that will be receiving `Instance`s of events for onclose requests of a `Stage`. |
| 47 | /// |
| 48 | /// The instance passed as argument needs to be of class `javafx.stage.Stage`. |
| 49 | fn on_close_event_receiver(&self, stage: &Instance) -> errors::Result<InstanceReceiver>; |
| 50 | /// Loads a FXML and returns a Result of a FxController for it. |
| 51 | fn load_fxml(&self, path: &PathBuf, stage: &Instance) -> errors::Result<FxController>; |
| 52 | } |
| 53 | |
| 54 | impl JavaFxSupport for Jvm { |
| 55 | /// Triggers the start of a JavaFX application. |
nothing calls this directly
no outgoing calls
no test coverage detected