/** * Handles the login. * <p> * In deferred mode, this method is called after the dummy POST request that * triggers the password manager has been completed. In direct mode (the * default setting), it is called directly when the user hits the enter key * or clicks on the login button. In the latter case, you cannot change the * URL in the method or the password manager will not be triggered. */ private void login() { Map<String, String> params = new HashMap<>(); params.put("username", getUsernameField().getValue()); params.put("password", getPasswordField().getValue()); LoginEvent event = new LoginEvent(LoginForm.this, params); fireEvent(event); }
@Override public void writeDesign(Element design, DesignContext designContext) { super.writeDesign(design, designContext); AbstractTextField def = designContext.getDefaultInstance(this); Attributes attr = design.attributes(); DesignAttributeHandler.writeAttribute("value", attr, getValue(), def.getValue(), String.class, designContext); } }
/** * Get the maintenance window duration. * * @return {@link String}. */ public String getMaintenanceDuration() { return duration.getValue(); }
/** * @see com.vaadin.data.Property#getValue() */ public String getValue() { return m_principalName.getValue(); }
/** * Gets the value of the text field.<p> * * @return the value of the text field */ public String getValue() { return m_input.getValue(); }
/** * Gets the value.<p> * * @return the value */ @Override public String getValue() { return m_textField.getValue(); }
/** * Gets the user.<p> * * @return the user */ public String getUser() { return m_userField.getValue(); }
/** * Returns the value of the key input field. * * @return the current value */ public String getKey() { return m_keyInputField.getValue(); }
@Override public void valueChange(Property.ValueChangeEvent event) { queue.setDescription((String) queueDescriptionField.getValue()); } });
@Override public void handleAction(Object sender, Object target) { openPath(m_infoPath.getValue()); } };
private void updateTimeField(Date date) { if(StringUtils.isEmpty((String)timeField.getValue()) && initWithEmptyHour) return; timeField.setValue(date != null ? dateFormat.format(date) : null); }
@Override public void handleAction(String action) { inputField.commit(); handleAdd((String)inputField.getValue()); } });
private void enableDisableSaveButton(final boolean validationFailed, final String query) { if (validationFailed || (isNameAndQueryEmpty(nameTextField.getValue(), query) || (query.equals(oldFilterQuery) && nameTextField.getValue().equals(oldFilterName)))) { saveButton.setEnabled(false); searchIcon.setEnabled(false); } else { if (hasSavePermission()) { saveButton.setEnabled(true); } searchIcon.setEnabled(true); } }
@Override protected void saveEntity() { updateDistributionSetType(findEntityByName() .orElseThrow(() -> new EntityNotFoundException(DistributionSetType.class, getTagName().getValue()))); }
private void onValueChange(final TextChangeEvent event) { if (hasCreatePermission() || hasUpdatePermission()) { if (!keyTextField.getValue().isEmpty() && !event.getText().isEmpty()) { metadataWindow.setSaveButtonEnabled(true); } else { metadataWindow.setSaveButtonEnabled(false); } } }
@Override protected void saveEntity() { updateExistingTag(findEntityByName() .orElseThrow(() -> new EntityNotFoundException(DistributionSetTag.class, getTagName().getValue()))); }
public void buttonClick(ClickEvent event) { if (login((String) m_name.getValue(), (String) m_password.getValue())) { closeWindow(); } else { // TODO provide some feedback, login failed, for now don't close the login window m_loginButton.setComponentError(new UserError("Invalid username or password.")); } } });
private void updateExistingTag(final Tag targetObj) { final TagUpdate update = getEntityFactory().tag().update(targetObj.getId()).name(getTagName().getValue()) .description(getTagDesc().getValue()) .colour(ColorPickerHelper.getColorPickedString(getColorPickerLayout().getSelPreview())); getDistributionSetTagManagement().update(update); getEventBus().publish(this, new DistributionSetTagTableEvent(BaseEntityEventType.UPDATED_ENTITY, (DistributionSetTag) targetObj)); getUiNotification().displaySuccess(getI18n().getMessage("message.update.success", targetObj.getName())); }