TextField<String> instancePasswordTextBox = new TextField<String>(); instancePasswordTextBox.setWidth(150); instancePasswordTextBox.setPassword(true); instancePasswordTextBox.setValue(model.getPassword()); instancePasswordTextBox.addListener(Events.Change, new Listener<FieldEvent>()
/** * <br/> * @return */ public String getSearchString() { return textField.getValue(); }
public FolderForm() { super(); binding = new FormBinding(this); UiConstants constants = GWT.create(UiConstants.class); nameField = new TextField<String>(); nameField.setFieldLabel(constants.name()); nameField.setMaxLength(PROJECT_MAX_LENGTH); nameField.setAllowBlank(false); nameField.setValidator(new BlankValidator()); binding.addFieldBinding(new FieldBinding(nameField, "name")); this.add(nameField); }
/** * Configures the passed text field to fail validation when having empty string values.<br/> Additionally, * configures the passed field to be validated when rendered. * * @param field */ public void configTextFieldForNonEmptyValues(TextField<String> field) { field.setAllowBlank(false); field.setAutoValidate(true); field.setValidator(nonEmptyStringValidator); field.addListener(Events.Render, validatorListener); field.addListener(Events.OnKeyUp, validatorListener); field.addListener(Events.Change, validatorListener); }
public void handleEvent(BaseEvent be) { boolean bothNulls = password.getValue() == null && password1.getValue() == null; boolean oneIsNull = password.getValue() == null || password1.getValue() == null && password.getValue() != password1.getValue(); boolean allowEmptyPasswords = ClientSecurity.hasPermission(WsecPermission.WSEC_ALLOW_EMPTY_PASSWORD); if((allowEmptyPasswords && bothNulls) || (!oneIsNull && password.getValue().trim().equals(password1.getValue().trim()))){ password.clearInvalid(); password1.clearInvalid(); } else { password.forceInvalid("Popraw hasło"); password1.forceInvalid("Popraw hasło"); } // if((!allowEmptyPasswords && bothNulls) // || (allowEmptyPasswords && oneIsNull) // || (!oneIsNull && !password.getValue().trim().equals(password1.getValue().trim()))) { // } else { // } } }
private void addNameField() { nameField = new TextField<String>(); nameField.setFieldLabel(locationType.getName()); nameField.setMaxLength(50); add(nameField); nameField.addKeyListener(new KeyListener() { @Override public void componentKeyDown(ComponentEvent event) { nameTypeAheadTimer.schedule(200); } }); }
final TextField<String> field = new TextField<String>(); // (ListField) field.setId("editRulePriority"); field.setName("editRulePriority"); field.setEmptyText("*"); field.setFieldLabel(BeanKeyValue.PRIORITY.getValue()); // DisplayField field.setValue(BeanKeyValue.PRIORITY.getValue()); field.setReadOnly(false); field.setWidth(COLUMN_PRIORITY_WIDTH - COLUMN_HEADER_OFFSET); field.show(); field.setValue(Long.valueOf(name2).toString()); field.setValue("-1"); field.addKeyListener(keyListener); field.addListener(Events.Blur, new Listener<FieldEvent>()
TextField<String> field = new TextField<String>(); field.setId("editRuleIpRange"); field.setName("editRuleIpRange"); field.setEmptyText("*"); field.setRegex(CIDR_FORMAT); field.setAutoValidate(true); field.setWidth(COLUMN_IPRANGE_WIDTH - COLUMN_HEADER_OFFSET); field.setValue(model.getSourceIPRange()); } else { field.setValue("*"); field.addListener(Events.Blur, new Listener<FieldEvent>()
this.setFrame(true); this.setLabelWidth(180); userId = new TextField(); userId.setFieldLabel("Id"); userId.setReadOnly(true); login = new TextField(); login.setFieldLabel("Login"); login.setMinLength(3); password = new TextField(); password.setFieldLabel("Hasło"); password.setPassword(true); password.addListener(Events.OnKeyUp, new PasswordValidator()); password1 = new TextField(); password1.setFieldLabel("Powtórz hasło"); password1.setPassword(true); password1.addListener(Events.OnKeyUp, new PasswordValidator()); firstName = new TextField(); firstName.setFieldLabel("Imię"); jobTitle = new TextField(); jobTitle.setFieldLabel("Stanowisko w firmie"); city = new TextField(); city.setFieldLabel("Adres miasto"); street = new TextField(); street.setFieldLabel("Adres ulica");
codeField = new TextField<>(); codeField.setFieldLabel(constants.codeFieldLabel()); codeField.setToolTip(constants.codeFieldLabel()); codeField.setValidator((field, value) -> { if (!Strings.isNullOrEmpty(value) && !FormField.isValidCode(value)) { return constants.invalidCodeMessage(); TextField<String> nameField = new TextField<>(); nameField.setFieldLabel(constants.name()); nameField.setAllowBlank(false); nameField.setValidator(new BlankValidator()); unitsField = new TextField<>(); unitsField.setName("units"); unitsField.setFieldLabel(constants.units()); unitsField.setAllowBlank(false); unitsField.setMaxLength(IndicatorDTO.UNITS_MAX_LENGTH); binding.addFieldBinding(new OnlyValidFieldBinding(unitsField, IndicatorDTO.UNITS_PROPERTY)); this.add(unitsField); expressionField = new TextField<>(); expressionField.addKeyListener(new KeyListener() { @Override public void componentKeyUp(ComponentEvent event) { expressionField.setFieldLabel(constants.calculation()); expressionField.setToolTip(constants.calculatedIndicatorExplanation()); expressionField.setValidator((field, value) -> validateExpression(value)); binding.addFieldBinding(new OnlyValidFieldBinding(expressionField, IndicatorDTO.EXPRESSION_PROPERTY));
fieldSet.setLayout(layout); instanceName = new TextField<String>(); instanceName.setAllowBlank(false); instanceName.setFieldLabel("name"); fieldSet.add(instanceName); instanceDescription = new TextField<String>(); instanceDescription.setAllowBlank(false); instanceDescription.setFieldLabel("description"); fieldSet.add(instanceDescription); instanceBaseURL = new TextField<String>(); instanceBaseURL.setAllowBlank(false); instanceBaseURL.setFieldLabel("base url"); fieldSet.add(instanceBaseURL); instanceUsername = new TextField<String>(); instanceUsername.setAllowBlank(false); instanceUsername.setFieldLabel("username"); fieldSet.add(instanceUsername); instancePassword = new TextField<String>(); instancePassword.setAllowBlank(false); instancePassword.setPassword(true); instancePassword.setFieldLabel("password"); fieldSet.add(instancePassword);
this.setButtonAlign(Style.HorizontalAlignment.CENTER); roleId = new TextField<Long>(); roleId.setFieldLabel("Id"); roleId.setReadOnly(true); roleName = new TextField<String>(); roleName.setFieldLabel("Nazwa"); roleDescription = new TextField<String>(); roleDescription.setFieldLabel("Opis roli");
getFormLayout().setDefaultWidth(200); TextField<String> databaseField = new TextField<>(); databaseField.setValue(activity.getDatabaseName()); databaseField.setFieldLabel(I18N.CONSTANTS.database()); databaseField.setReadOnly(true); add(databaseField); TextField<String> activityField = new TextField<>(); activityField.setValue(activity.getName()); activityField.setFieldLabel(I18N.CONSTANTS.activity()); activityField.setReadOnly(true); add(activityField);
userName = new TextField<String>(); userName.setMinLength(USERNAME_MIN_LENGTH); userName.setFieldLabel(I18nProvider.getMessages().usernameLabel()); userName.addKeyListener(keyListener); add(userName); password = new TextField<String>(); password.setMinLength(PASSWORD_MIN_LENGTH); password.setPassword(true); password.setFieldLabel(I18nProvider.getMessages().passwordLabel()); password.addKeyListener(keyListener); add(password);
TextField<String> nameField = new TextField<String>(); nameField.setAllowBlank(false); nameField.setFieldLabel(I18N.CONSTANTS.name()); nameField.setMaxLength(50); nameField.addListener(Events.Change, new ProfileChangeListener("name")); binding.addFieldBinding(new FieldBinding(nameField, "name")); this.add(nameField); TextField<String> organizationField = new TextField<String>(); organizationField.setFieldLabel(I18N.CONSTANTS.organization()); organizationField.setMaxLength(100); organizationField.addListener(Events.Change, new ProfileChangeListener("organization")); binding.addFieldBinding(new FieldBinding(organizationField, "organization")); this.add(organizationField); TextField<String> jobtitleField = new TextField<String>(); jobtitleField.setFieldLabel(I18N.CONSTANTS.jobtitle()); jobtitleField.setMaxLength(100); jobtitleField.addListener(Events.Change, new ProfileChangeListener("jobtitle")); binding.addFieldBinding(new FieldBinding(jobtitleField, "jobtitle")); this.add(jobtitleField);
@Override public void addComponentToForm() { fieldSet = new FieldSet(); fieldSet.setHeading("Role Information"); FormLayout layout = new FormLayout(); layout.setLabelWidth(80); fieldSet.setLayout(layout); profileName = new TextField<String>(); profileName.setAllowBlank(false); profileName.setFieldLabel("Role name"); fieldSet.add(profileName); this.formPanel.add(fieldSet); addOtherComponents(); }
private void initComponents() { dateTimeFormat = DateTimeFormat.getFormat("dd/MM/yyyy HH:mm"); fDate = new TextField<String>(); if (date != null) { fDate.setValue(dateTimeFormat.format(date)); } fDate.setEmptyText("dd/mm/aaaa hh:mm"); fDate.addStyleName(styles.marginLeft17px()); add(fDate); // Calendar icon button: SelectionListener<IconButtonEvent> lCalendar = new SelectionListener<IconButtonEvent>() { @Override public void componentSelected(IconButtonEvent ce) { showDatePicker(); } }; final IconButton bCalendar = buttons.createGenericIconButton(DATE_TIME_PICKER_TEXT, styles.iCalendar(), lCalendar); add(bCalendar); }
fieldSet.setLayout(layout); userName = new TextField<String>(); userName.setEnabled(false); userName.setId(UpdateUserKey.USER_NAME_ID.getValue()); userName.setName(BeanKeyValue.USER_NAME.getValue()); userName.setFieldLabel("User Name"); fieldSet.add(userName); email = new TextField<String>(); email.setFieldLabel("Email"); email.setId(UpdateUserKey.EMAIL_UPDATE.getValue()); email.setName(BeanKeyValue.EMAIL.getValue()); email.setEnabled(false);
/** (non-Javadoc) * @see com.isotrol.merlin3.gui.common.widget.multivalue.AMultiValueField#resetSource() */ @Override protected void resetSource() { sourceField.setValue(""); }
searchFieldSet.setLayout(layout); search = new TextField<String>(); search.setFieldLabel("Find"); search.addKeyListener(new KeyListener() {