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.haulmont.cuba.web.LoginWindow.java

License:Apache License

protected void initStandartUI(int formWidth, int formHeight, int fieldWidth, boolean localesSelectVisible) {
    setStyleName("cuba-login-main-layout");

    VerticalLayout centerLayout = createCenterLayout(formWidth, formHeight, fieldWidth, localesSelectVisible);

    addComponent(centerLayout);/*from w w  w  .jav  a 2  s. co m*/
    setSizeFull();
    setComponentAlignment(centerLayout, Alignment.MIDDLE_CENTER);

    initFields();
    loginField.focus();
}

From source file:com.haulmont.cuba.web.LoginWindow.java

License:Apache License

protected VerticalLayout createCenterLayout(int formWidth, int formHeight, int fieldWidth,
        boolean localesSelectVisible) {
    VerticalLayout centerLayout = new VerticalLayout();
    centerLayout.setStyleName("cuba-login-bottom");
    centerLayout.setWidth(formWidth + "px");
    centerLayout.setHeight(formHeight + "px");

    HorizontalLayout titleLayout = createTitleLayout();
    centerLayout.addComponent(titleLayout);
    centerLayout.setComponentAlignment(titleLayout, Alignment.MIDDLE_CENTER);

    FormLayout loginFormLayout = createLoginFormLayout(fieldWidth, localesSelectVisible);
    centerLayout.addComponent(loginFormLayout);
    centerLayout.setComponentAlignment(loginFormLayout, Alignment.MIDDLE_CENTER);
    return centerLayout;
}

From source file:com.haulmont.cuba.web.LoginWindow.java

License:Apache License

protected FormLayout createLoginFormLayout(int fieldWidth, boolean localesSelectVisible) {
    FormLayout loginFormLayout = new FormLayout();
    loginFormLayout.setStyleName("cuba-login-form");
    loginFormLayout.setSpacing(true);// w  ww  .j  a  v a 2 s .com
    loginFormLayout.setSizeUndefined();

    loginField.setCaption(messages.getMainMessage("loginWindow.loginField", resolvedLocale));
    loginFormLayout.addComponent(loginField);
    loginField.setWidth(fieldWidth + "px");
    loginField.setStyleName("username-field");
    loginFormLayout.setComponentAlignment(loginField, Alignment.MIDDLE_CENTER);

    passwordField.setCaption(messages.getMainMessage("loginWindow.passwordField", resolvedLocale));
    passwordField.setWidth(fieldWidth + "px");
    passwordField.setAutocomplete(true);
    passwordField.setStyleName("password-field");
    loginFormLayout.addComponent(passwordField);
    loginFormLayout.setComponentAlignment(passwordField, Alignment.MIDDLE_CENTER);

    if (localesSelectVisible) {
        localesSelect.setCaption(messages.getMainMessage("loginWindow.localesSelect", resolvedLocale));
        localesSelect.setWidth(fieldWidth + "px");
        localesSelect.setNullSelectionAllowed(false);
        loginFormLayout.addComponent(localesSelect);
        loginFormLayout.setComponentAlignment(localesSelect, Alignment.MIDDLE_CENTER);
    }

    if (rememberMeAllowed) {
        rememberMeCheckBox.setCaption(messages.getMainMessage("loginWindow.rememberMe", resolvedLocale));
        rememberMeCheckBox.setStyleName("remember-me");
        loginFormLayout.addComponent(rememberMeCheckBox);
        loginFormLayout.setComponentAlignment(rememberMeCheckBox, Alignment.MIDDLE_CENTER);
    }

    okButton.setCaption(messages.getMainMessage("loginWindow.okButton", resolvedLocale));
    okButton.addClickListener(submitListener);
    okButton.setStyleName("cuba-login-submit");
    okButton.setIcon(WebComponentsHelper.getIcon("app/images/login-button.png"));

    loginFormLayout.addComponent(okButton);
    loginFormLayout.setComponentAlignment(okButton, Alignment.MIDDLE_CENTER);
    return loginFormLayout;
}

From source file:com.haulmont.cuba.web.toolkit.ui.CubaRowsCount.java

License:Apache License

protected AbstractOrderedLayout createContentLayout() {
    HorizontalLayout contentLayout = new HorizontalLayout();
    contentLayout.setStyleName("c-paging-wrap");
    contentLayout.setSpacing(true);// w w w .java 2  s.co m

    firstButton = new CubaButton();
    firstButton.setIcon(WebComponentsHelper.getIcon("icons/rows-count-first.png"));
    firstButton.setStyleName("c-paging-change-page");
    firstButton.addStyleName("c-paging-first");
    contentLayout.addComponent(firstButton);

    contentLayout.setComponentAlignment(firstButton, Alignment.MIDDLE_CENTER);

    prevButton = new CubaButton();
    prevButton.setIcon(WebComponentsHelper.getIcon("icons/rows-count-prev.png"));
    prevButton.setStyleName("c-paging-change-page");
    prevButton.addStyleName("c-paging-prev");
    contentLayout.addComponent(prevButton);
    contentLayout.setComponentAlignment(prevButton, Alignment.MIDDLE_CENTER);

    label = new Label();
    label.setWidthUndefined();
    label.setStyleName("c-paging-status");
    contentLayout.addComponent(label);
    contentLayout.setComponentAlignment(label, Alignment.MIDDLE_CENTER);

    countButton = new CubaButton("[?]");
    countButton.setWidthUndefined();
    countButton.setStyleName(BaseTheme.BUTTON_LINK);
    countButton.addStyleName("c-paging-count");
    countButton.setTabIndex(-1);
    contentLayout.addComponent(countButton);
    contentLayout.setComponentAlignment(countButton, Alignment.MIDDLE_CENTER);

    nextButton = new CubaButton();
    nextButton.setIcon(WebComponentsHelper.getIcon("icons/rows-count-next.png"));
    nextButton.setStyleName("c-paging-change-page");
    nextButton.addStyleName("c-paging-next");
    contentLayout.addComponent(nextButton);
    contentLayout.setComponentAlignment(nextButton, Alignment.MIDDLE_CENTER);

    lastButton = new CubaButton();
    lastButton.setIcon(WebComponentsHelper.getIcon("icons/rows-count-last.png"));
    lastButton.setStyleName("c-paging-change-page");
    lastButton.addStyleName("c-paging-last");
    contentLayout.addComponent(lastButton);
    contentLayout.setComponentAlignment(lastButton, Alignment.MIDDLE_CENTER);

    return contentLayout;
}

From source file:com.haulmont.cuba.web.widgets.addons.dragdroplayouts.drophandlers.DefaultGridLayoutDropHandler.java

License:Apache License

/**
 * Default constructor
 */
public DefaultGridLayoutDropHandler() {
    dropAlignment = Alignment.MIDDLE_CENTER;
}

From source file:com.haulmont.cuba.web.widgets.CubaRowsCount.java

License:Apache License

protected AbstractOrderedLayout createContentLayout() {
    HorizontalLayout contentLayout = new HorizontalLayout(); // vaadin8 use CssLayout instead
    contentLayout.setStyleName("c-paging-wrap");
    contentLayout.setSpacing(true);//from   w w  w . jav a 2s . c o  m
    contentLayout.setMargin(false);

    firstButton = new CubaButton();
    firstButton.setStyleName("c-paging-change-page");
    firstButton.addStyleName("c-paging-first");
    contentLayout.addComponent(firstButton);

    contentLayout.setComponentAlignment(firstButton, Alignment.MIDDLE_CENTER);

    prevButton = new CubaButton();
    prevButton.setStyleName("c-paging-change-page");
    prevButton.addStyleName("c-paging-prev");
    contentLayout.addComponent(prevButton);
    contentLayout.setComponentAlignment(prevButton, Alignment.MIDDLE_CENTER);

    label = new Label();
    label.setWidthUndefined();
    label.setStyleName("c-paging-status");
    contentLayout.addComponent(label);
    contentLayout.setComponentAlignment(label, Alignment.MIDDLE_CENTER);

    countButton = new CubaButton("[?]");
    countButton.setWidthUndefined();
    countButton.setStyleName(ValoTheme.BUTTON_LINK);
    countButton.addStyleName("c-paging-count");
    countButton.setTabIndex(-1);
    contentLayout.addComponent(countButton);
    contentLayout.setComponentAlignment(countButton, Alignment.MIDDLE_CENTER);

    nextButton = new CubaButton();
    nextButton.setStyleName("c-paging-change-page");
    nextButton.addStyleName("c-paging-next");
    contentLayout.addComponent(nextButton);
    contentLayout.setComponentAlignment(nextButton, Alignment.MIDDLE_CENTER);

    lastButton = new CubaButton();
    lastButton.setStyleName("c-paging-change-page");
    lastButton.addStyleName("c-paging-last");
    contentLayout.addComponent(lastButton);
    contentLayout.setComponentAlignment(lastButton, Alignment.MIDDLE_CENTER);

    return contentLayout;
}

From source file:com.hivesys.dashboard.view.repository.RepositoryUpload.java

public RepositoryUpload()

{
    final Label infoLabel = new Label("asasasasasasasxasx");

    final VerticalLayout dropPane = new VerticalLayout(infoLabel);

    dropPane.setComponentAlignment(infoLabel, Alignment.MIDDLE_CENTER);
    dropPane.setWidth(280.0f, Unit.PIXELS);
    dropPane.setHeight(200.0f, Unit.PIXELS);
    dropPane.addStyleName("drop-area");

    progress = new ProgressBar();
    progress.setIndeterminate(true);/*from  ww w .  ja v a2 s  .  c o m*/
    progress.setVisible(false);
    dropPane.addComponent(progress);

    final DragAndDropBox dropBox = new DragAndDropBox(dropPane, progress) {

        @Override
        void processFile(String name, String type, ByteArrayOutputStream bas) {
            throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
        }
    };
    dropBox.setSizeUndefined();
}

From source file:com.hybridbpm.ui.component.chart.color.ChartColorLayout.java

License:Apache License

public ChartColorLayout(BeanFieldGroup<DiagrammePreference> preferences) {
    super(preferences);

    colorTable.setSizeFull();/*from   ww  w.  j a  v  a2 s  . co  m*/
    colorTable.addStyleName("compact");
    colorTable.addStyleName("small");
    colorTable.addStyleName("color-table");

    setSpacing(true);
    addComponent(colorTable);

    colorTable.setWidth("100%");
    colorTable.setEditable(false);

    colorTable.addContainerProperty(Translate.getMessage("identity"), String.class, null);
    colorTable.addContainerProperty(Translate.getMessage("colour"), ColorPicker.class, null);
    colorTable.setColumnWidth(Translate.getMessage("colour"), 58);

    colorTable.setSortEnabled(false);
    colorTable.setPageLength(9);

    // TODO dataset descriptor seems to be redundant
    String header = Translate.getMessage("identity");
    String dataSetDescriptor = getPreferenceValue(DiagrammePreference.DATASET_DESCRIPTOR, preferences);
    if (dataSetDescriptor != null) {
        header = dataSetDescriptor.substring(0, dataSetDescriptor.indexOf("(java"));
    }

    colorTable.setColumnHeaders(header, Translate.getMessage("colour"));

    fillTable();

    setComponentAlignment(colorTable, Alignment.MIDDLE_CENTER);
}

From source file:com.hybridbpm.ui.component.chart.configuration.LookAndFeelLayout.java

License:Apache License

public LookAndFeelLayout(BeanFieldGroup<DiagrammePreference> preferences) {
    super(preferences);
    addComponent(splitLayout);//from w  ww  .jav a 2s  .  c om

    chartSplit.addComponent(chartContainer);
    chartSplit.addComponent(btnPreview);

    btnPreview.setIcon(FontAwesome.PLAY);
    chartSplit.setComponentAlignment(chartContainer, Alignment.MIDDLE_CENTER);
    chartSplit.setExpandRatio(chartContainer, 1f);

    chartSplit.setSizeFull();
    colourContainer.setSizeFull();

    splitLayout.setSizeFull();
    splitLayout.addComponent(chartSplit);
    splitLayout.setSplitPosition(70f);
    splitLayout.addComponent(colourContainer);

    bindHandlers();
}

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

License:Apache License

private void addRowButton(int col, int row) {
    if (HybridbpmUI.getDeveloperMode()) {
        AddRowButton addRowButton = new AddRowButton(this);
        addComponent(addRowButton, col, row, col, row);
        setComponentAlignment(addRowButton, Alignment.MIDDLE_CENTER);
    }//w ww  .j  a v a  2 s  .co m
}