This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ViewController("view.fxml") | |
public class MyController { | |
@ActionHandler | |
protected FlowActionHandler actionHandler; | |
public void doSomething() { | |
actionHandler.handle("actionId"); | |
//or | |
actionHandler.navigate(NextController.class); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ViewController("main.fxml") | |
public class MainController { | |
@ViewNode | |
private RadioButton radioButton1; | |
@ViewNode | |
private RadioButton radioButton2; | |
@ViewNode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ViewNode("fx-id") | |
private Button anyName; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@ViewController("main.fxml") | |
public class MainController { | |
@ViewNode | |
private RadioButton radioButton1; | |
@ViewNode | |
private RadioButton radioButton2; | |
@ViewNode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.guigarage.dolphin; | |
import javafx.application.Application; | |
import javafx.geometry.Insets; | |
import javafx.scene.Scene; | |
import javafx.scene.control.Label; | |
import javafx.scene.control.TextField; | |
import javafx.scene.layout.VBox; | |
import javafx.stage.Stage; | |
import org.opendolphin.binding.JFXBinder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.guigarage.dolphin; | |
public class DolphinClient extends Application { | |
private TextField input; | |
private Label output; | |
@Override | |
public void start(Stage primaryStage) throws Exception { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void initClientDolphin(ClientDolphin clientDolphin) { | |
clientDolphin.getClientConnector().setUiThreadHandler(new JavaFXUiThreadHandler()); | |
ClientAttribute inputAttribute = clientDolphin.createAttribute("inputValue", ""); | |
ClientAttribute outputAttribute = clientDolphin.createAttribute("outputValue", ""); | |
ClientPresentationModel presentationModel = clientDolphin.presentationModel("myPresentationModel", inputAttribute, outputAttribute); | |
JFXBinder.bind("outputValue").of(presentationModel).to("text").of(output); | |
JFXBinder.bind("text").of(input).to("inputValue").of(presentationModel); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void initServerDolphin(ServerDolphin dolphin) { | |
dolphin.registerDefaultActions(); | |
dolphin.action("action", (command, response) -> { | |
ServerPresentationModel model = dolphin.findPresentationModelById("myPresentationModel"); | |
ServerAttribute inputAttribute = model.findAttributeByPropertyName("inputValue"); | |
ServerAttribute outputAttribute = model.findAttributeByPropertyName("outputValue"); | |
outputAttribute.setValue("Hello " + inputAttribute.getValue()); | |
}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void initDolphin() { | |
DefaultInMemoryConfig dolphinConfig = new DefaultInMemoryConfig(); | |
initServerDolphin(dolphinConfig.getServerDolphin()); | |
initClientDolphin(dolphinConfig.getClientDolphin()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.guigarage.dolphin; | |
import javafx.application.Application; | |
import javafx.geometry.Insets; | |
import javafx.scene.Scene; | |
import javafx.scene.control.Label; | |
import javafx.scene.control.TextField; | |
import javafx.scene.layout.VBox; | |
import javafx.stage.Stage; | |
import org.opendolphin.binding.JFXBinder; |