當前位置: 首頁>>代碼示例>>Java>>正文


Java FormLayout.addComponents方法代碼示例

本文整理匯總了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;
}
 
開發者ID:ljessendk,項目名稱:easybinder,代碼行數:17,代碼來源:AutomaticPropertyBindingExample.java

示例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;
}
 
開發者ID:ljessendk,項目名稱:easybinder,代碼行數:27,代碼來源:ManualReflectionBindingExample.java

示例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;
}
 
開發者ID:viydaag,項目名稱:dungeonstory-java,代碼行數:23,代碼來源:FeatForm.java

示例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);
}
 
開發者ID:viydaag,項目名稱:dungeonstory-java,代碼行數:20,代碼來源:SpellChoiceForm.java

示例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;
}
 
開發者ID:viydaag,項目名稱:dungeonstory-java,代碼行數:20,代碼來源:AdventureForm.java

示例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);
}
 
開發者ID:felixhusse,項目名稱:bookery,代碼行數:24,代碼來源:ServerSettingsLayout.java

示例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;
}
 
開發者ID:ljessendk,項目名稱:easybinder,代碼行數:16,代碼來源:BuildAndBindExample.java

示例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();
}
 
開發者ID:apache,項目名稱:incubator-tamaya-sandbox,代碼行數:14,代碼來源:LoginBox.java

示例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;
}
 
開發者ID:viydaag,項目名稱:dungeonstory-java,代碼行數:14,代碼來源:LanguageForm.java

示例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;
}
 
開發者ID:viydaag,項目名稱:dungeonstory-java,代碼行數:31,代碼來源:ClassFeatureForm.java

示例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;
}
 
開發者ID:viydaag,項目名稱:dungeonstory-java,代碼行數:14,代碼來源:InnForm.java

示例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;
}
 
開發者ID:viydaag,項目名稱:dungeonstory-java,代碼行數:15,代碼來源:TempleForm.java

示例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;
}
 
開發者ID:viydaag,項目名稱:dungeonstory-java,代碼行數:16,代碼來源:UserForm.java

示例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;
}
 
開發者ID:viydaag,項目名稱:dungeonstory-java,代碼行數:34,代碼來源:InformationForm.java

示例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);
        }
    }
 
開發者ID:viydaag,項目名稱:dungeonstory-java,代碼行數:29,代碼來源:SummaryStep.java


注:本文中的com.vaadin.ui.FormLayout.addComponents方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。