Example usage for com.vaadin.ui Alignment MIDDLE_CENTER

List of usage examples for com.vaadin.ui Alignment MIDDLE_CENTER

Introduction

In this page you can find the example usage for com.vaadin.ui Alignment MIDDLE_CENTER.

Prototype

Alignment MIDDLE_CENTER

To view the source code for com.vaadin.ui Alignment MIDDLE_CENTER.

Click Source Link

Usage

From source file:com.hybridbpm.ui.component.dashboard.tab.GridLayoutContainer.java

License:Apache License

private void addColumnButton(int col, int row) {
    if (HybridbpmUI.getDeveloperMode()) {
        AddColumnButton addColumnButton = new AddColumnButton(this);
        addComponent(addColumnButton, col, row, col, row);
        setComponentAlignment(addColumnButton, Alignment.MIDDLE_CENTER);
    }//from www .  j  av a 2s  .c om
}

From source file:com.hybridbpm.ui.component.dashboard.tab.HorizontalLayoutContainer.java

License:Apache License

private void addColumnButton(int index) {
    if (HybridbpmUI.getDeveloperMode()) {
        AddColumnButton addColumnButton = new AddColumnButton(this);
        addComponent(addColumnButton, index);
        setComponentAlignment(addColumnButton, Alignment.MIDDLE_CENTER);
    }/*from   ww  w . ja  va2 s.  c  o m*/
}

From source file:com.hybridbpm.ui.component.dashboard.tab.VerticalLayoutContainer.java

License:Apache License

private void addRowButton(int index) {
    if (HybridbpmUI.getDeveloperMode()) {
        AddRowButton addRowButton = new AddRowButton(this);
        addComponent(addRowButton, index);
        setComponentAlignment(addRowButton, Alignment.MIDDLE_CENTER);
    }/*from  w w w  . j  av a 2s  .  c o  m*/
}

From source file:com.hybridbpm.ui.component.development.FieldForm.java

License:Apache License

public FieldForm(CLASS_LIST_TYPE classListType) {
    this.classListType = classListType;
    setContent(layout);//from  w  ww  .j av  a 2  s .  c om
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setWidth(100, Unit.PERCENTAGE);
    layout.setExpandRatio(elementsLayout, 1f);

    firstLayout.setSpacing(true);
    firstLayout.setWidth(100, Unit.PERCENTAGE);

    secondLayout.setSpacing(true);
    secondLayout.setWidth(100, Unit.PERCENTAGE);

    firstLayout.setExpandRatio(name, 1f);
    firstLayout.setExpandRatio(className, 1f);
    firstLayout.setExpandRatio(collection, 1f);
    firstLayout.setExpandRatio(editor, 1f);

    secondLayout.setExpandRatio(description, 1f);
    secondLayout.setExpandRatio(defaultValue, 1f);
    secondLayout.setVisible(false);

    buttonsLayout.setComponentAlignment(btnShowMore, Alignment.MIDDLE_CENTER);
    buttonsLayout.setComponentAlignment(btnRemove, Alignment.MIDDLE_CENTER);
    buttonsLayout.setComponentAlignment(btnUp, Alignment.MIDDLE_CENTER);
    buttonsLayout.setComponentAlignment(btnDown, Alignment.MIDDLE_CENTER);
    buttonsLayout.setHeight(100, Unit.PERCENTAGE);
    //        buttonsLayout.setSpacing(true);

    prepareComponents();
    fieldGroup.bind(name, "name");
    fieldGroup.bind(description, "description");
    fieldGroup.bind(defaultValue, "defaultValue");
    fieldGroup.bind(className, "className");
    fieldGroup.bind(collection, "collection");
    fieldGroup.bind(editor, "editor");
}

From source file:com.hybridbpm.ui.component.development.FileForm.java

License:Apache License

public FileForm() {
    setContent(layout);/*from ww w .j a  v a2 s .c  om*/
    layout.setMargin(true);
    layout.setSpacing(true);
    layout.setWidth(100, Unit.PERCENTAGE);
    layout.setExpandRatio(elementsLayout, 1f);

    elementsLayout.setWidth(100, Unit.PERCENTAGE);
    elementsLayout.setSpacing(true);
    elementsLayout.setComponentAlignment(multiple, Alignment.MIDDLE_CENTER);
    elementsLayout.setExpandRatio(name, 3f);
    elementsLayout.setExpandRatio(description, 3f);
    elementsLayout.setExpandRatio(multiple, 1f);
    description.setWidth(100, Unit.PERCENTAGE);
    name.setWidth(100, Unit.PERCENTAGE);

    buttonsLayout.setComponentAlignment(btnRemove, Alignment.MIDDLE_CENTER);
    buttonsLayout.setComponentAlignment(btnUp, Alignment.MIDDLE_CENTER);
    buttonsLayout.setComponentAlignment(btnDown, Alignment.MIDDLE_CENTER);
    buttonsLayout.setHeight(100, Unit.PERCENTAGE);
    //        buttonsLayout.setSpacing(true);

    prepareComponents();
    fieldGroup.bind(name, "name");
    fieldGroup.bind(description, "description");
    fieldGroup.bind(multiple, "multiple");
}

From source file:com.hybridbpm.ui.component.TableButtonBar.java

License:Apache License

public TableButtonBar(Component... children) {
    super(children);
    setSpacing(true);//from  ww  w.  j  a  va 2  s .  c o m
    setWidth(100, Unit.PERCENTAGE);
    for (int i = 0; i < children.length; i++) {
        setComponentAlignment(children[i], Alignment.MIDDLE_CENTER);
    }
}

From source file:com.hybridbpm.ui.view.LoginView.java

License:Apache License

public LoginView() {
    setSizeFull();//from ww  w .  j  av a 2  s .co m
    buildLoginForm();
    addComponent(loginPanel);
    setComponentAlignment(loginPanel, Alignment.MIDDLE_CENTER);
    CookieManager.getCookieValue(HybridbpmUI.COOKIENAME_USERNAME, (String value) -> {
        if (value != null && !value.isEmpty() && !value.equalsIgnoreCase("null")) {
            username.setValue(value);
        }
    });
}

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

License:Apache License

@JNIComponentInit
public void init() {
    setModal(true);//  ww w . java 2 s . c  o m
    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.action.confirm.ConfirmWindow.java

License:Apache License

/**
 * // w ww.j ava2 s.co  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.jain.addon.component.crud.JCrudWindow.java

License:Apache License

private void createActions(VerticalLayout layout) {
    if (!isViewOnly()) {
        ActionBar<JCrudWindow<T>> hLayout = new ActionBar<JCrudWindow<T>>(null, this);

        VerticalLayout vLayout = new VerticalLayout();
        vLayout.setSizeUndefined();//w  w  w.j  ava  2  s. c o  m
        vLayout.setStyleName(JNStyleConstants.J_VIEW);
        vLayout.addComponent(hLayout);

        layout.addComponent(vLayout);
        layout.setComponentAlignment(vLayout, Alignment.MIDDLE_CENTER);
        layout.setExpandRatio(vLayout, 1);
    }
}