@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; }
public void refreshTable() { try { table.removeAllItems(); Collection<LightProcessDefinition> processes = ProcessbaseApplication.getCurrent() .getBpmModule() .getLightProcessDefinitions(ProcessState.ENABLED); for (LightProcessDefinition pd : processes) { if (pd.getCategoryNames().contains(category.getName())) { addTableRow(pd); } else { Item woItem = processesComboBox.addItem(pd); String caption = pd.getLabel() != null ? pd.getLabel() : pd.getName(); processesComboBox.setItemCaption(pd, caption + " (version " + pd.getVersion() + ")"); } } table.setSortContainerPropertyId("name"); table.setSortAscending(true); table.sort(); } catch (Exception ex) { ex.printStackTrace(); showError(ex.getMessage()); } }
private void createComponents() { components.add(new TextField("Default TextBox")); components.add(new TextArea("Default TextArea.")); // components.add(new RichTextArea("Default RichtTextArea")); components.add(new PasswordField("Default Password")); components.add(new DateField("Default DateField")); // PopupDateField popupDateField = new // PopupDateField("Default DateField"); // popupDateField.setTextFieldEnabled(false); // components.add(popupDateField); components.add(new CheckBox("Default CheckBox")); ComboBox comboBox = new ComboBox("Default ComboBox"); comboBox.addItem("Item1"); components.add(comboBox); OptionGroup radioGroup = new OptionGroup("Single Items"); radioGroup.addItem("Single Item 1"); radioGroup.addItem("Single Item 2"); radioGroup.setMultiSelect(false); components.add(radioGroup); OptionGroup checkGroup = new OptionGroup("Multi Items"); checkGroup.addItem("Multi Item 1"); checkGroup.addItem("Multi Item 2"); checkGroup.setMultiSelect(true); components.add(checkGroup); // Tree tree = new Tree(); // tree.setCaption("tree"); // tree.addItem("single item"); // components.add(tree); }
public void buttonClick(ClickEvent event) { try { if (event.getButton().equals(saveBtn)) { save(); close(); } else if (event.getButton().equals(addBtn)) { LightProcessDefinition lpd = (LightProcessDefinition) processesComboBox.getValue(); addTableRow(lpd); processesComboBox.removeItem(lpd); } else if (event.getButton().equals(deleteBtn)) { delete(); close(); } else if (event.getButton() instanceof TableLinkButton) { LightProcessDefinition lpd = (LightProcessDefinition) ((TableLinkButton) event.getButton()).getTableValue(); table.removeItem(lpd); processesComboBox.addItem(lpd); processesComboBox.setItemCaption( lpd, lpd.getLabel() + " (version " + lpd.getVersion() + ")"); } else { close(); } } catch (Exception ex) { ex.printStackTrace(); showError(ex.getMessage()); } }
@Override protected void resetFields() { logger.info( "Company ID : " + companyid + " | User Name : " + username + " > " + "Resetting the UI controls"); tfEnqNo.setReadOnly(false); tfEnqNo.setValue(""); cbEnqStatus.setValue(null); listEnqDtls = new ArrayList<SmsPurEnqDtlDM>(); tblSmsEnqDtl.removeAllItems(); cbBranch.setValue(branchId); cbBranch.setComponentError(null); lsVendorName.setValue(null); lsVendorName.setComponentError(null); dfDueDate.setValue(null); dfEnqDate.setValue(null); taEnqRem.setValue(""); taEnqDtlRem.setValue(""); dfEnqDate.setValue(new Date()); cbEnqStatus.setValue(cbEnqStatus.getItemIds().iterator().next()); cbUom.setReadOnly(true); dfDueDate.setValue(addDays(new Date(), 7)); }
/** * The constructor should first build the main layout, set the composition root and then do any * custom initialization. * * <p>The constructor will not be automatically regenerated by the visual editor. */ public ParameterPathQuestion() { buildMainLayout(); setCompositionRoot(mainLayout); // Parameter Name parameterName.setNullRepresentation(""); parameterName.setRequiredError("Parameter must be filled"); // TODO: vyrobit skryvani // TODO: brat v uvahu fragmenty!!! // TODO: link na vnorene fieldy BeanItemContainer<ParameterType> parameterTypeContainer = new BeanItemContainer<ParameterType>( ParameterType.class, Arrays.asList(ParameterType.values())); parameterType.setContainerDataSource(parameterTypeContainer); parameterType.setImmediate(true); parameterType.setNullSelectionAllowed(false); parameterType.addListener( new Property.ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { if (parameterType.getValue() instanceof ParameterType) { ParameterType value = (ParameterType) parameterType.getValue(); if (ParameterType.FIXED.equals(value)) { semanticComposite.setVisible(false); } else { semanticComposite.setVisible(true); } } } }); }
@Override public void setSelectGoodsData(Map<String, String> data) { for (Map.Entry<String, String> entry : data.entrySet()) { inputGoodsSelect.addItem(entry.getKey()); inputGoodsSelect.setItemCaption(entry.getKey(), entry.getValue()); } }
private ComboBox buildFieldComboBox(Object[] items) { ComboBox cb = new ComboBox(); cb.addItems(items); cb.setValue(items[0]); cb.setNullSelectionAllowed(false); return cb; }
/* * loadEmployeeList()-->this function is used for load the employee list */ private void loadEmployeeList() { try { logger.info( "Company ID : " + companyId + " | User Name : " + userName + " > " + "Loading Search..."); List<EmployeeDM> empList = new ArrayList<EmployeeDM>(); empList.add(new EmployeeDM(-1L, "All")); empList.addAll( serviceEmployee.getEmployeeList( null, null, null, "Active", companyId, null, null, (Long) cbBranch.getValue(), null, "P")); BeanContainer<Long, EmployeeDM> beanLoadEmployee = new BeanContainer<Long, EmployeeDM>(EmployeeDM.class); beanLoadEmployee.setBeanIdProperty("employeeid"); beanLoadEmployee.addAll(empList); cbEmployeeName.setContainerDataSource(beanLoadEmployee); } catch (Exception e) { logger.info(e.getMessage()); } }
/** Llenado del Combo Box */ private void fillcbGrupo() { cb_Grupo.setNullSelectionAllowed(false); cb_Grupo.setInputPrompt("Seleccione un Grupo Contable"); for (GruposContablesModel grupo : grupo_impl.getalls()) { cb_Grupo.addItem(grupo.getGRC_Grupo_Contable()); cb_Grupo.setItemCaption(grupo.getGRC_Grupo_Contable(), grupo.getGRC_Nombre_Grupo_Contable()); } }
private ComboBox createSelect() { final ComboBox outSelect = new ComboBox(null); outSelect.setStyleName("ripla-select"); // $NON-NLS-1$ outSelect.setWidth(55, Unit.PIXELS); outSelect.setNullSelectionAllowed(false); outSelect.setImmediate(true); return outSelect; }
@Override protected void setup(VaadinRequest request) { ComboBox cb = new ComboBox("200px wide ComboBox with 100% wide suggestion popup", items); cb.setPopupWidth("100%"); cb.setWidth("200px"); cb.addStyleName("width-as-percentage"); addComponent(cb); }
@Override public Field createField(Item item, Object propertyId, Component uiContext) { BeanItemContainer<Localidad> container = new BeanItemContainer<Localidad>(Localidad.class, service.findAll()); ComboBox box = new ComboBox(); box.setItemCaptionPropertyId(Localidad.Atributos.NOMBRE); box.setContainerDataSource(container); return box; }
@Override public void setComboBoxData(ComboDataList list) { Map<String, String> roleList = list.getRoleList(); for (Map.Entry<String, String> entry : roleList.entrySet()) { selectRole.addItem(entry.getKey()); selectRole.setItemCaption(entry.getKey(), entry.getValue()); } }
@Override protected void initializeComponents() { ComboBox s = createSelect(null); s.setScrollToSelectedItem(false); populate(s, 100); Object selection = new ArrayList<Object>(s.getItemIds()).get(50); s.setValue(selection); addTestComponent(s); }
@Override protected void resetFields() { readonlyfalse(); tfProcessPeriod.setValue(""); cbBranch.setValue(null); cbEmployeeName.setValue(null); cbPayPeried.setValue(null); tfProcessPeriod.setReadOnly(true); }
/** @return */ private Field<?> getComboBox(String requiredErrorMsg, Collection<?> items) { ComboBox comboBox = new ComboBox(); comboBox.setNullSelectionAllowed(true); IndexedContainer container = new IndexedContainer(items); comboBox.setContainerDataSource(container); comboBox.setRequired(true); comboBox.setRequiredError(requiredErrorMsg); return comboBox; }
// Load Purchase Header private void loadSrchRslt() { try { logger.info( "Company ID : " + companyid + " | User Name : " + username + " > " + "Loading Search..."); tblMstScrSrchRslt.removeAllItems(); List<SmsPurEnqHdrDM> listPurEnq = new ArrayList<SmsPurEnqHdrDM>(); logger.info( "Company ID : " + companyid + " | User Name : " + username + " > " + "Search Parameters are " + companyid + ", " + cbBranch.getValue() + ", " + cbEnqStatus.getValue()); listPurEnq = serviceSmsPurEnqHdr.getSmsPurEnqHdrList( companyid, null, tfEnqNo.getValue(), (Long) cbBranch.getValue(), (String) cbEnqStatus.getValue(), username); recordCnt = listPurEnq.size(); beanPurEnqHdrDM = new BeanItemContainer<SmsPurEnqHdrDM>(SmsPurEnqHdrDM.class); beanPurEnqHdrDM.addAll(listPurEnq); logger.info( "Company ID : " + companyid + " | User Name : " + username + " > " + "Got the PurchaseEnquiry. result set"); tblMstScrSrchRslt.setContainerDataSource(beanPurEnqHdrDM); tblMstScrSrchRslt.setVisibleColumns( new Object[] { "enquiryId", "branchName", "enquiryNo", "enquiryStatus", "lastUpdateddt", "lastUpdatedby" }); tblMstScrSrchRslt.setColumnHeaders( new String[] { "Ref.Id", "Branch Name", "EnquiryNo.", "Status", "Last Updated Date", "Last Updated By" }); tblMstScrSrchRslt.setColumnAlignment("enquiryId", Align.RIGHT); tblMstScrSrchRslt.setColumnFooter("lastUpdatedby", "No.of Records : " + recordCnt); } catch (Exception e) { logger.info(e.getMessage()); } }
@Override protected void setup() { final ComboBox<String> box = new ComboBox(); box.setItems("Value 1", "Value 2", "Value 3", "Value 4"); box.setPrimaryStyleName("my-combobox"); addComponent(box); addComponent( new Button("Set primary style", event -> box.setPrimaryStyleName("my-second-combobox"))); }
protected Params getParams() { return new Params( params.getModuleId(), (String) testNameCombo.getValue(), params.getCommitId(), params.getRunNumber(), (Metric) metricCombo.getValue(), Integer.parseInt((String) percentileCombo.getValue()), (FailureType) failureCombo.getValue()); }
@Override public void attach() { super.attach(); final LanguagesContainer lLanguages = LanguagesContainer.getLanguages( Constants.LANGUAGES, getSession().getLocale().getLanguage()); select.setContainerDataSource(lLanguages); select.select(lLanguages.getActiveLanguage()); }
private void fillcbAuxiliar(String id_grupo) { cb_Auxiliar.removeAllItems(); cb_Auxiliar.setNullSelectionAllowed(false); cb_Auxiliar.setInputPrompt("Seleccione el Auxiliar Contable"); for (AuxiliaresContablesModel auxiliar : auxiliar_impl.getreporte(id_grupo)) { cb_Auxiliar.addItem(auxiliar.getAUC_Auxiliar_Contable()); cb_Auxiliar.setItemCaption( auxiliar.getAUC_Auxiliar_Contable(), auxiliar.getAUC_Nombre_Auxiliar_Contable()); } }
public JanelaGerenciarUsuarios() { this.center(); this.setWidth("40%"); this.setHeight("80%"); this.setModal(true); users = new ComboBox("Usuários"); preencheCB(); users.setImmediate(true); users.addListener(new EventoMostraDados()); users.setNullSelectionAllowed(false); leiaute = new FormLayout(); leiaute.setSpacing(true); titulo = new Label("Gerenciar Usuários"); nome = new TextField("Nome"); email = new TextField("E-Mail"); telefone = new TextField("Telefone"); cargo = new TextField("Cargo"); login = new TextField("Login"); senha1 = new PasswordField("Senha"); senha2 = new PasswordField("Confirme a senha"); admin = new CheckBox("Administrador? "); bloquear = new CheckBox("Bloqueado? "); // bloquear.setEnabled(false); addUser = new Button("Adicionar Usuário"); addUser.addListener(new EventoNovoUsuario()); editar = new Button("Editar Usuário"); editar.addListener(new EventoEditarUsuario()); excluir = new Button("Excluir Usuário"); excluir.addListener(new EventoExclusao()); desligaCampos(); leiaute.addComponent(titulo); leiaute.addComponent(users); leiaute.addComponent(nome); leiaute.addComponent(email); leiaute.addComponent(telefone); leiaute.addComponent(cargo); leiaute.addComponent(login); leiaute.addComponent(senha1); leiaute.addComponent(senha2); leiaute.addComponent(admin); leiaute.addComponent(bloquear); leiaute.addComponent(addUser); leiaute.addComponent(editar); leiaute.addComponent(excluir); this.addComponent(leiaute); }
private void loadData() throws IllegalArgumentException, Exception { bcClientType.removeAllItems(); bcClientType.addAll(clientTypeService.getAll(context.getUser().getActiveOrganization())); clientTypeField.setContainerDataSource(bcClientType); bcClientGroup.removeAllItems(); bcClientGroup.addAll(clientGroupService.getAll(context.getUser().getActiveOrganization())); clientGroupField.setContainerDataSource(bcClientGroup); }
public VentanaAltaConsultaSesion( final IPacientes iPacientes, Observer observer, Evaluacion evaluacion) { this.iPacientes = iPacientes; this.observer = observer; this.evaluacion = evaluacion; setModal(true); setCaption("Ingeso de consulta/sesión"); layout.setMargin(true); fecha = new PopupDateField(); fecha.setValue(Calendar.getInstance().getTime()); layout.addComponent(fecha); textArea.setInputPrompt("observaciones"); layout.addComponent(textArea); // containerTipoConsulta = new BeanItemContainer<TipoConsulta>(TipoConsulta.class, // TipoConsulta.getAll()); containerTipoConsulta = new BeanItemContainer<TipoConsulta>( TipoConsulta.class, Arrays.asList(TipoConsulta.values())); comboBoxTipoConsulta = new ComboBox(); comboBoxTipoConsulta.setContainerDataSource(containerTipoConsulta); comboBoxTipoConsulta.setItemCaptionPropertyId("descripcion"); comboBoxTipoConsulta.setItemCaptionMode(ItemCaptionMode.PROPERTY); comboBoxTipoConsulta.setImmediate(true); comboBoxTipoConsulta.addValueChangeListener( new ValueChangeListener() { private static final long serialVersionUID = 1L; @Override public void valueChange(ValueChangeEvent event) { if (event.getProperty() != null) { TipoConsulta tipoConsulta = (TipoConsulta) event.getProperty().getValue(); layoutAdicional.removeAllComponents(); if (tipoConsulta != null) { if (tipoConsulta.equals(TipoConsulta.TERAPIA_FISICA)) { layoutAdicional.addComponent(opcionesTerapiaFisica); } else if (tipoConsulta.equals(TipoConsulta.GIMNASIO)) { layoutAdicional.addComponent(opcionesGimnasio); } } } } }); layout.addComponent(comboBoxTipoConsulta); cargarTipoTerapiaFisica(); cargarTipoGimnasio(); layout.addComponent(layoutAdicional); layout.addComponent(this.obtenerBotonGuardar()); this.setContent(layout); }
void configureComponents() { saveButton.setClickShortcut(ShortcutAction.KeyCode.ENTER); saveButton.setStyleName(ValoTheme.BUTTON_PRIMARY); cloneDinnerButton.setStyleName(ValoTheme.BUTTON_FRIENDLY); removeButton.setStyleName(ValoTheme.BUTTON_DANGER); dinnerDate.setResolution(Resolution.DAY); soup.setContainerDataSource(new BeanItemContainer<>(DinnerComponent.class)); meat.setContainerDataSource(new BeanItemContainer<>(DinnerComponent.class)); starch.setContainerDataSource(new BeanItemContainer<>(DinnerComponent.class)); vegetables.setContainerDataSource(new BeanItemContainer<>(DinnerComponent.class)); }
@Override protected void setup(VaadinRequest request) { ComboBox cb = new ComboBox("Page length 0", items); cb.setPageLength(0); cb.setFilteringMode(FilteringMode.CONTAINS); addComponent(cb); cb = new ComboBox("Page length 2", items); cb.setPageLength(2); cb.setFilteringMode(FilteringMode.CONTAINS); addComponent(cb); }
/** * Modify available options based on the "geo department" select. * * @param currentGeoDepartment */ private void filterDepartments(Department currentGeoDepartment) { if (currentGeoDepartment == null) { department.setValue(null); department.setEnabled(false); } else { container.removeAllContainerFilters(); container.addContainerFilter(new Equal("parent", currentGeoDepartment)); container.applyFilters(); department.setValue(null); department.setEnabled(true); } }
@SuppressWarnings({"rawtypes", "unchecked"}) private AbstractField createEnumField(Class<?> type, Object propertyId) { ComboBox enumSelect = new ComboBox(); /* Add possible 'view all' item */ if (owner.getFilterDecorator() != null && owner.getFilterDecorator().getAllItemsVisibleString() != null) { Object nullItem = enumSelect.addItem(); enumSelect.setNullSelectionItemId(nullItem); enumSelect.setItemCaption(nullItem, owner.getFilterDecorator().getAllItemsVisibleString()); } /* Add items from enumeration */ for (Object o : EnumSet.allOf((Class<Enum>) type)) { enumSelect.addItem(o); if (owner.getFilterDecorator() != null) { String caption = owner.getFilterDecorator().getEnumFilterDisplayName(propertyId, o); enumSelect.setItemCaption(o, caption == null ? o.toString() : caption); Resource icon = owner.getFilterDecorator().getEnumFilterIcon(propertyId, o); if (icon != null) { enumSelect.setItemIcon(o, icon); } } else { enumSelect.setItemCaption(o, o.toString()); } } enums.put(enumSelect, propertyId); return enumSelect; }
ComboBox userList() { users.setCaption("Users: "); users.setWidth("200px"); users.setNullSelectionAllowed(false); users.addContainerProperty("y", String.class, ""); users.setItemCaptionPropertyId("y"); Item i; for (User u : service.getUserList()) { i = users.addItem(u.getId()); i.getItemProperty("y").setValue(u.getUsername()); } users.addListener( new ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { allowedBackwardInputAttendance.setValue( service.isUserAllowedToEnterPreviousAttendance( util.convertStringToInteger(event.getProperty().getValue().toString()))); } }); users.setImmediate(true); return users; }