本文整理匯總了Java中com.vaadin.ui.FormLayout.addComponents方法的典型用法代碼示例。如果您正苦於以下問題:Java FormLayout.addComponents方法的具體用法?Java FormLayout.addComponents怎麽用?Java FormLayout.addComponents使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vaadin.ui.FormLayout
的用法示例。
在下文中一共展示了FormLayout.addComponents方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getTestComponent
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
@Override
public Component getTestComponent() {
AutoBinder<Flight> binder = new AutoBinder<>(Flight.class);
binder.bindInstanceFields(this);
FormLayout f = new FormLayout();
f.addComponents(airline, flightNumber, flightSuffix, date, legType, sbt, ebt, abt, gate, canceled);
Label statusLabel = new Label();
binder.setStatusLabel(statusLabel);
f.addComponents(statusLabel);
binder.setBean(new Flight());
return f;
}
示例2: getTestComponent
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
@Override
public Component getTestComponent() {
ReflectionBinder<Flight> binder = new ReflectionBinder<>(Flight.class);
binder.bind(airline, "flightId.airline");
binder.bind(flightNumber, "flightId.flightNumber");
binder.bind(flightSuffix, "flightId.flightSuffix");
binder.bind(date, "flightId.date");
binder.bind(legType, "flightId.legType");
binder.bind(sbt, "sbt");
binder.bind(ebt, "ebt");
binder.bind(abt, "abt");
binder.bind(gate, "gate");
binder.bind(canceled, "canceled");
FormLayout f = new FormLayout();
f.addComponents(airline, flightNumber, flightSuffix, date, legType, sbt, ebt, abt, gate, canceled);
Label statusLabel = new Label();
binder.setStatusLabel(statusLabel);
f.addComponents(statusLabel);
binder.setBean(new Flight());
return f;
}
示例3: 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;
}
示例4: getSpellWindow
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
private void getSpellWindow(Spell spell) {
Messages messages = Messages.getInstance();
Window window = new Window(spell.getName());
window.setModal(true);
window.setWidth("60%");
CollectionToStringConverter converter = new CollectionToStringConverter();
FormLayout layout = new FormLayout();
DSLabel componentType = new DSLabel(messages.getMessage("spellStep.component.label"),
converter.convertToPresentation(spell.getComponentTypes(), new ValueContext()));
DSLabel text = new DSLabel(messages.getMessage("spellStep.description.label"), spell.getDescription());
layout.addComponents(componentType, text);
//TODO : other useful info
window.setContent(layout);
UI.getCurrent().addWindow(window);
}
示例5: 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;
}
示例6: 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);
}
示例7: getTestComponent
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
@Override
public Component getTestComponent() {
AutoBinder<Flight> binder = new AutoBinder<>(Flight.class);
FormLayout f = new FormLayout();
f.addComponents(binder.buildAndBind("flightId"));
Label statusLabel = new Label();
binder.setStatusLabel(statusLabel);
f.addComponents(statusLabel);
binder.setBean(new Flight());
return f;
}
示例8: addForm
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
private void addForm() {
FormLayout loginForm = new FormLayout();
MessageProvider mp = ServiceContextManager.getServiceContext().getService(MessageProvider.class);
username = new TextField(mp.getMessage("default.label.username"));
password = new PasswordField(mp.getMessage("default.label.password"));
loginForm.addComponents(username, password);
addComponent(loginForm);
loginForm.setSpacing(true);
for(Component component:loginForm){
component.setWidth("100%");
}
username.focus();
}
示例9: createContent
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
@Override
protected Component createContent() {
FormLayout layout = new FormLayout();
name = new FTextField("Nom");
script = new FTextField("Alphabet");
playable = new FormCheckBox("Jouable par un personnage");
layout.addComponents(name, script, playable);
layout.addComponent(getToolbar());
return layout;
}
示例10: 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<>(ClassFeatureUsage.class, "Usage");
nbUse = new DSIntegerField("Nombre d'utilisation avant repos");
restType = new EnumComboBox<RestType>(RestType.class, "Type de repos requis");
pointCost = new DSIntegerField("Coût en points");
parent = new FComboBox<ClassFeature>("Don parent").withWidth(50, Unit.PERCENTAGE);
replacement = new FComboBox<ClassFeature>("Remplace le don").withWidth(50, Unit.PERCENTAGE);
requiredLevel = new ComboBox<>("Niveau requis", Services.getLevelService().findAll());
parent.addValueChangeListener(event -> {
requiredLevel.setVisible(event.getValue() != null);
if (event.getValue() == null) {
requiredLevel.setValue(null);
}
});
layout.addComponent(name);
layout.addComponent(description);
layout.addComponent(usage);
layout.addComponents(nbUse, restType, pointCost);
layout.addComponents(parent, requiredLevel, replacement);
layout.addComponent(getToolbar());
return layout;
}
示例11: createContent
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
@Override
protected Component createContent() {
FormLayout layout = new FormLayout();
name = new FTextField("Nom");
description = new FTextArea("Description").withFullWidth().withRows(10);
city = new ComboBox<City>("Ville", Services.getCityService().findAll());
layout.addComponents(name, description, city);
layout.addComponent(getToolbar());
return layout;
}
示例12: createContent
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
@Override
protected Component createContent() {
FormLayout layout = new FormLayout();
name = new TextField("Nom");
description = new FTextArea("Description").withFullWidth().withRows(10);
city = new ComboBox<City>("Ville", Services.getCityService().findAll());
deity = new ComboBox<Deity>("Dieu", Services.getDeityService().findAll());
layout.addComponents(name, description, city, deity);
layout.addComponent(getToolbar());
return layout;
}
示例13: createContent
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
@Override
protected Component createContent() {
FormLayout layout = new FormLayout();
username = new LabelField<>();
name = new LabelField<>();
role = new LabelField<>();
status = new LabelField<>();
email = new LabelField<>();
created = new LabelField<>();
layout.addComponents(username, name, email, role, status, created);
return layout;
}
示例14: createContent
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
@Override
protected Component createContent() {
Messages messages = Messages.getInstance();
layout = new FormLayout();
layout.setMargin(new MarginInfo(true, true));
name = new FTextField(messages.getMessage("informationStep.name.label")).withWidth("250px");
gender = new RadioButtonGroup<Gender>(messages.getMessage("informationStep.sex.label"), EnumSet.allOf(Gender.class));
age = new DSIntegerField(messages.getMessage("informationStep.age.label"));
weight = new DSIntegerField(messages.getMessage("informationStep.weight.label"));
height = new TextField(messages.getMessage("informationStep.height.label"));
alignment = new ComboBox<>(messages.getMessage("informationStep.alignment.label"), alignmentService.findAllPlayable());
region = new ComboBox<>(messages.getMessage("informationStep.region.label"), regionService.findAllOrderBy("name", "ASC"));
getBinder().forMemberField(age).withValidator((value, context) -> {
int minAge = getEntity().getRace().getMinAge();
int maxAge = getEntity().getRace().getMaxAge();
if (value.intValue() < minAge || value.intValue() > maxAge) {
return ValidationResult.error(messages.getMessage("informationStep.age.validator", minAge, maxAge, getEntity().getRace().getName()));
}
return ValidationResult.ok();
});
gender.addValueChangeListener(event -> initImageSelector(event.getValue()));
layout.addComponents(name, gender, age, weight, height, alignment, region);
initImageSelector(null);
return layout;
}
示例15: showCharacterInfo
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
private void showCharacterInfo() {
Messages messages = Messages.getInstance();
Character character = wizard.getCharacter();
if (character.getId() == null) {
FormLayout infoLayout = new FFormLayout().withMargin(true);
Panel infoPanel = new Panel(messages.getMessage("summaryStep.info.label"), infoLayout);
layout.addComponent(infoPanel);
File imageFile = new File(DSConstant.getImageDir() + character.getImage());
FileResource resource = new FileResource(imageFile);
Image image = new Image("Image", resource);
DSLabel nameLabel = new DSLabel(messages.getMessage("summaryStep.name.label"), character.getName());
DSLabel genderLabel = new DSLabel(messages.getMessage("summaryStep.sex.label"), character.getGender().toString());
DSLabel ageLabel = new DSLabel(messages.getMessage("summaryStep.age.label"), String.valueOf(character.getAge()));
DSLabel weightLabel = new DSLabel(messages.getMessage("summaryStep.weight.label"), character.getWeight() + " lbs");
DSLabel heightLabel = new DSLabel(messages.getMessage("summaryStep.height.label"), character.getHeight());
DSLabel alignmentLabel = new DSLabel(messages.getMessage("summaryStep.alignment.label"),
character.getAlignment().toString());
DSLabel regionLabel = new DSLabel(messages.getMessage("summaryStep.region.label"), character.getRegion().toString());
DSLabel backgroundLabel = new DSLabel(messages.getMessage("summaryStep.background.label"),
character.getBackground().getBackground().toString());
DSLabel goldLabel = new DSLabel(messages.getMessage("summaryStep.startingGold.label"), character.getGold());
infoLayout.addComponents(image, nameLabel, genderLabel, ageLabel, weightLabel, heightLabel, alignmentLabel,
regionLabel, backgroundLabel, goldLabel);
}
}