List of usage examples for com.vaadin.ui Window Window
public Window()
From source file:com.morevaadin.vaadin.externallayout.ExternalLayoutApplication.java
License:Apache License
@Override public void init() { Window window = new Window(); window.addComponent(new ExternalLayout("menu", new EclipseMenuBar())); window.addComponent(new View()); setMainWindow(window);/*from ww w . j a va2s . co m*/ }
From source file:com.morevaadin.vaadin.theming.ThemingApplication.java
License:Apache License
@Override public void init() { setTheme("reindeer"); Window window = new Window(); ThemingContent content = new ThemingContent(); window.setContent(content);/*from w ww. ja va 2s . co m*/ setMainWindow(window); content.afterApplicationSet(); }
From source file:com.piccritic.website.Home.java
/** * Sets up menu based on auth/*from ww w. j a v a 2 s . com*/ */ private void setupMenu() { Button home = new Button("Home", e -> { navigator.navigateTo(DefaultView.NAME); }); menu.addComponent(home); LoginStatus loginStatus = getLoginStatus(); if (loginStatus == LoginStatus.LOGGED_IN) { Button logout = new Button("Log out"); logout.addClickListener(e -> { logoutUser(); Page.getCurrent().reload(); }); menu.addComponent(logout); Button button = new Button("Create Post"); button.addClickListener(e -> { Window createPost = new CreatePost(getHandle()); UI.getCurrent().addWindow(createPost); }); menu.addComponent(button); } else { Button loginUser = new Button("Login"); loginUser.addClickListener(e -> { Window login = new LoginWindow(); addWindow(login); }); menu.addComponent(loginUser); } Button createUser = new Button(((loginStatus == LoginStatus.LOGGED_IN) ? "Update" : "Create") + "User"); createUser.addClickListener(e -> { Window userForm = new Window(); userForm.setModal(true); userForm.setContent(new VerticalLayout(new UserForm(getHandle()))); addWindow(userForm); }); menu.addComponent(createUser); menu.setMargin(true); menu.setSpacing(true); }
From source file:com.save.employee.maintenance.MRDataGridProperties.java
Window deletConfirmationWindow(int mrId, Object itemId) { Window sub = new Window(); sub.setCaption("CONFIRM DELETE"); sub.setWidth("250px"); sub.setModal(true);/*from w ww. j a va 2 s.c o m*/ VerticalLayout v = new VerticalLayout(); v.setWidth("100%"); v.setMargin(true); Button deleteBtn = new Button("DELETE?"); deleteBtn.setWidth("100%"); deleteBtn.addStyleName(ValoTheme.BUTTON_PRIMARY); deleteBtn.addClickListener((Button.ClickEvent event) -> { boolean result = mrs.removeMaintenanceReimbursement(mrId); if (result) { getContainerDataSource().removeItem(itemId); sub.close(); } }); v.addComponent(deleteBtn); sub.setContent(v); sub.getContent().setHeightUndefined(); return sub; }
From source file:com.save.employee.request.RLDataGridProperties.java
Window deletConfirmationWindow(int rlId, Object itemId) { Window sub = new Window(); sub.setCaption("CONFIRM DELETE"); sub.setWidth("250px"); sub.setModal(true);/*from www . j a va 2s. c o m*/ VerticalLayout v = new VerticalLayout(); v.setWidth("100%"); v.setMargin(true); Button deleteBtn = new Button("DELETE?"); deleteBtn.setWidth("100%"); deleteBtn.addStyleName(ValoTheme.BUTTON_PRIMARY); deleteBtn.addClickListener((Button.ClickEvent event) -> { boolean result = rls.deleteRequestById(rlId); if (result) { getContainerDataSource().removeItem(itemId); sub.close(); } }); v.addComponent(deleteBtn); sub.setContent(v); sub.getContent().setHeightUndefined(); return sub; }
From source file:com.thingtrack.route.planner.MainApplication.java
License:Apache License
@Override public void init() { main = new Window(); main.setSizeFull();/*from w w w . j a v a 2s . c o m*/ mainLayout = buildMainLayout(); main.setContent(mainLayout); setTheme("router.planner"); setMainWindow(main); }
From source file:de.codecentric.vaadin.copy2clipboard.Copy2ClipboardApplication.java
License:Apache License
/** * (non-Javadoc)/*from w ww . ja v a 2 s . c o m*/ * * @see com.vaadin.Application#init() */ @Override public void init() { mainWindow = new Window(); setMainWindow(mainWindow); // Add a Copy2ClipboardButton to the main page: Copy2ClipboardButton button = new Copy2ClipboardButton(); button.setCaption("Copy"); button.setClipboardText("copy this to the clipboard"); button.addListener(new CopyListener("from page: copied to clipboard")); mainWindow.addComponent(button); // Add a Copy2ClipboardButton to a panel: Copy2ClipboardButton c2c = new Copy2ClipboardButton(); c2c.setCaption("panelTest"); c2c.setClipboardText("clipboard text from panel"); c2c.addListener(new CopyListener("from panel: copied to clipboard")); Panel panel = new Panel(); panel.addComponent(c2c); mainWindow.addComponent(panel); Button modal = new Button("open modal window"); modal.addListener(new ClickListener() { @Override public void buttonClick(ClickEvent event) { C2CModalWindow w = new C2CModalWindow("Modal window"); w.center(); w.setContent(new ModalLayout()); mainWindow.addWindow(w); } }); mainWindow.addComponent(modal); }
From source file:de.decidr.ui.main.DecidrUI.java
License:Apache License
@Override public void init() { /* So that we immediately have access to the current application */ setCurrent(this); main = new Window(); setMainWindow(main);//from ww w .j a v a 2 s .com /* * Handle URLs such as * http://decidr.de/WebPortal/invitation?id=123&type=joinTenant */ main.addParameterHandler(new InvitationParameterHandler()); main.addParameterHandler(new ConfirmationParameterHandler()); main.addParameterHandler(new TenantParameterHandler()); main.addParameterHandler(new LoginParameterHandler()); director = new UIDirector(); director.createNewView(); /* * We're always starting as an unregistered user. */ UIBuilder ui = new UnregisteredUserViewBuilder(); director.setUiBuilder(ui); director.constructView(); user = new UserRole(UserRole.UNKNOWN_USER_ID); /* * FIXME The "decidr" theme is definitly broken since the upgrade to * Vaadin 6.2 ~dh */ setTheme(UIConventions.DEFAULT_THEME_NAME); /* * I guess this adds the navigation menu to the main window? TODO * document ~dh */ main.addComponent(director.getTemplateView()); /* * Register a transaction listener that updates our ThreadLocal with * each request */ if (getContext() != null) { getContext().addTransactionListener(this); } }
From source file:de.escidoc.admintool.view.context.AddOrgUnitToTheList.java
License:Open Source License
private void configure() { modalWindow = new Window(); modalWindow.setModal(true);/*from www. j a va 2 s . c om*/ modalWindow.setCaption(ViewConstants.SELECT_ORGANIZATIONAL_UNIT); modalWindow.setHeight(ViewConstants.MODAL_DIALOG_HEIGHT); modalWindow.setWidth(ViewConstants.MODAL_DIALOG_WIDTH); }
From source file:de.metas.ui.web.vaadin.report.VaadinJRViewerProvider.java
License:Open Source License
@Override public void openViewer(final byte[] data, final OutputType type, final String title, final ProcessInfo pi) throws JRException { final StreamResource pdfResource = new StreamResource(() -> new ByteArrayInputStream(data), "report.pdf"); final Window window = new Window(); window.setCaption(title);//from w w w. ja va 2 s . c om window.setStyleName(STYLE); window.center(); window.setWidth(800, Unit.PIXELS); window.setHeight(600, Unit.PIXELS); final BrowserFrame pdfComp = new BrowserFrame(); pdfComp.setPrimaryStyleName(STYLE + "-content"); pdfComp.setSizeFull(); pdfComp.setSource(pdfResource); window.setContent(pdfComp); UI.getCurrent().addWindow(window); }