本文整理汇总了Java中com.vaadin.v7.ui.HorizontalLayout.setSpacing方法的典型用法代码示例。如果您正苦于以下问题:Java HorizontalLayout.setSpacing方法的具体用法?Java HorizontalLayout.setSpacing怎么用?Java HorizontalLayout.setSpacing使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.vaadin.v7.ui.HorizontalLayout
的用法示例。
在下文中一共展示了HorizontalLayout.setSpacing方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: init
import com.vaadin.v7.ui.HorizontalLayout; //导入方法依赖的package包/类
@PostConstruct
void init() {
addComponent(spacer);
spacer.setHeight("5em");
addComponent(warning);
warning.setSizeUndefined();
// setComponentAlignment(warning, Alignment.MIDDLE_CENTER);
HorizontalLayout horizontalLayout = new HorizontalLayout();
horizontalLayout.setSpacing(true);
horizontalLayout.setMargin(true);
horizontalLayout.addComponent(goToTillReport);
goToTillReport.focus();
goToTillReport.setClickShortcut(ShortcutAction.KeyCode.ENTER);
goToTillReport.addStyleName(ValoTheme.BUTTON_PRIMARY);
goToTillReport.addClickListener((Button.ClickListener) clickEvent -> navigateTo(CloseOutTillView.VIEW_NAME));
horizontalLayout.addComponent(logout);
logout.addClickListener((Button.ClickListener) clickEvent -> handler.logout(this));
addComponent(horizontalLayout);
// setComponentAlignment(horizontalLayout, Alignment.MIDDLE_CENTER);
}
示例2: getDetails
import com.vaadin.v7.ui.HorizontalLayout; //导入方法依赖的package包/类
@Override
public Component getDetails(Grid.RowReference rowReference) {
rowReference.getGrid().scrollTo(rowReference.getItemId());
Customer customer = (Customer)rowReference.getItemId();
HorizontalLayout layout = new HorizontalLayout();
layout.setHeight(300, Sizeable.Unit.PIXELS);
layout.setMargin(true);
layout.setSpacing(true);
Image image = new Image("", customer.getPhoto());
image.setHeight(200, Sizeable.Unit.PIXELS);
image.setWidth(200, Sizeable.Unit.PIXELS);
layout.addComponent(image);
Label nameLabel = new Label("<h1>" + customer.getFirstName() + " " + customer.getLastName() + "</h1>", ContentMode.HTML);
layout.addComponent(nameLabel);
layout.setExpandRatio(nameLabel, 1.0f);
return layout;
}
示例3: getDetails
import com.vaadin.v7.ui.HorizontalLayout; //导入方法依赖的package包/类
@Override
public Component getDetails(Grid.RowReference rowReference) {
rowReference.getGrid().scrollTo(rowReference.getItemId());
StaticCustomer customer = (StaticCustomer)rowReference.getItemId();
HorizontalLayout layout = new HorizontalLayout();
layout.setHeight(300, Sizeable.Unit.PIXELS);
layout.setMargin(true);
layout.setSpacing(true);
Image image = new Image("", customer.getPhoto());
image.setHeight(200, Sizeable.Unit.PIXELS);
image.setWidth(200, Sizeable.Unit.PIXELS);
layout.addComponent(image);
Label nameLabel = new Label("<h1>" + customer.getFirstName() + " " + customer.getLastName() + "</h1>", ContentMode.HTML);
layout.addComponent(nameLabel);
layout.setExpandRatio(nameLabel, 1.0f);
return layout;
}
示例4: AttendeeWindow
import com.vaadin.v7.ui.HorizontalLayout; //导入方法依赖的package包/类
public AttendeeWindow(OrderView parentView, OrderPresenter orderPresenter) {
super("Attendee");
this.parentView = parentView;
this.handler = orderPresenter;
setIcon(FontAwesome.USER);
center();
setModal(true);
setWidth(1100, Unit.PIXELS);
setHeight(800, Unit.PIXELS);
VerticalLayout verticalLayout = new VerticalLayout();
verticalLayout.setMargin(false);
verticalLayout.setSpacing(true);
verticalLayout.addComponent(attendeeDetailForm);
HorizontalLayout horizontalLayout = new HorizontalLayout();
horizontalLayout.setMargin(new MarginInfo(false, true, false, true));
horizontalLayout.setSpacing(true);
horizontalLayout.addComponent(save);
horizontalLayout.addComponent(cancel);
horizontalLayout.addComponent(delete);
horizontalLayout.addComponent(addNote);
save.setTabIndex(20);
cancel.setTabIndex(21);
delete.setTabIndex(22);
addNote.setTabIndex(23);
delete.addStyleName(ValoTheme.BUTTON_DANGER);
save.addClickListener((Button.ClickListener) clickEvent -> {
Attendee attendee = attendeeDetailForm.getAttendee();
try {
handler.validate(attendee);
handler.addAttendeeToOrder(parentView, attendee);
close();
} catch (ValidationException e) {
parentView.notifyError(e.getMessage());
}
});
cancel.addClickListener((Button.ClickListener) clickEvent -> {
close();
});
delete.addClickListener((Button.ClickListener) clickEvent -> {
handler.removeAttendeeFromOrder(parentView, attendeeDetailForm.getAttendee());
close();
});
addNote.addClickListener((Button.ClickListener) clickEvent -> showAddNoteWindow());
verticalLayout.addComponent(horizontalLayout);
setContent(verticalLayout);
attendeeDetailForm.selectFirstName();
save.setClickShortcut(ShortcutAction.KeyCode.ENTER);
save.addStyleName(ValoTheme.BUTTON_PRIMARY);
}