当前位置: 首页>>代码示例>>Java>>正文


Java HorizontalLayout.setMargin方法代码示例

本文整理汇总了Java中com.vaadin.v7.ui.HorizontalLayout.setMargin方法的典型用法代码示例。如果您正苦于以下问题:Java HorizontalLayout.setMargin方法的具体用法?Java HorizontalLayout.setMargin怎么用?Java HorizontalLayout.setMargin使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.vaadin.v7.ui.HorizontalLayout的用法示例。


在下文中一共展示了HorizontalLayout.setMargin方法的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);
    }
 
开发者ID:kumoregdev,项目名称:kumoreg,代码行数:23,代码来源:LogoutView.java

示例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;
}
 
开发者ID:datenhahn,项目名称:componentrenderer,代码行数:19,代码来源:CustomerDetailsGenerator.java

示例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;
}
 
开发者ID:datenhahn,项目名称:componentrenderer,代码行数:19,代码来源:StaticCustomerDetailsGenerator.java

示例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);
}
 
开发者ID:kumoregdev,项目名称:kumoreg,代码行数:60,代码来源:AttendeeWindow.java


注:本文中的com.vaadin.v7.ui.HorizontalLayout.setMargin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。