Example usage for com.vaadin.ui HorizontalLayout setComponentAlignment

List of usage examples for com.vaadin.ui HorizontalLayout setComponentAlignment

Introduction

In this page you can find the example usage for com.vaadin.ui HorizontalLayout setComponentAlignment.

Prototype

@Override
    public void setComponentAlignment(Component childComponent, Alignment alignment) 

Source Link

Usage

From source file:com.hris.payroll.alphalist.AlphaListMainUI.java

public AlphaListMainUI(int branchId) {
    this.branchId = branchId;

    setSizeFull();//w w  w . j  a v a2s. c  om
    setMargin(new MarginInfo(true, true, false, true));
    setSpacing(true);

    HorizontalLayout h1 = new HorizontalLayout();
    h1.setCaption("Year: ");
    h1.setWidthUndefined();
    h1.setSpacing(true);

    h1.addComponent(employmentStatus);
    h1.addComponent(selectYear());
    h1.addComponent(alphaListButton());
    h1.addComponent(exportToExcelButton());

    addComponent(h1);

    HorizontalLayout h2 = new HorizontalLayout();
    h2.setWidthUndefined();
    h2.setSpacing(true);

    progress.setWidth("410px");
    h2.addComponent(progress);
    h2.setComponentAlignment(progress, Alignment.MIDDLE_LEFT);

    status.setValue("0%");
    h2.addComponent(status);

    processLabel.setValue("");
    h2.addComponent(processLabel);

    addComponent(h2);
    addComponent(grid);
    setExpandRatio(grid, 3);
}

From source file:com.hris.payroll.thirteenthmonth.ThirteenthMonth.java

public ThirteenthMonth(int branchId) {
    this.branchId = branchId;

    setSizeFull();/*w  w w .  j av  a  2s .c  o  m*/
    setMargin(new MarginInfo(true, true, false, true));
    setSpacing(true);

    HorizontalLayout h1 = new HorizontalLayout();
    h1.setWidthUndefined();
    h1.setSpacing(true);

    h1.addComponent(employmentStatus);
    h1.addComponent(selectYear());
    h1.addComponent(generate13thMonth());
    h1.addComponent(exportToExcelButton());

    addComponent(h1);

    HorizontalLayout h2 = new HorizontalLayout();
    h2.setWidthUndefined();
    h2.setSpacing(true);

    progress.setWidth("410px");
    h2.addComponent(progress);
    h2.setComponentAlignment(progress, Alignment.MIDDLE_LEFT);

    status.setValue("0%");
    h2.addComponent(status);

    grid = new ThirteenthMonthDataGridProperty();
    addComponent(h2);
    addComponent(grid);
    setExpandRatio(grid, 3);
}

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

License:Apache License

/**
 * //w w w  .  ja va2 s.  c  o m
 * @param confirm
 * @param layout
 */
private void findNAddIcon(JNConfirm confirm, HorizontalLayout layout) {
    if (StringHelper.isNotEmptyWithTrim(confirm.icon())) {
        String iconPath = PropertyReader.instance().getProperty(confirm.icon());

        if (StringHelper.isNotEmptyWithTrim(iconPath)) {
            Label label = new Label();
            ThemeResource icon = new ThemeResource(iconPath);
            label.setIcon(icon);
            layout.addComponent(label);
            layout.setComponentAlignment(label, Alignment.MIDDLE_CENTER);
        }
    }
}

From source file:com.jiangyifen.ec2.ui.mgr.outlinemanage.AddOutline.java

/**
 * Form ?//w ww.j  a v a 2s . co  m
 * @return HorizontalLayout ?
 */
private HorizontalLayout creatFormFooterComponents() {
    HorizontalLayout buttonsLayout = new HorizontalLayout();
    buttonsLayout.setSpacing(true);
    buttonsLayout.setWidth("100%");

    // ?
    save = new Button("?", this);
    save.setStyleName("default");
    buttonsLayout.addComponent(save);

    // ?
    cancel = new Button("?", this);
    buttonsLayout.addComponent(cancel);

    // ??
    Label settingTypeLabel = new Label("??");
    settingTypeLabel.setWidth("-1px");
    buttonsLayout.addComponent(settingTypeLabel);
    buttonsLayout.setComponentAlignment(settingTypeLabel, Alignment.MIDDLE_CENTER);

    // ??
    settingType = new OptionGroup();
    settingType.addItem("typical");
    settingType.addItem("advanced");
    settingType.select("typical");
    settingType.setItemCaption("typical", "?");
    settingType.setItemCaption("advanced", "");
    settingType.setImmediate(true);
    settingType.setStyleName("twocol100");
    settingType.addListener((ValueChangeListener) this);
    buttonsLayout.addComponent(settingType);
    buttonsLayout.setComponentAlignment(settingType, Alignment.MIDDLE_CENTER);

    return buttonsLayout;
}

From source file:com.jiangyifen.ec2.ui.mgr.system.tabsheet.DynQueueMemberManagement.java

/** 
 * ?(?????)//from  w w w. j  a  va2  s .c  o  m
 * @return HorizontalLayout
 */
private HorizontalLayout createCenterHLayout() {
    HorizontalLayout centerHLayout = new HorizontalLayout();
    centerHLayout.setSpacing(true);
    centerHLayout.setWidth("100%");

    // ?(??)
    VerticalLayout leftComponents = createLeftComponents();
    centerHLayout.addComponent(leftComponents);
    centerHLayout.setExpandRatio(leftComponents, 0.4f);

    // ??("?")
    VerticalLayout middleComponents = createMiddleComponents();
    centerHLayout.addComponent(middleComponents);
    centerHLayout.setComponentAlignment(middleComponents, Alignment.MIDDLE_CENTER);
    centerHLayout.setExpandRatio(middleComponents, 0.2f);

    // ??(????)
    VerticalLayout rightComponents = createRightComponents();
    centerHLayout.addComponent(rightComponents);
    centerHLayout.setExpandRatio(rightComponents, 0.4f);

    return centerHLayout;
}

From source file:com.jiangyifen.ec2.ui.mgr.system.tabsheet.DynQueueMemberManagement.java

/**
 *  ?(??)/*  w w w  .ja va 2 s  .c  om*/
 * @return
 */

private VerticalLayout createLeftComponents() {
    VerticalLayout leftVLayout = new VerticalLayout();
    leftVLayout.setSpacing(true);
    leftVLayout.setWidth("100%");

    // ?
    HorizontalLayout searchHLayout = new HorizontalLayout();
    searchHLayout.setSpacing(true);
    leftVLayout.addComponent(searchHLayout);

    Label caption = new Label("");
    caption.setWidth("-1px");
    searchHLayout.addComponent(caption);
    searchHLayout.setComponentAlignment(caption, Alignment.MIDDLE_CENTER);

    leftKeyword = new TextField();
    leftKeyword.setImmediate(true);
    leftKeyword.setInputPrompt("?");
    leftKeyword.setDescription("??????????");
    leftKeyword.setStyleName("search");
    leftKeyword.addListener(this);
    searchHLayout.addComponent(leftKeyword);
    searchHLayout.setComponentAlignment(leftKeyword, Alignment.MIDDLE_CENTER);

    leftSearch = new Button("?", this);
    leftSearch.setImmediate(true);
    searchHLayout.addComponent(leftSearch);
    searchHLayout.setComponentAlignment(leftSearch, Alignment.MIDDLE_CENTER);

    // 
    // 
    leftTable = new Table("??");
    leftTable.setStyleName("striped");
    leftTable.setSelectable(true);
    leftTable.setMultiSelect(true);
    leftTable.setWidth("100%");
    leftTable.setRowHeaderMode(Table.ROW_HEADER_MODE_INDEX);
    leftVLayout.addComponent(leftTable);

    leftTableContainer = new BeanItemContainer<User>(User.class);
    leftTableContainer.addNestedContainerProperty("department.name");
    leftTable.setContainerDataSource(leftTableContainer);
    leftTable.setPageLength(20);
    leftTable.setVisibleColumns(VISIBLE_PROPERTIES);
    leftTable.setColumnHeaders(COL_HEADERS);

    return leftVLayout;
}

From source file:com.jiangyifen.ec2.ui.mgr.system.tabsheet.DynQueueMemberManagement.java

/**
 * ??(????)//w w  w . j  a v  a  2 s .  c o m
 * return 
 */
private VerticalLayout createRightComponents() {
    VerticalLayout rightVLayout = new VerticalLayout();
    rightVLayout.setSpacing(true);
    rightVLayout.setWidth("100%");

    // ?
    HorizontalLayout searchHLayout = new HorizontalLayout();
    searchHLayout.setSpacing(true);
    rightVLayout.addComponent(searchHLayout);

    Label caption = new Label("");
    caption.setWidth("-1px");
    searchHLayout.addComponent(caption);
    searchHLayout.setComponentAlignment(caption, Alignment.MIDDLE_CENTER);

    rightKeyword = new TextField();
    rightKeyword.setImmediate(true);
    rightKeyword.setInputPrompt("?");
    rightKeyword.setDescription("??????????");
    rightKeyword.setStyleName("search");
    rightKeyword.addListener(this);
    searchHLayout.addComponent(rightKeyword);
    searchHLayout.setComponentAlignment(rightKeyword, Alignment.MIDDLE_CENTER);

    rightSearch = new Button("?", this);
    rightSearch.setImmediate(true);
    searchHLayout.addComponent(rightSearch);
    searchHLayout.setComponentAlignment(rightSearch, Alignment.MIDDLE_CENTER);

    // 
    // 
    rightTable = new Table("?");
    rightTable.setStyleName("striped");
    rightTable.setSelectable(true);
    rightTable.setMultiSelect(true);
    rightTable.setWidth("100%");
    rightTable.setPageLength(16);
    rightTable.setRowHeaderMode(Table.ROW_HEADER_MODE_INDEX);
    rightVLayout.addComponent(rightTable);

    rightTableContainer = new BeanItemContainer<User>(User.class);
    rightTableContainer.addNestedContainerProperty("department.name");
    rightTable.setContainerDataSource(rightTableContainer);
    rightTable.setVisibleColumns(VISIBLE_PROPERTIES);
    rightTable.setColumnHeaders(COL_HEADERS);
    rightTable.addGeneratedColumn("priority", new PriorityColumnGenerate());
    rightTable.setColumnHeader("priority", "");

    return rightVLayout;
}

From source file:com.jiangyifen.ec2.ui.mgr.system.tabsheet.DynQueueMemberManagement.java

/**
 * ?(???)/*from w w w. j a v  a2 s .  c  o m*/
 */
private void createBottomComponents() {
    HorizontalLayout bottomHLayout = new HorizontalLayout();
    bottomHLayout.setSpacing(true);
    bottomHLayout.setWidth("100%");
    this.addComponent(bottomHLayout);

    // 
    HorizontalLayout bottomLeft = new HorizontalLayout();
    bottomLeft.setSpacing(true);
    bottomLeft.setWidth("-1px");
    bottomHLayout.addComponent(bottomLeft);
    bottomHLayout.setComponentAlignment(bottomLeft, Alignment.MIDDLE_LEFT);

    // ?
    save = new Button("? ", this);
    save.setStyleName("default");
    bottomLeft.addComponent(save);
    bottomLeft.setComponentAlignment(save, Alignment.MIDDLE_LEFT);

    // ?
    cancel = new Button("? ", this);
    bottomLeft.addComponent(cancel);
    bottomLeft.setComponentAlignment(cancel, Alignment.MIDDLE_LEFT);

    // ?
    HorizontalLayout bottomRight = new HorizontalLayout();
    bottomRight.setSpacing(true);
    bottomRight.setWidth("-1px");
    bottomHLayout.addComponent(bottomRight);
    bottomHLayout.setComponentAlignment(bottomRight, Alignment.MIDDLE_RIGHT);

    Label priorityCaption = new Label("<B>?</B>", Label.CONTENT_XHTML);
    priorityCaption.setWidth("-1px");
    bottomRight.addComponent(priorityCaption);
    bottomRight.setComponentAlignment(priorityCaption, Alignment.MIDDLE_RIGHT);

    priorityField = new TextField();
    priorityField.addListener(this);
    priorityField.setWidth("100px");
    priorityField.setImmediate(true);
    priorityField.setWriteThrough(false);
    bottomRight.addComponent(priorityField);
    bottomRight.setComponentAlignment(priorityField, Alignment.MIDDLE_RIGHT);

    // ?????
    setButtonsEnable(false);
}

From source file:com.jiangyifen.ec2.ui.mgr.system.tabsheet.MgrPhone2PhoneSettingView.java

/**
 *  ????//from w w w.jav  a  2 s  .c o m
 * @param panelContent
 */
private void createCsrSelectTables(VerticalLayout panelContent) {
    csrSelectHLayout = new HorizontalLayout();
    csrSelectHLayout.setSpacing(true);
    csrSelectHLayout.setVisible(false);
    csrSelectHLayout.setWidth("100%");
    panelContent.addComponent(csrSelectHLayout);

    Label caption = new Label("");
    caption.setWidth("-1px");
    caption.setDescription("<B>??</B>");
    csrSelectHLayout.addComponent(caption);

    // ???
    HorizontalLayout panelLayout = new HorizontalLayout();
    panelLayout.setSpacing(true);
    panelLayout.setMargin(false, true, false, true);
    panelLayout.setWidth("100%");

    Panel tablePanel = new Panel();
    tablePanel.setContent(panelLayout);
    csrSelectHLayout.addComponent(tablePanel);
    csrSelectHLayout.setExpandRatio(tablePanel, 1.0f);

    // (??)
    VerticalLayout leftComponents = createLeftComponents();
    panelLayout.addComponent(leftComponents);
    panelLayout.setExpandRatio(leftComponents, 0.4f);

    // ??("?")
    VerticalLayout middleComponents = createMiddleComponents();
    panelLayout.addComponent(middleComponents);
    panelLayout.setComponentAlignment(middleComponents, Alignment.MIDDLE_CENTER);
    panelLayout.setExpandRatio(middleComponents, 0.2f);

    // ?(????)
    VerticalLayout rightComponents = createRightComponents();
    panelLayout.addComponent(rightComponents);
    panelLayout.setExpandRatio(rightComponents, 0.4f);
}

From source file:com.jiangyifen.ec2.ui.mgr.system.tabsheet.MgrPhone2PhoneSettingView.java

/**
 *  ?(??)//  ww  w . j  a va 2  s. c o  m
 * @return
 */

private VerticalLayout createLeftComponents() {
    VerticalLayout leftVLayout = new VerticalLayout();
    leftVLayout.setSpacing(true);
    leftVLayout.setWidth("100%");

    // ?
    HorizontalLayout searchHLayout = new HorizontalLayout();
    searchHLayout.setSpacing(true);
    leftVLayout.addComponent(searchHLayout);

    Label caption = new Label("");
    caption.setWidth("-1px");
    searchHLayout.addComponent(caption);
    searchHLayout.setComponentAlignment(caption, Alignment.MIDDLE_CENTER);

    leftKeyword = new TextField();
    leftKeyword.setImmediate(true);
    leftKeyword.setInputPrompt("?");
    leftKeyword.setDescription("?????????????");
    leftKeyword.setStyleName("search");
    leftKeyword.addListener(this);
    leftKeyword.setEnabled(false);
    searchHLayout.addComponent(leftKeyword);
    searchHLayout.setComponentAlignment(leftKeyword, Alignment.MIDDLE_CENTER);

    leftSearch = new Button("?", this);
    leftSearch.setImmediate(true);
    leftSearch.setEnabled(false);
    searchHLayout.addComponent(leftSearch);
    searchHLayout.setComponentAlignment(leftSearch, Alignment.MIDDLE_CENTER);

    // 
    leftTable = new Table("?");
    leftTable.addStyleName("striped");
    leftTable.addStyleName("mydisabled");
    leftTable.setSelectable(true);
    leftTable.setMultiSelect(true);
    leftTable.setWidth("100%");
    leftTable.setRowHeaderMode(Table.ROW_HEADER_MODE_INDEX);
    leftVLayout.addComponent(leftTable);

    leftTableContainer = new BeanItemContainer<User>(User.class);
    leftTableContainer.addNestedContainerProperty("department.name");
    leftTable.setContainerDataSource(leftTableContainer);
    leftTable.setPageLength(10);
    leftTable.setVisibleColumns(VISIBLE_PROPERTIES);
    leftTable.setColumnHeaders(COL_HEADERS);

    return leftVLayout;
}