private void checkDataBinding(Class<? extends AbstractField> class1) { boolean ok = false; AbstractField b; try { b = class1.newInstance(); b.setCaption("Button of type " + class1.getSimpleName()); try { b.setWriteThrough(true); b.setReadThrough(true); ObjectProperty<String> prop = new ObjectProperty<String>("ABC 123"); /* * This should throw an exception or somehow tell that the * property was invalid (wrong type). See #2223. */ b.setPropertyDataSource(prop); } catch (Exception e) { e.printStackTrace(); } } catch (Exception e1) { e1.printStackTrace(); return; } if (ok) { status.setValue(status.getValue() + " " + class1.getClass().getSimpleName() + "/DB: OK"); } else { status.setValue(status.getValue() + " " + class1.getClass().getSimpleName() + "/DB: FAILED"); } }
@Override public void enter(ViewChangeListener.ViewChangeEvent event) { User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); List<String> roles = new ArrayList<String>(); for (GrantedAuthority grantedAuthority : user.getAuthorities()) { roles.add(grantedAuthority.getAuthority()); } usernameLabel.setValue(user.getUsername()); rolesLabel.setValue(StringUtils.join(roles, ",")); }
@Override public void updateTrackPosition(Song song, long elapsedTime) { if (song != null) { double lenght = (double) song.getSong().getLength(); indicator.setValue(new Float(elapsedTime / lenght)); labelMusic.setValue(song.getArtist() + " - " + song.getTitle()); labelDuration.setValue( Utils.formatTime(song.getSong().getLength(), TimeUnit.SECONDS) + " / " + Utils.formatTime(elapsedTime, TimeUnit.SECONDS)); } }
private void handleSubmit(ClickEvent event) { final String mnth = mnth_sel.getValue().toString(); final String day = day_sel.getValue().toString(); final String answer = ans_txt.getValue().toString().trim(); if (answer.isEmpty()) { info.setValue("Answer is empty"); } else if (!mnth.equals(emp.getBirth_month()) || !day.equals(emp.getBirth_day())) { info.setValue("Incorrect birth month and day for user"); } else if (!isAnswerCorrect()) { info.setValue("Incorrect answer to security question"); } else UI.getCurrent().setContent(new PasswordRec3View(emp)); }
@AutoGenerated private AbsoluteLayout buildAbsLCaracteristicas2() { // common part: create layout absLCaracteristicas2 = new AbsoluteLayout(); absLCaracteristicas2.setImmediate(false); absLCaracteristicas2.setWidth("100.0%"); absLCaracteristicas2.setHeight("45px"); // cmbEtapa cmbEtapa = new ComboBox(); cmbEtapa.setCaption("Etapa Fenológica"); cmbEtapa.setImmediate(false); cmbEtapa.setWidth("250px"); cmbEtapa.setHeight("25px"); absLCaracteristicas2.addComponent(cmbEtapa, "top:18.0px;left:10.0px;"); // txtSupRegada txtSupRegada = new TextField(); txtSupRegada.setCaption("Superficie Regada"); txtSupRegada.setImmediate(false); txtSupRegada.setWidth("100px"); txtSupRegada.setHeight("25px"); absLCaracteristicas2.addComponent(txtSupRegada, "top:18.0px;left:280.0px;"); // lblSupRegada lblSupRegada = new Label(); lblSupRegada.setImmediate(false); lblSupRegada.setWidth("-1px"); lblSupRegada.setHeight("-1px"); lblSupRegada.setValue("ha"); absLCaracteristicas2.addComponent(lblSupRegada, "top:22.0px;left:385.0px;"); // txtProfRaices txtProfRaices = new TextField(); txtProfRaices.setCaption("Prof. de Raíces"); txtProfRaices.setImmediate(false); txtProfRaices.setWidth("100px"); txtProfRaices.setHeight("25px"); absLCaracteristicas2.addComponent(txtProfRaices, "top:18.0px;left:415.0px;"); // lblProfRaices lblProfRaices = new Label(); lblProfRaices.setImmediate(false); lblProfRaices.setWidth("-1px"); lblProfRaices.setHeight("-1px"); lblProfRaices.setValue("cm"); absLCaracteristicas2.addComponent(lblProfRaices, "top:22.0px;left:520.0px;"); return absLCaracteristicas2; }
public void displayReport(Filter filter, Map<String, Object> parameters) { // TODO make the report generation asynchronous and display the first page when it is ready // and not after last // page is ready currentParameters = parameters; // Load template ReportDefinition rd = (ReportDefinition) getReportSelection().getValue(); String path = getFullPath(rd); jasperReport = reportGenerator.loadTemplate(path); // Set parameters Map<String, Object> params = JRUtils.createParametersFromFilter(jasperReport, filter); params.putAll(currentParameters); currentParameters.putAll(params); // Set datasource jrDataSource = null; if (!rd.requiresDatabaseConnection()) { if (container instanceof Indexed) { jrDataSource = new JRIndexedContainerDataSource((Indexed) container); } else { jrDataSource = new JRContainerDataSource(container); } } // Generate report reportGenerator.setShowMargins(showMargins.getValue()); String html = reportGenerator.executeReportAsHtml( jasperReport, params, jrDataSource, ((WrappedHttpSession) VaadinSession.getCurrent().getSession()).getHttpSession(), VaadinSession.getCurrent().getLocale()); if (html == null || "".equals(html) || (container != null && container.size() <= 0)) { reportArea.setValue(getMessageService().getMessage(NO_DATA_FOUND_KEY)); exportPDF.setEnabled(false); } else { if (rd.requiresExternalScript()) { VaadinUtils.loadScript(REPORT_AREA_ID, html, rd.requiresExternalScript(), alreadyLoaded); // only load external script for the map alreadyLoaded = true; } else { reportArea.setValue(html); } exportPDF.setEnabled(true); } }
protected void activateLoadingView() { removeAllComponents(); // This is workaround to ticket #14 at googlecode: // http://code.google.com/p/tpt/issues/detail?id=14 progressBar = new ProgressIndicator(); // ======== TPTSizer sz1 = new TPTSizer(null, "50%"); TPTSizer sz2 = new TPTSizer(null, "50%"); addComponent(sz1); final String message = loader.getLazyLoadingMessage(); loadingLabel.setValue( (message != null && !message.isEmpty()) ? message : getDefaultLoadingMessage()); addComponent(loadingLabel); addComponent(progressBar); addComponent(sz2); setComponentAlignment(loadingLabel, Alignment.MIDDLE_CENTER); setComponentAlignment(progressBar, Alignment.MIDDLE_CENTER); setExpandRatio(sz1, 0.5f); setExpandRatio(sz2, 0.5f); }
@AutoGenerated private VerticalLayout buildVerticalLayout_2() { // common part: create layout verticalLayout_2 = new VerticalLayout(); verticalLayout_2.setImmediate(false); verticalLayout_2.setWidth("-1px"); verticalLayout_2.setHeight("-1px"); verticalLayout_2.setMargin(false); // label_1 label_1 = new Label(); label_1.setStyleName("h1"); label_1.setImmediate(false); label_1.setWidth("-1px"); label_1.setHeight("-1px"); label_1.setValue("Filtro de Busqueda de Usuarios"); verticalLayout_2.addComponent(label_1); // horizontalLayout_3 horizontalLayout_3 = buildHorizontalLayout_3(); verticalLayout_2.addComponent(horizontalLayout_3); // tblUsuarios tblUsuarios = new Table(); tblUsuarios.setImmediate(false); tblUsuarios.setWidth("650px"); tblUsuarios.setHeight("430px"); verticalLayout_2.addComponent(tblUsuarios); return verticalLayout_2; }
public void setProgress(long bytesReceived, long contentLength) { pi.setValue(new Float(bytesReceived / (float) contentLength)); textualProgress.setValue( UploadUtil.getHumanReadableByteCount(bytesReceived, false) + " / " + UploadUtil.getHumanReadableByteCount(contentLength, false)); }
@AutoGenerated private AbsoluteLayout buildMainLayout() { // common part: create layout mainLayout = new AbsoluteLayout(); mainLayout.setImmediate(false); mainLayout.setWidth("100%"); mainLayout.setHeight("100%"); mainLayout.setMargin(false); // top-level component properties setWidth("100.0%"); setHeight("100.0%"); // mainMenu mainMenu = buildMenuBar(); mainLayout.addComponent(mainMenu, "top:0.0px;left:0.0px;"); // titleLabel titleLabel = new Label(); titleLabel.setStyleName("titleLabel"); titleLabel.setImmediate(false); titleLabel.setWidth("540px"); titleLabel.setHeight("40px"); titleLabel.setValue("Naslov"); mainLayout.addComponent(titleLabel, "top:40.0px;left:20.0px;"); loginComponent = new LoginComponent(this); mainLayout.addComponent(loginComponent, "top:30.0px;left:700.0px;"); // productSearchSplit productSearchSplit = buildProductSearchSplit(); mainLayout.addComponent(productSearchSplit, "top:100.0px;left:10.0px;"); return mainLayout; }
@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; }
private void writeOutZoomInfo() { String string = "Zoom states: "; for (ZoomCoordinates zoom : list) { string = string + "[" + zoom.xMin + "-" + zoom.xMax + "] "; } zoominfo.setValue(string); }
@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; }
@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 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; }
@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; }
@AutoGenerated private VerticalLayout buildVerticalLayout_2() { // common part: create layout verticalLayout_2 = new VerticalLayout(); verticalLayout_2.setImmediate(false); verticalLayout_2.setWidth("259px"); verticalLayout_2.setHeight("-1px"); verticalLayout_2.setMargin(false); // loginLabel loginLabel = new Label(); loginLabel.setImmediate(false); loginLabel.setWidth("200px"); loginLabel.setHeight("-1px"); loginLabel.setValue("Welcome to AppSyc!"); verticalLayout_2.addComponent(loginLabel); verticalLayout_2.setComponentAlignment(loginLabel, new Alignment(20)); // loginForm_2 loginForm_2 = new LoginForm(); loginForm_2.setStyleName("v-loginform"); loginForm_2.setImmediate(false); loginForm_2.setWidth("90.72%"); loginForm_2.setHeight("-1px"); verticalLayout_2.addComponent(loginForm_2); verticalLayout_2.setComponentAlignment(loginForm_2, new Alignment(48)); return verticalLayout_2; }
@AutoGenerated private GridLayout buildHeadLayout() { // common part: create layout headLayout = new GridLayout(); headLayout.setImmediate(false); headLayout.setWidth("-1px"); headLayout.setHeight("-1px"); headLayout.setMargin(false); headLayout.setSpacing(true); headLayout.setColumns(2); headLayout.setRows(2); // parameterTypeLabel parameterTypeLabel = new Label(); parameterTypeLabel.setImmediate(false); parameterTypeLabel.setWidth("-1px"); parameterTypeLabel.setHeight("-1px"); parameterTypeLabel.setValue("Type of Parameter"); headLayout.addComponent(parameterTypeLabel, 0, 0); // parameterType parameterType = new ComboBox(); parameterType.setImmediate(false); parameterType.setWidth("-1px"); parameterType.setHeight("-1px"); headLayout.addComponent(parameterType, 1, 0); // parameterNameLabel parameterNameLabel = new Label(); parameterNameLabel.setImmediate(false); parameterNameLabel.setWidth("-1px"); parameterNameLabel.setHeight("-1px"); parameterNameLabel.setValue("Parameter"); headLayout.addComponent(parameterNameLabel, 0, 1); headLayout.setComponentAlignment(parameterNameLabel, new Alignment(6)); // parameterName parameterName = new TextField(); parameterName.setImmediate(false); parameterName.setWidth("-1px"); parameterName.setHeight("-1px"); parameterName.setRequired(true); headLayout.addComponent(parameterName, 1, 1); return headLayout; }
private void checkButton(Class<? extends Button> class1) { boolean ok = false; AbstractComponent b; try { b = class1.newInstance(); b.setCaption("Button of type " + class1.getSimpleName()); ok = true; } catch (Exception e1) { e1.printStackTrace(); } if (ok) { status.setValue(status.getValue() + " " + class1.getClass().getSimpleName() + ": OK"); } else { status.setValue(status.getValue() + " " + class1.getClass().getSimpleName() + ": FAILED"); } }
public EditableLabel(String value) { label.setValue(value); label.setSizeUndefined(); textField.setPropertyDataSource(label); setDescription("Double click field to change value"); addComponent(label); addListeners(); }
@AutoGenerated private HorizontalLayout buildLytFormulario2() { // common part: create layout lytFormulario2 = new HorizontalLayout(); lytFormulario2.setImmediate(false); lytFormulario2.setWidth("-1px"); lytFormulario2.setHeight("-1px"); lytFormulario2.setMargin(false); lytFormulario2.setSpacing(true); // lblFechaRecepcion lblFechaRecepcion = new Label(); lblFechaRecepcion.setImmediate(false); lblFechaRecepcion.setWidth("160px"); lblFechaRecepcion.setHeight("-1px"); lblFechaRecepcion.setValue("Fecha Recepcion Notificacion"); lytFormulario2.addComponent(lblFechaRecepcion); // dtFechaRecepcion dtFechaRecepcion = new PopupDateField(); dtFechaRecepcion.setImmediate(false); dtFechaRecepcion.setWidth("150px"); dtFechaRecepcion.setHeight("-1px"); dtFechaRecepcion.setResolution(4); lytFormulario2.addComponent(dtFechaRecepcion); // lblFechaVencimiento lblFechaVencimiento = new Label(); lblFechaVencimiento.setImmediate(false); lblFechaVencimiento.setWidth("160px"); lblFechaVencimiento.setHeight("-1px"); lblFechaVencimiento.setValue("Fecha Vencimiento PRI"); lytFormulario2.addComponent(lblFechaVencimiento); // dtFechaVencimiento dtFechaVencimiento = new PopupDateField(); dtFechaVencimiento.setImmediate(false); dtFechaVencimiento.setWidth("150px"); dtFechaVencimiento.setHeight("-1px"); dtFechaVencimiento.setResolution(4); lytFormulario2.addComponent(dtFechaVencimiento); return lytFormulario2; }
/** * Cuts off long queries. Actually they are restricted to 50 characters. The full query is * available with descriptions (tooltip in gui) * * @param text the query to display in the result view panel */ public void setInfo(String text) { if (text != null && text.length() > 0) { String prefix = "Result for: <span class=\"" + Helper.CORPUS_FONT_FORCE + "\">"; lblInfo.setDescription(prefix + text.replaceAll("\n", " ") + "</span>"); lblInfo.setValue( text.length() < 50 ? prefix + StringEscapeUtils.escapeHtml4(text.substring(0, text.length())) : prefix + StringEscapeUtils.escapeHtml4(text.substring(0, 50)) + " ... </span>"); } }
/** building top menu */ private ComponentContainer buildBottomMenu() { FormLayout bottomMenu = new FormLayout(); Label copyrightLl = new Label(); copyrightLl.setValue( "Copyright 2011 <a href=\"http://www.speos.be\" target=\"_blank\">Speos Belgium</a>"); copyrightLl.setContentMode(Label.CONTENT_XHTML); bottomMenu.addComponent(copyrightLl); bottomMenu.setComponentAlignment(copyrightLl, Alignment.TOP_CENTER); return bottomMenu; }
@Override public void showError(ErrorLabel label, String content) { switch (label) { case GENERAL: labelGeneralError.setVisible(true); labelGeneralError.setValue(content); break; case QUANTITY: labelErrorQuantity.setVisible(true); labelErrorQuantity.setValue(content); break; case PRICE: labelErrorPrice.setVisible(true); labelErrorPrice.setValue(content); break; default: break; } }
@AutoGenerated private HorizontalLayout buildLytFormulario3() { // common part: create layout lytFormulario3 = new HorizontalLayout(); lytFormulario3.setImmediate(false); lytFormulario3.setWidth("-1px"); lytFormulario3.setHeight("-1px"); lytFormulario3.setMargin(false); lytFormulario3.setSpacing(true); // lblFechaPlazo lblFechaPlazo = new Label(); lblFechaPlazo.setImmediate(false); lblFechaPlazo.setWidth("160px"); lblFechaPlazo.setHeight("-1px"); lblFechaPlazo.setValue("Fecha Plazo Fundamentar"); lytFormulario3.addComponent(lblFechaPlazo); // dtFechaPlazo dtFechaPlazo = new PopupDateField(); dtFechaPlazo.setImmediate(false); dtFechaPlazo.setWidth("150px"); dtFechaPlazo.setHeight("-1px"); dtFechaPlazo.setResolution(4); lytFormulario3.addComponent(dtFechaPlazo); // lblEstadoNotificacion lblEstadoNotificacion = new Label(); lblEstadoNotificacion.setImmediate(false); lblEstadoNotificacion.setWidth("160px"); lblEstadoNotificacion.setHeight("-1px"); lblEstadoNotificacion.setValue("Estado Notificacion"); lytFormulario3.addComponent(lblEstadoNotificacion); // cmbEstadoNotificacion cmbEstadoNotificacion = new ComboBoxLOVS(); cmbEstadoNotificacion.setImmediate(false); cmbEstadoNotificacion.setWidth("150px"); cmbEstadoNotificacion.setHeight("-1px"); lytFormulario3.addComponent(cmbEstadoNotificacion); return lytFormulario3; }
@AutoGenerated private AbsoluteLayout buildAbsLCaracteristicas5() { // common part: create layout absLCaracteristicas5 = new AbsoluteLayout(); absLCaracteristicas5.setImmediate(false); absLCaracteristicas5.setWidth("100.0%"); absLCaracteristicas5.setHeight("55px"); // txtLamApl txtLamApl = new TextField(); txtLamApl.setCaption("Lámina Aplicada"); txtLamApl.setImmediate(false); txtLamApl.setWidth("150px"); txtLamApl.setHeight("25px"); absLCaracteristicas5.addComponent(txtLamApl, "top:18.0px;left:10.0px;"); // lblLamApl lblLamApl = new Label(); lblLamApl.setImmediate(false); lblLamApl.setWidth("-1px"); lblLamApl.setHeight("-1px"); lblLamApl.setValue("cm"); absLCaracteristicas5.addComponent(lblLamApl, "top:22.0px;left:165.0px;"); // txtLamCalc txtLamCalc = new TextField(); txtLamCalc.setCaption("Lámina Calculada"); txtLamCalc.setImmediate(false); txtLamCalc.setWidth("150px"); txtLamCalc.setHeight("25px"); absLCaracteristicas5.addComponent(txtLamCalc, "top:18.0px;left:230.0px;"); // lblLamCalc lblLamCalc = new Label(); lblLamCalc.setImmediate(false); lblLamCalc.setWidth("-1px"); lblLamCalc.setHeight("-1px"); lblLamCalc.setValue("cm"); absLCaracteristicas5.addComponent(lblLamCalc, "top:22.0px;left:385.0px;"); return absLCaracteristicas5; }
@AutoGenerated private AbsoluteLayout buildAbsLCaracteristicas4() { // common part: create layout absLCaracteristicas4 = new AbsoluteLayout(); absLCaracteristicas4.setImmediate(false); absLCaracteristicas4.setWidth("100.0%"); absLCaracteristicas4.setHeight("45px"); // txtTirante txtTirante = new TextField(); txtTirante.setCaption("Tirante del Surco o Melga"); txtTirante.setImmediate(false); txtTirante.setWidth("150px"); txtTirante.setHeight("25px"); absLCaracteristicas4.addComponent(txtTirante, "top:18.0px;left:10.0px;"); // lblTirante lblTirante = new Label(); lblTirante.setImmediate(false); lblTirante.setWidth("-1px"); lblTirante.setHeight("-1px"); lblTirante.setValue("cm"); absLCaracteristicas4.addComponent(lblTirante, "top:22.0px;left:165.0px;"); // txtGasto txtGasto = new TextField(); txtGasto.setCaption("Gasto en Surco o Melga"); txtGasto.setImmediate(false); txtGasto.setWidth("150px"); txtGasto.setHeight("25px"); absLCaracteristicas4.addComponent(txtGasto, "top:18.0px;left:230.0px;"); // lblGasto lblGasto = new Label(); lblGasto.setImmediate(false); lblGasto.setWidth("-1px"); lblGasto.setHeight("-1px"); lblGasto.setValue("L/s"); absLCaracteristicas4.addComponent(lblGasto, "top:22.0px;left:385.0px;"); return absLCaracteristicas4; }
@AutoGenerated private AbsoluteLayout buildAbsLCaracteristicas3() { // common part: create layout absLCaracteristicas3 = new AbsoluteLayout(); absLCaracteristicas3.setImmediate(false); absLCaracteristicas3.setWidth("100.0%"); absLCaracteristicas3.setHeight("45px"); // txtHumIni txtHumIni = new TextField(); txtHumIni.setCaption("Cont. de Hum. Inicial"); txtHumIni.setImmediate(false); txtHumIni.setWidth("150px"); txtHumIni.setHeight("25px"); absLCaracteristicas3.addComponent(txtHumIni, "top:18.0px;left:10.0px;"); // lblHumIni lblHumIni = new Label(); lblHumIni.setImmediate(false); lblHumIni.setWidth("-1px"); lblHumIni.setHeight("-1px"); lblHumIni.setValue("cm³/cm³"); absLCaracteristicas3.addComponent(lblHumIni, "top:22.0px;left:165.0px;"); // txtHumSat txtHumSat = new TextField(); txtHumSat.setCaption("Cont. de Hum. Saturación"); txtHumSat.setImmediate(false); txtHumSat.setWidth("150px"); txtHumSat.setHeight("25px"); absLCaracteristicas3.addComponent(txtHumSat, "top:18.0px;left:230.0px;"); // lblHumSat lblHumSat = new Label(); lblHumSat.setImmediate(false); lblHumSat.setWidth("-1px"); lblHumSat.setHeight("-1px"); lblHumSat.setValue("cm³/cm³"); absLCaracteristicas3.addComponent(lblHumSat, "top:22.0px;left:385.0px;"); return absLCaracteristicas3; }
@AutoGenerated private HorizontalLayout buildLytFormulario1() { // common part: create layout lytFormulario1 = new HorizontalLayout(); lytFormulario1.setImmediate(false); lytFormulario1.setWidth("-1px"); lytFormulario1.setHeight("-1px"); lytFormulario1.setMargin(false); lytFormulario1.setSpacing(true); // lblUnidadProcuraduria lblUnidadProcuraduria = new Label(); lblUnidadProcuraduria.setImmediate(false); lblUnidadProcuraduria.setWidth("160px"); lblUnidadProcuraduria.setHeight("-1px"); lblUnidadProcuraduria.setValue("Unidad Procuraduria"); lytFormulario1.addComponent(lblUnidadProcuraduria); // cmbUnidadProcuraduria cmbUnidadProcuraduria = new ComboBox(); cmbUnidadProcuraduria.setImmediate(false); cmbUnidadProcuraduria.setWidth("150px"); cmbUnidadProcuraduria.setHeight("-1px"); lytFormulario1.addComponent(cmbUnidadProcuraduria); // lblTipoNotificacion lblTipoNotificacion = new Label(); lblTipoNotificacion.setImmediate(false); lblTipoNotificacion.setWidth("160px"); lblTipoNotificacion.setHeight("-1px"); lblTipoNotificacion.setValue("Tipo Notificacion"); lytFormulario1.addComponent(lblTipoNotificacion); // cmbTipoNotificacion cmbTipoNotificacion = new ComboBoxLOVS(); cmbTipoNotificacion.setImmediate(false); cmbTipoNotificacion.setWidth("150px"); cmbTipoNotificacion.setHeight("-1px"); lytFormulario1.addComponent(cmbTipoNotificacion); return lytFormulario1; }
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(); }); }