... | ... | @@ -267,4 +267,12 @@ public class CorefViewParameterlessFunction extends BrowserFunction { |
|
|
```
|
|
|
This class extends ```Browserfunction``` and the delegation to ```super()``` registers our function to the browser. The function ```function(Object[] args)``` gets called, whenever someone pushes the according button. Since we allowed this implementation to take a ```Runnable``` as input (which is a procedure that has no param and no return value) we can just run it inside the method.
|
|
|
|
|
|
Note: If you need parameter you obviously need to change the Runnable into any other functional interface!
|
|
|
|
|
|
## Executing Javascript from within Java
|
|
|
|
|
|
This is probably the direction you need less often, since the interactions in between the layout should be handled entirely using HTML and jscript and the controller usually only passes new input data which should get rendered into new html code.
|
|
|
However we usually also have a method to refresh the input or other stuff. Since this is shown in two other tutorials and i currently dont have any uses im just gonna link to them:
|
|
|
|
|
|
* [Javascript and Java I](http://ramkulkarni.com/blog/using-java-objects-in-javascript-in-eclipse-swt-browser-control/)
|
|
|
* [Javascript and Java - Vogella] (http://blog.vogella.com/2009/12/21/javascript-swt/) |