diff options
Diffstat (limited to 'src/com/vaadin/ui/HelloWorldExtension.java')
-rw-r--r-- | src/com/vaadin/ui/HelloWorldExtension.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/src/com/vaadin/ui/HelloWorldExtension.java b/src/com/vaadin/ui/HelloWorldExtension.java new file mode 100644 index 0000000000..e705954f2e --- /dev/null +++ b/src/com/vaadin/ui/HelloWorldExtension.java @@ -0,0 +1,38 @@ +/* +@VaadinApache2LicenseForJavaFiles@ + */ +package com.vaadin.ui; + +import com.vaadin.terminal.AbstractExtension; +import com.vaadin.terminal.gwt.client.ui.helloworldfeature.GreetAgainRpc; +import com.vaadin.terminal.gwt.client.ui.helloworldfeature.HelloWorldRpc; +import com.vaadin.terminal.gwt.client.ui.helloworldfeature.HelloWorldState; + +public class HelloWorldExtension extends AbstractExtension { + + public HelloWorldExtension() { + registerRpc(new HelloWorldRpc() { + public void onMessageSent(String message) { + Notification.show(message); + } + }); + } + + @Override + public HelloWorldState getState() { + return (HelloWorldState) super.getState(); + } + + public void setGreeting(String greeting) { + getState().setGreeting(greeting); + requestRepaint(); + } + + public String getGreeting() { + return getState().getGreeting(); + } + + public void greetAgain() { + getRpcProxy(GreetAgainRpc.class).greetAgain(); + } +} |