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); } } }