@Override public void init() { setTheme("mocha"); Window window = new Window(); window.setCaption(applicationTitle()); window.setSizeFull(); window.addStyleName("mocha-window"); setMainWindow(window); boolean needLogin = true; // check user if (getUser() != null) { needLogin = false; } else { if (isDevelopMode()) { setUser(loadTestUser()); needLogin = false; } } if (!needLogin) { AbstractMainPage homepage = SpringContextUtils.getBean("homepage", AbstractMainPage.class); homepage.setResponse(response); window.setContent(homepage); } else { LoginScreen loginScreen = new LoginScreen(cookieUsername); loginScreen.setResponse(response); window.setContent(loginScreen); } }
@Override public void init() { window = new Window("Vaadin DB Tester"); window.setSizeFull(); setMainWindow(window); setTheme("runo"); Panel panel = new MainPanel(); window.addComponent(panel); }
/** {@inheritdoc} */ @Override public void init() { // Add a horizontal SplitPanel to the lower area final HorizontalSplitPanel horizontalSplitPanel = new HorizontalSplitPanel(); horizontalSplitPanel.setSplitPosition(150, Sizeable.UNITS_PIXELS); horizontalSplitPanel.setSizeFull(); final Window mainWindow = new Window("NodeGraph Widget Application"); final Button openWindow = new Button("Open diagram"); openWindow.addListener( new Button.ClickListener() { /** */ private static final long serialVersionUID = -1522261898787739587L; /** {@inheritdoc} */ @Override public void buttonClick(ClickEvent event) { final Window subwindow = new Window("Node Graph Widget"); subwindow.setWidth("850px"); subwindow.setHeight("500px"); subwindow.setModal(true); final VerticalLayout layout = (VerticalLayout) subwindow.getContent(); layout.setMargin(true); layout.setSpacing(true); layout.setSizeFull(); final GraphComponent nodeGraphWidget = getNodeGraph(); layout.addComponent(nodeGraphWidget); mainWindow.addWindow(subwindow); } }); final HorizontalLayout hl = new HorizontalLayout(); hl.setSizeFull(); horizontalSplitPanel.setFirstComponent(openWindow); horizontalSplitPanel.setSecondComponent(hl); mainWindow.setContent(horizontalSplitPanel); mainWindow.setSizeFull(); this.setMainWindow(mainWindow); }