List of usage examples for com.vaadin.ui PasswordField PasswordField
public PasswordField()
From source file:com.mycollab.module.user.accountsettings.profile.view.PasswordChangeWindow.java
License:Open Source License
private void initUI() { final MVerticalLayout mainLayout = new MVerticalLayout().withFullWidth(); final Label lbInstruct1 = new Label(UserUIContext.getMessage(UserI18nEnum.MSG_PASSWORD_INSTRUCT_LABEL_1)); mainLayout.addComponent(lbInstruct1); mainLayout.setComponentAlignment(lbInstruct1, Alignment.MIDDLE_LEFT); final Label lbInstruct2 = new Label(UserUIContext.getMessage(UserI18nEnum.MSG_PASSWORD_INSTRUCT_LABEL_2)); mainLayout.addComponent(lbInstruct2); mainLayout.setComponentAlignment(lbInstruct2, Alignment.MIDDLE_LEFT); GridFormLayoutHelper passInfo = GridFormLayoutHelper.defaultFormLayoutHelper(1, 3); txtNewPassword = new PasswordField(); passInfo.addComponent(txtNewPassword, UserUIContext.getMessage(ShellI18nEnum.OPT_NEW_PASSWORD), 0, 0); txtConfirmPassword = new PasswordField(); passInfo.addComponent(txtConfirmPassword, UserUIContext.getMessage(ShellI18nEnum.OPT_CONFIRMED_PASSWORD), 0, 1);// w w w .ja va 2s . com mainLayout.addComponent(passInfo.getLayout()); mainLayout.setComponentAlignment(passInfo.getLayout(), Alignment.MIDDLE_CENTER); MButton cancelBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_CANCEL), clickEvent -> close()).withStyleName(WebThemes.BUTTON_OPTION); MButton saveBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_SAVE), clickEvent -> changePassword()).withIcon(FontAwesome.SAVE).withStyleName(WebThemes.BUTTON_ACTION) .withClickShortcut(ShortcutAction.KeyCode.ENTER); MHorizontalLayout hlayoutControls = new MHorizontalLayout(cancelBtn, saveBtn) .withMargin(new MarginInfo(false, true, false, true)); mainLayout.with(hlayoutControls).withAlign(hlayoutControls, Alignment.MIDDLE_RIGHT); this.setContent(mainLayout); }
From source file:com.mycollab.shell.view.SetupNewInstanceView.java
License:Open Source License
SetupNewInstanceView() { this.setDefaultComponentAlignment(Alignment.TOP_CENTER); MHorizontalLayout content = new MHorizontalLayout().withFullHeight(); this.with(content); content.with(new MHorizontalLayout( ELabel.html(UserUIContext.getMessage(ShellI18nEnum.OPT_SUPPORTED_LANGUAGES_INTRO)) .withStyleName(WebThemes.META_COLOR)).withMargin(true).withWidth("400px") .withStyleName("separator")); MVerticalLayout formLayout = new MVerticalLayout().withWidth("600px"); content.with(formLayout).withAlign(formLayout, Alignment.TOP_LEFT); formLayout.with(ELabel.h2("Last step, you are almost there!").withWidthUndefined()); formLayout.with(ELabel.h3("All fields are required *").withStyleName("overdue").withWidthUndefined()); GridFormLayoutHelper formLayoutHelper = GridFormLayoutHelper.defaultFormLayoutHelper(2, 8, "200px"); formLayoutHelper.getLayout().setWidth("600px"); final TextField adminField = formLayoutHelper.addComponent(new TextField(), "Admin email", 0, 0); final PasswordField passwordField = formLayoutHelper.addComponent(new PasswordField(), "Admin password", 0, 1);/*ww w . jav a 2s .c om*/ final PasswordField retypePasswordField = formLayoutHelper.addComponent(new PasswordField(), "Retype Admin password", 0, 2); final DateFormatField dateFormatField = formLayoutHelper.addComponent( new DateFormatField(SimpleBillingAccount.DEFAULT_DATE_FORMAT), UserUIContext.getMessage(AdminI18nEnum.FORM_DEFAULT_YYMMDD_FORMAT), UserUIContext.getMessage(GenericI18Enum.FORM_DATE_FORMAT_HELP), 0, 3); final DateFormatField shortDateFormatField = formLayoutHelper.addComponent( new DateFormatField(SimpleBillingAccount.DEFAULT_SHORT_DATE_FORMAT), UserUIContext.getMessage(AdminI18nEnum.FORM_DEFAULT_MMDD_FORMAT), UserUIContext.getMessage(GenericI18Enum.FORM_DATE_FORMAT_HELP), 0, 4); final DateFormatField longDateFormatField = formLayoutHelper.addComponent( new DateFormatField(SimpleBillingAccount.DEFAULT_LONG_DATE_FORMAT), UserUIContext.getMessage(AdminI18nEnum.FORM_DEFAULT_HUMAN_DATE_FORMAT), UserUIContext.getMessage(GenericI18Enum.FORM_DATE_FORMAT_HELP), 0, 5); final TimeZoneSelectionField timeZoneSelectionField = formLayoutHelper.addComponent( new TimeZoneSelectionField(false), UserUIContext.getMessage(AdminI18nEnum.FORM_DEFAULT_TIMEZONE), 0, 6); timeZoneSelectionField.setValue(TimeZone.getDefault().getID()); final LanguageSelectionField languageBox = formLayoutHelper.addComponent(new LanguageSelectionField(), UserUIContext.getMessage(AdminI18nEnum.FORM_DEFAULT_LANGUAGE), 0, 7); languageBox.setValue(Locale.US.toLanguageTag()); formLayout.with(formLayoutHelper.getLayout()); CheckBox createSampleDataSelection = new CheckBox("Create sample data", true); MButton installBtn = new MButton("Setup", clickEvent -> { String adminName = adminField.getValue(); String password = passwordField.getValue(); String retypePassword = retypePasswordField.getValue(); if (!StringUtils.isValidEmail(adminName)) { NotificationUtil.showErrorNotification("Invalid email value"); return; } if (!password.equals(retypePassword)) { NotificationUtil.showErrorNotification("Password is not match"); return; } String dateFormat = dateFormatField.getValue(); String shortDateFormat = shortDateFormatField.getValue(); String longDateFormat = longDateFormatField.getValue(); if (!isValidDayPattern(dateFormat) || !isValidDayPattern(shortDateFormat) || !isValidDayPattern(longDateFormat)) { NotificationUtil.showErrorNotification("Invalid date format"); return; } String language = languageBox.getValue(); String timezoneDbId = timeZoneSelectionField.getValue(); BillingAccountMapper billingAccountMapper = AppContextUtil.getSpringBean(BillingAccountMapper.class); BillingAccountExample ex = new BillingAccountExample(); ex.createCriteria().andIdEqualTo(MyCollabUI.getAccountId()); List<BillingAccount> billingAccounts = billingAccountMapper.selectByExample(ex); BillingAccount billingAccount = billingAccounts.get(0); billingAccount.setDefaultlanguagetag(language); billingAccount.setDefaultyymmddformat(dateFormat); billingAccount.setDefaultmmddformat(shortDateFormat); billingAccount.setDefaulthumandateformat(longDateFormat); billingAccount.setDefaulttimezone(timezoneDbId); billingAccountMapper.updateByPrimaryKey(billingAccount); BillingAccountService billingAccountService = AppContextUtil.getSpringBean(BillingAccountService.class); billingAccountService.createDefaultAccountData(adminName, password, timezoneDbId, language, true, createSampleDataSelection.getValue(), MyCollabUI.getAccountId()); ((DesktopApplication) UI.getCurrent()).doLogin(adminName, password, false); }).withStyleName(WebThemes.BUTTON_ACTION); MHorizontalLayout buttonControls = new MHorizontalLayout(createSampleDataSelection, installBtn) .alignAll(Alignment.MIDDLE_RIGHT); formLayout.with(buttonControls).withAlign(buttonControls, Alignment.MIDDLE_RIGHT); }
From source file:com.openhris.administrator.ChangePassword.java
private PasswordField createPasswordField(String str) { PasswordField p = new PasswordField(); p.setCaption(str);// w w w .java 2 s.c o m p.setWidth("100%"); p.setStyleName(Reindeer.TEXTFIELD_SMALL); p.setNullSettingAllowed(true); return p; }
From source file:com.parship.roperty.ui.LoginUI.java
License:Apache License
@AutoGenerated private GridLayout buildLoginLayout() { // common part: create layout loginLayout = new GridLayout(); loginLayout.setImmediate(false);//from w w w . j a va 2 s .c o m loginLayout.setWidth("-1px"); loginLayout.setHeight("100px"); loginLayout.setMargin(false); loginLayout.setSpacing(true); loginLayout.setColumns(2); loginLayout.setRows(2); // userTextField userTextField = new TextField(); userTextField.setCaption("Username"); userTextField.setImmediate(false); userTextField.setWidth("220px"); userTextField.setHeight("-1px"); userTextField.setTabIndex(1); userTextField.setRequired(true); loginLayout.addComponent(userTextField, 0, 0); loginLayout.setComponentAlignment(userTextField, new Alignment(33)); // passTextField passTextField = new PasswordField(); passTextField.setCaption("Password"); passTextField.setImmediate(false); passTextField.setWidth("220px"); passTextField.setHeight("-1px"); passTextField.setTabIndex(2); passTextField.setRequired(true); loginLayout.addComponent(passTextField, 1, 0); loginLayout.setComponentAlignment(passTextField, new Alignment(33)); // buttonLayout buttonLayout = buildButtonLayout(); loginLayout.addComponent(buttonLayout, 1, 1); return loginLayout; }
From source file:com.rdonasco.security.user.views.UserEditorView.java
License:Apache License
public UserEditorView() { this.retypedPasswordField = new PasswordField(); this.passwordField = new PasswordField(); this.logonIdField = new TextField(); this.registrationTokenField = new TextField(); this.registrationTokenExpirationField = new DateField(); this.userDetailPanel = new Panel(); this.otherDetailTab = new TabSheet(); this.capabilitiesLayout = new HorizontalLayout(); this.rolesLayout = new HorizontalLayout(); this.groupsLayout = new HorizontalLayout(); this.buttonsLayout = new HorizontalLayout(); this.cancelButton = new Button(); this.saveButton = new Button(); this.editButton = new Button(); }
From source file:com.vaushell.treetasker.application.content.layout.LoginLayout.java
License:Open Source License
@AutoGenerated private GridLayout buildVFormLayout() { // common part: create layout vFormLayout = new GridLayout(); vFormLayout.setImmediate(false);/*from www . ja v a 2s . c o m*/ vFormLayout.setWidth("100.0%"); vFormLayout.setHeight("100.0%"); vFormLayout.setMargin(true); vFormLayout.setSpacing(true); vFormLayout.setColumns(2); vFormLayout.setRows(4); // vLBLuserName vLBLuserName = new Label(); vLBLuserName.setImmediate(false); vLBLuserName.setWidth("-1px"); vLBLuserName.setHeight("-1px"); vLBLuserName.setValue("E-mail :"); vFormLayout.addComponent(vLBLuserName, 0, 0); vFormLayout.setComponentAlignment(vLBLuserName, new Alignment(33)); // vTFuserNameValue vTFuserNameValue = new TextField(); vTFuserNameValue.setImmediate(true); vTFuserNameValue.setWidth("80.0%"); vTFuserNameValue.setHeight("-1px"); vTFuserNameValue.setInputPrompt("E-mail"); vTFuserNameValue.setSecret(false); vFormLayout.addComponent(vTFuserNameValue, 1, 0); vFormLayout.setComponentAlignment(vTFuserNameValue, new Alignment(33)); // vLBLpassword vLBLpassword = new Label(); vLBLpassword.setImmediate(false); vLBLpassword.setWidth("-1px"); vLBLpassword.setHeight("-1px"); vLBLpassword.setValue("Mot de passe :"); vFormLayout.addComponent(vLBLpassword, 0, 1); // vTFpasswordValue vTFpasswordValue = new PasswordField(); vTFpasswordValue.setImmediate(true); vTFpasswordValue.setWidth("80.0%"); vTFpasswordValue.setHeight("-1px"); vTFpasswordValue.setInputPrompt("password"); vFormLayout.addComponent(vTFpasswordValue, 1, 1); vFormLayout.setComponentAlignment(vTFpasswordValue, new Alignment(33)); // vBTregister vBTregister = new Button(); vBTregister.setCaption("S'enregistrer"); vBTregister.setImmediate(true); vBTregister.setWidth("-1px"); vBTregister.setHeight("26px"); vFormLayout.addComponent(vBTregister, 1, 2); vFormLayout.setComponentAlignment(vBTregister, new Alignment(33)); // vBTlogin vBTlogin = new Button(); vBTlogin.setCaption("Se connecter"); vBTlogin.setImmediate(true); vBTlogin.setWidth("-1px"); vBTlogin.setHeight("-1px"); vFormLayout.addComponent(vBTlogin, 1, 3); vFormLayout.setComponentAlignment(vBTlogin, new Alignment(33)); return vFormLayout; }
From source file:com.vaushell.treetasker.application.content.layout.RegistrationLayout.java
License:Open Source License
@AutoGenerated private GridLayout buildMainLayout() { // common part: create layout mainLayout = new GridLayout(); mainLayout.setImmediate(false);/*from w ww. j a v a 2 s . c om*/ mainLayout.setWidth("-1px"); mainLayout.setHeight("-1px"); mainLayout.setMargin(true); mainLayout.setSpacing(true); mainLayout.setColumns(2); mainLayout.setRows(5); // top-level component properties setWidth("-1px"); setHeight("-1px"); // vLBLregistration vLBLregistration = new Label(); vLBLregistration.setImmediate(false); vLBLregistration.setWidth("-1px"); vLBLregistration.setHeight("-1px"); vLBLregistration.setValue("<h2>Enregistrement</h2>"); vLBLregistration.setContentMode(3); mainLayout.addComponent(vLBLregistration, 0, 0); // vLBLmail vLBLmail = new Label(); vLBLmail.setImmediate(false); vLBLmail.setWidth("-1px"); vLBLmail.setHeight("-1px"); vLBLmail.setValue("E-mail"); mainLayout.addComponent(vLBLmail, 0, 1); // vTFmailValue vTFmailValue = new TextField(); vTFmailValue.setImmediate(true); vTFmailValue.setWidth("100.0%"); vTFmailValue.setHeight("-1px"); vTFmailValue.setSecret(false); mainLayout.addComponent(vTFmailValue, 1, 1); // vLBLpassword vLBLpassword = new Label(); vLBLpassword.setImmediate(false); vLBLpassword.setWidth("-1px"); vLBLpassword.setHeight("-1px"); vLBLpassword.setValue("Mot de passe :"); mainLayout.addComponent(vLBLpassword, 0, 2); // vTFpasswordValue vTFpasswordValue = new PasswordField(); vTFpasswordValue.setImmediate(true); vTFpasswordValue.setWidth("100.0%"); vTFpasswordValue.setHeight("-1px"); mainLayout.addComponent(vTFpasswordValue, 1, 2); // vLBLpassword2 vLBLpassword2 = new Label(); vLBLpassword2.setImmediate(false); vLBLpassword2.setWidth("-1px"); vLBLpassword2.setHeight("-1px"); vLBLpassword2.setValue("Confirmation de mot de passe :"); mainLayout.addComponent(vLBLpassword2, 0, 3); // vTFpasswordConfirmationValue vTFpasswordConfirmationValue = new PasswordField(); vTFpasswordConfirmationValue.setImmediate(true); vTFpasswordConfirmationValue.setWidth("100.0%"); vTFpasswordConfirmationValue.setHeight("-1px"); mainLayout.addComponent(vTFpasswordConfirmationValue, 1, 3); // buttonsLayout buttonsLayout = buildButtonsLayout(); mainLayout.addComponent(buttonsLayout, 1, 4); return mainLayout; }
From source file:cz.opendata.linked.lodcloud.loader.LoaderDialog.java
@Override protected void buildDialogLayout() { // common part: create layout mainLayout = new VerticalLayout(); mainLayout.setImmediate(false);//from w w w.j av a2 s. c o m mainLayout.setSizeUndefined(); mainLayout.setWidth("100%"); //mainLayout.setHeight("-1px"); mainLayout.setMargin(false); //mainLayout.setSpacing(true); // top-level component properties setWidth("100%"); setHeight("100%"); tfRestApiUrl = new TextField(); tfRestApiUrl.setWidth("100%"); tfRestApiUrl.setCaption("CKAN Rest API URL"); tfRestApiUrl.setInputPrompt("http://datahub.io/api/rest/dataset"); mainLayout.addComponent(tfRestApiUrl); tfApiKey = new PasswordField(); tfApiKey.setWidth("100%"); tfApiKey.setCaption("CKAN API Key"); tfApiKey.setDescription("CKAN API Key"); tfApiKey.setInputPrompt("00000000-0000-0000-0000-000000000000"); mainLayout.addComponent(tfApiKey); tfDatasetID = new TextField(); tfDatasetID.setImmediate(true); tfDatasetID.setWidth("100%"); tfDatasetID.setTextChangeEventMode(TextChangeEventMode.EAGER); tfDatasetID.setCaption("Dataset ID"); tfDatasetID.setDescription("CKAN Dataset Name used in CKAN Dataset URL"); tfDatasetID.setInputPrompt("cz-test"); tfDatasetID.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = -8684376114117545707L; @Override public void valueChange(ValueChangeEvent event) { String url = "http://datahub.io/api/rest/dataset/" + tfDatasetID.getValue(); lblRestApiUrl.setValue("<a href=\"" + url + "\" target=\"_blank\">" + url + "</a>"); } }); mainLayout.addComponent(tfDatasetID); lblRestApiUrl = new Label(); lblRestApiUrl.setContentMode(ContentMode.HTML); mainLayout.addComponent(lblRestApiUrl); tfOwnerOrg = new TextField(); tfOwnerOrg.setWidth("100%"); tfOwnerOrg.setCaption("Owner CKAN organization ID"); tfOwnerOrg.setInputPrompt("00000000-0000-0000-0000-000000000000"); mainLayout.addComponent(tfOwnerOrg); tfShortName = new TextField(); tfShortName.setWidth("100%"); tfShortName.setCaption("Dataset short name - for LOD cloud circle label"); tfShortName.setInputPrompt("CZ IC"); mainLayout.addComponent(tfShortName); cbTopic = new ComboBox(); cbTopic.setWidth("100%"); cbTopic.setCaption("Topic"); cbTopic.setDescription("Topic is used for coloring of the LOD cloud"); for (LoaderConfig.Topics topic : LoaderConfig.Topics.values()) { cbTopic.addItem(topic); } cbTopic.setInvalidAllowed(false); cbTopic.setNullSelectionAllowed(false); cbTopic.setTextInputAllowed(false); mainLayout.addComponent(cbTopic); tfMaintainerName = new TextField(); tfMaintainerName.setWidth("100%"); tfMaintainerName.setCaption("Maintainer name"); tfMaintainerName.setInputPrompt("Jakub Klmek"); mainLayout.addComponent(tfMaintainerName); tfMaintainerEmail = new TextField(); tfMaintainerEmail.setWidth("100%"); tfMaintainerEmail.setCaption("Maintainer email"); tfMaintainerEmail.setInputPrompt("klimek@opendata.cz"); mainLayout.addComponent(tfMaintainerEmail); tfAuthorName = new TextField(); tfAuthorName.setWidth("100%"); tfAuthorName.setCaption("Author name"); tfAuthorName.setInputPrompt("Jakub Klmek"); mainLayout.addComponent(tfAuthorName); tfAuthorEmail = new TextField(); tfAuthorEmail.setWidth("100%"); tfAuthorEmail.setCaption("Author email"); tfAuthorEmail.setInputPrompt("klimek@opendata.cz"); mainLayout.addComponent(tfAuthorEmail); tfVersion = new TextField(); tfVersion.setWidth("100%"); tfVersion.setCaption("Version"); tfVersion.setInputPrompt("2014-03-01"); mainLayout.addComponent(tfVersion); chkGenerateVersion = new CheckBox(); chkGenerateVersion.setCaption("Generate Version as current date"); chkGenerateVersion.setImmediate(true); chkGenerateVersion.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = 7348068985822592639L; @Override public void valueChange(ValueChangeEvent event) { tfVersion.setEnabled(!chkGenerateVersion.getValue()); } }); mainLayout.addComponent(chkGenerateVersion); cbLicense = new ComboBox(); cbLicense.setWidth("100%"); cbLicense.setCaption("License"); cbLicense.setDescription("License displayed in CKAN"); for (LoaderConfig.Licenses license : LoaderConfig.Licenses.values()) { cbLicense.addItem(license); } cbLicense.setImmediate(true); cbLicense.setInvalidAllowed(false); cbLicense.setTextInputAllowed(false); cbLicense.setNullSelectionAllowed(false); cbLicense.addValueChangeListener(new ValueChangeListener() { private static final long serialVersionUID = -5553056221069512526L; @Override public void valueChange(ValueChangeEvent event) { LoaderConfig.Licenses l = (Licenses) cbLicense.getValue(); boolean enabled = false; enabled = enabled || l == LoaderConfig.Licenses.otherat; enabled = enabled || l == LoaderConfig.Licenses.otherclosed; enabled = enabled || l == LoaderConfig.Licenses.othernc; enabled = enabled || l == LoaderConfig.Licenses.otheropen; enabled = enabled || l == LoaderConfig.Licenses.otherpd; } }); mainLayout.addComponent(cbLicense); tfSPARQLName = new TextField(); tfSPARQLName.setWidth("100%"); tfSPARQLName.setCaption("SPARQL Endpoint name"); tfSPARQLName.setInputPrompt("Opendata.cz SPARQL Endpoint"); mainLayout.addComponent(tfSPARQLName); tfSPARQLDescription = new TextField(); tfSPARQLDescription.setWidth("100%"); tfSPARQLDescription.setCaption("SPARQL Endpoint description"); tfSPARQLDescription.setInputPrompt("Running Virtuoso 7"); mainLayout.addComponent(tfSPARQLDescription); tfNamespace = new TextField(); tfNamespace.setWidth("100%"); tfNamespace.setCaption("RDF namespace"); tfNamespace.setInputPrompt("http://linked.opendata.cz/resource/"); mainLayout.addComponent(tfNamespace); lsLicenseMetadataTag = new ListSelect(); lsLicenseMetadataTag.setWidth("100%"); lsLicenseMetadataTag.setCaption("License metadata"); lsLicenseMetadataTag.setDescription("Switches between license-metadata and no-license-metadata tags"); for (LoaderConfig.LicenseMetadataTags lmdTag : LoaderConfig.LicenseMetadataTags.values()) { lsLicenseMetadataTag.addItem(lmdTag); } lsLicenseMetadataTag.setNewItemsAllowed(false); lsLicenseMetadataTag.setMultiSelect(false); lsLicenseMetadataTag.setNullSelectionAllowed(false); lsLicenseMetadataTag.setRows(LoaderConfig.LicenseMetadataTags.values().length); mainLayout.addComponent(lsLicenseMetadataTag); lsProvenanceMetadataTag = new ListSelect(); lsProvenanceMetadataTag.setWidth("100%"); lsProvenanceMetadataTag.setCaption("Provenance metadata"); lsProvenanceMetadataTag .setDescription("Switches between provenance-metadata and no-provenance-metadata tags"); for (LoaderConfig.ProvenanceMetadataTags pmdTag : LoaderConfig.ProvenanceMetadataTags.values()) { lsProvenanceMetadataTag.addItem(pmdTag); } lsProvenanceMetadataTag.setNewItemsAllowed(false); lsProvenanceMetadataTag.setMultiSelect(false); lsProvenanceMetadataTag.setNullSelectionAllowed(false); lsProvenanceMetadataTag.setRows(LoaderConfig.ProvenanceMetadataTags.values().length); mainLayout.addComponent(lsProvenanceMetadataTag); lsPublishedTag = new ListSelect(); lsPublishedTag.setWidth("100%"); lsPublishedTag.setCaption("Publised by"); lsPublishedTag.setDescription("Switches between published-by-producer and published-by-third-party tags"); for (LoaderConfig.PublishedTags pTag : LoaderConfig.PublishedTags.values()) { lsPublishedTag.addItem(pTag); } lsPublishedTag.setNewItemsAllowed(false); lsPublishedTag.setMultiSelect(false); lsPublishedTag.setNullSelectionAllowed(false); lsPublishedTag.setRows(LoaderConfig.PublishedTags.values().length); mainLayout.addComponent(lsPublishedTag); lsVocabTag = new ListSelect(); lsVocabTag.setWidth("100%"); lsVocabTag.setCaption("Proprietary vocabulary"); lsVocabTag.setDescription("Switches among no-proprietary-vocab deref-vocab and no-deref-vocab tags"); for (LoaderConfig.VocabTags vTag : LoaderConfig.VocabTags.values()) { lsVocabTag.addItem(vTag); } lsVocabTag.setNewItemsAllowed(false); lsVocabTag.setImmediate(true); lsVocabTag.setMultiSelect(false); lsVocabTag.setNullSelectionAllowed(false); lsVocabTag.setRows(LoaderConfig.VocabTags.values().length); mainLayout.addComponent(lsVocabTag); lsVocabMappingsTag = new ListSelect(); lsVocabMappingsTag.setWidth("100%"); lsVocabMappingsTag.setCaption("Vocabulary mapping"); lsVocabMappingsTag.setDescription( "Only valid when using proprietary vocabulary. Switches between vocab-mappings and no-vocab-mappings tags"); for (LoaderConfig.VocabMappingsTags vmTag : LoaderConfig.VocabMappingsTags.values()) { lsVocabMappingsTag.addItem(vmTag); } lsVocabMappingsTag.setNewItemsAllowed(false); lsVocabMappingsTag.setMultiSelect(false); lsVocabMappingsTag.setNullSelectionAllowed(false); lsVocabMappingsTag.setRows(LoaderConfig.VocabMappingsTags.values().length); mainLayout.addComponent(lsVocabMappingsTag); lsAdditionalTags = new ListSelect(); lsAdditionalTags.setRows(4); lsAdditionalTags.setWidth("100%"); lsAdditionalTags.setCaption("Additional CKAN tags"); lsAdditionalTags.setDescription("Custom CKAN tags in addition to the ones required for the LODCloud"); lsAdditionalTags.setNewItemsAllowed(true); lsAdditionalTags.setNullSelectionAllowed(false); lsAdditionalTags.setMultiSelect(true); mainLayout.addComponent(lsAdditionalTags); chkLodcloudNolinks = new CheckBox(); chkLodcloudNolinks.setCaption("Data set has no external RDF links to other datasets."); mainLayout.addComponent(chkLodcloudNolinks); chkLodcloudUnconnected = new CheckBox(); chkLodcloudUnconnected.setCaption("Data set has no external RDF links to or from other datasets."); mainLayout.addComponent(chkLodcloudUnconnected); chkLodcloudNeedsFixing = new CheckBox(); chkLodcloudNeedsFixing.setCaption("The dataset is currently broken."); mainLayout.addComponent(chkLodcloudNeedsFixing); chkLodcloudNeedsInfo = new CheckBox(); chkLodcloudNeedsInfo .setCaption("The data provider or data set homepage do not provide mininum information."); mainLayout.addComponent(chkLodcloudNeedsInfo); chkLimitedSparql = new CheckBox(); chkLimitedSparql.setCaption("Indicates whether the SPARQL endpoint is not serving the whole data set."); mainLayout.addComponent(chkLimitedSparql); lsVocabularies = new ListSelect(); lsVocabularies.setRows(4); lsVocabularies.setWidth("100%"); lsVocabularies.setCaption("Standard prefixes of vocabularies used"); lsVocabularies.setDescription("Tags the dataset with used vocabulary prefixes. Lookup: http://prefix.cc"); lsVocabularies.setNewItemsAllowed(true); lsVocabularies.setNullSelectionAllowed(false); lsVocabularies.setMultiSelect(true); mainLayout.addComponent(lsVocabularies); gtLinkCounts = new ComponentTable<LoaderConfig.LinkCount>(LoaderConfig.LinkCount.class, new ComponentTable.ColumnInfo("targetDataset", "Target CKAN dataset name", null, 0.4f), new ComponentTable.ColumnInfo("linkCount", "Link count", null, 0.1f)); gtLinkCounts.setPolicy(new ComponentTable.Policy<LoaderConfig.LinkCount>() { @Override public boolean isSet(LoaderConfig.LinkCount value) { return !value.getTargetDataset().isEmpty(); } }); mainLayout.addComponent(gtLinkCounts); gtMappingFiles = new ComponentTable<LoaderConfig.MappingFile>(LoaderConfig.MappingFile.class, new ComponentTable.ColumnInfo("mappingFormat", "Mapping format", null, 0.1f), new ComponentTable.ColumnInfo("mappingFile", "Link to mapping file", null, 0.4f)); gtMappingFiles.setPolicy(new ComponentTable.Policy<LoaderConfig.MappingFile>() { @Override public boolean isSet(LoaderConfig.MappingFile value) { return !value.getMappingFile().isEmpty(); } }); mainLayout.addComponent(gtMappingFiles); Panel panel = new Panel(); panel.setSizeFull(); panel.setContent(mainLayout); setCompositionRoot(panel); }
From source file:dhbw.clippinggorilla.userinterface.views.MenuBar.java
public MenuBar() { setColumns(7);/*from w w w . j av a 2 s . c o m*/ setRows(1); addStyleName("menubar"); setWidth("100%"); setHeightUndefined(); setColumnExpandRatio(1, 5); setSpacing(true); setMargin(true); logo = new Image(); try { logo.setSource(new FileResource(FileUtils.getFile("images/logowide_small.png").toFile())); } catch (FileNotFoundException ex) { Log.error("Could not find logo!", ex); } logo.setHeight("100%"); spacing1 = new Label(); spacing2 = new Label(); username = new TextField(); username.focus(); Language.setCustom(Word.USERNAME_OR_EMAIL, null, v -> username.setPlaceholder(v)); username.setMaxLength(255); password = new PasswordField(); Language.setCustom(Word.PASSWORD, null, v -> password.setPlaceholder(v)); password.setMaxLength(50); passwordForgotten = new Button(VaadinIcons.KEY); Language.set(Word.PASSWORD_FORGOTTEN, passwordForgotten); passwordForgotten.addStyleName(ValoTheme.BUTTON_BORDERLESS_COLORED); passwordForgotten.addClickListener(ce -> UI.getCurrent().addWindow(PasswordRecoveryWindow.create())); login = new Button(); Language.set(Word.LOGIN, login); register = new Button(); login.setClickShortcut(KeyCode.ENTER, null); login.addClickListener(ce -> logInActions()); login.addStyleName(ValoTheme.BUTTON_PRIMARY); login.setIcon(VaadinIcons.SIGN_IN); Language.set(Word.REGISTER, register); register.addClickListener(ce -> UI.getCurrent().addWindow(RegisterWindow.get())); register.setIcon(VaadinIcons.USER_CHECK); home = new Button(); home.setIcon(VaadinIcons.HOME); home.addClickListener(ce -> ClippingGorillaUI.getCurrent().setMainContent(ClippingView.getCurrent())); profile = new Button(Language.get(Word.PROFILES)); profile.setIcon(VaadinIcons.USER); Language.set(Word.PROFILES, profile); profile.addClickListener( ce -> ClippingGorillaUI.getCurrent().setMainContent(InterestProfileView.getCurrent())); groups = new Button(Language.get(Word.GROUPS)); groups.setIcon(VaadinIcons.GROUP); Language.set(Word.GROUPS, groups); groups.addClickListener(ce -> ClippingGorillaUI.getCurrent().setMainContent(GroupView.getCurrent())); userBar = new com.vaadin.ui.MenuBar(); addComponents(logo, spacing1, spacing2, username, password, login, register); SESSIONS.put(VaadinSession.getCurrent(), this); }
From source file:dhbw.ka.mwi.businesshorizon2.ui.login.LogInScreenViewImplv2.java
License:Open Source License
private VerticalLayout generateLogin() { VerticalLayout loginForm = new VerticalLayout(); loginEmail = new TextField(); loginEmail.setCaption("Emailadresse"); loginPassword = new PasswordField(); loginPassword.setCaption("Passwort"); loginForm.addComponent(loginEmail);//from w w w. j a va 2 s .c om loginForm.addComponent(loginPassword); return loginForm; }