diff options
Diffstat (limited to 'java-vaadin/src/ch/asynk/helloworld/HelloWorldApp.java')
-rw-r--r-- | java-vaadin/src/ch/asynk/helloworld/HelloWorldApp.java | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/java-vaadin/src/ch/asynk/helloworld/HelloWorldApp.java b/java-vaadin/src/ch/asynk/helloworld/HelloWorldApp.java new file mode 100644 index 0000000..d5e3091 --- /dev/null +++ b/java-vaadin/src/ch/asynk/helloworld/HelloWorldApp.java @@ -0,0 +1,42 @@ +package ch.asynk.helloworld; + +import com.vaadin.Application; +import com.vaadin.terminal.Terminal; +import com.vaadin.terminal.Sizeable; +import com.vaadin.ui.Window; + +public class HelloWorldApp extends Application { + // + private static final long serialVersionUID = 1L; + // + private Context ctx = null; + public Context getCtx() { + return ctx; + } + // + @Override + public void init() { + ctx = new Context(this); + setTheme("asynk"); + final Window mainWindow = new Window("Hello World Application"); + mainWindow.setWidth(900,Sizeable.UNITS_PIXELS); + setMainWindow(mainWindow); + mainWindow.setContent( new MainLayout(ctx) ); + setLogoutURL("http://asynk.ch"); + ctx.getLogger().warning("hell : "+ctx.getProps().getProperty("hello.next")+" "+ctx.getProps().getProperty("hello.world")); + } + + public void notifyError(String title, String msg){ + getMainWindow().showNotification(title,msg,Window.Notification.TYPE_ERROR_MESSAGE); + } + + @Override + public void terminalError(Terminal.ErrorEvent event) { + // Call the default implementation. + super.terminalError(event); + // Some custom behaviour. + if (getMainWindow() != null) { + getMainWindow().showNotification("An unchecked exception occured!", event.getThrowable().toString(), Window.Notification.TYPE_ERROR_MESSAGE); + } + } +} |