/** * 页面底部版权 Bar * * @return */ public HorizontalLayout getPageFooter() { // 底部公司介绍 水平布局 HorizontalLayout footer = new HorizontalLayout(); footer.setWidth(100, Unit.PERCENTAGE); footer.setMargin(true); footer.addStyleName(Reindeer.LAYOUT_BLACK); // -----------------------底部公司介绍------------------------------- Label lbcopyright = new Label("Copyright 2014"); lbcopyright.setSizeUndefined(); // lbcopyright.addStyleName(Reindeer.LABEL_H2); Label lbcompany = new Label("上海释伟科技有限公司"); // lbcompany.addStyleName(Reindeer.LABEL_H2); Label lbdesc = new Label("留夫鸭电子商务O2O解决方案"); // lbdesc.addStyleName(Reindeer.LABEL_H2); Label lbspace = new Label(); // 占位空间 lbspace.setWidth(520, Unit.PIXELS); footer.setSpacing(true); // 设置间隙 footer.addComponent(lbcopyright); footer.setComponentAlignment(lbcopyright, Alignment.MIDDLE_LEFT); // footer.addComponent(lbspace); footer.addComponent(lbdesc); footer.setComponentAlignment(lbdesc, Alignment.MIDDLE_LEFT); footer.addComponent(lbspace); footer.addComponent(lbcompany); footer.setComponentAlignment(lbcompany, Alignment.MIDDLE_LEFT); return footer; }
private void addNavigation() { userLabel = new Label(); userLabel.setSizeFull(); HorizontalLayout informtaion = new HorizontalLayout(); informtaion.addComponent(userLabel); HorizontalLayout navigation = new HorizontalLayout(); navigation.addComponents( btnAdverts, btnLogin, btnRegistration, btnAdvertReg, btnMyAccout, btnAdminAccount, btnLogout); HorizontalLayout languages = new HorizontalLayout(); languages.addComponents(btnHun, btnEng); HorizontalLayout headersplitter = new HorizontalLayout(); headersplitter.addComponents(informtaion, navigation, languages); headersplitter.setWidth(i18Helper.getMessage("size_100")); headersplitter.setComponentAlignment(informtaion, Alignment.TOP_LEFT); headersplitter.setComponentAlignment(navigation, Alignment.TOP_CENTER); headersplitter.setComponentAlignment(languages, Alignment.TOP_RIGHT); header.addComponent(headersplitter); header.setComponentAlignment(headersplitter, Alignment.TOP_CENTER); }
public void onSuccessfulLogin2() { this.context = (WebApplicationContext) getContext(); context .getHttpSession() .setAttribute("session", HibernateUtil.getSessionFactory().openSession()); context.getHttpSession().setAttribute("userName", userCurrent.getName()); controlUserPermissions = new ControlUserPermissions(userCurrent, context); String propName = this.getProperty("pathEntityOrder"); String propPath = this.getContext().getBaseDirectory().getAbsolutePath() + File.separator + propName; HibernateUtil.getEntityOrder(propPath); /** * ******************************************** Cabecera * ****************************************************** */ HorizontalLayout headHorizontalLayout = new HorizontalLayout(); headHorizontalLayout.setWidth("100%"); headHorizontalLayout.setHeight("80"); logoPNG = new Embedded(null, new ThemeResource("images/logo.png")); logoPNG.setWidth("140"); logoPNG.setHeight("60"); headHorizontalLayout.addComponent(logoPNG); headHorizontalLayout.setComponentAlignment(logoPNG, Alignment.MIDDLE_LEFT); headHorizontalLayout.setExpandRatio(logoPNG, 3); UserTab userTab = new UserTab(this); headHorizontalLayout.addComponent(userTab); headHorizontalLayout.setComponentAlignment(userTab, Alignment.MIDDLE_RIGHT); headHorizontalLayout.setExpandRatio(userTab, 1); /** * ********************************************************************* * *************************************** */ /** * ******************************************** Barra Menú * **************************************************** */ toolbar = new YacareToolbar(this); /** * ********************************************************************* * *************************************** */ /** * ******************************************** Cuerpo de página * ********************************************** */ bodyPageVerticalLayout = new VerticalLayout(); bodyPageVerticalLayout.addComponent(headHorizontalLayout); bodyPageVerticalLayout.addComponent(toolbar); YacareFooter footer = new YacareFooter(); bodyPageVerticalLayout.addComponent(footer); bodyPageVerticalLayout.setComponentAlignment(footer, Alignment.BOTTOM_CENTER); /** * ********************************************************************* * *************************************** */ getMainWindow().setContent(bodyPageVerticalLayout); }
@AutoGenerated private HorizontalLayout buildPasswordDiv() { // common part: create layout passwordDiv = new HorizontalLayout(); passwordDiv.setImmediate(false); passwordDiv.setDescription("Your password"); passwordDiv.setWidth("291px"); passwordDiv.setHeight("34px"); passwordDiv.setMargin(false); // passwordLabel passwordLabel = new Label(); passwordLabel.setImmediate(false); passwordLabel.setWidth("80px"); passwordLabel.setHeight("20px"); passwordLabel.setValue("Password:"******"Need Password"); passwordField.setImmediate(false); passwordField.setWidth("197px"); passwordField.setHeight("20px"); passwordField.setRequired(true); passwordDiv.addComponent(passwordField); passwordDiv.setComponentAlignment(passwordField, new Alignment(34)); return passwordDiv; }
public ConfirmDialog( String caption, String message, String okButtonText, String cancelButtonText) { super(caption); super.setModal(true); super.setClosable(false); super.setResizable(false); VerticalLayout windowLayout = new VerticalLayout(); windowLayout.setMargin(true); // confirmation message windowLayout.addComponent(new Label(message, ContentMode.HTML)); windowLayout.setSpacing(true); // buttons HorizontalLayout buttonsLayout = new HorizontalLayout(); buttonsLayout.setWidth(100.0f, Unit.PERCENTAGE); windowLayout.addComponent(buttonsLayout); okButton = new Button(okButtonText); buttonsLayout.addComponent(okButton); okButton.setTabIndex(1); okButton.addClickListener(this); buttonsLayout.setComponentAlignment(okButton, Alignment.MIDDLE_CENTER); cancelButton = new Button(cancelButtonText); buttonsLayout.addComponent(cancelButton); cancelButton.setTabIndex(0); cancelButton.setClickShortcut(KeyCode.ESCAPE, null); cancelButton.addClickListener(this); buttonsLayout.setComponentAlignment(cancelButton, Alignment.MIDDLE_CENTER); super.setContent(windowLayout); }
@AutoGenerated private HorizontalLayout buildConfirmDiv() { // common part: create layout confirmDiv = new HorizontalLayout(); confirmDiv.setImmediate(false); confirmDiv.setWidth("100.0%"); confirmDiv.setHeight("100.0%"); confirmDiv.setMargin(false); // confirmLabel confirmLabel = new Label(); confirmLabel.setImmediate(false); confirmLabel.setWidth("52px"); confirmLabel.setHeight("-1px"); confirmLabel.setValue("Confirm:"); confirmDiv.addComponent(confirmLabel); confirmDiv.setComponentAlignment(confirmLabel, new Alignment(9)); // passwordConfirm passwordConfirm = new PasswordField(); passwordConfirm.setCaption("Need confirm password:"******"195px"); passwordConfirm.setHeight("20px"); passwordConfirm.setRequired(true); confirmDiv.addComponent(passwordConfirm); confirmDiv.setExpandRatio(passwordConfirm, 1.0f); confirmDiv.setComponentAlignment(passwordConfirm, new Alignment(34)); return confirmDiv; }
private void initComponents() { setSpacing(true); HorizontalLayout layout = new HorizontalLayout(); layout.setSpacing(true); layout.setWidth("100%"); cardNuberField = new TextField(); cardNuberField.setWidth("100%"); cardNuberField.setInputPrompt("Ноомер социальной карты, либо e-mail"); layout.addComponent(cardNuberField); layout.setComponentAlignment(cardNuberField, Alignment.MIDDLE_RIGHT); layout.setExpandRatio(cardNuberField, 1.0f); addComponent(layout); layout = new HorizontalLayout(); layout.setSpacing(true); layout.setWidth("100%"); checkwordField = new TextField(); checkwordField.setWidth("100%"); checkwordField.setInputPrompt("Проверочное слово"); layout.addComponent(checkwordField); layout.setComponentAlignment(checkwordField, Alignment.MIDDLE_RIGHT); layout.setExpandRatio(checkwordField, 1.0f); addComponent(layout); Button btnSearch = new Button("Найти"); btnSearch.addClickListener(getSearchClickListener()); addComponent(btnSearch); }
@AutoGenerated private HorizontalLayout buildEmailDiv() { // common part: create layout emailDiv = new HorizontalLayout(); emailDiv.setImmediate(false); emailDiv.setWidth("291px"); emailDiv.setHeight("100.0%"); emailDiv.setMargin(false); // emailLabel emailLabel = new Label(); emailLabel.setStyleName("emailLabel"); emailLabel.setImmediate(false); emailLabel.setWidth("63px"); emailLabel.setHeight("15px"); emailLabel.setValue("Email:"); emailDiv.addComponent(emailLabel); emailDiv.setComponentAlignment(emailLabel, new Alignment(9)); // email email = new TextField(); email.setCaption("Email Required"); email.setImmediate(false); email.setWidth("197px"); email.setHeight("18px"); email.setRequired(true); email.setSecret(false); emailDiv.addComponent(email); emailDiv.setComponentAlignment(email, new Alignment(34)); return emailDiv; }
@AutoGenerated private HorizontalLayout buildLastNameDiv() { // common part: create layout lastNameDiv = new HorizontalLayout(); lastNameDiv.setImmediate(false); lastNameDiv.setWidth("291px"); lastNameDiv.setHeight("45px"); lastNameDiv.setMargin(false); // lastNameLabel lastNameLabel = new Label(); lastNameLabel.setStyleName("lastNameLabel"); lastNameLabel.setImmediate(false); lastNameLabel.setWidth("69px"); lastNameLabel.setHeight("60.0%"); lastNameLabel.setValue("Last Name:"); lastNameDiv.addComponent(lastNameLabel); lastNameDiv.setComponentAlignment(lastNameLabel, new Alignment(9)); // lastName lastName = new TextField(); lastName.setStyleName("lastName"); lastName.setCaption("Last Name Required:"); lastName.setImmediate(false); lastName.setWidth("202px"); lastName.setHeight("20px"); lastName.setRequired(true); lastName.setSecret(false); lastNameDiv.addComponent(lastName); lastNameDiv.setComponentAlignment(lastName, new Alignment(34)); return lastNameDiv; }
@Override public void attach() { // System.out.println("refer url is: "+referrer); // System.out.println("Start to read the window name: "); // List<String> wNames = new ArrayList<String>(); // for(Window w:getWindows()){ // wNames.add(w.getName()); // System.out.println("window name is: "+w.getName()); // } // getApplication().getMainWindow().removeAllComponents(); VerticalLayout userAuthLayout = new VerticalLayout(); userAuthLayout.addStyleName("sourceAppLayout"); Label comfireLable = new Label("Please Check the User Information"); comfireLable.addStyleName("comfireLable"); userAuthLayout.addComponent(comfireLable); // userAuthLayout.setComponentAlignment(comfireLable, Alignment.MIDDLE_RIGHT); HorizontalLayout g1 = new HorizontalLayout(); g1.addStyleName("sourceAPPAuthInfoLayout"); userAuthLayout.addComponent(g1); userAuthLayout.setComponentAlignment(g1, Alignment.MIDDLE_LEFT); // network infor Label networkInfo = new Label("Authencation Network"); networkInfo.addStyleName("inforCard"); g1.addComponent(networkInfo); g1.setComponentAlignment(networkInfo, Alignment.TOP_LEFT); Label autheFromSiteName = new Label("eBay"); autheFromSiteName.addStyleName("inforValue"); g1.addComponent(autheFromSiteName); g1.setComponentAlignment(autheFromSiteName, Alignment.TOP_RIGHT); HorizontalLayout g2 = new HorizontalLayout(); g2.addStyleName("sourceAPPAuthInfoLayout"); userAuthLayout.addComponent(g2); userAuthLayout.setComponentAlignment(g2, Alignment.MIDDLE_LEFT); // userName infor Label userNameInfo = new Label("User Info"); userNameInfo.addStyleName("inforCard"); userNameInfo.addStyleName("userNameInfo"); g2.addComponent(userNameInfo); g2.setComponentAlignment(userNameInfo, Alignment.TOP_LEFT); Label authUserName = new Label(referrer.split("username="******"inforValue"); g2.addComponent(authUserName); g2.setComponentAlignment(authUserName, Alignment.TOP_RIGHT); // // token expireDate infor // Label tokenInfo=new Label("Developer"); // g.addComponent(tokenInfo); // g.setComponentAlignment(tokenInfo,Alignment.MIDDLE_CENTER); // Label tokenExpireDate=new Label(referrer.split("username=")[1]); // g.addComponent(authUserName); // g.setComponentAlignment(authUserName,Alignment.MIDDLE_CENTER); userAuthLayout.addComponent(getWebFoot()); this.setContent(userAuthLayout); }
private Component AutoGeneratedLayoutDesign() { final VerticalLayout layout = new VerticalLayout(); layout.setSpacing(true); layout.setMargin(true); // set parent Test Case manually without a field if (editmode == false && (clonemode == false)) { testsession.setParentcase(parentcase); } binder = new FieldGroup(); // BeanItem<Person> item = new BeanItem<Person>(person); // takes item as argument // item.addNestedProperty("address.street"); // Address info is not person but address to which // person is linked binder.setItemDataSource(newSessionItem); // link to data model to binder // binder.bindMemberFields(form); // link to layout // GENERATE FIELDS // for (Object propertyId : item.getItemPropertyIds()) { // if(!"address".equals(propertyId)) { // Field field = binder.buildAndBind(propertyId); // layout.addComponent(field); // } // } // using bind() to determine what type of field is created yourself... title = new TextField(); binder.bind(title, "title"); title.setWidth(22, Unit.EM); title.setCaption("Title"); title.focus(); title.setImmediate(true); title.addValidator(new BeanValidator(TestSession.class, "title")); // title.setValidationVisible(false); title.setNullRepresentation(""); layout.addComponent(title); binder.setBuffered(true); // button layout HorizontalLayout buttons = new HorizontalLayout(); buttons.setWidth("100%"); buttons.addStyleName("buttons-margin-top"); layout.addComponent(buttons); createButton = new Button("Create", this); if (editmode) createButton.setCaption("Save"); createButton.addStyleName(ValoTheme.BUTTON_PRIMARY); createButton.setClickShortcut(KeyCode.ENTER); cancelButton = new Button("Cancel", this); buttons.addComponents(createButton, cancelButton); buttons.setComponentAlignment(createButton, Alignment.MIDDLE_LEFT); buttons.setComponentAlignment(cancelButton, Alignment.MIDDLE_RIGHT); return layout; }
public void buildView() { TabSheet tabSheet = new TabSheet(); tabSheet.setSizeFull(); VerticalLayout layoutUtama = new VerticalLayout(); layoutUtama.setSizeFull(); layoutUtama.setMargin(true); // LAYOUT TOP VerticalLayout layoutTop = new VerticalLayout(); layoutTop.setMargin(true); HorizontalLayout layoutTopInner1 = new HorizontalLayout(); HorizontalLayout layoutTopInner2 = new HorizontalLayout(); layoutTop.addComponent(layoutTopInner1); layoutTop.addComponent(layoutTopInner2); // LAYOUT TABLE VerticalLayout layoutTable = new VerticalLayout(); layoutTable.setSizeFull(); layoutTable.addComponent(table); table.setSizeFull(); // LAYOUT BOTTOM VerticalLayout layoutBottom = new VerticalLayout(); HorizontalLayout layoutFooter1 = new HorizontalLayout(); HorizontalLayout layoutFooter2 = new HorizontalLayout(); layoutBottom.addComponent(layoutFooter1); layoutBottom.addComponent(layoutFooter2); // LAYOUT UTAMA layoutUtama.addComponent(layoutTop); layoutUtama.addComponent(layoutTable); layoutUtama.addComponent(layoutBottom); tabSheet.addComponent(layoutUtama); content.addComponent(tabSheet); setCompositionRoot(content); // Extended Konfigurasi Size layoutUtama.setExpandRatio(layoutTable, 1); layoutTopInner1.addComponent(fieldSearchById); layoutTopInner1.setComponentAlignment(fieldSearchById, Alignment.BOTTOM_CENTER); layoutTopInner1.addComponent(comboSearchByDivision); layoutTopInner1.setComponentAlignment(comboSearchByDivision, Alignment.BOTTOM_CENTER); layoutTopInner1.addComponent(dateFieldSearchByTransdateFrom); layoutTopInner1.setComponentAlignment(dateFieldSearchByTransdateFrom, Alignment.BOTTOM_CENTER); layoutTopInner1.addComponent(dateFieldSearchByTransdateTo); layoutTopInner1.setComponentAlignment(dateFieldSearchByTransdateTo, Alignment.BOTTOM_CENTER); layoutTopInner1.addComponent(btnSearch); layoutTopInner1.setComponentAlignment(btnSearch, Alignment.BOTTOM_CENTER); layoutBottom.addComponent(btnSelect); // init formLayout.setVisible(true); }
public UserSelect() { loginInfo = new Label(""); loginInfo.addStyleName("error-font"); loginInfo.addStyleName("margin15"); loginInfo.addStyleName("margin-top40"); loginInfo.setVisible(false); selected = null; loginField = new PasswordField(""); loginField.setWidth("200px"); loginField.addStyleName("margin15"); loginField.addStyleName("margin-bot40"); loginBut = new Button("login"); loginBut.addStyleName("margin15"); loginBut.addClickListener( e -> { if (loginField.getValue().equals(selected.getPassword())) { hidePass(); Globals.user = selected; Globals.root.changeScreen(Globals.user); } else { loginInfo.setVisible(true); loginInfo.setValue("Wrong password"); loginField.setValue(""); } }); loginBox = new HorizontalLayout(); loginBox.addStyleName("popup-box"); loginBox.addComponents(loginField, loginBut, loginInfo); loginBox.setComponentAlignment(loginField, Alignment.MIDDLE_LEFT); loginBox.setComponentAlignment(loginBut, Alignment.MIDDLE_CENTER); loginBox.setComponentAlignment(loginField, Alignment.MIDDLE_RIGHT); loginBox.setVisible(false); userIcon = new ThemeResource("icons/user.png"); users = Globals.control.usersData(); vbox = new VerticalLayout(); // vbox.setSizeUndefined(); vbox.setDefaultComponentAlignment(Alignment.MIDDLE_CENTER); Panel p = new Panel(); p.setSizeFull(); p.setContent(vbox); // vbox.addStyleName("border-l-r"); this.addComponent(p, "left: 25%; right: 25%; top: 15px"); this.addComponent(loginBox, "left: 25%; right: 25%; top: 40%"); this.addLayoutClickListener( e -> { if (!loginBox.isVisible()) return; System.out.println(e.getClickedComponent()); if (e.getClickedComponent() == null || e.getClickedComponent().equals(vbox)) hidePass(); }); }
Layout getHeader() { HorizontalLayout header = new HorizontalLayout(); header.setWidth("100%"); header.setMargin(false); header.setSpacing(true); ThemeResource themeResource = new ThemeResource("icons/processbase.png"); Embedded logo = new Embedded(); logo.setSource(themeResource); logo.setType(Embedded.TYPE_IMAGE); header.addComponent(logo); header.setExpandRatio(logo, 1.0f); Label helloUser; if (StringUtils.isEmpty(user.firstName) && StringUtils.isEmpty(user.lastName)) helloUser = new Label(getPbMessages("welcome") + ", " + user.username); else helloUser = new Label(getPbMessages("welcome") + ", " + user.firstName + " " + user.lastName); // helloUser.setStyleName(Runo.LABEL_H2); header.addComponent(helloUser); header.setComponentAlignment(helloUser, Alignment.MIDDLE_RIGHT); header.setExpandRatio(helloUser, 1.0f); if (!BPMModule.USER_GUEST.equals(user.username)) { Button profile = new Button( getPbMessages("btnProfile"), new Button.ClickListener() { public void buttonClick(ClickEvent event) { openProfileWindow(); } }); profile.setStyleName(Runo.BUTTON_LINK); header.addComponent(profile); header.setComponentAlignment(profile, Alignment.MIDDLE_RIGHT); } Button logout = new Button( getPbMessages("btnLogout"), new Button.ClickListener() { public void buttonClick(ClickEvent event) { openLogoutWindow(); } }); logout.setStyleName(Runo.BUTTON_LINK); header.addComponent(logout); header.setComponentAlignment(logout, Alignment.MIDDLE_RIGHT); return header; }
private void initLayoutContent() { initNavigationButtons(); initHideWeekEndButton(); initReadOnlyButton(); initDisabledButton(); initAddNewEventButton(); HorizontalLayout hl = new HorizontalLayout(); hl.setWidth("100%"); hl.setSpacing(true); hl.setMargin(new MarginInfo(false, false, true, false)); hl.addComponent(prevButton); hl.addComponent(captionLabel); hl.addComponent(monthButton); hl.addComponent(weekButton); hl.addComponent(nextButton); hl.setComponentAlignment(prevButton, Alignment.MIDDLE_LEFT); hl.setComponentAlignment(captionLabel, Alignment.MIDDLE_CENTER); hl.setComponentAlignment(monthButton, Alignment.MIDDLE_CENTER); hl.setComponentAlignment(weekButton, Alignment.MIDDLE_CENTER); hl.setComponentAlignment(nextButton, Alignment.MIDDLE_RIGHT); monthButton.setVisible(viewMode == Mode.WEEK); weekButton.setVisible(viewMode == Mode.DAY); HorizontalLayout controlPanel = new HorizontalLayout(); controlPanel.setSpacing(true); controlPanel.setMargin(new MarginInfo(false, false, true, false)); controlPanel.setWidth("100%"); controlPanel.addComponent(localeSelect); controlPanel.addComponent(timeZoneSelect); controlPanel.addComponent(formatSelect); controlPanel.addComponent(customFirstDayOfWeekSelect); controlPanel.addComponent(hideWeekendsButton); controlPanel.addComponent(readOnlyButton); controlPanel.addComponent(disabledButton); controlPanel.addComponent(addNewEvent); controlPanel.setComponentAlignment(timeZoneSelect, Alignment.MIDDLE_LEFT); controlPanel.setComponentAlignment(formatSelect, Alignment.MIDDLE_LEFT); controlPanel.setComponentAlignment(localeSelect, Alignment.MIDDLE_LEFT); controlPanel.setComponentAlignment(hideWeekendsButton, Alignment.MIDDLE_LEFT); controlPanel.setComponentAlignment(readOnlyButton, Alignment.MIDDLE_LEFT); controlPanel.setComponentAlignment(disabledButton, Alignment.MIDDLE_LEFT); controlPanel.setComponentAlignment(addNewEvent, Alignment.MIDDLE_LEFT); GridLayout layout = (GridLayout) getContent(); layout.addComponent(controlPanel); layout.addComponent(hl); layout.addComponent(calendarComponent); layout.setRowExpandRatio(layout.getRows() - 1, 1.0f); }
private Layout createTextFieldMail(String title, Component component) { HorizontalLayout layout = new HorizontalLayout(); Label lbTitle = new Label(title); lbTitle.setWidth("60px"); lbTitle.setStyleName("lbmail"); layout.addComponent(lbTitle); layout.setComponentAlignment(lbTitle, Alignment.MIDDLE_RIGHT); layout.addComponent(component); layout.setComponentAlignment(component, Alignment.MIDDLE_LEFT); layout.setWidth("100%"); layout.setExpandRatio(component, 1.0f); return layout; }
private Component buildLabels() { HorizontalLayout labels = new HorizontalLayout(); labels.setSpacing(true); labels.setWidth(100, Unit.PERCENTAGE); ThemeResource resource = new ThemeResource("images/logo.jpg"); Image image = new Image("", resource); labels.addComponent(image); Label title = new Label("SAPo"); title.setSizeUndefined(); title.addStyleName(ValoTheme.LABEL_H3); labels.addComponent(title); labels.setComponentAlignment(image, Alignment.TOP_RIGHT); labels.setComponentAlignment(title, Alignment.BOTTOM_LEFT); return labels; }
private Component buildFields() { HorizontalLayout fields = new HorizontalLayout(); fields.setSpacing(true); fields.addStyleName("fields"); username = new TextField("Usuario"); username.setIcon(FontAwesome.USER); username.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON); username.focus(); clave = new PasswordField("Contraseña"); clave.setIcon(FontAwesome.LOCK); clave.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON); final Button signin = new Button("Entrar"); signin.addStyleName(ValoTheme.BUTTON_PRIMARY); signin.setClickShortcut(KeyCode.ENTER); fields.addComponents(username, clave, signin); fields.setComponentAlignment(signin, Alignment.BOTTOM_LEFT); signin.addClickListener( new ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { doLogin(); } }); return fields; }
@AutoGenerated private HorizontalLayout buildCompanyDiv() { // common part: create layout companyDiv = new HorizontalLayout(); companyDiv.setImmediate(false); companyDiv.setWidth("299px"); companyDiv.setHeight("31px"); companyDiv.setMargin(false); // companyLabel companyLabel = new Label(); companyLabel.setStyleName("companyLabel"); companyLabel.setImmediate(false); companyLabel.setWidth("63px"); companyLabel.setHeight("15px"); companyLabel.setValue("Company:"); companyDiv.addComponent(companyLabel); // company company = new TextField(); company.setImmediate(false); company.setWidth("202px"); company.setHeight("20px"); company.setRequired(true); company.setSecret(false); companyDiv.addComponent(company); companyDiv.setComponentAlignment(company, new Alignment(34)); return companyDiv; }
@AutoGenerated private HorizontalLayout buildHorizontalLayout_1() { // common part: create layout horizontalLayout_1 = new HorizontalLayout(); horizontalLayout_1.setImmediate(false); horizontalLayout_1.setWidth("-1px"); horizontalLayout_1.setHeight("-1px"); horizontalLayout_1.setMargin(false); horizontalLayout_1.setSpacing(true); // cmbPolicia cmbPolicia = new ComboBox(); cmbPolicia.setCaption("Policia"); cmbPolicia.setImmediate(false); cmbPolicia.setWidth("230px"); cmbPolicia.setHeight("-1px"); horizontalLayout_1.addComponent(cmbPolicia); // btnAgregarPolicia btnAgregarPolicia = new Button(); btnAgregarPolicia.setCaption(" "); btnAgregarPolicia.setImmediate(true); btnAgregarPolicia.setWidth("-1px"); btnAgregarPolicia.setHeight("-1px"); horizontalLayout_1.addComponent(btnAgregarPolicia); horizontalLayout_1.setComponentAlignment(btnAgregarPolicia, new Alignment(9)); return horizontalLayout_1; }
private Component buildFooter() { HorizontalLayout footer = new HorizontalLayout(); footer.addStyleName(ValoTheme.WINDOW_BOTTOM_TOOLBAR); footer.setWidth(100.0f, Unit.PERCENTAGE); Button ok = new Button("OK"); ok.addStyleName(ValoTheme.BUTTON_PRIMARY); ok.addClickListener( event -> { try { fieldGroup.commit(); // Updated user should also be persisted to database. But // not in this demo. Notification success = new Notification("Profile updated successfully"); success.setDelayMsec(2000); success.setStyleName("bar success small"); success.setPosition(Position.BOTTOM_CENTER); success.show(Page.getCurrent()); // DashboardEventBus.post(new ProfileUpdatedEvent()); close(); } catch (CommitException e) { Notification.show("Error while updating profile", Type.ERROR_MESSAGE); } }); ok.focus(); footer.addComponent(ok); footer.setComponentAlignment(ok, Alignment.TOP_RIGHT); return footer; }
public TimelineScreen() { setMargin(true); Label label = new Label(VaadinSession.getCurrent().getAttribute(Principal.class).getName()); Button button = new Button("Logout"); button.addClickListener(new LogoutBehavior()); HorizontalLayout menuBar = new HorizontalLayout(label, button); menuBar.setWidth(100, PERCENTAGE); menuBar.setComponentAlignment(button, MIDDLE_RIGHT); menuBar.setMargin(true); addComponent(menuBar); TweetRefresherBehavior behavior = TwaattinUI.getCurrent().getTweetRefresherBehavior(); addComponentAttachListener(behavior); VerticalLayout timeline = new VerticalLayout(); timeline.addStyleName("p-timeline"); addComponent(timeline); }
public HorizontalLayout createTopBar() { TextField filter = new TextField(); filter.setStyleName("filter-textfield"); filter.setInputPrompt("Filter"); ResetButtonForTextField.extend(filter); filter.setImmediate(true); filter.addTextChangeListener( new FieldEvents.TextChangeListener() { @Override public void textChange(FieldEvents.TextChangeEvent event) { grid.setFilter(event.getText()); } }); newProduct = new Button("New product"); newProduct.addStyleName(ValoTheme.BUTTON_PRIMARY); newProduct.setIcon(FontAwesome.PLUS_CIRCLE); newProduct.addClickListener( new ClickListener() { @Override public void buttonClick(ClickEvent event) { viewLogic.newProduct(); } }); HorizontalLayout topLayout = new HorizontalLayout(); topLayout.setSpacing(true); topLayout.setWidth("100%"); topLayout.addComponent(filter); topLayout.addComponent(newProduct); topLayout.setComponentAlignment(filter, Alignment.MIDDLE_LEFT); topLayout.setExpandRatio(filter, 1); topLayout.setStyleName("top-bar"); return topLayout; }
private com.vaadin.ui.Component buildFields() { HorizontalLayout fields = new HorizontalLayout(); fields.setSpacing(true); fields.addStyleName("fields"); final TextField username = new TextField("Username"); username.setIcon(FontAwesome.USER); username.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON); final PasswordField password = new PasswordField("Password"); password.setIcon(FontAwesome.LOCK); password.addStyleName(ValoTheme.TEXTFIELD_INLINE_ICON); final Button signin = new Button("Sign In"); signin.addStyleName(ValoTheme.BUTTON_PRIMARY); signin.setClickShortcut(ShortcutAction.KeyCode.ENTER); signin.focus(); fields.addComponents(username, password, signin); fields.setComponentAlignment(signin, Alignment.BOTTOM_LEFT); signin.addClickListener( new Button.ClickListener() { @Override public void buttonClick(final Button.ClickEvent event) { DashboardEventBus.post( new UserLoginRequestedEvent(username.getValue(), password.getValue())); } }); return fields; }
@AutoGenerated private HorizontalLayout buildHorizontalLayout_1() { // common part: create layout horizontalLayout_1 = new HorizontalLayout(); horizontalLayout_1.setImmediate(false); horizontalLayout_1.setWidth("-1px"); horizontalLayout_1.setHeight("-1px"); horizontalLayout_1.setMargin(false); horizontalLayout_1.setSpacing(true); // textAreaDescription textAreaDescription = new TextArea(); textAreaDescription.setCaption("Enter A Description"); textAreaDescription.setImmediate(false); textAreaDescription.setWidth("50.0%"); textAreaDescription.setHeight("-1px"); horizontalLayout_1.addComponent(textAreaDescription); // textFieldFilter textFieldFilter = new TextField(); textFieldFilter.setCaption("Filter Function By ID"); textFieldFilter.setImmediate(false); textFieldFilter.setWidth("-1px"); textFieldFilter.setHeight("-1px"); horizontalLayout_1.addComponent(textFieldFilter); horizontalLayout_1.setComponentAlignment(textFieldFilter, new Alignment(9)); // comboBoxDatatypeFilter comboBoxDatatypeFilter = new ComboBox(); comboBoxDatatypeFilter.setCaption("Filter By Data Type"); comboBoxDatatypeFilter.setImmediate(false); comboBoxDatatypeFilter.setWidth("-1px"); comboBoxDatatypeFilter.setHeight("-1px"); horizontalLayout_1.addComponent(comboBoxDatatypeFilter); horizontalLayout_1.setComponentAlignment(comboBoxDatatypeFilter, new Alignment(9)); // checkBoxFilterIsBag checkBoxFilterIsBag = new CheckBox(); checkBoxFilterIsBag.setCaption("Is Bag Filter"); checkBoxFilterIsBag.setImmediate(false); checkBoxFilterIsBag.setWidth("-1px"); checkBoxFilterIsBag.setHeight("-1px"); horizontalLayout_1.addComponent(checkBoxFilterIsBag); horizontalLayout_1.setComponentAlignment(checkBoxFilterIsBag, new Alignment(9)); return horizontalLayout_1; }
private void assembleSearchLayout() { logger.info( "Company ID : " + companyId + " | User Name : " + userName + " > " + "Assembling search layout"); // Remove all components in User Search Layout hlSearchLayout.removeAllComponents(); cbPayPeried.setRequired(true); cbBranch.setRequired(true); vlSrchRsltContainer.setVisible(true); hlCmdBtnLayout.setVisible(false); // Add components for Search Layout FormLayout formLayout1 = new FormLayout(); FormLayout formLayout2 = new FormLayout(); FormLayout formLayout3 = new FormLayout(); FormLayout formLayout4 = new FormLayout(); formLayout1.addComponent(cbPayPeried); formLayout1.setSpacing(true); formLayout2.addComponent(tfProcessPeriod); formLayout2.setSpacing(true); formLayout3.addComponent(cbBranch); formLayout3.setSpacing(true); formLayout4.addComponent(cbEmployeeName); formLayout4.setSpacing(true); HorizontalLayout hlAttendanceProc1 = new HorizontalLayout(); hlAttendanceProc1.addComponent(formLayout1); hlAttendanceProc1.addComponent(formLayout2); hlAttendanceProc1.addComponent(formLayout3); hlAttendanceProc1.addComponent(formLayout4); hlAttendanceProc1.addComponent(btnSearchStaff); hlAttendanceProc1.setComponentAlignment(btnSearchStaff, Alignment.MIDDLE_RIGHT); hlAttendanceProc1.setSpacing(true); HorizontalLayout hlAttendanceProc2 = new HorizontalLayout(); hlAttendanceProc2.addComponent(btnAttendanceProc); hlAttendanceProc2.setSizeFull(); hlAttendanceProc2.setComponentAlignment(btnAttendanceProc, Alignment.MIDDLE_RIGHT); VerticalLayout vlAttendanceProc1 = new VerticalLayout(); vlAttendanceProc1.addComponent(hlAttendanceProc1); vlAttendanceProc1.addComponent(hlAttendanceProc2); hlSearchLayout.addComponent(vlAttendanceProc1); hlSearchLayout.setSpacing(true); hlSearchLayout.setMargin(true); btnSearch.setVisible(false); }
public FileSearchResultComponent() { this.resourceService = ApplicationContextUtil.getSpringBean(ResourceService.class); final CssLayout headerWrapper = new CssLayout(); headerWrapper.setWidth("100%"); headerWrapper.addStyleName(UIConstants.THEME_COMP_HEADER); final HorizontalLayout headerLayout = new HorizontalLayout(); headerLayout.setWidth("100%"); headerLayout.setSpacing(true); headerWrapper.addComponent(headerLayout); this.addComponent(headerWrapper); final Embedded headerIcon = new Embedded(); headerIcon.setSource(MyCollabResource.newResource("icons/16/search.png")); headerLayout.addComponent(headerIcon); headerLayout.setComponentAlignment(headerIcon, Alignment.MIDDLE_LEFT); this.searchHeader = new Label(); headerLayout.addComponent(this.searchHeader); headerLayout.setComponentAlignment(this.searchHeader, Alignment.MIDDLE_LEFT); headerLayout.setExpandRatio(this.searchHeader, 1.0f); final Button backButton = new Button( "Back to dashboard", new Button.ClickListener() { private static final long serialVersionUID = 1L; @Override public void buttonClick(final ClickEvent event) { backView(); } }); backButton.addStyleName(UIConstants.THEME_BLUE_LINK); headerLayout.addComponent(backButton); this.resourceTable = new ResourceTableDisplay(); this.resourceTable.setWidth("100%"); this.bodyLayout = new VerticalLayout(); this.bodyLayout.addComponent(this.resourceTable); this.addComponent(this.bodyLayout); this.setMargin(true); }
public SubsEditViewImpl() { ButtonRenderer deleteButton = createDeleteButton(); Slider percentSlider = createPercentSlider(); MultiFileUpload uploader = createUploader(); // need to update the grid a first time for initialization. updateGrid(null); grid.getColumn("delete").setRenderer(deleteButton); fileDownloader = new FileDownloader(generateResource()); fileDownloader.extend(downloadButton); // create the main layout VerticalLayout content = new VerticalLayout(); // layout which contains the uploader and the percentage - in other words : all the // configuration information HorizontalLayout configHorizontalLayout = new HorizontalLayout(); configHorizontalLayout.addComponent(uploader); // Configure the layout which contains the percentage slider AbsoluteLayout sliderLayout = new AbsoluteLayout(); sliderLayout.setWidth("100px"); sliderLayout.setHeight("35px"); sliderLayout.addComponent(percentSlider); // Configure the layout which contains the percentage slider layout and the labels linked to the // percentage HorizontalLayout percentageLayout = new HorizontalLayout(); percentageLayout.addComponent(percentSliderTitle); percentageLayout.addComponent(sliderLayout); percentageLayout.addComponent(percentLabel); percentageLayout.setComponentAlignment(percentSliderTitle, Alignment.MIDDLE_LEFT); percentageLayout.setComponentAlignment(percentLabel, Alignment.MIDDLE_LEFT); // add the percentage Layout to the layout which contains the uploader configHorizontalLayout.addComponent(percentageLayout); configHorizontalLayout.setComponentAlignment(percentageLayout, Alignment.BOTTOM_LEFT); // add every layouts to the principal one content.addComponent(configHorizontalLayout); content.addComponent(new Label(" ", Label.CONTENT_XHTML)); content.addComponents(grid); content.addComponent(downloadButton); setCompositionRoot(content); }
public TableEditorWindow(final Table table, final Object value, Object... dates) { for (Object o : dates) dates2.add(o); VerticalLayout content = new VerticalLayout(); Object[] columns = table.getVisibleColumns(); String[] headers = table.getColumnHeaders(); int n = columns.length; for (int i = 0; i < n; ++i) { HorizontalLayout lay = new HorizontalLayout(); Label l = new Label(headers[i]); lay.addComponent(l); Component field = dates2.contains(columns[i]) ? new DateField() : new TextField(); lay.addComponent(field); map.put(columns[i], field); content.addComponent(lay); lay.setComponentAlignment(l, Alignment.MIDDLE_LEFT); lay.setComponentAlignment(field, Alignment.MIDDLE_RIGHT); } if (value != null) { Item item = table.getItem(value); for (Object o : columns) { Object val = item.getItemProperty(o).getValue(); if (dates2.contains(o)) { ((DateField) map.get(o)).setValue((Date) val); } else { ((TextField) map.get(o)).setValue(val.toString()); } } } save = new Button("Записать"); content.addComponent(save); save.addClickListener( new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent clickEvent) { if (actionPerformed()) close(); } }); setContent(content); }
private void addHelpLink() { if (StringUtils.isEmpty(helpLink)) { return; } final Link helpLinkComponent = SPUIComponentProvider.getHelpLink(helpLink); buttonsLayout.addComponent(helpLinkComponent); buttonsLayout.setComponentAlignment(helpLinkComponent, Alignment.MIDDLE_RIGHT); }