use of com.vaadin.flow.component.textfield.TextArea in project Akros-Marketplace by AkrosAG.
the class FieldTypeView method createEditorFormComponents.
private Component createEditorFormComponents() {
Div div = new Div();
FormLayout formLayout = new FormLayout();
formLayout.setResponsiveSteps(new ResponsiveStep("0", 1, LabelsPosition.TOP));
ValueChangeListener<ValueChangeEvent<?>> listener = getUpdateSaveButtonValueChangeListener();
txtFieldTypeId = new NumberField("fieldTypeId (Column: FIELD_TYPE_ID)");
txtFieldTypeId.setReadOnly(true);
txtDescription = new TextArea("description (Column: DESCRIPTION)");
txtDescription.setClassName("full-width");
txtDescription.setRequired(true);
txtDescription.setHeightFull();
txtDescription.setValueChangeMode(ValueChangeMode.LAZY);
txtDescription.addValueChangeListener(listener);
txtDescription.setId(TEXT_CONTROL_DESCRIPTION);
txtShortDescription = new TextField("shortDescription (Column: SHORT_DESCRIPTON)");
txtShortDescription.setClassName("full-width");
txtShortDescription.setRequired(true);
txtShortDescription.setValueChangeMode(ValueChangeMode.LAZY);
txtShortDescription.addValueChangeListener(listener);
comboFieldTypeDefinitions = new ComboBox<FieldTypeDefinition>("fieldTypeDefinitionId (Column: FIELD_TYPE_DEFINITION_ID)", fieldTypeDefinitionService.list());
comboFieldTypeDefinitions.setItemLabelGenerator(e -> String.format("%d: %s", e.getFieldTypeDefinitionId(), e.getDescription()));
comboFieldTypeDefinitions.setRequired(true);
comboFieldTypeDefinitions.addValueChangeListener(listener);
txtMinValue = new NumberField("minValue (Column: MIN_VALUE)");
txtMinValue.setClassName("full-width");
txtMinValue.setRequiredIndicatorVisible(true);
txtMinValue.setValueChangeMode(ValueChangeMode.LAZY);
txtMinValue.addValueChangeListener(listener);
txtMaxValue = new NumberField("maxValue (Column: MAX_VALUE)");
txtMaxValue.setClassName("full-width");
txtMaxValue.setRequiredIndicatorVisible(true);
txtMaxValue.setValueChangeMode(ValueChangeMode.LAZY);
txtMaxValue.addValueChangeListener(listener);
chkOffer = new Checkbox("offer (Column: OFFER)");
chkOffer.setClassName("full-width");
chkSearch = new Checkbox("search (Column: SEARCH)");
chkSearch.setClassName("full-width");
chkRequired = new Checkbox("required (Column: REQUIRED)");
chkRequired.setClassName("full-width");
chkSearchable = new Checkbox("searchable (Column: SEARCHABLE)");
chkSearchable.setClassName("full-width");
txtSortNumber = new NumberField("sortNumber (Column: SORT_NUMBER)");
txtSortNumber.setClassName("full-width");
txtSortNumber.setRequiredIndicatorVisible(true);
txtSortNumber.setValueChangeMode(ValueChangeMode.LAZY);
txtSortNumber.addValueChangeListener(listener);
formLayout.add(txtFieldTypeId, txtDescription, txtShortDescription, comboFieldTypeDefinitions, txtMinValue, txtMaxValue, chkOffer, chkSearch, chkRequired, chkSearchable, txtSortNumber);
div.add(formLayout);
return div;
}
use of com.vaadin.flow.component.textfield.TextArea in project ArchCNL by Mari-Wie.
the class RuleCreatorView method initializeLayout.
private void initializeLayout(Optional<String> ruleString) {
subject = new SubjectComponent();
subject.addListener(RelationListUpdateRequestedEvent.class, this::fireEvent);
subject.addListener(ConceptListUpdateRequestedEvent.class, this::fireEvent);
subject.addListener(DetermineStatementComponentEvent.class, event -> verb.determineVerbComponent(event.getSource().getFirstModifierValue()));
verb = new StatementComponent();
verb.addListener(RelationListUpdateRequestedEvent.class, this::fireEvent);
verb.addListener(ConceptListUpdateRequestedEvent.class, this::fireEvent);
buttonsLayout = new HorizontalLayout();
saveButton = new Button("Save Rule", e -> saveRule());
cancelButton = new Button("Cancel", click -> fireEvent(new RulesWidgetRequestedEvent(this, true)));
expertmodeCheckbox = new Checkbox("Activate Expertmode");
expertmodeCheckbox.addClickListener(e -> activateExpertMode(expertmodeCheckbox.getValue()));
buttonsLayout.setVerticalComponentAlignment(Alignment.CENTER, expertmodeCheckbox);
buttonsLayout.setPadding(true);
buttonsLayout.add(saveButton, cancelButton, expertmodeCheckbox);
archRuleTextArea = new TextArea("Create new architecture rule");
archRuleTextArea.setWidthFull();
add(subject, verb, buttonsLayout);
ruleString.ifPresent(rule -> {
archRuleTextArea.setValue(rule);
expertmodeCheckbox.setValue(true);
activateExpertMode(true);
});
}
use of com.vaadin.flow.component.textfield.TextArea in project docs by vaadin.
the class DialogDraggable method createDialogLayout.
private static VerticalLayout createDialogLayout() {
TextField titleField = new TextField("Title");
TextArea descriptionArea = new TextArea("Description");
VerticalLayout fieldLayout = new VerticalLayout(titleField, descriptionArea);
fieldLayout.setSpacing(false);
fieldLayout.setPadding(false);
fieldLayout.setAlignItems(FlexComponent.Alignment.STRETCH);
fieldLayout.getStyle().set("width", "300px").set("max-width", "100%");
return fieldLayout;
}
use of com.vaadin.flow.component.textfield.TextArea in project SODevelopment by syampillai.
the class MailForm method buildFields.
@Override
protected void buildFields() {
String userEmail = getTransactionManager().getUser().getPerson().getContact("email");
senderField = new ObjectField<>("From", SenderGroup.class, ObjectField.Type.CHOICE);
senderField.setValue((Id) null);
senderField.setFilter(g -> {
for (Sender s : StoredObject.list(Sender.class, "SenderGroup=" + g.getId(), true)) {
if (s.getFromAddress().equalsIgnoreCase(userEmail) || s.getReplyToAddress().equalsIgnoreCase(userEmail)) {
senderGroup = g;
return true;
}
}
return false;
});
addField(senderField);
if (senderGroup != null) {
senderField.setValue(senderGroup);
senderGroup = null;
}
addressField = new TokensField<>("To");
addField(addressField);
ccField = new TokensField<>("CC");
addField(ccField);
subjectField = new TextField("Subject");
addField(subjectField);
setAllowAttachments(allowAttachments);
contentField = new TextArea("Content");
addField(contentField);
}
use of com.vaadin.flow.component.textfield.TextArea in project SODevelopment by syampillai.
the class ChangePassword method buildFields.
@Override
protected void buildFields() {
String voice;
if (expired) {
voice = "You password has expired, please change it now!";
speak(voice);
add(new ELabel(voice, "red"));
}
TextField user;
addField(user = new TextField("User Name"));
user.setReadOnly(true);
user.setTabIndex(-1);
user.setValue(su.getId() + ":" + su.getLogin());
password = createPasswordField("Current Password");
if (!forgot) {
addField(password);
}
addField(newPassword = createPasswordField("New Password"));
addField(repeatNewPassword = createPasswordField("Repeat New Password"));
TextArea condition = new TextArea();
voice = PasswordPolicy.getForClass(SystemUser.class).describe();
condition.setValue(voice);
condition.setReadOnly(true);
condition.setTabIndex(-1);
add(condition);
speak(voice);
}
Aggregations