本文整理汇总了Java中com.vaadin.v7.ui.HorizontalLayout类的典型用法代码示例。如果您正苦于以下问题:Java HorizontalLayout类的具体用法?Java HorizontalLayout怎么用?Java HorizontalLayout使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
HorizontalLayout类属于com.vaadin.v7.ui包,在下文中一共展示了HorizontalLayout类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: MoveStuff
import com.vaadin.v7.ui.HorizontalLayout; //导入依赖的package包/类
public MoveStuff() {
setDescription("Move stuff from view to another");
HorizontalLayout horizontalLayout = new HorizontalLayout();
horizontalLayout.setSizeFull();
navigationView = new NavigationView("First");
navigationView.setWidth("40%");
navigationView.setId("first ");
c = new Label("Foo");
c.setId("stuff");
navigationView.setContent(c);
Button button = new Button("Move", this);
navigationView.setRightComponent(button);
another = new NavigationView("Another");
another.setId("another ");
another.setWidth("40%");
horizontalLayout.addComponents(navigationView, another);
addComponent(horizontalLayout);
}
示例5: addSliderWithIcons
import com.vaadin.v7.ui.HorizontalLayout; //导入依赖的package包/类
private void addSliderWithIcons(ComponentContainer optionLayout) {
final Component emb = new Embedded(null, getNextIcon());
emb.setWidth("32px");
final Embedded emb2 = new Embedded(null, getNextIcon());
emb2.setWidth("32px");
final Slider slider = new Slider(0, 100);
slider.setWidth(100, UNITS_PERCENTAGE);
HorizontalLayout hl = new HorizontalLayout();
hl.addComponent(emb);
hl.addComponent(slider);
hl.addComponent(emb2);
hl.setWidth(100, UNITS_PERCENTAGE);
hl.setExpandRatio(slider, 1);
hl.setComponentAlignment(slider, Alignment.MIDDLE_CENTER);
optionLayout.addComponent(hl);
}
示例6: testCustomField
import com.vaadin.v7.ui.HorizontalLayout; //导入依赖的package包/类
@Test
public void testCustomField() {
Grid grid = createTestGrid();
ComponentGridDecorator<ExampleBean> decorator = new ComponentGridDecorator<>(grid, ExampleBean.class);
decorator.addComponentColumn(COLUMN_CAPTION, new ComponentGenerator<ExampleBean>() {
@Override
public Component getComponent(ExampleBean bean) {
return new Label(bean.getCaption());
}
});
Item item = grid.getContainerDataSource().getItem(grid.getContainerDataSource().getIdByIndex(0));
Property prop = item.getItemProperty(COLUMN_CAPTION)
;
ComponentCustomField field = new ComponentCustomField();
HorizontalLayout layout = (HorizontalLayout)field.initContent();
assertThat(layout, not(hasItem(isA(Label.class))));
field.setPropertyDataSource(prop);
assertThat(field.getValue(), instanceOf(Label.class));
assertThat(layout, hasItem(isA(Label.class)));
}
示例7: TableAndNavigationManager
import com.vaadin.v7.ui.HorizontalLayout; //导入依赖的package包/类
public TableAndNavigationManager() {
setDescription("NavigationView and -Bar test");
HorizontalLayout horizontalLayout = new HorizontalLayout();
horizontalLayout.setSizeFull();
horizontalLayout.addComponent(makeTable());
horizontalLayout.addComponent(makeNavigationManager());
addComponent(horizontalLayout);
}
示例8: 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);
}
示例9: NavViewWithButtonsT
import com.vaadin.v7.ui.HorizontalLayout; //导入依赖的package包/类
NavViewWithButtonsT() {
setCaption("Test buttons");
HorizontalButtonGroup group = new HorizontalButtonGroup();
Button button = new Button("Up", this);
button.addStyleName("icon-arrow-up");
group.addComponent(button);
Button button2 = new Button("Down", this);
button2.addStyleName("icon-arrow-down");
group.addComponent(button2);
setLeftComponent(group);
HorizontalLayout right = new HorizontalLayout();
HorizontalButtonGroup group2 = new HorizontalButtonGroup();
button2 = new Button("No deco", this);
button2.setStyleName("no-decoration");
right.addComponent(button2);
button2 = new Button("Left", this);
button2.addStyleName("icon-arrow-left");
group2.addComponent(button2);
button2 = new Button("Right", this);
button2.addStyleName("icon-arrow-right");
group2.addComponent(button2);
right.addComponent(group2);
setRightComponent(right);
Toolbar toolbar = new Toolbar();
button2 = new Button();
button2.setIcon(new ThemeResource("../runo/icons/64/document-web.png"));
toolbar.addComponent(button2);
button2 = new Button();
button2.setIcon(new ThemeResource(
"../runo/icons/64/document-delete.png"));
toolbar.addComponent(button2);
button2 = new Button();
button2.setIcon(new ThemeResource("../runo/icons/64/document-edit.png"));
toolbar.addComponent(button2);
button2 = new Button();
button2.setIcon(new ThemeResource("../runo/icons/64/document-doc.png"));
toolbar.addComponent(button2);
button2 = new Button();
button2.setIcon(new ThemeResource("../runo/icons/64/document-ppt.png"));
toolbar.addComponent(button2);
setToolbar(toolbar);
}