本文整理匯總了Java中com.vaadin.ui.FormLayout.addComponent方法的典型用法代碼示例。如果您正苦於以下問題:Java FormLayout.addComponent方法的具體用法?Java FormLayout.addComponent怎麽用?Java FormLayout.addComponent使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vaadin.ui.FormLayout
的用法示例。
在下文中一共展示了FormLayout.addComponent方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createContent
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
@Override
protected Component createContent() {
FormLayout layout = new FormLayout();
name = new FTextField("Nom").withWidth(50, Unit.PERCENTAGE);
description = new FTextArea("Description").withFullWidth().withRows(10);
usage = new EnumComboBox<FeatUsage>(FeatUsage.class, "Usage");
prerequisiteType = new EnumComboBox<PrerequisiteType>(PrerequisiteType.class, "Type de prérequis");
prerequisiteArmorProficiency = new EnumComboBox<>(ArmorType.ProficiencyType.class, "Maitrise d'armure prérequise");
prerequisiteAbility = new ComboBox<Ability>("Caractéristique prérequise", abilityService.findAll());
prerequisiteAbilityScore = new DSIntegerField("Score de caractéristique");
prerequisiteType.addSelectionListener(event -> adjustTypeVisibility(event.getValue()));
layout.addComponent(name);
layout.addComponent(description);
layout.addComponent(usage);
layout.addComponents(prerequisiteType, prerequisiteArmorProficiency, prerequisiteAbility, prerequisiteAbilityScore);
layout.addComponent(getToolbar());
return layout;
}
示例2: createContent
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
@Override
protected Component createContent() {
layout = new FormLayout();
name = new FTextField("Titre").withWidth("50%");
description = new FTextArea("Description").withFullWidth();
challengeRating = new ComboBox<>("Degré de difficulté");
challengeRating.setItems(Services.getLevelService().findAll());
status = new EnumComboBox<>(AdventureStatus.class, "Statut");
layout.addComponents(name, description, challengeRating, status);
layout.addComponent(getToolbar());
messageButton = new Button("Messages", event -> {
EventBus.post(new NavigationEvent(AdventureView.URI + "/" + getEntity().getId()));
});
layout.addComponent(messageButton);
return layout;
}
示例3: init
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
@PostConstruct
void init() {
FormLayout formLayout = new FormLayout();
formLayout.addComponent(usernameField);
formLayout.addComponent(passwordField);
formLayout.addComponent(loginButton);
formLayout.setWidth(null);
addComponent(formLayout);
loginButton.setClickShortcut( ShortcutAction.KeyCode.ENTER ) ;
loginButton.addClickListener((Button.ClickListener) clickEvent -> {
if (usernameField.isEmpty()) {
Notification.show("Username is required");
usernameField.focus();
} else if (passwordField.isEmpty()) {
Notification.show("Password is required");
passwordField.focus();
} else {
handler.login(this, usernameField.getValue(), passwordField.getValue());
}
});
usernameField.focus();
// setComponentAlignment(formLayout, Alignment.MIDDLE_CENTER);
}
示例4: createContent
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
@Override
protected Component createContent() {
FormLayout layout = new FormLayout();
name = new FTextField("Nom");
shortDescription = new FTextField("Description courte").withFullWidth();
description = new FTextArea("Description").withFullWidth();
keyAbility = new ComboBox<Ability>("Attribut clé", Services.getAbilityService().findAll());
layout.addComponent(name);
layout.addComponent(shortDescription);
layout.addComponent(description);
layout.addComponent(keyAbility);
layout.addComponent(getToolbar());
return layout;
}
示例5: postInit
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
@PostConstruct
private void postInit() {
addStyleName("bookery-content");
formLayout = new FormLayout();
formLayout.addStyleName("light");
formLayout.addComponents(generateFields());
formLayout.addComponents(generateStatusFields());
Button checkSolr = new Button("check", new Button.ClickListener() {
@Override
public void buttonClick(Button.ClickEvent event) {
checkSolr();
}
});
checkSolr.addStyleName(ValoTheme.BUTTON_SMALL);
checkSolr.addStyleName(ValoTheme.BUTTON_FRIENDLY);
formLayout.addComponent(checkSolr);
Label titleLabel = new Label("General Settings");
titleLabel.addStyleName(ValoTheme.LABEL_H2);
addComponents(titleLabel, formLayout);
}
示例6: createSolrIndexManagementSection
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
protected Component createSolrIndexManagementSection() {
FormLayout layout = new FormLayout();
Label manageSolrSectionTitle = new Label(i18n.translate("solr.app.manageSolrIndex.label.intro"));
manageSolrSectionTitle.addStyleName(STYLE_SECTION_TITLE);
layout.addComponent(manageSolrSectionTitle);
layout.addComponent(new Label(i18n.translate("solr.app.manageSolrIndex.label.description")));
Button clearSolrIndexButton =
new Button(i18n.translate("solr.app.management.button.clearSolrIndex.caption"),
event -> listener.clearSolrIndex()
);
clearSolrIndexButton.addStyleName(STYLE_V_BUTTON_SMALLAPP);
clearSolrIndexButton.addStyleName(STYLE_COMMIT);
VerticalLayout buttons = new VerticalLayout();
buttons.addStyleName(STYLE_BUTTONS);
buttons.setSpacing(true);
buttons.addComponent(clearSolrIndexButton);
layout.addComponent(buttons);
return layout;
}
示例7: buildEntryForm
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
protected FormLayout buildEntryForm() {
FormLayout form = new FormLayout();
form.addStyleName(ValoTheme.FORMLAYOUT_LIGHT);
form.setMargin(true);
nameField = new TextField("Name");
nameField.setValue(releasePackage.getName() != null ? releasePackage.getName() : "");
nameField.setReadOnly(releasePackage.isReleased());
form.addComponent(nameField);
versionLabelField = new TextField("Version");
versionLabelField.setValue(releasePackage.getVersionLabel() != null ? releasePackage.getVersionLabel() : "");
versionLabelField.setReadOnly(releasePackage.isReleased());
form.addComponent(versionLabelField);
releaseDateField = new DateField("Release Date");
releaseDateField.setValue(releasePackage.getReleaseDate() != null ? releasePackage.getReleaseDate() : null);
releaseDateField.setReadOnly(releasePackage.isReleased());
form.addComponent(releaseDateField);
return form;
}
示例8: PluginRepositoryEditPanel
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
public PluginRepositoryEditPanel(ApplicationContext context, PluginRepository pluginRepository) {
this.context = context;
this.pluginRepository = pluginRepository;
FormLayout form = new FormLayout();
form.setSpacing(true);
TextField field = new TextField("Name", StringUtils.trimToEmpty(pluginRepository.getName()));
field.setWidth(20, Unit.EM);
form.addComponent(field);
field.addValueChangeListener(new NameChangeListener());
field.focus();
field = new TextField("Url", StringUtils.trimToEmpty(pluginRepository.getUrl()));
field.setWidth(45, Unit.EM);
field.addValueChangeListener(new UrlChangeListener());
form.addComponent(field);
addComponent(form);
setMargin(true);
}
示例9: addCommonComponentSettings
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
@SuppressWarnings("unchecked")
protected void addCommonComponentSettings(FormLayout formLayout, Object obj) {
List<Object> list = (List<Object>) obj;
List<Component> components = new ArrayList<Component>(list.size());
for (Object object : list) {
if (object instanceof FlowStep) {
components.add(((FlowStep) object).getComponent());
} else if (object instanceof Component) {
components.add((Component) object);
}
}
if (components.size() != 0 && !readOnly) {
formLayout.addComponent(buildOptionGroup("Enabled", ENABLED, components));
formLayout.addComponent(buildOptionGroup("Log Input", LOG_INPUT, components));
formLayout.addComponent(buildOptionGroup("Log Output", LOG_OUTPUT, components));
}
}
示例10: ViewWithPopup
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
public ViewWithPopup(String title) {
addComponent(new Label(title));
button = new Button("Open Popup");
PopupExtensionManualBundle bundle = PopupExtension.extendWithManualBundle(button);
addComponent(bundle.getDataTransferComponent());
final PopupExtension popupExtension = bundle.getPopupExtension();
popupExtension.setOffset(100, 50);
popupExtension.setDirection(Alignment.BOTTOM_RIGHT);
FormLayout popupLayout = new FormLayout();
popupLayout.setWidth("500px");
popupLayout.addComponent(new Label("Problematic Combobox (press F5)"));
popupLayout.addComponent(new ComboBox("POPUP CONTENT"));
popupExtension.setContent(popupLayout);
button.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
popupExtension.toggle();
}
});
addComponent(button);
}
示例11: NativeSelectInForm
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
public NativeSelectInForm() {
setDescription("NativeSelect in forms should work fine on Android");
BeanItem<Bean> bi = new BeanItem<Bean>(new Bean());
Form form = new Form();
form.setCaption("Old deprecated form");
form.setFormFieldFactory(new FormFieldFactory() {
@Override
public Field<?> createField(Item item, Object propertyId,
Component uiContext) {
return createNativeSelect();
}
});
form.setItemDataSource(bi);
form.setBuffered(false);
addComponent(form);
NativeSelect select = createNativeSelect();
FormLayout layout = new FormLayout();
layout.setCaption("New field group in a form layout");
layout.addComponent(select);
FieldGroup fg = new FieldGroup(bi);
fg.bind(select, "aString");
fg.setBuffered(false);
addComponent(layout);
}
示例12: createEditFields
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override
protected ComponentContainer createEditFields() {
final FormLayout form = new ExtaFormLayout();
startValueField = new EditField("Начальное значение", "Введите целое число.");
startValueField.setColumns(15);
startValueField.setRequired(true);
startValueField.addValidator(new RangeValidator<>("Неподходящее значение", Long.class, 0L, Long.MAX_VALUE));
form.addComponent(startValueField);
endValueField = new EditField("Конечное значение", "Введите целое число.");
endValueField.setColumns(15);
endValueField.setRequired(true);
endValueField.addValidator(new RangeValidator<>("Неподходящее значение", Long.class, 0L, Long.MAX_VALUE));
form.addComponent(endValueField);
return form;
}
示例13: createEditFields
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override
protected ComponentContainer createEditFields() {
final FormLayout form = new ExtaFormLayout();
form.setSizeFull();
typeField = new MotorTypeSelect();
typeField.setRequired(true);
form.addComponent(typeField);
brandField = new MotorBrandSelect();
brandField.setRequired(true);
brandField.linkToType(typeField);
form.addComponent(brandField);
nameField = new EditField("Название модели", "Введите название модели техники");
nameField.setColumns(30);
nameField.setRequired(true);
form.addComponent(nameField);
codeField = new EditField("Код модели", "Введите кодовое название модели техники");
codeField.setColumns(30);
form.addComponent(codeField);
return form;
}
示例14: createEditFields
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override
protected ComponentContainer createEditFields() {
final FormLayout form = new ExtaFormLayout();
form.setSizeFull();
nameField = new EditField("Название типа техники", "Введите название типа техники");
nameField.setColumns(20);
nameField.setRequired(true);
form.addComponent(nameField);
brandsField = new MotorBrandObjMultiselect("Доступные бренды");
form.addComponent(brandsField);
return form;
}
示例15: createEditFields
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
/** {@inheritDoc} */
@Override
protected ComponentContainer createEditFields() {
final FormLayout form = new ExtaFormLayout();
form.setSizeFull();
regNumField = new EditField("Номер полиса", "Введите номер полиса.");
regNumField.setColumns(20);
regNumField.setRequired(true);
form.addComponent(regNumField);
bookTimeField = new DateTimeField("Полис забронирован", "Введите дату бронирования");
bookTimeField.setWidth(15, Unit.EM);
bookTimeField.setDateFormat("dd.MM.yyyy HH:mm:ss");
form.addComponent(bookTimeField);
issueDateField = new DateTimeField("Дата реализации", "Введите дату оформления полиса");
issueDateField.setWidth(15, Unit.EM);
form.addComponent(issueDateField);
return form;
}