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:586d8a7483343c0a350a
Created November 1, 2014 16:40
platform dependent UI toolkit concurrency tools
View gist:586d8a7483343c0a350a
void runAndWait(Runnable runnable)
void runLater(Runnable runnable)
boolean isToolkitThread()
<T> T runCallableAndWait(Callable<T> callable)
@hendrikebbers
hendrikebbers / gist:8f703604408b1f31c807
Created November 1, 2014 16:42
JWarp define platform
View gist:8f703604408b1f31c807
UIToolkit.setPlatform(SwingPlatform.getInstance());
@hendrikebbers
hendrikebbers / gist:fb4e75887bb6e1c10388
Created November 1, 2014 16:45
ProcessChain in Swing
View gist:fb4e75887bb6e1c10388
ProcessChain.create().
addSupplierInPlatformThread(() -> myTextField.getText()).
addFunctionInExecutor((t) -> WeatherService.getWeather(t)).
addConsumerInPlatformThread((t) -> myLabel.setText(t)).onException((e) -> {
myLabel.setText("Error");
e.printStackTrace();
}).run();
View gist:386e867c3a659bd6bafd
public class SwingDemoView extends JPanel {
public SwingDemoView() {
setLayout(new BorderLayout());
JButton myButton = new JButton("Get weather by city");
myButton.setName("myButton");
JTextField myTextField = new JTextField();
myTextField.setName("myTextField");
@hendrikebbers
hendrikebbers / gist:d0282b33b5d78df79ebe
Created November 1, 2014 16:50
JWrap Swing Controller
View gist:d0282b33b5d78df79ebe
public class SwingDemoController {
@ViewNode
@ActionTrigger("copy-action")
private JButton myButton;
@ViewNode
private JTextField myTextField;
@ViewNode
View gist:d9b1b4d7f4b048ecc20d
public class JavaFXDemoView extends VBox {
public JavaFXDemoView() {
setSpacing(12);
setPadding(new Insets(12));
Button myButton = new Button("Get weather by city");
myButton.setId("myButton");
TextField myTextField = new TextField();
@hendrikebbers
hendrikebbers / gist:2fe09e4ad2f971fd3ffc
Created November 1, 2014 16:54
JWrap JavaFX Controller
View gist:2fe09e4ad2f971fd3ffc
public class JavaFXDemoController {
@ViewNode
@ActionTrigger("copy-action")
private Button myButton;
@ViewNode
private TextField myTextField;
@ViewNode
@hendrikebbers
hendrikebbers / gist:8a4201a4104b96fb7417
Created November 3, 2014 21:56
AquaFX 0.1 Dependency
View gist:8a4201a4104b96fb7417
<dependency>
<groupId>com.aquafx-project</groupId>
<artifactId>aquafx</artifactId>
<version>0.1</version>
</dependency>
@hendrikebbers
hendrikebbers / gist:f4536f16ecd0607a21fa
Created November 10, 2014 19:50
Install Polymer with Bower
View gist:f4536f16ecd0607a21fa
bower init
bower install --save Polymer/polymer
@hendrikebbers
hendrikebbers / gist:17685c4c660a17e1d204
Created November 10, 2014 19:53
polymer bower file
View gist:17685c4c660a17e1d204
{
"name": "polymer-test",
"version": "0.0.0",
"description": "A polymer playground",
"license": "MIT",
"keywords": [
"polymer",
"web-components"
],
"ignore": [