com.vaadin.ui.TextField.getValue() - java examples

Here are the examples of the java api com.vaadin.ui.TextField.getValue() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

49 Examples 7

19 View Complete Implementation : OpenSnapshotFileDialog.java
Copyright Apache License 2.0
Author : alenca
boolean validateInputs() {
    boolean isOk = true;
    if (snapshotFileLabel.getValue().isEmpty()) {
        snapshotFileLabel.setComponentError(new UserError("File path must be provided"));
        isOk = false;
    } else {
        snapshotFileLabel.setComponentError(null);
    }
    if (tabNameLabel.getValue().isEmpty()) {
        tabNameLabel.setComponentError(new UserError("Name must be provided"));
        isOk = false;
    } else {
        tabNameLabel.setComponentError(null);
    }
    return isOk;
}

19 View Complete Implementation : CmsEditFavoriteDialog.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Handler for the OK button.
 */
protected void onClickOk() {
    if (!m_changed) {
        CmsVaadinUtils.closeWindow(CmsEditFavoriteDialog.this);
        return;
    }
    String value = m_replacedle.getValue();
    CmsFavoriteEntry result;
    try {
        result = new CmsFavoriteEntry(m_entry.toJson());
        result.setCustomreplacedle(value);
        m_callback.accept(result);
        CmsVaadinUtils.closeWindow(CmsEditFavoriteDialog.this);
    } catch (JSONException e) {
        LOG.error(e.getLocalizedMessage(), e);
        CmsErrorDialog.showErrorDialog(e);
    }
}

19 View Complete Implementation : CmsDbSettingsPanel.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Saves form field data to setup bean.
 */
public void saveToSetupBean() {
    Map<String, String[]> result = new HashMap<String, String[]>();
    CmsSetupBean bean = m_setupBean;
    if (m_dbCreateUser.isVisible()) {
        bean.setDbCreateUser(m_dbCreateUser.getValue());
    }
    if (m_dbCreatePwd.isVisible()) {
        bean.setDbCreatePwd(m_dbCreatePwd.getValue());
    }
    if (m_dbWorkUser.isVisible()) {
        bean.setDbWorkUser(m_dbWorkUser.getValue());
    }
    if (m_templateDb.isVisible()) {
        setDbProp("templateDb", m_templateDb.getValue());
    }
    if (m_dbWorkPwd.isVisible()) {
        bean.setDbWorkPwd(m_dbWorkPwd.getValue());
    }
    if (m_dbCreateConStr.isVisible()) {
        bean.setDbCreateConStr(m_dbCreateConStr.getValue());
    }
    if (m_dbName.isVisible()) {
        bean.setDb(m_dbName.getValue());
    }
    result.put("dbCreateConStr", new String[] { m_dbCreateConStr.getValue() });
    result.put("dbName", new String[] { bean.getDatabase() });
    result.put("dbProduct", new String[] { bean.getDatabase() });
    result.put("dbProvider", new String[] { "sql" });
    result.put("dbName", new String[] { m_dbName.getValue() });
    result.put("db", new String[] { bean.getDb() });
    result.put("createDb", new String[] { Boolean.toString(m_createDb.getValue().booleanValue()) });
    result.put("createTables", new String[] { Boolean.toString(m_createTables.getValue().booleanValue()) });
    result.put("jdbcDriver", new String[] { dbProp("driver") });
    result.put("templateDb", new String[] { dbProp("templateDb") });
    result.put("dbCreateUser", new String[] { bean.getDbCreateUser() });
    result.put("dbCreatePwd", new String[] { bean.getDbCreatePwd() });
    result.put("dbWorkUser", new String[] { bean.getDbWorkUser() });
    result.put("dbWorkPwd", new String[] { bean.getDbWorkPwd() });
    result.put("dbDefaultTablespace", new String[] { m_defaultTablespace.getValue() });
    result.put("dbTemporaryTablespace", new String[] { m_temporaryTablespace.getValue() });
    result.put("dbIndexTablespace", new String[] { m_indexTablespace.getValue() });
    // result.put("servletMapping", new String[] {getServeltMapping()});
    result.put("submit", new String[] { Boolean.TRUE.toString() });
    bean.setDbParamaters(result, bean.getDatabase(), null, null);
}

19 View Complete Implementation : Login.java
Copyright Apache License 2.0
Author : apache
private void loginButtonClicked() {
    String username = usernameField.getValue();
    String preplacedword = preplacedwordField.getValue();
    if (StringUtils.isEmpty(username) || StringUtils.isEmpty(preplacedword)) {
        Notification.show("Error", "Please enter username and preplacedword", Notification.Type.ERROR_MESSAGE);
        return;
    }
    try {
        if (authUser(username, preplacedword)) {
            redirectToMainView();
        } else {
            Notification.show("Error", "Check your preplacedword and username", Notification.Type.HUMANIZED_MESSAGE);
        }
    } catch (Exception e) {
        Notification.show("Error", "Check your preplacedword and username: " + e.getMessage(), Notification.Type.ERROR_MESSAGE);
    }
}

19 View Complete Implementation : UserLayout.java
Copyright Apache License 2.0
Author : apache
private void saveButtonClicked() {
    String username = usernameField.getValue();
    String preplacedword = preplacedwordField.getValue();
    // Check if the selected user is the default user and it's username is tried to be changed
    if (UserListWindow.getSelectedUser() != null && UserListWindow.getSelectedUser().equals(ShiroRealm.getDefaultUser()) && isUserNameChanged(username)) {
        Notification.show("Error", "Username of the default user cannot be changed", Notification.Type.ERROR_MESSAGE);
        return;
    }
    if (StringUtils.isEmpty(username) || StringUtils.isEmpty(preplacedword)) {
        Notification.show("Error", "Please enter username and preplacedword", Notification.Type.ERROR_MESSAGE);
        return;
    }
    try {
        // Update the information of an existing user
        if (UserListWindow.getSelectedUser() != null) {
            userDao.delete(UserListWindow.getSelectedUser());
            userDao.save(new User(username, preplacedword));
            UserListWindow.setSelectedUser(username);
            ShiroRealm.setAuthenticatedUser(username);
            BasicProviderParams newProviderParams = new BasicProviderParams(username, instanceTypeField.getValue(), accessKeyField.getValue(), secretKeyField.getValue(), imageField.getValue(), keyPairNameField.getValue());
            ProviderParams oldProviderParams = providerParamsDao.getByUser(UserListWindow.getSelectedUser());
            Map<String, String> keys = oldProviderParams != null ? oldProviderParams.getKeys() : new HashMap<String, String>();
            newProviderParams.setKeys(keys);
            providerParamsDao.delete(UserListWindow.getSelectedUser());
            providerParamsDao.save(newProviderParams);
            close();
            Notification.show("Success", "User information updated successfully", Notification.Type.HUMANIZED_MESSAGE);
        } else // Create a new user
        {
            // Check if the new user exists in the system
            if (userDao.get(username) != null) {
                Notification.show("Error", "The username " + username + " already exists!", Notification.Type.ERROR_MESSAGE);
                return;
            }
            doSaveUser(username, preplacedword);
        }
    } catch (Exception e) {
        Notification.show("Error", "Error to save user: " + e.getMessage(), Notification.Type.ERROR_MESSAGE);
    }
}

19 View Complete Implementation : AutoCompleteTextFieldComponent.java
Copyright Eclipse Public License 1.0
Author : eclipse
public String getValue() {
    return queryTextField.getValue();
}

19 View Complete Implementation : AbstractHawkbitLoginUI.java
Copyright Eclipse Public License 1.0
Author : eclipse
private void handleLogin() {
    if (mulreplacedenancyIndicator.isMulreplacedenancySupported()) {
        final boolean textFieldsNotEmpty = hasTenantFieldText() && hasUserFieldText() && hashPreplacedwordFieldText();
        if (textFieldsNotEmpty) {
            login(tenant.getValue(), username.getValue(), preplacedword.getValue(), true);
        }
    } else if (!mulreplacedenancyIndicator.isMulreplacedenancySupported() && hasUserFieldText() && hashPreplacedwordFieldText()) {
        login(null, username.getValue(), preplacedword.getValue(), true);
    }
}

19 View Complete Implementation : DistributionAddUpdateWindowLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
private boolean isDuplicate(final Long editDistId) {
    final String name = distNameTextField.getValue();
    final String version = distVersionTextField.getValue();
    final Optional<DistributionSet> existingDs = distributionSetManagement.getByNameAndVersion(name, version);
    /*
         * Distribution should not exists with the same name & version. Display
         * error message, when the "existingDs" is not null and it is add window
         * (or) when the "existingDs" is not null and it is edit window and the
         * distribution Id of the edit window is different then the "existingDs"
         */
    if (existingDs.isPresent() && !existingDs.get().getId().equals(editDistId)) {
        distNameTextField.addStyleName(SPUIStyleDefinitions.SP_TEXTFIELD_LAYOUT_ERROR_HIGHTLIGHT);
        distVersionTextField.addStyleName(SPUIStyleDefinitions.SP_TEXTFIELD_LAYOUT_ERROR_HIGHTLIGHT);
        notificationMessage.displayValidationError(i18n.getMessage("message.duplicate.dist", existingDs.get().getName(), existingDs.get().getVersion()));
        return true;
    }
    return false;
}

19 View Complete Implementation : MaintenanceWindowLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
/**
 * Get the maintenance window duration.
 *
 * @return {@link String}.
 */
public String getMaintenanceDuration() {
    return duration.getValue();
}

19 View Complete Implementation : MaintenanceWindowLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
/**
 * Get the cron expression for maintenance schedule.
 *
 * @return {@link String}.
 */
public String getMaintenanceSchedule() {
    return schedule.getValue();
}

19 View Complete Implementation : TargetAddUpdateWindowLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
private boolean isDuplicate() {
    final String newControlllerId = controllerIDTextField.getValue();
    final Optional<Target> existingTarget = targetManagement.getByControllerID(newControlllerId.trim());
    if (existingTarget.isPresent()) {
        uINotification.displayValidationError(i18n.getMessage("message.target.duplicate.check", newControlllerId));
        return true;
    } else {
        return false;
    }
}

19 View Complete Implementation : TargetAddUpdateWindowLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
/**
 * Update the Target if modified.
 */
public void updateTarget() {
    /* save updated enreplacedy */
    final Target target = targetManagement.update(enreplacedyFactory.target().update(controllerId).name(nameTextField.getValue()).description(descTextArea.getValue()));
    /* display success msg */
    uINotification.displaySuccess(i18n.getMessage("message.update.success", target.getName()));
    // publishing through event bus
    eventBus.publish(this, new TargetTableEvent(BaseEnreplacedyEventType.UPDATED_ENreplacedY, target));
}

19 View Complete Implementation : TargetAddUpdateWindowLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
private void addNewTarget() {
    final String newControllerId = controllerIDTextField.getValue();
    final String newName = nameTextField.getValue();
    final String newDesc = descTextArea.getValue();
    final Target newTarget = targetManagement.create(enreplacedyFactory.target().create().controllerId(newControllerId).name(newName).description(newDesc));
    eventBus.publish(this, new TargetTableEvent(BaseEnreplacedyEventType.ADD_ENreplacedY, newTarget));
    uINotification.displaySuccess(i18n.getMessage("message.save.success", newTarget.getName()));
    targetTable.setValue(Sets.newHashSet(newTarget.getId()));
}

19 View Complete Implementation : AddUpdateRolloutWindowLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
private void validateGroups() {
    if (editRolloutEnabled) {
        return;
    }
    if (isGroupsDefinition()) {
        final List<RolloutGroupCreate> savedRolloutGroups = defineGroupsLayout.getSavedRolloutGroups();
        if (!defineGroupsLayout.isValid() || savedRolloutGroups == null || savedRolloutGroups.isEmpty()) {
            noOfGroups.clear();
        } else {
            noOfGroups.setValue(String.valueOf(savedRolloutGroups.size()));
        }
        updateGroupsChart(defineGroupsLayout.getGroupsValidation());
    }
    if (isNumberOfGroups()) {
        if (noOfGroups.isValid() && !noOfGroups.getValue().isEmpty()) {
            updateGroupsChart(Integer.parseInt(noOfGroups.getValue()));
        } else {
            updateGroupsChart(0);
        }
    }
}

19 View Complete Implementation : ActionAutocleanupConfigurationItem.java
Copyright Eclipse Public License 1.0
Author : eclipse
@Override
public void save() {
    if (cleanupEnabledChanged) {
        setActionCleanupEnabled(cleanupEnabled);
        cleanupEnabledChanged = false;
    }
    if (cleanupEnabled && actionStatusChanged) {
        setActionStatus((ActionStatusOption) actionStatusCombobox.getValue());
        actionStatusChanged = false;
    }
    if (cleanupEnabled && actionExpiryChanged) {
        setActionExpiry(Long.parseLong(actionExpiryInput.getValue()));
        actionExpiryChanged = false;
    }
}

19 View Complete Implementation : ImportPanel.java
Copyright Apache License 2.0
Author : korpling
private void startImport() {
    WebResource res = Helper.getAnnisWebResource(UI.getCurrent()).path("admin").path("import");
    String mail = txtMail.getValue();
    if (requestBinder.isValid() && mail != null && !mail.isEmpty()) {
        res = res.queryParam("statusMail", mail);
    }
    if (cbOverwrite.getValue() == true) {
        res = res.queryParam("overwrite", "true");
    }
    String alias = txtAlias.getValue();
    if (alias != null && !alias.isEmpty()) {
        res = res.queryParam("alias", alias);
    }
    try (FileInputStream tmpFileStream = new FileInputStream(temporaryCorpusFile)) {
        ClientResponse response = res.enreplacedy(tmpFileStream).type("application/zip").post(ClientResponse.clreplaced);
        if (response.getStatus() == Response.Status.ACCEPTED.getStatusCode()) {
            URI location = response.getLocation();
            appendMessage("Import requested, update URL is " + location);
            UI ui = UI.getCurrent();
            Background.run(new WaitForFinishRunner(location, ui));
        } else {
            upload.setEnabled(true);
            progress.setVisible(false);
            appendMessage("Error (response code " + response.getStatus() + "): " + response.getEnreplacedy(String.clreplaced));
        }
    } catch (IOException ex) {
        log.error(null, ex);
    }
}

19 View Complete Implementation : SignInViewImpl.java
Copyright Apache License 2.0
Author : markoradinovic
@Override
public void buttonClick(ClickEvent event) {
    /*
		 * Signin using username and preplacedword
		 */
    if (event.getButton() == btnLogin) {
        mvpPresenterHandlers.doSignIn(username.getValue(), preplacedword.getValue(), rememberMe.getValue());
    }
}

19 View Complete Implementation : GroupsView.java
Copyright The Unlicense
Author : mstahv
private void listEntries() {
    listEntries(filter.getValue());
}

19 View Complete Implementation : DurationEditField.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
@Override
public Long getValue() {
    String durationStr = txtField.getValue();
    if (StringUtils.isNotBlank(durationStr)) {
        return HumanTime.eval(durationStr).getDelta();
    }
    return null;
}

19 View Complete Implementation : ToggleBugSummaryField.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
private void updateFieldValue(TextField editField) {
    removeComponent(editField);
    addComponent(replacedleLinkLbl);
    addComponent(buttonControls);
    addStyleName("editable-field");
    String newValue = editField.getValue();
    if (StringUtils.isNotBlank(newValue) && !newValue.equals(bug.getName())) {
        bug.setName(newValue);
        replacedleLinkLbl.setValue(buildBugLink());
        BugService bugService = AppContextUtil.getSpringBean(BugService.clreplaced);
        bugService.updateSelectiveWithSession(BeanUtility.deepClone(bug), UserUIContext.getUsername());
    }
    isRead = !isRead;
}

19 View Complete Implementation : ToggleMilestoneSummaryField.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
private void updateFieldValue(TextField editField) {
    removeComponent(editField);
    withComponents(replacedleLinkLbl, buttonControls).withStyleName("editable-field");
    String newValue = editField.getValue();
    if (StringUtils.isNotBlank(newValue) && !newValue.equals(milestone.getName())) {
        milestone.setName(newValue);
        replacedleLinkLbl.setValue(buildMilestoneLink());
        MilestoneService milestoneService = AppContextUtil.getSpringBean(MilestoneService.clreplaced);
        milestoneService.updateSelectiveWithSession(BeanUtility.deepClone(milestone), UserUIContext.getUsername());
    }
    isRead = !isRead;
}

19 View Complete Implementation : ToggleTaskSummaryField.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
private void updateFieldValue(TextField editField) {
    removeComponent(editField);
    withComponents(replacedleLinkLbl, buttonControls).withStyleName("editable-field");
    String newValue = editField.getValue();
    if (StringUtils.isNotBlank(newValue) && !newValue.equals(task.getName())) {
        task.setName(newValue);
        replacedleLinkLbl.setValue(buildTaskLink());
        TaskService taskService = AppContextUtil.getSpringBean(TaskService.clreplaced);
        taskService.updateSelectiveWithSession(BeanUtility.deepClone(task), UserUIContext.getUsername());
    }
    isRead = !isRead;
}

19 View Complete Implementation : AdvancedInfoChangeWindow.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
private void changeInfo() {
    user.setWebsite(txtWebsite.getValue());
    user.setCompany(txtCompany.getValue());
    user.setCountry((String) cboCountry.getValue());
    UserService userService = AppContextUtil.getSpringBean(UserService.clreplaced);
    userService.updateWithSession(user, UserUIContext.getUsername());
    close();
    UIUtils.reloadPage();
}

19 View Complete Implementation : SearchableGrid.java
Copyright GNU General Public License v3.0
Author : rlsutton1
public void triggerFilter() {
    triggerFilter(searchField.getValue());
}

19 View Complete Implementation : SearchableSelectableEntityTable.java
Copyright GNU General Public License v3.0
Author : rlsutton1
/**
 * call this method to cause filters to be applied
 */
public void triggerFilter() {
    triggerFilter(searchField.getValue());
}

19 View Complete Implementation : InputDialog.java
Copyright GNU General Public License v3.0
Author : rlsutton1
@Override
public boolean onOK() {
    return recipient.onOK(field.getValue());
}

19 View Complete Implementation : TextFieldWithLabel.java
Copyright GNU General Public License v3.0
Author : rlsutton1
public String getValue() {
    return textField.getValue();
}

19 View Complete Implementation : ReportParameterString.java
Copyright GNU General Public License v3.0
Author : rlsutton1
@Override
public String getValue(String parameterName) {
    return field.getValue();
}

19 View Complete Implementation : ChatUI.java
Copyright Apache License 2.0
Author : saturnism
@Override
protected void init(VaadinRequest vaadinRequest) {
    final UI currentUI = getCurrent();
    final StreamObserver<Chat.ChatMessage> observer = stub.chat(new StreamObserver<Chat.ChatMessageFromServer>() {

        @Override
        public void onNext(Chat.ChatMessageFromServer chatMessageFromServer) {
            currentUI.access(() -> layout.addComponent(new Label(String.format("%s: %s", chatMessageFromServer.getMessage().getFrom(), chatMessageFromServer.getMessage().getMessage()))));
        }

        @Override
        public void onError(Throwable throwable) {
            logger.log(Level.SEVERE, "gRPC Error", throwable);
        }

        @Override
        public void onCompleted() {
            logger.info("gRPC Call Completed");
        }
    });
    button.addClickListener(e -> {
        final String nameValue = name.getValue();
        final String messageValue = message.getValue();
        observer.onNext(Chat.ChatMessage.newBuilder().setFrom(nameValue).setMessage(messageValue).build());
    });
}

19 View Complete Implementation : NumberFilterPopup.java
Copyright Apache License 2.0
Author : tepi
private String parseInput(TextField input) throws NumberFormatException {
    String value = input.getValue();
    if (value == null || value.trim().isEmpty()) {
        return "";
    } else {
        if (allowDecimalPlaces) {
            Double.valueOf(value);
        } else {
            new BigInteger(value);
        }
        return value;
    }
}

19 View Complete Implementation : LoginScreen.java
Copyright The Unlicense
Author : vaadin
private void login() {
    if (accessControl.signIn(username.getValue(), preplacedword.getValue())) {
        loginListener.loginSuccessful();
    } else {
        showNotification(new Notification("Login failed", "Please check your username and preplacedword and try again.", Notification.Type.HUMANIZED_MESSAGE));
        username.focus();
    }
}

19 View Complete Implementation : ClearableTextField.java
Copyright Apache License 2.0
Author : viritin
@Override
public Object getValue() {
    return textfield.getValue();
}

18 View Complete Implementation : CmsSetupStep05ServerSettings.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Proceed to next step.
 */
private void forward() {
    try {
        String macAddress = m_macAddress.getValue();
        String serverId = m_serverId.getValue();
        String serverUrl = m_serverUrl.getValue();
        CmsSetupBean setupBean = m_context.getSetupBean();
        setupBean.setEthernetAddress(macAddress);
        setupBean.setServerName(serverId);
        setupBean.setWorkplaceSite(serverUrl);
        setupBean.prepareStep8();
        m_context.stepForward();
    } catch (Exception e) {
        CmsSetupErrorDialog.showErrorDialog(e);
    }
}

18 View Complete Implementation : OldLoginView.java
Copyright GNU General Public License v3.0
Author : antoniomaria
@Override
public void buttonClick(ClickEvent event) {
    logger.info("Submitting login");
    // List<QuestionnaireDTO> questionnaires = questionnairResource.list();
    // System.out.println(questionnaires);
    // 
    // Validate the fields using the navigator. By using validors for the
    // fields we reduce the amount of queries we have to use to the database
    // for wrongly entered preplacedwords
    // 
    if (!invitationTextField.isValid()) {
        return;
    }
    String invitation = invitationTextField.getValue();
    WrappedSession session = VaadinService.getCurrentRequest().getWrappedSession();
    QuestionnaireResource proxy = JAXRSClientFactory.create("", QuestionnaireResource.clreplaced, Collections.singletonList(new JacksonJsonProvider()), "respondent", invitation, null);
    // 
    // Validate username and preplacedword with database here. For examples sake
    // I use a dummy username and preplacedword.
    // 
    boolean isValid = true;
    if (isValid) {
        // Store the current invitation in the service session
        getSession().setAttribute("invitation", invitation);
        session.setAttribute("username", "respondent");
        session.setAttribute("preplacedword", invitation);
        // Navigate to main view
        getUI().getNavigator().navigateTo(QuestionnaireView.NAME);
    } else {
        // Wrong preplacedword clear the preplacedword field and refocuses it
        invitationTextField.setValue(null);
        invitationTextField.focus();
    }
}

18 View Complete Implementation : AbstractMetadataPopupLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
private boolean duplicateCheck(final E enreplacedy) {
    if (!checkForDuplicate(enreplacedy, keyTextField.getValue())) {
        return false;
    }
    uiNotification.displayValidationError(i18n.getMessage("message.metadata.duplicate.check", keyTextField.getValue()));
    return true;
}

18 View Complete Implementation : AbstractMetadataPopupLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
private boolean mandatoryCheck() {
    if (keyTextField.getValue().isEmpty()) {
        uiNotification.displayValidationError(i18n.getMessage("message.key.missing"));
        return false;
    }
    if (valueTextArea.getValue().isEmpty()) {
        uiNotification.displayValidationError(i18n.getMessage("message.value.missing"));
        return false;
    }
    return true;
}

18 View Complete Implementation : AddUpdateRolloutWindowLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
private void onGroupNumberChange(final ValueChangeEvent event) {
    if (editRolloutEnabled) {
        return;
    }
    if (event.getProperty().getValue() != null && noOfGroups.isValid() && totalTargetsCount != null && isNumberOfGroups()) {
        groupSizeLabel.setValue(getTargetPerGroupMessage(String.valueOf(getGroupSize())));
        groupSizeLabel.setVisible(true);
        updateGroupsChart(Integer.parseInt(noOfGroups.getValue()));
    } else {
        groupSizeLabel.setVisible(false);
        if (isNumberOfGroups()) {
            updateGroupsChart(0);
        }
    }
}

18 View Complete Implementation : ToggleTicketSummaryField.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
private void updateFieldValue(TextField editField) {
    removeComponent(editField);
    addComponent(replacedleLinkLbl);
    addComponent(buttonControls);
    addStyleName("editable-field");
    String newValue = editField.getValue();
    if (StringUtils.isNotBlank(newValue) && !newValue.equals(ticket.getName())) {
        ticket.setName(newValue);
        replacedleLinkLbl.setValue(buildTicketLink());
        if (ticket.isBug()) {
            BugWithBLOBs bug = ProjectTicket.buildBug(ticket);
            BugService bugService = AppContextUtil.getSpringBean(BugService.clreplaced);
            bugService.updateSelectiveWithSession(bug, UserUIContext.getUsername());
        } else if (ticket.isTask()) {
            Task task = ProjectTicket.buildTask(ticket);
            TaskService taskService = AppContextUtil.getSpringBean(TaskService.clreplaced);
            taskService.updateSelectiveWithSession(task, UserUIContext.getUsername());
        } else if (ticket.isRisk()) {
            Risk risk = ProjectTicket.buildRisk(ticket);
            RiskService riskService = AppContextUtil.getSpringBean(RiskService.clreplaced);
            riskService.updateSelectiveWithSession(risk, UserUIContext.getUsername());
        }
    }
    isRead = !isRead;
}

18 View Complete Implementation : ContactInfoChangeWindow.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
private void changeUserInfo() {
    txtWorkPhone.removeStyleName("errorField");
    txtHomePhone.removeStyleName("errorField");
    user.setWorkphone(txtWorkPhone.getValue());
    user.setHomephone(txtHomePhone.getValue());
    user.setFacebookaccount(txtFaceBook.getValue());
    user.setTwitteraccount(txtTwitter.getValue());
    user.setSkypecontact(txtSkype.getValue());
    if (validateForm(user)) {
        UserService userService = AppContextUtil.getSpringBean(UserService.clreplaced);
        userService.updateWithSession(user, UserUIContext.getUsername());
        close();
        UIUtils.reloadPage();
    }
}

18 View Complete Implementation : MainUI.java
Copyright MIT License
Author : techger
@Override
protected void init(VaadinRequest request) {
    // build layout
    HorizontalLayout actions = new HorizontalLayout(filter, addNewBtn);
    VerticalLayout mainLayout = new VerticalLayout(actions, grid, editor);
    setContent(mainLayout);
    // Configure layouts and components
    actions.setSpacing(true);
    mainLayout.setMargin(true);
    mainLayout.setSpacing(true);
    grid.setHeight(300, Unit.PIXELS);
    grid.setColumns("id", "firstName", "lastName");
    filter.setInputPrompt("Filter by last name");
    // Hook logic to components
    // Replace listing with filtered content when user changes filter
    filter.addTextChangeListener(e -> listCustomers(e.getText()));
    // Connect selected Customer to editor or hide if none is selected
    grid.addSelectionListener(e -> {
        if (e.getSelected().isEmpty()) {
            editor.setVisible(false);
        } else {
            editor.editCustomer((Customer) grid.getSelectedRow());
        }
    });
    // Instantiate and edit new Customer the new button is clicked
    addNewBtn.addClickListener(e -> editor.editCustomer(new Customer("", "")));
    // Listen changes made by the editor, refresh data from backend
    editor.setChangeHandler(() -> {
        editor.setVisible(false);
        listCustomers(filter.getValue());
    });
    // Initialize listing
    listCustomers(null);
}

17 View Complete Implementation : AbstractMetadataPopupLayout.java
Copyright Eclipse Public License 1.0
Author : eclipse
protected void onSave() {
    final String key = keyTextField.getValue();
    final String value = valueTextArea.getValue();
    if (mandatoryCheck()) {
        final E enreplacedy = selectedEnreplacedy;
        if (metaDataGrid.getSelectedRow() == null) {
            if (!duplicateCheck(enreplacedy)) {
                final M metadata = createMetadata(enreplacedy, key, value);
                uiNotification.displaySuccess(i18n.getMessage("message.metadata.saved", metadata.getKey()));
                addItemToGrid(metadata);
                metaDataGrid.scrollToEnd();
                metaDataGrid.select(metadata.getKey());
                addIcon.setEnabled(true);
                metadataWindow.setSaveButtonEnabled(false);
                if (!hasUpdatePermission()) {
                    valueTextArea.setEnabled(false);
                }
            }
        } else {
            final M metadata = updateMetadata(enreplacedy, key, value);
            uiNotification.displaySuccess(i18n.getMessage("message.metadata.updated", metadata.getKey()));
            updateItemInGrid(metadata.getKey());
            metaDataGrid.select(metadata.getKey());
            addIcon.setEnabled(true);
            metadataWindow.setSaveButtonEnabled(false);
        }
    }
}

17 View Complete Implementation : CreateOrUpdateFilterHeader.java
Copyright Eclipse Public License 1.0
Author : eclipse
private void createTargetFilterQuery() {
    final TargetFilterQuery targetFilterQuery = targetFilterQueryManagement.create(enreplacedyFactory.targetFilterQuery().create().name(nameTextField.getValue()).query(queryTextField.getValue()));
    notification.displaySuccess(i18n.getMessage("message.create.filter.success", targetFilterQuery.getName()));
    eventBus.publish(this, CustomFilterUIEvent.CREATE_TARGET_FILTER_QUERY);
}

17 View Complete Implementation : CreateOrUpdateFilterHeader.java
Copyright Eclipse Public License 1.0
Author : eclipse
private boolean doesAlreadyExists() {
    if (targetFilterQueryManagement.getByName(nameTextField.getValue()).isPresent()) {
        notification.displayValidationError(i18n.getMessage("message.target.filter.duplicate", nameTextField.getValue()));
        return true;
    }
    return false;
}

13 View Complete Implementation : CmsImportExportUserDialog.java
Copyright GNU Lesser General Public License v2.1
Author : alkacon
/**
 * Gets selected groups in List.<p>
 *
 * @param parent layout
 * @param importCase boolean
 * @return List of group names
 */
private List<String> getGroupsList(VerticalLayout parent, boolean importCase) {
    List<String> res = new ArrayList<String>();
    if (m_groupID != null) {
        try {
            res.add(m_cms.readGroup(m_groupID).getName());
        } catch (CmsException e) {
            LOG.error("Unable to read group", e);
        }
        return res;
    }
    if (m_groupEditable) {
        CmsEditableGroup editableGroup = importCase ? m_importGroupsGroup : m_exportGroupsGroup;
        for (I_CmsEditableGroupRow row : editableGroup.getRows()) {
            String groupName = ((CmsPrincipalSelect) row.getComponent()).getValue();
            if (!CmsStringUtil.isEmptyOrWhitespaceOnly(groupName)) {
                res.add(groupName);
            }
        }
    } else {
        TextField comp = (TextField) parent.getComponent(0);
        res.add(comp.getValue());
    }
    return res;
}

11 View Complete Implementation : CreateOrUpdateFilterHeader.java
Copyright Eclipse Public License 1.0
Author : eclipse
private void updateCustomFilter() {
    final Optional<TargetFilterQuery> tfQuery = filterManagementUIState.getTfQuery();
    if (!tfQuery.isPresent()) {
        return;
    }
    final TargetFilterQuery targetFilterQuery = tfQuery.get();
    final TargetFilterQuery updatedTargetFilter = targetFilterQueryManagement.update(enreplacedyFactory.targetFilterQuery().update(targetFilterQuery.getId()).name(nameTextField.getValue()).query(queryTextField.getValue()));
    filterManagementUIState.setTfQuery(updatedTargetFilter);
    oldFilterName = nameTextField.getValue();
    oldFilterQuery = queryTextField.getValue();
    notification.displaySuccess(i18n.getMessage("message.update.filter.success"));
    eventBus.publish(this, CustomFilterUIEvent.UPDATED_TARGET_FILTER_QUERY);
}

8 View Complete Implementation : BasicInfoChangeWindow.java
Copyright GNU Affero General Public License v3.0
Author : MyCollab
private void changeUserInfo() {
    txtLastName.removeStyleName("errorField");
    txtEmail.removeStyleName("errorField");
    if (txtLastName.getValue().equals("")) {
        NotificationUtil.showErrorNotification(UserUIContext.getMessage(ErrorI18nEnum.FIELD_MUST_NOT_NULL, UserUIContext.getMessage(GenericI18Enum.FORM_LASTNAME)));
        txtLastName.addStyleName("errorField");
        return;
    }
    if (txtEmail.getValue().equals("")) {
        NotificationUtil.showErrorNotification(UserUIContext.getMessage(ErrorI18nEnum.FIELD_MUST_NOT_NULL, UserUIContext.getMessage(GenericI18Enum.FORM_EMAIL)));
        txtLastName.addStyleName("errorField");
        return;
    }
    user.setFirstname(txtFirstName.getValue());
    user.setLastname(txtLastName.getValue());
    user.setEmail(txtEmail.getValue());
    user.setBirthday(birthdayField.getValue());
    user.setLanguage(languageBox.getValue());
    user.setTimezone(timeZoneField.getValue());
    UserService userService = AppContextUtil.getSpringBean(UserService.clreplaced);
    userService.updateWithSession(user, UserUIContext.getUsername());
    close();
    UIUtils.reloadPage();
}

5 View Complete Implementation : TimePicker24.java
Copyright GNU General Public License v3.0
Author : rlsutton1
private void showPopupTimePicker() {
    String value = field.getValue();
    try {
        String[] parts = value.split(":");
        hour = parts[0];
        String[] np = parts[1].split(" ");
        minute = np[0];
        displayTime.setValue(value);
    } catch (Exception e) {
        clearValue();
    }
    final Window window = new Window(replacedle);
    window.setModal(true);
    window.setResizable(false);
    window.setWidth("430");
    window.setHeight("240");
    window.setClosable(false);
    HorizontalLayout layout = new HorizontalLayout();
    layout.setSizeFull();
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setStyleName(Reindeer.BUTTON_SMALL);
    displayTime.setWidth("100");
    VerticalLayout hourPanelLabelWrapper = new VerticalLayout();
    Label hourLabel = new Label("Hour");
    // hourLabel.setBackgroundColor(headerColor);
    hourLabel.setWidth("230");
    // hourLabel.setHeight("30");
    // hourLabel.setAutoFit(false);
    HorizontalLayout innerHourLabelPanel = new HorizontalLayout();
    // innerHourLabelPanel.setPadding(5);
    innerHourLabelPanel.addComponent(hourLabel);
    innerHourLabelPanel.setWidth("100");
    // innerHourLabelPanel.setHeight("30");
    hourPanelLabelWrapper.addComponent(innerHourLabelPanel);
    VerticalLayout minuteLabelWrapper = new VerticalLayout();
    minuteLabelWrapper.setWidth("60");
    Label minuteLabel = new Label("Minute");
    // minuteLabel.setBackgroundColor(headerColor);
    // minuteLabel.setStyleName("njadmin-search-colour");
    minuteLabel.setWidth("45");
    // minuteLabel.setHeight("30");
    // minuteLabel.setAutoFit(false);
    VerticalLayout innerMinuteLabelPanel = new VerticalLayout();
    // innerMinuteLabelPanel.setPadding(5);
    innerMinuteLabelPanel.addComponent(minuteLabel);
    innerMinuteLabelPanel.setWidth("45");
    // innerMinuteLabelPanel.setHeight("30");
    minuteLabelWrapper.addComponent(innerMinuteLabelPanel);
    HorizontalLayout hourPanel = new HorizontalLayout();
    // hourPanel.setPadding(5);
    HorizontalLayout hourButtonPanel = new HorizontalLayout();
    hourPanel.addComponent(hourButtonPanel);
    addHourButtons(hourButtonPanel, 3, 8);
    HorizontalLayout minutePanel = new HorizontalLayout();
    // minutePanel.setPadding(5);
    HorizontalLayout minuteButtonPanel = new HorizontalLayout();
    minutePanel.addComponent(minuteButtonPanel);
    addMinuteButtons(minuteButtonPanel, 2, 4);
    HorizontalLayout amPmHourWrapper = new HorizontalLayout();
    amPmHourWrapper.addComponent(hourPanel);
    hourPanelLabelWrapper.addComponent(amPmHourWrapper);
    layout.addComponent(hourPanelLabelWrapper);
    minuteLabelWrapper.addComponent(minutePanel);
    layout.addComponent(minuteLabelWrapper);
    layout.setExpandRatio(hourPanelLabelWrapper, 0.7f);
    layout.setExpandRatio(minuteLabelWrapper, 0.3f);
    HorizontalLayout okcancel = new HorizontalLayout();
    okcancel.setSizeFull();
    Button ok = new Button("OK");
    ok.setWidth("75");
    ok.addClickListener(new ClickListener() {

        /**
         */
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            try {
                displayTime.validate();
                if (displayTime.getValue().equals(EMPTY)) {
                    field.setValue("");
                } else {
                    field.setValue(displayTime.getValue());
                }
                window.close();
            } catch (InvalidValueException e) {
            }
        }
    });
    Button cancel = new Button("Cancel");
    cancel.setWidth("75");
    cancel.addClickListener(new ClickListener() {

        /**
         */
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            window.close();
        }
    });
    okcancel.addComponent(displayTime);
    okcancel.addComponent(cancel);
    okcancel.addComponent(ok);
    okcancel.setMargin(true);
    okcancel.setSpacing(true);
    okcancel.setExpandRatio(displayTime, 0.50f);
    // okcancel.setExpandRatio(ok, 0.25f);
    // okcancel.setExpandRatio(cancel, 0.25f);
    VerticalLayout wrapper = new VerticalLayout();
    // wrapper.setStyleName("njadmin-search-colour");
    wrapper.setSizeFull();
    wrapper.addComponent(layout);
    wrapper.addComponent(okcancel);
    wrapper.setExpandRatio(layout, 0.9f);
    wrapper.setExpandRatio(okcancel, 0.5f);
    window.setContent(wrapper);
    UI.getCurrent().addWindow(window);
}

3 View Complete Implementation : TimePicker.java
Copyright GNU General Public License v3.0
Author : rlsutton1
@SuppressWarnings("deprecation")
private void showPopupTimePicker() {
    try {
        if (field.getValue() != null) {
            Date value = parseDate(field.getValue());
            if (value != null) {
                int hourNumber = value.getHours() % 12;
                if (hourNumber == 0) {
                    hourNumber = 12;
                }
                displayTime.setValue(field.getValue());
            }
        }
    } catch (Exception e) {
        logger.error(e);
        clearValue();
    }
    final Window window = new Window(replacedle);
    window.setModal(true);
    window.setResizable(false);
    // window.setWidth("550");
    // window.setHeight("220");
    window.setClosable(false);
    HorizontalLayout layout = new HorizontalLayout();
    layout.setSizeFull();
    layout.setSpacing(true);
    layout.setStyleName(Reindeer.BUTTON_SMALL);
    displayTime.setWidth("100");
    displayTime.addValueChangeListener(new ValueChangeListener() {

        private static final long serialVersionUID = 1L;

        @Override
        public void valueChange(com.vaadin.data.Property.ValueChangeEvent event) {
            final Date parsedDate = parseDate((String) event.getProperty().getValue());
            if (parsedDate != null) {
                dateTime.set(Calendar.HOUR_OF_DAY, parsedDate.getHours());
                dateTime.set(Calendar.MINUTE, parsedDate.getMinutes());
                isSet = true;
                setNewValue();
            }
        }
    });
    VerticalLayout hourPanelLabelWrapper = new VerticalLayout();
    hourPanelLabelWrapper.setWidth("225");
    Label hourLabel = new Label("Hour");
    hourLabel.setWidth("230");
    HorizontalLayout innerHourLabelPanel = new HorizontalLayout();
    innerHourLabelPanel.addComponent(hourLabel);
    innerHourLabelPanel.setWidth("100");
    hourPanelLabelWrapper.addComponent(innerHourLabelPanel);
    VerticalLayout minuteLabelWrapper = new VerticalLayout();
    minuteLabelWrapper.setWidth("60");
    Label minuteLabel = new Label("Minute");
    minuteLabel.setWidth("45");
    VerticalLayout innerMinuteLabelPanel = new VerticalLayout();
    innerMinuteLabelPanel.addComponent(minuteLabel);
    innerMinuteLabelPanel.setWidth("45");
    minuteLabelWrapper.addComponent(innerMinuteLabelPanel);
    HorizontalLayout hourPanel = new HorizontalLayout();
    HorizontalLayout amPmPanel = new HorizontalLayout();
    VerticalLayout amPmButtonPanel = new VerticalLayout();
    amPmPanel.addComponent(amPmButtonPanel);
    addAmPmButtons(amPmButtonPanel);
    HorizontalLayout hourButtonPanel = new HorizontalLayout();
    hourPanel.addComponent(hourButtonPanel);
    addHourButtons(hourButtonPanel, 2, 6);
    HorizontalLayout minutePanel = new HorizontalLayout();
    HorizontalLayout minuteButtonPanel = new HorizontalLayout();
    minutePanel.addComponent(minuteButtonPanel);
    addMinuteButtons(minuteButtonPanel, 2, 4);
    HorizontalLayout amPmHourWrapper = new HorizontalLayout();
    amPmHourWrapper.addComponent(hourPanel);
    amPmHourWrapper.addComponent(amPmPanel);
    hourPanelLabelWrapper.addComponent(amPmHourWrapper);
    layout.addComponent(hourPanelLabelWrapper);
    minuteLabelWrapper.addComponent(minutePanel);
    layout.addComponent(minuteLabelWrapper);
    layout.setExpandRatio(minuteLabelWrapper, 1);
    HorizontalLayout okcancel = new HorizontalLayout();
    okcancel.setSizeFull();
    Button ok = new Button("OK");
    ok.setWidth("75");
    ok.addClickListener(new ClickListener() {

        /**
         */
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            field.setValue(displayTime.getValue());
            window.close();
        }
    });
    Button cancel = new Button("Cancel");
    cancel.setWidth("75");
    cancel.addClickListener(new ClickListener() {

        /**
         */
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            window.close();
        }
    });
    Button clear = new Button("Clear");
    clear.setWidth("75");
    clear.addClickListener(new ClickListener() {

        /**
         */
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            isSet = false;
            clearValue();
        }
    });
    okcancel.addComponent(displayTime);
    okcancel.addComponent(cancel);
    okcancel.addComponent(clear);
    okcancel.addComponent(ok);
    okcancel.setSpacing(true);
    okcancel.setExpandRatio(displayTime, 0.50f);
    VerticalLayout wrapper = new VerticalLayout();
    wrapper.addComponent(layout);
    wrapper.addComponent(okcancel);
    window.setContent(wrapper);
    wrapper.setMargin(true);
    wrapper.setSpacing(true);
    UI.getCurrent().addWindow(window);
}

0 View Complete Implementation : JasperReportEmailWindow.java
Copyright GNU General Public License v3.0
Author : rlsutton1
private ReportEmailScheduleEnreplacedy sendEmail(Collection<ReportParameter<?>> params, JasperReportProperties reportProperties) {
    String errorMessage = "";
    boolean hasValidTargets = false;
    for (EmailTargetLine target : emailTargetLayout.getTargets()) {
        if (target.targetAddress.getValue() != null) {
            if (!target.targetAddress.isValid()) {
                errorMessage = target.targetAddress.getValue() + " is not a valid email address";
                Notification.show(errorMessage, Type.ERROR_MESSAGE);
                return null;
            }
            hasValidTargets = true;
        }
    }
    if (!hasValidTargets) {
        Notification.show("Set at least one Recipient.", Type.ERROR_MESSAGE);
        return null;
    }
    ReportEmailScheduleEnreplacedy schedule = new ReportEmailScheduleEnreplacedy();
    schedule.setreplacedle(reportProperties.getReportreplacedle());
    schedule.setReportFilename(reportProperties.getReportFileName());
    schedule.setReportTemplateIdentifier(reportProperties.getReportIdentifier());
    schedule.setMessage(message.getValue());
    schedule.setSubject(subject.getValue());
    schedule.setReportClreplaced(reportProperties.getReportClreplaced());
    schedule.setScheduleMode(ScheduleMode.ONE_TIME);
    schedule.setOneTimeRunTime(new Date());
    schedule.setEnabled(true);
    EnreplacedyManager enreplacedyManager = EnreplacedyManagerProvider.getEnreplacedyManager();
    List<ReportEmailParameterEnreplacedy> rparams = new LinkedList<ReportEmailParameterEnreplacedy>();
    List<ReportEmailScheduledDateParameter> dparams = new LinkedList<ReportEmailScheduledDateParameter>();
    for (ReportParameter<?> param : params) {
        // omit report choosers, as they would complicate and confuse
        // if (!(param instanceof ReportChooser))
        {
            if (param instanceof ReportChooser) {
                String[] names = param.getParameterNames().toArray(new String[] {});
                // add non date fields
                ReportEmailParameterEnreplacedy rparam = new ReportEmailParameterEnreplacedy();
                rparam.setName(names[0]);
                rparam.setValue(param.getValue(names[0]).toString(), param.getDisplayValue(names[0]));
                rparams.add(rparam);
                enreplacedyManager.persist(rparam);
            } else if (!param.isDateField()) {
                String[] names = param.getParameterNames().toArray(new String[] {});
                // add non date fields
                ReportEmailParameterEnreplacedy rparam = new ReportEmailParameterEnreplacedy();
                rparam.setName(names[0]);
                rparam.setValue(param.getValue(names[0]).toString(), param.getDisplayValue(names[0]));
                rparams.add(rparam);
                enreplacedyManager.persist(rparam);
            } else {
                // add date fields
                ReportEmailScheduledDateParameter rparam = new ReportEmailScheduledDateParameter();
                String[] names = param.getParameterNames().toArray(new String[] {});
                rparam.setStartName(names[0]);
                rparam.setStartDate(param.getStartDate());
                rparam.setEndName(names[1]);
                rparam.setEndDate(param.getEndDate());
                rparam.setType(param.getDateParameterType());
                rparam.setOffsetType(DateParameterOffsetType.CONSTANT);
                rparam.setLabel(param.getLabel(names[0]));
                dparams.add(rparam);
                enreplacedyManager.persist(rparam);
            }
        }
    }
    schedule.setParameters(rparams);
    schedule.setDateParameters(dparams);
    ReportEmailSender reportEmailSender = new ReportEmailSender();
    reportEmailSender.setUserName(reportProperties.getUsername());
    reportEmailSender.setEmailAddress(reportProperties.getUserEmailAddress());
    schedule.setSender(reportEmailSender);
    enreplacedyManager.persist(reportEmailSender);
    List<ReportEmailRecipient> recips = new LinkedList<ReportEmailRecipient>();
    for (EmailTargetLine target : emailTargetLayout.getTargets()) {
        ReportEmailRecipient recipient = new ReportEmailRecipient();
        recipient.setEmail((String) target.targetAddress.getValue());
        recipient.setVisibility((ReportEmailRecipientVisibility) target.targetTypeCombo.getValue());
        enreplacedyManager.persist(recipient);
        recips.add(recipient);
    }
    schedule.setRecipients(recips);
    schedule.setNextScheduledRunTime(schedule.getScheduleMode().getNextRuntime(schedule, new Date()));
    schedule.setOutputFormat(OutputFormat.PDF);
    enreplacedyManager.persist(schedule);
    enreplacedyManager.flush();
    reportEmailSender = enreplacedyManager.merge(reportEmailSender);
    return schedule;
}