This file contains hidden or 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
| // the view | |
| public MyView() { | |
| new Label().appendTo(container).bind(bindOnPresenter().get(Presenter_._greeting)); | |
| new InputText().appendTo(container).bind(bindOnPresenter().get(Presenter_._name)); | |
| new Button("Greet").appendTo(container).click(presenterMethod(Presenter_.__greet)); | |
| } | |
| // the presenter | |
| public class MyPresenter() { |
This file contains hidden or 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
| @ViewScoped | |
| @ManagedBean(name="TestView") | |
| public class TestView extends AbstractBackingView<TestBacking> { | |
| public TestView() { | |
| super(TestBacking.class, "TestBacking", "test"); | |
| JsfForm form = new JsfForm("mainform").appendTo(container); | |
| new JsfLabel("headerLabel", "Component showcase") | |
| .withStyleClasses("heading").appendTo(form); | |
| new JsfInputText("messageInput") |
This file contains hidden or 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
| Authenticator.setDefault(new Authenticator() { | |
| public PasswordAuthentication getPasswordAuthentication () { | |
| return new PasswordAuthentication ("DOMAIN\\your.username", "password".toCharArray()); | |
| } | |
| }); |
This file contains hidden or 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
| <svg xmlns="http://www.w3.org/2000/svg" | |
| xmlns:xlink="http://www.w3.org/1999/xlink" | |
| width="256" height="256"> | |
| <defs> | |
| <filter id="filter_ok"> | |
| <feColorMatrix type="matrix" values="0 0 0 0 1 | |
| 0 0 0 0 0 | |
| 0 0 0 0 0 | |
| -1 0 0 1 0"></feColorMatrix> | |
| </filter> |
This file contains hidden or 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
| public static <T> T find(Array<T> inArray, Function1<T, Boolean> predicate) { | |
| class X { | |
| public T result; | |
| public X run() { | |
| inArray.forEach((T item) -> { | |
| if (predicate.$invoke(item)) { | |
| result = item; | |
| } | |
| }); | |
| return this; |
This file contains hidden or 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
| Bindings.obs(person).get(Person_._manager).get(Person_._name); |
This file contains hidden or 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
| Person person = new Person(); | |
| Person_._name.addValueChangeListener(person, new ValueChangeListener<String>() { | |
| public void changed(String newValue) { | |
| System.out.println("Value changed to: " + newValue); | |
| } | |
| }); | |
| person.setName("new name"); // value changed to: new name |
This file contains hidden or 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
| <input type="text" ng-model="person.name" placeholder="Enter a name here"> | |
| <a href="" ng-click="savePerson">Save</a> |
This file contains hidden or 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
| <h:inputText value="#{personBacking.person.name}"/> | |
| <h:commandButton action="#{personBacking.savePerson}"/> |
This file contains hidden or 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
| <example> | |
| <gist-embed-testing with="medium.com"> | |
| </gist-embed-testing> | |
| </example> |