本文整理匯總了Java中com.vaadin.ui.FormLayout.setCaption方法的典型用法代碼示例。如果您正苦於以下問題:Java FormLayout.setCaption方法的具體用法?Java FormLayout.setCaption怎麽用?Java FormLayout.setCaption使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類com.vaadin.ui.FormLayout
的用法示例。
在下文中一共展示了FormLayout.setCaption方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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);
}
示例2: createWindow
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
private CommonDialogWindow createWindow() {
final Label madatoryStarLabel = new Label("*");
madatoryStarLabel.setStyleName("v-caption v-required-field-indicator");
madatoryStarLabel.setWidth(null);
addStyleName("lay-color");
setSizeUndefined();
formLayout = new FormLayout();
formLayout.setCaption(null);
formLayout.addComponent(typeComboBox);
formLayout.addComponent(nameTextField);
formLayout.addComponent(versionTextField);
formLayout.addComponent(vendorTextField);
formLayout.addComponent(descTextArea);
setCompositionRoot(formLayout);
final CommonDialogWindow window = new WindowBuilder(SPUIDefinitions.CREATE_UPDATE_WINDOW)
.caption(i18n.getMessage("upload.caption.add.new.swmodule")).content(this).layout(formLayout).i18n(i18n)
.saveDialogCloseListener(new SaveOnDialogCloseListener()).buildCommonDialogWindow();
nameTextField.setEnabled(!editSwModule);
versionTextField.setEnabled(!editSwModule);
typeComboBox.setEnabled(!editSwModule);
typeComboBox.focus();
return window;
}
示例3: CtrCandActionPjWindow
import com.vaadin.ui.FormLayout; //導入方法依賴的package包/類
/**
* Crée une fenêtre d'action sur une ou plusieurs pièces justif
* @param listePj la liste des pièces à manipuler
*/
@SuppressWarnings("unchecked")
public CtrCandActionPjWindow(List<PjPresentation> listePj) {
/* Style */
setModal(true);
setWidth(550,Unit.PIXELS);
setResizable(true);
setClosable(true);
/* Layout */
VerticalLayout layout = new VerticalLayout();
layout.setMargin(true);
layout.setSpacing(true);
setContent(layout);
/* Titre */
setCaption(applicationContext.getMessage("pj.action.window", null, UI.getCurrent().getLocale()));
/*Le field group pour la decision*/
fieldGroup = new CustomBeanFieldGroup<>(PjCand.class);
fieldGroup.setItemDataSource(new PjCand());
formLayout = new FormLayout();
formLayout.setCaption(applicationContext.getMessage("pj.action.label", new Object[]{listePj.size()}, UI.getCurrent().getLocale()));
formLayout.setWidth(100, Unit.PERCENTAGE);
formLayout.setSpacing(true);
for (String fieldName : FIELDS_ORDER) {
Field<?> field = fieldGroup.buildAndBind(applicationContext.getMessage("pj.action." + fieldName, null, UI.getCurrent().getLocale()), fieldName);
field.setWidth(100, Unit.PERCENTAGE);
formLayout.addComponent(field);
}
layout.addComponent(formLayout);
RequiredTextField tf = (RequiredTextField)fieldGroup.getField(PjCand_.commentPjCand.getName());
RequiredComboBox<TypeStatutPiece> cb = (RequiredComboBox<TypeStatutPiece>)fieldGroup.getField(PjCand_.typeStatutPiece.getName());
cb.setRequired(true);
cb.setRequiredError(applicationContext.getMessage("validation.obigatoire", null, UI.getCurrent().getLocale()));
if (listePj.size()==1){
cb.setValue(new TypeStatutPiece(listePj.get(0).getCodStatut(),""));
tf.setValue(listePj.get(0).getCommentaire());
}
/* Ajoute les boutons */
HorizontalLayout buttonsLayout = new HorizontalLayout();
buttonsLayout.setWidth(100, Unit.PERCENTAGE);
buttonsLayout.setSpacing(true);
layout.addComponent(buttonsLayout);
btnClose = new OneClickButton(applicationContext.getMessage("btnClose", null, UI.getCurrent().getLocale()), FontAwesome.TIMES);
btnClose.addClickListener(e -> close());
buttonsLayout.addComponent(btnClose);
buttonsLayout.setComponentAlignment(btnClose, Alignment.MIDDLE_LEFT);
btnValid = new OneClickButton(applicationContext.getMessage("btnValid", null, UI.getCurrent().getLocale()), FontAwesome.SAVE);
btnValid.addClickListener(e -> {
try {
/* Valide la saisie */
fieldGroup.commit();
/* Enregistre la typeStatutPiece saisie */
changeStatutPieceWindowListener.btnOkClick((TypeStatutPiece)cb.getValue(),tf.getValue());
/* Ferme la fenêtre */
close();
} catch (CommitException ce) {
}
});
buttonsLayout.addComponent(btnValid);
buttonsLayout.setComponentAlignment(btnValid, Alignment.MIDDLE_RIGHT);
/* Centre la fenêtre */
center();
}