Example usage for com.vaadin.ui VerticalLayout setWidth

List of usage examples for com.vaadin.ui VerticalLayout setWidth

Introduction

In this page you can find the example usage for com.vaadin.ui VerticalLayout setWidth.

Prototype

@Override
    public void setWidth(String width) 

Source Link

Usage

From source file:com.hris.employee.EmployeeUI.java

private VerticalLayout firstComponent(int branchId) {
    employeeGridUI = new EmployeeGridUI(new EmployeeDataContainer(branchId));
    VerticalLayout v = new VerticalLayout();
    v.setWidth("100%");
    v.setHeight("100%");

    employeeStatus = employeeStatusComboBox();
    employeeStatus.addValueChangeListener((Property.ValueChangeEvent event) -> {
        v.removeComponent(employeeGridUI);

        if (employeeStatus.getValue() == null) {
            employeeGridUI = new EmployeeGridUI(new EmployeeDataContainer(getBranchId()));
        } else {//from  w  w  w .j a v a 2s . c om
            employeeGridUI = new EmployeeGridUI(
                    new EmployeeDataContainer(getBranchId(), (int) employeeStatus.getValue()));
        }

        v.addComponent(employeeGridUI);
        v.setExpandRatio(employeeGridUI, 2);
    });
    v.addComponent(employeeStatus);

    v.addComponent(employeeGridUI);
    v.setExpandRatio(employeeGridUI, 2);

    return v;
}

From source file:com.jain.addon.action.confirm.ConfirmWindow.java

License:Apache License

@JNIComponentInit
public void init() {
    setModal(true);//from   w w  w.  j  a v a  2  s  .com
    setWidth("25%");

    VerticalLayout layout = new VerticalLayout();
    setContent(layout);

    layout.setWidth("100%");
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setStyleName(JNStyleConstants.J_ALTERNATE_VIEW);

    JNConfirm confirm = action.getConfirm();
    HorizontalLayout hLayout = new HorizontalLayout();
    hLayout.setSpacing(true);
    hLayout.setWidth("100%");
    findNAddIcon(confirm, hLayout);

    Label label = new Label(confirm.message());
    label.setContentMode(confirm.mode());
    hLayout.addComponent(label);
    hLayout.setExpandRatio(label, 2);
    layout.addComponent(hLayout);
    layout.setComponentAlignment(hLayout, Alignment.MIDDLE_CENTER);

    ActionMenuBar<ConfirmWindow> menuBar = new ActionMenuBar<ConfirmWindow>(null, this);
    layout.addComponent(menuBar);
    layout.setExpandRatio(menuBar, 2);
    layout.setComponentAlignment(menuBar, Alignment.MIDDLE_CENTER);
}

From source file:com.jain.addon.component.crud.JCrudWindow.java

License:Apache License

@JNIComponentInit
public void init() {
    setModal(true);// ww  w  .  j a  v a 2 s.  c om
    setSizeUndefined();
    setWidth("70%");

    VerticalLayout layout = new VerticalLayout();
    layout.setWidth("100%");
    layout.setMargin(new MarginInfo(false, false, true, false));
    layout.setStyleName(JNStyleConstants.J_ALTERNATE_VIEW);

    setContent(layout);
    createFieldGroup(layout);

    createActions(layout);
}

From source file:com.jain.addon.web.layout.JainGroupLayout.java

License:Apache License

private JainLayout createOrUpdateCurrentLayout(JNIGroup group, String groupName) {
    if (group != null && group.getParent() != null) {
        JainLayout parentLayout = groupLayoutMap.get(group.getParent().getName());
        if (parentLayout == null) {
            parentLayout = createOrUpdateCurrentLayout(group.getParent(), group.getParent().getName());
        }//from www.j av  a2  s  .c o  m

        if (parentLayout != null) {
            JainLayout layout = new JainLayout(spacing, margin,
                    group.getParent() == null ? group.getColumns() : group.getParent().getColumns());

            if (StringHelper.isNotEmptyWithTrim(alternateStyleName))
                layout.setStyleName(alternateStyleName);

            VerticalLayout groupLayout = new VerticalLayout();

            if (StringHelper.isNotEmptyWithTrim(styleName))
                groupLayout.setStyleName(styleName);

            if (StringHelper.isNotEmptyWithTrim(group.getDisplayName())) {
                groupLayout.setCaption(group.getDisplayName());
            }

            groupLayout.setSpacing(true);
            groupLayout.setMargin(true);
            groupLayout.setWidth("100%");
            groupLayout.addComponent(layout);
            parentLayout.addComponent(groupLayout, group.getColSpan());

            groupLayoutMap.put(groupName, layout);
            return layout;
        }
    }

    String groupDisplayName = group == null ? "" : group.getDisplayName();
    JainLayout layout = new JainLayout(spacing, margin, group == null ? columns : group.getColumns());

    if (StringHelper.isNotEmptyWithTrim(alternateStyleName))
        layout.setStyleName(alternateStyleName);

    VerticalLayout groupLayout = new VerticalLayout();

    if (StringHelper.isNotEmptyWithTrim(styleName))
        groupLayout.setStyleName(styleName);

    if (StringHelper.isNotEmptyWithTrim(groupDisplayName)) {
        groupLayout.setCaption(group.getDisplayName());
    }

    groupLayout.setSpacing(true);
    groupLayout.setMargin(true);
    groupLayout.setWidth("100%");
    groupLayout.addComponent(layout);
    super.addComponent(groupLayout);

    groupLayoutMap.put(groupName, layout);
    return layout;
}

From source file:com.jain.common.approot.ApplicationUI.java

License:Apache License

public void initialize(Locale locale) {
    user.setLocale(locale);//  w w w .  j a v a  2  s.  c om

    addApplicationTitle();

    VerticalLayout view = new VerticalLayout();
    setContent(view);

    view.setStyleName(ApplicationTheme.VIEW);
    view.setWidth("100%");
    view.setHeight("100%");
    view.setSpacing(false);
    view.setMargin(false);

    createWelcomebar(view);

    Header header = CDIComponent.getInstance(Header.class);
    view.addComponent(header);
    header.addDefaultTab();
}

From source file:com.jain.common.authenticate.LoginAction.java

License:Apache License

@JNIComponentInit
public void init() {
    setModal(true);//from   w  ww.  j  a v  a 2 s .com
    setWidth("30%");

    VerticalLayout layout = new VerticalLayout();
    setContent(layout);

    layout.setWidth("100%");
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setStyleName(ApplicationTheme.ALTERNATE_VIEW);

    createFieldGroup(layout);

    createActions(layout);
}

From source file:com.jain.common.authenticate.LoginAction.java

License:Apache License

private void createFieldGroup(VerticalLayout layout) {
    I18NProvider provider = DefaultI18NResourceProvider.instance();

    userName = new TextField("user.name");
    userName.setCursorPosition(0);/*from   ww w  .  ja  va2s .  c  o  m*/
    userName.setRequired(true);
    userName.setRequiredError(provider.getMessage(getLocale(), "common.something.required", "user.name.title",
            JAction.LOGIN.getDisplayName()));
    userName.setDescription("user.name");
    userName.setSizeFull();
    userName.setStyleName(JNStyleConstants.J_FIELD);

    password = new PasswordField("password");
    password.setRequired(true);
    password.setRequiredError(provider.getMessage(getLocale(), "common.something.required", "password.title",
            JAction.LOGIN.getDisplayName()));
    password.setDescription("password");
    password.setSizeFull();
    password.setStyleName(JNStyleConstants.J_FIELD);

    VerticalLayout verticalLayout = new VerticalLayout();
    verticalLayout.setStyleName(ApplicationTheme.VIEW);
    verticalLayout.setSpacing(true);
    verticalLayout.setMargin(true);
    verticalLayout.setWidth("100%");

    FormLayout formLayout = new FormLayout();
    formLayout.setStyleName(ApplicationTheme.ALTERNATE_VIEW);
    formLayout.setSpacing(true);
    formLayout.setMargin(true);
    formLayout.setWidth("100%");
    formLayout.addComponent(userName);
    formLayout.addComponent(password);

    verticalLayout.addComponent(formLayout);

    layout.addComponent(verticalLayout);
}

From source file:com.jain.i18N.definition.PersonDefinitionForm.java

License:Apache License

@JNIComponentInit
public void init() {
    setModal(true);/*from   w w w.j a  v  a2  s .com*/
    setWidth("70%");

    VerticalLayout layout = new VerticalLayout();
    layout.setWidth("100%");
    layout.setMargin(new MarginInfo(false, false, true, false));
    layout.setStyleName(ApplicationTheme.ALTERNATE_VIEW);

    setContent(layout);
    createFieldGroup(layout);

    createActions(layout);
}

From source file:com.jiangyifen.ec2.ui.csr.toolbar.CsrPhone2PhoneSettingWindow.java

public CsrPhone2PhoneSettingWindow() {
    this.setWidth("413px");
    this.setHeight("220px");
    this.setResizable(false);

    VerticalLayout mainLayout = new VerticalLayout();
    mainLayout.setWidth("100%");
    mainLayout.setSpacing(true);//w  ww.  jav a2s  .  c om
    mainLayout.setMargin(true);
    this.setContent(mainLayout);

    domain = SpringContextHolder.getDomain();
    loginUser = SpringContextHolder.getLoginUser();
    phone2PhoneSettingService = SpringContextHolder.getBean("phone2PhoneSettingService");

    notification = new Notification("");
    notification.setDelayMsec(1000);
    notification.setHtmlContentAllowed(true);

    // ???????
    String notice = "<font color='red'><B>??????</B></font>";
    noticeLabel = new Label(notice, Label.CONTENT_XHTML);
    noticeLabel.setVisible(false);
    mainLayout.addComponent(noticeLabel);

    // ??? 
    this.customP2PSetting = initializeCustomP2PSetting();

    // ?
    createlStartSetting(mainLayout);

    // 
    createlDaysOfWeekType(mainLayout);

    // 
    createlDayOfWeek(mainLayout);

    // 
    createRunRedirectTime(mainLayout);

    // 
    createlRedirectType(mainLayout);

    // ?? 
    createNoanwserTimeout(mainLayout);

    // ?
    createOperatorButtons(mainLayout);
}

From source file:com.jiangyifen.ec2.ui.LoginLayout.java

/**
 * ??? (?, ?)/*from  w  w  w .  j  av a 2 s.  c  o m*/
 */
private void createConflictManageWindow() {
    conflictManageWindow = new Window("?");
    conflictManageWindow.setModal(true);
    conflictManageWindow.setResizable(false);

    VerticalLayout mainLayout = new VerticalLayout();
    mainLayout.setSpacing(true);
    mainLayout.setMargin(true);
    mainLayout.setSizeUndefined();
    mainLayout.setWidth("400px");
    conflictManageWindow.setContent(mainLayout);

    Label captionLabel = new Label("<font color='blue'><B>??</B></font>",
            Label.CONTENT_XHTML);
    captionLabel.setWidth("-1px");
    mainLayout.addComponent(captionLabel);

    conflictNotice = new RichTextArea();
    conflictNotice.setReadOnly(true);
    conflictNotice.setWriteThrough(false);
    conflictNotice.setWidth("-1px");
    mainLayout.addComponent(conflictNotice);

    String placeholder = "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp";
    Label noticeLabel = new Label(
            "<font color='red'><B>" + placeholder
                    + "?</B></font>",
            Label.CONTENT_XHTML);
    noticeLabel.setWidth("-1px");
    mainLayout.addComponent(noticeLabel);

    Label confirmLabel = new Label("<B>" + placeholder + "??</B>",
            Label.CONTENT_XHTML);
    confirmLabel.setWidth("-1px");
    mainLayout.addComponent(confirmLabel);

    // ???
    HorizontalLayout operatorHLayout = new HorizontalLayout();
    operatorHLayout.setSpacing(true);
    mainLayout.addComponent(operatorHLayout);

    confirm = new Button("", this);
    confirm.setImmediate(true);
    cancel = new Button("?", this);
    cancel.setStyleName("default");
    cancel.setImmediate(true);
    operatorHLayout.addComponent(confirm);
    operatorHLayout.addComponent(cancel);
}