Skip to content

Instantly share code, notes, and snippets.

View hendrikebbers's full-sized avatar
:octocat:
Doing Java

Hendrik Ebbers hendrikebbers

:octocat:
Doing Java
View GitHub Profile
@hendrikebbers
hendrikebbers / gist:866d842707c7f635801c
Created January 21, 2015 07:10
Inject the FlowActionHandler in a DataFX Controller
@ViewController("view.fxml")
public class MyController {
@ActionHandler
protected FlowActionHandler actionHandler;
public void doSomething() {
actionHandler.handle("actionId");
//or
actionHandler.navigate(NextController.class);
@hendrikebbers
hendrikebbers / gist:29af17814c02f370581f
Last active August 29, 2015 14:13
The DataFX Controller
@ViewController("main.fxml")
public class MainController {
@ViewNode
private RadioButton radioButton1;
@ViewNode
private RadioButton radioButton2;
@ViewNode
@ViewNode("fx-id")
private Button anyName;
@ViewController("main.fxml")
public class MainController {
@ViewNode
private RadioButton radioButton1;
@ViewNode
private RadioButton radioButton2;
@ViewNode
@hendrikebbers
hendrikebbers / gist:974050726646860793c1
Last active August 29, 2015 14:14
Open Dolphin JavaFX Sample
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;
@hendrikebbers
hendrikebbers / gist:efd8f38ce118440d11a8
Created January 26, 2015 07:48
Open Dolphin Hello Word 1
package com.guigarage.dolphin;
public class DolphinClient extends Application {
private TextField input;
private Label output;
@Override
public void start(Stage primaryStage) throws Exception {
@hendrikebbers
hendrikebbers / gist:050c0e6f5bf361139496
Created January 26, 2015 07:49
Open Dolphin Hello Word 2
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);
@hendrikebbers
hendrikebbers / gist:fa965deb53f41b294b3d
Created January 26, 2015 07:50
Open Dolphin Hello Word 3
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());
});
}
@hendrikebbers
hendrikebbers / gist:4032a5d49074c747a505
Created January 26, 2015 07:51
Open Dolphin Hello Word 4
private void initDolphin() {
DefaultInMemoryConfig dolphinConfig = new DefaultInMemoryConfig();
initServerDolphin(dolphinConfig.getServerDolphin());
initClientDolphin(dolphinConfig.getClientDolphin());
}
@hendrikebbers
hendrikebbers / gist:a74bb52c852ebc72ed64
Created January 26, 2015 07:51
Open Dolphin Hello Word 5
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;