/** * Customize the user name field. Only for overriding, do not call. * * @return the user name field * @since 7.7 */ protected TextField createUsernameField() { throwIfInitialized(); TextField field = new TextField(getUsernameCaption()); field.focus(); return field; }
private ColorPickerPreview() { setStyleName("v-colorpicker-preview"); field = new TextField(); field.setSizeFull(); field.setStyleName("v-colorpicker-preview-textfield"); field.setData(this); valueChangeListenerRegistration = field .addValueChangeListener(this::valueChange); addComponent(field); }
public AbstractField getDateField(MaduraPropertyWrapper property) { TextField ret = new TextField(); // use a touchkit date field when one becomes available return ret; // final DateField df = new DateField(); // df.setResolution(DateField.RESOLUTION_DAY); // df.setStyleName("calendar"); // return df; } public AbstractField getBooleanField(MaduraPropertyWrapper property) {
public void builder3() { // tag::builder3[] TextField field = new TextField(); Input<String> stringInput = Input.from(field); // <1> // end::builder3[] }
/** * Creates a new instance.<p> */ public A_CmsFileSelectField() { m_textField = new TextField(); m_textField.setWidth("100%"); m_filter = CmsResourceFilter.ONLY_VISIBLE_NO_DELETED; }
@Override public AbstractField componentFor(Class<?> dataType) { if (dataType.equals(Date.class)) { return new DateField(); } if (dataType.equals(boolean.class) || dataType.equals(Boolean.class)) { return new CheckBox(); } return new TextField(); }
@Override public Field<?> createField(Container container, Object itemId, Object propertyId, Component uiContext) { if (propertyId.equals("vbvalues")) { final TextField field = new TextField(); field.setConverter(new CsvListConverter()); return field; } return super.createField(container, itemId, propertyId, uiContext); } });
setEditorComponent((HasValue<V> & Component) new TextField(), (item, value) -> {
/** * Initializes the label for the file path display {@link #m_filePathLabel}. */ private void initFilePathLabel() { m_filePathLabel = new TextField(); m_filePathLabel.setWidth("100%"); m_filePathLabel.setEnabled(true); m_filePathLabel.setReadOnly(true); m_filePathLabel = new Label(m_messages.key(Messages.GUI_FILENAME_LABEL_0)); }
@Override public Field<?> caseJCounterField(JCounterField jfield) { final TextField field = new TextField(); field.setWidth("100%"); field.setNullSettingAllowed(false); field.setConverter(new SimpleFieldConverter<Long>(JObjectEditorWindow.this.jclass.getPermazen() .getDatabase().getFieldTypeRegistry().getFieldType(TypeToken.of(long.class)))); return field; } @Override
public void buttonClick(ClickEvent event) { // Remove button addSubTaskPanel.removeAllComponents(); // And add textfield Label createSubTaskLabel = new Label("Create new subtask:"); createSubTaskLabel.addStyleName(Reindeer.LABEL_SMALL); addSubTaskPanel.addComponent(createSubTaskLabel); newTaskTextField = new TextField(); newTaskTextField.focus(); addSubTaskPanel.addComponent(newTaskTextField); } });
private void buildTenantField() { if (multiTenancyIndicator.isMultiTenancySupported()) { tenant = new TextField(i18n.getMessage("label.login.tenant")); tenant.setIcon(FontAwesome.DATABASE); tenant.addStyleName( ValoTheme.TEXTFIELD_INLINE_ICON + " " + ValoTheme.TEXTFIELD_SMALL + " " + LOGIN_TEXTFIELD); tenant.addStyleName("uppercase"); tenant.setId("login-tenant"); } }
public void input7() { // tag::input7[] Input<String> stringInput = Components.input.string().build(); Input<Integer> integerInput = Input.from(stringInput, new StringToIntegerConverter("Conversion error")); // <1> Input<Boolean> booleanInput = Input.from(integerInput, // <2> Converter.from(value -> Result.ok((value == null) ? Boolean.FALSE : (value.intValue() > 0)), value -> (value == null) ? null : (value ? 1 : 0))); Input<Long> longInput = Input.from(new TextField(), new StringToLongConverter("Conversion error")); // <3> // end::input7[] }
private void buildUserField() { username = new TextField(i18n.getMessage("label.login.username")); username.setIcon(FontAwesome.USER); username.addStyleName( ValoTheme.TEXTFIELD_INLINE_ICON + " " + ValoTheme.TEXTFIELD_SMALL + " " + LOGIN_TEXTFIELD); username.setId("login-username"); if(isDemo && !uiProperties.getDemo().getUser().isEmpty()) { username.setValue(uiProperties.getDemo().getUser()); } }
private void buildUserField() { username = new TextField(i18n.getMessage("label.login.username")); username.setIcon(FontAwesome.USER); username.addStyleName( ValoTheme.TEXTFIELD_INLINE_ICON + " " + ValoTheme.TEXTFIELD_SMALL + " " + LOGIN_TEXTFIELD); username.setId("login-username"); if (isDemo && !uiProperties.getDemo().getUser().isEmpty()) { username.setValue(uiProperties.getDemo().getUser()); } }
public void group1b() { // tag::group1b[] PropertyInputGroup group = Components.input.propertyGroup().properties(PROPERTIES) .bind(ID, Components.input.number(Long.class).build()) // <1> .bind(DESCRIPTION, new TextField()) // <2> .build(); // end::group1b[] }
protected void initNameField(GridLayout layout) { nameField = new TextField(); nameField.setWriteThrough(true); nameField.setImmediate(true); layout.addComponent(new Label(ExplorerApp.get().getI18nManager().getMessage(Messages.PROCESS_EDITOR_NAME))); layout.addComponent(nameField); if (workflowName != null) { nameField.setValue(workflowName); workflowName = null; } }
public void group1c() { // tag::group1c[] PropertyInputGroup group = Components.input.propertyGroup().properties(PROPERTIES) .bind(ID, Components.input.string().build(), new StringToLongConverter("Conversion error")) // <1> .bind(ID, new TextField(), new StringToLongConverter("Conversion error")) // <2> .build(); // end::group1c[] }
public Component getComponent() { container = new HorizontalLayout(); container.setSpacing(true); container.setMargin(true); container.addComponent(new Label("User")); container.addComponent(new TextField()); container.addComponent(new Label("Password")); container.addComponent(new PasswordField()); return container; }
protected void initDescriptionField(GridLayout layout) { descriptionField = new TextField(); descriptionField.setRows(4); descriptionField.setColumns(35); descriptionField.addStyleName(ExplorerLayout.STYLE_TEXTAREA_NO_RESIZE); layout.addComponent(new Label(ExplorerApp.get().getI18nManager().getMessage(Messages.PROCESS_EDITOR_DESCRIPTION))); layout.addComponent(descriptionField); if (description != null) { descriptionField.setValue(description); description = null; } }