Example usage for com.vaadin.ui Alignment TOP_LEFT

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

Introduction

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

Prototype

Alignment TOP_LEFT

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

Click Source Link

Usage

From source file:com.esofthead.mycollab.vaadin.web.ui.NotificationComponent.java

License:Open Source License

private Component buildComponentFromNotification(AbstractNotification item) {
    final MHorizontalLayout wrapper = new MHorizontalLayout();
    wrapper.setData(item);// w  ww . j a  v a 2 s.  c  om
    wrapper.setDefaultComponentAlignment(Alignment.TOP_LEFT);

    if (item instanceof NewUpdateAvailableNotification) {
        final NewUpdateAvailableNotification notification = (NewUpdateAvailableNotification) item;
        Span spanEl = new Span();
        spanEl.appendText(
                AppContext.getMessage(ShellI18nEnum.OPT_HAVING_NEW_VERSION, notification.getVersion()));
        Label lbl = new Label(FontAwesome.INFO_CIRCLE.getHtml() + " " + spanEl.write(), ContentMode.HTML);
        lbl.setWidth("100%");
        CssLayout lblWrapper = new CssLayout();
        lblWrapper.addComponent(lbl);
        wrapper.addComponent(lblWrapper);
        wrapper.expand(lblWrapper);
        if (AppContext.isAdmin()) {
            Button upgradeBtn = new Button(AppContext.getMessage(ShellI18nEnum.ACTION_UPGRADE),
                    new Button.ClickListener() {
                        @Override
                        public void buttonClick(Button.ClickEvent event) {
                            UI.getCurrent().addWindow(new UpgradeConfirmWindow(notification.getVersion(),
                                    notification.getManualDownloadLink(), notification.getInstallerFile()));
                            NotificationComponent.this.setPopupVisible(false);
                        }
                    });
            upgradeBtn.addStyleName(UIConstants.BUTTON_BLOCK);
            wrapper.addComponent(upgradeBtn);
        }
    } else if (item instanceof RequestUploadAvatarNotification) {
        wrapper.addComponent(new Label(FontAwesome.EXCLAMATION_TRIANGLE.getHtml() + " "
                + AppContext.getMessage(ShellI18nEnum.OPT_REQUEST_UPLOAD_AVATAR), ContentMode.HTML));
        Button uploadAvatarBtn = new Button(AppContext.getMessage(ShellI18nEnum.ACTION_UPLOAD_AVATAR),
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent event) {
                        EventBusFactory.getInstance()
                                .post(new ShellEvent.GotoUserAccountModule(this, new String[] { "preview" }));
                        NotificationComponent.this.setPopupVisible(false);
                    }
                });
        uploadAvatarBtn.setStyleName(UIConstants.BUTTON_BLOCK);
        wrapper.add(uploadAvatarBtn);
    } else if (item instanceof SmtpSetupNotification) {
        Button smtpBtn = new Button(AppContext.getMessage(GenericI18Enum.ACTION_SETUP),
                new Button.ClickListener() {
                    @Override
                    public void buttonClick(Button.ClickEvent clickEvent) {
                        EventBusFactory.getInstance()
                                .post(new ShellEvent.GotoUserAccountModule(this, new String[] { "setup" }));
                        NotificationComponent.this.setPopupVisible(false);
                    }
                });
        smtpBtn.setStyleName(UIConstants.BUTTON_BLOCK);
        Label lbl = new Label(FontAwesome.EXCLAMATION_TRIANGLE.getHtml() + " "
                + AppContext.getMessage(ShellI18nEnum.ERROR_NO_SMTP_SETTING), ContentMode.HTML);
        MCssLayout lblWrapper = new MCssLayout(lbl);
        wrapper.with(lblWrapper, smtpBtn).expand(lblWrapper);
    } else {
        LOG.error("Do not render notification " + item);
    }
    return wrapper;
}

From source file:com.esofthead.mycollab.vaadin.web.ui.SavedFilterComboBox.java

License:Open Source License

@Override
protected Component initContent() {
    componentsText = new TextField();
    componentsText.setNullRepresentation("");
    componentsText.setReadOnly(true);//from w w w. j av  a2  s  . c  o m
    componentsText.addStyleName("noBorderRight");
    componentsText.setWidth("100%");
    componentPopupSelection = new PopupButton();
    componentPopupSelection.addStyleName(UIConstants.MULTI_SELECT_BG);
    componentPopupSelection.setDirection(Alignment.TOP_LEFT);
    componentPopupSelection.addClickListener(new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(final Button.ClickEvent event) {
            SavedFilterComboBox.this.initContentPopup();
        }
    });

    popupContent = new OptionPopupContent();
    componentPopupSelection.setContent(popupContent);

    MHorizontalLayout content = new MHorizontalLayout().withSpacing(true).with(componentsText)
            .withAlign(componentsText, Alignment.MIDDLE_LEFT);

    MHorizontalLayout multiSelectComp = new MHorizontalLayout().withSpacing(false)
            .with(componentsText, componentPopupSelection).expand(componentsText);
    content.with(multiSelectComp);
    return content;
}

From source file:com.esspl.datagen.DataGenApplication.java

License:Open Source License

private void buildMainLayout() {
    log.debug("DataGenApplication - buildMainLayout() start");
    VerticalLayout rootLayout = new VerticalLayout();
    final Window root = new Window("DATA Gen", rootLayout);
    root.setStyleName("tData");

    setMainWindow(root);//from w  w  w  .ja v a2 s  .  c  o m

    rootLayout.setSizeFull();
    rootLayout.setMargin(false, true, false, true);

    // Top area, containing logo and header
    HorizontalLayout top = new HorizontalLayout();
    top.setWidth("100%");
    root.addComponent(top);

    // Create the placeholders for all the components in the top area
    HorizontalLayout header = new HorizontalLayout();

    // Add the components and align them properly
    top.addComponent(header);
    top.setComponentAlignment(header, Alignment.TOP_LEFT);

    top.setStyleName("top");
    top.setHeight("75px"); // Same as the background image height

    // header controls
    Embedded logo = new Embedded();
    logo.setSource(DataGenConstant.LOGO);
    logo.setWidth("100%");
    logo.setStyleName("logo");
    header.addComponent(logo);
    header.setSpacing(false);

    //Show which connection profile is connected
    connectedString = new Label("Connected to - Oracle");
    connectedString.setStyleName("connectedString");
    connectedString.setWidth("500px");
    connectedString.setVisible(false);
    top.addComponent(connectedString);

    //Toolbar
    toolbar = new ToolBar(this);
    top.addComponent(toolbar);
    top.setComponentAlignment(toolbar, Alignment.TOP_RIGHT);

    listing = new Table();
    listing.setHeight("240px");
    listing.setWidth("100%");
    listing.setStyleName("dataTable");
    listing.setImmediate(true);

    // turn on column reordering and collapsing
    listing.setColumnReorderingAllowed(true);
    listing.setColumnCollapsingAllowed(true);
    listing.setSortDisabled(true);

    // Add the table headers
    listing.addContainerProperty("Sl No.", Integer.class, null);
    listing.addContainerProperty("Column Name", TextField.class, null);
    listing.addContainerProperty("Data Type", Select.class, null);
    listing.addContainerProperty("Format", Select.class, null);
    listing.addContainerProperty("Examples", Label.class, null);
    listing.addContainerProperty("Additional Data", HorizontalLayout.class, null);
    listing.setColumnAlignments(new String[] { Table.ALIGN_CENTER, Table.ALIGN_CENTER, Table.ALIGN_CENTER,
            Table.ALIGN_CENTER, Table.ALIGN_CENTER, Table.ALIGN_CENTER });

    //From the starting create 5 rows
    addRow(5);

    //Add different style for IE browser
    WebApplicationContext context = ((WebApplicationContext) getMainWindow().getApplication().getContext());
    WebBrowser browser = context.getBrowser();

    //Create a TabSheet
    tabSheet = new TabSheet();
    tabSheet.setSizeFull();
    if (!browser.isIE()) {
        tabSheet.setStyleName("tabSheet");
    }

    //Generator Tab content start
    generator = new VerticalLayout();
    generator.setMargin(true, true, false, true);

    generateTypeHl = new HorizontalLayout();
    generateTypeHl.setMargin(false, false, false, true);
    generateTypeHl.setSpacing(true);
    List<String> generateTypeList = Arrays.asList(new String[] { "Sql", "Excel", "XML", "CSV" });
    generateType = new OptionGroup("Generation Type", generateTypeList);
    generateType.setNullSelectionAllowed(false); // user can not 'unselect'
    generateType.select("Sql"); // select this by default
    generateType.setImmediate(true); // send the change to the server at once
    generateType.addListener(this); // react when the user selects something
    generateTypeHl.addComponent(generateType);

    //SQL Options
    sqlPanel = new Panel("SQL Options");
    sqlPanel.setHeight("180px");
    if (browser.isIE()) {
        sqlPanel.setStyleName(Runo.PANEL_LIGHT + " sqlPanelIE");
    } else {
        sqlPanel.setStyleName(Runo.PANEL_LIGHT + " sqlPanel");
    }
    VerticalLayout vl1 = new VerticalLayout();
    vl1.setMargin(false);
    Label lb1 = new Label("DataBase");
    database = new Select();
    database.addItem("Oracle");
    database.addItem("Sql Server");
    database.addItem("My Sql");
    database.addItem("Postgress Sql");
    database.addItem("H2");
    database.select("Oracle");
    database.setWidth("160px");
    database.setNullSelectionAllowed(false);
    HorizontalLayout dbBar = new HorizontalLayout();
    dbBar.setMargin(false, false, false, false);
    dbBar.setSpacing(true);
    dbBar.addComponent(lb1);
    dbBar.addComponent(database);
    vl1.addComponent(dbBar);

    Label tblLabel = new Label("Table Name");
    tblName = new TextField();
    tblName.setWidth("145px");
    tblName.setStyleName("mandatory");
    HorizontalLayout tableBar = new HorizontalLayout();
    tableBar.setMargin(true, false, false, false);
    tableBar.setSpacing(true);
    tableBar.addComponent(tblLabel);
    tableBar.addComponent(tblName);
    vl1.addComponent(tableBar);

    createQuery = new CheckBox("Include CREATE TABLE query");
    createQuery.setValue(true);
    HorizontalLayout createBar = new HorizontalLayout();
    createBar.setMargin(true, false, false, false);
    createBar.addComponent(createQuery);
    vl1.addComponent(createBar);
    sqlPanel.addComponent(vl1);

    generateTypeHl.addComponent(sqlPanel);
    generator.addComponent(generateTypeHl);

    //CSV Option
    csvPanel = new Panel("CSV Options");
    csvPanel.setHeight("130px");
    if (browser.isIE()) {
        csvPanel.setStyleName(Runo.PANEL_LIGHT + " sqlPanelIE");
    } else {
        csvPanel.setStyleName(Runo.PANEL_LIGHT + " sqlPanel");
    }
    Label delimiter = new Label("Delimiter Character(s)");
    VerticalLayout vl2 = new VerticalLayout();
    vl2.setMargin(false);
    csvDelimiter = new TextField();
    HorizontalLayout csvBar = new HorizontalLayout();
    csvBar.setMargin(true, false, false, false);
    csvBar.setSpacing(true);
    csvBar.addComponent(delimiter);
    csvBar.addComponent(csvDelimiter);
    vl2.addComponent(csvBar);
    csvPanel.addComponent(vl2);

    //XML Options
    xmlPanel = new Panel("XML Options");
    xmlPanel.setHeight("160px");
    if (browser.isIE()) {
        xmlPanel.setStyleName(Runo.PANEL_LIGHT + " sqlPanelIE");
    } else {
        xmlPanel.setStyleName(Runo.PANEL_LIGHT + " sqlPanel");
    }

    VerticalLayout vl3 = new VerticalLayout();
    vl3.setMargin(false);
    Label lb4 = new Label("Root node name");
    rootNode = new TextField();
    rootNode.setWidth("125px");
    rootNode.setStyleName("mandatory");
    HorizontalLayout nodeBar = new HorizontalLayout();
    nodeBar.setMargin(true, false, false, false);
    nodeBar.setSpacing(true);
    nodeBar.addComponent(lb4);
    nodeBar.addComponent(rootNode);
    vl3.addComponent(nodeBar);

    Label lb5 = new Label("Record node name");
    recordNode = new TextField();
    recordNode.setWidth("112px");
    recordNode.setStyleName("mandatory");
    HorizontalLayout recordBar = new HorizontalLayout();
    recordBar.setMargin(true, false, false, false);
    recordBar.setSpacing(true);
    recordBar.addComponent(lb5);
    recordBar.addComponent(recordNode);
    vl3.addComponent(recordBar);
    xmlPanel.addComponent(vl3);

    HorizontalLayout noOfRowHl = new HorizontalLayout();
    noOfRowHl.setSpacing(true);
    noOfRowHl.setMargin(true, false, false, true);
    noOfRowHl.addComponent(new Label("Number of Results"));
    resultNum = new TextField();
    resultNum.setImmediate(true);
    resultNum.setNullSettingAllowed(false);
    resultNum.setStyleName("mandatory");
    resultNum.addValidator(new IntegerValidator("Number of Results must be an Integer"));
    resultNum.setWidth("5em");
    resultNum.setMaxLength(5);
    resultNum.setValue(50);
    noOfRowHl.addComponent(resultNum);
    generator.addComponent(noOfRowHl);

    HorizontalLayout addRowHl = new HorizontalLayout();
    addRowHl.setMargin(true, false, true, true);
    addRowHl.setSpacing(true);
    addRowHl.addComponent(new Label("Add"));
    rowNum = new TextField();
    rowNum.setImmediate(true);
    rowNum.setNullSettingAllowed(true);
    rowNum.addValidator(new IntegerValidator("Row number must be an Integer"));
    rowNum.setWidth("4em");
    rowNum.setMaxLength(2);
    rowNum.setValue(1);
    addRowHl.addComponent(rowNum);
    rowsBttn = new Button("Row(s)");
    rowsBttn.setIcon(DataGenConstant.ADD);
    rowsBttn.addListener(ClickEvent.class, this, "addRowButtonClick"); // react to clicks
    addRowHl.addComponent(rowsBttn);
    generator.addComponent(addRowHl);

    //Add the Grid
    generator.addComponent(listing);

    //Generate Button
    Button bttn = new Button("Generate");
    bttn.setDescription("Generate Gata");
    bttn.addListener(ClickEvent.class, this, "generateButtonClick"); // react to clicks
    bttn.setIcon(DataGenConstant.VIEW);
    bttn.setStyleName("generate");
    generator.addComponent(bttn);
    //Generator Tab content end

    //Executer Tab content start - new class created to separate execution logic
    executor = new ExecutorView(this);
    //Executer Tab content end

    //Explorer Tab content start - new class created to separate execution logic
    explorer = new ExplorerView(this, databaseSessionManager);
    //explorer.setMargin(true);
    //Explorer Tab content end

    //About Tab content start
    VerticalLayout about = new VerticalLayout();
    about.setMargin(true);
    Label aboutRichText = new Label(DataGenConstant.ABOUT_CONTENT);
    aboutRichText.setContentMode(Label.CONTENT_XHTML);
    about.addComponent(aboutRichText);
    //About Tab content end

    //Help Tab content start
    VerticalLayout help = new VerticalLayout();
    help.setMargin(true);
    Label helpText = new Label(DataGenConstant.HELP_CONTENT);
    helpText.setContentMode(Label.CONTENT_XHTML);
    help.addComponent(helpText);

    Embedded helpScreen = new Embedded();
    helpScreen.setSource(DataGenConstant.HELP_SCREEN);
    help.addComponent(helpScreen);

    Label helpStepsText = new Label(DataGenConstant.HELP_CONTENT_STEPS);
    helpStepsText.setContentMode(Label.CONTENT_XHTML);
    help.addComponent(helpStepsText);
    //Help Tab content end

    //Add the respective contents to the tab sheet
    tabSheet.addTab(generator, "Generator", DataGenConstant.HOME_ICON);
    executorTab = tabSheet.addTab(executor, "Executor", DataGenConstant.EXECUTOR_ICON);
    explorerTab = tabSheet.addTab(explorer, "Explorer", DataGenConstant.EXPLORER_ICON);
    tabSheet.addTab(about, "About", DataGenConstant.ABOUT_ICON);
    tabSheet.addTab(help, "Help", DataGenConstant.HELP_ICON);

    HorizontalLayout content = new HorizontalLayout();
    content.setSizeFull();
    content.addComponent(tabSheet);

    rootLayout.addComponent(content);
    rootLayout.setExpandRatio(content, 1);
    log.debug("DataGenApplication - buildMainLayout() end");
}

From source file:com.etest.view.tq.reports.ReportGeneratorUI.java

public ReportGeneratorUI() {
    setWidth("100%");
    setMargin(true);//from w  w  w.ja v a2s.  c o m
    setSpacing(true);

    Label lineSeparator1 = new Label();
    lineSeparator1.setContentMode(ContentMode.HTML);
    lineSeparator1.setStyleName("line-separator");

    Label lineSeparator2 = new Label();
    lineSeparator2.setContentMode(ContentMode.HTML);
    lineSeparator2.setStyleName("line-separator");

    Label lineSeparator3 = new Label();
    lineSeparator3.setContentMode(ContentMode.HTML);
    lineSeparator3.setStyleName("line-separator");

    searchSubject1.addValueChangeListener(dropDownChangeListener);
    searchSubject1.setEnabled(false);
    searchApproveTq1.setWidth("100%");
    searchApproveTq1.setInputPrompt("Search Approved TQ");
    searchApproveTq1.setEnabled(false);
    searchApproveTq1.addStyleName(ValoTheme.COMBOBOX_SMALL);

    searchSubject2.addValueChangeListener(dropDownChangeListener);
    searchSubject2.setEnabled(false);
    searchApproveTq2.setWidth("100%");
    searchApproveTq2.setInputPrompt("Search TQ Ticket No.");
    searchApproveTq2.setEnabled(false);
    searchApproveTq2.addStyleName(ValoTheme.COMBOBOX_SMALL);

    GridLayout g1 = new GridLayout(3, 1);
    g1.setWidth("70%");
    g1.setSpacing(true);

    VerticalLayout v1 = new VerticalLayout();
    v1.setWidth("5px");

    reportType1.addItem("Test Questionnaire");
    reportType1.setWidth("200px");
    reportType1.addValueChangeListener(optionChangeListener);
    reportType1.setImmediate(true);
    v1.addComponent(reportType1);
    v1.setExpandRatio(reportType1, 1);
    g1.addComponent(v1, 0, 0);
    g1.addComponent(searchSubject1, 1, 0);
    g1.addComponent(searchApproveTq1, 2, 0);

    addComponent(g1);

    addComponent(lineSeparator1);

    GridLayout g2 = new GridLayout(3, 1);
    g2.setWidth("70%");
    g2.setSpacing(true);

    VerticalLayout v2 = new VerticalLayout();
    v2.setWidth("5px");

    reportType2.addItem("Item Analysis");
    reportType2.setWidth("200px");
    reportType2.addValueChangeListener(optionChangeListener);
    reportType2.setImmediate(true);
    v2.addComponent(reportType2);
    v2.setExpandRatio(reportType2, 1);
    g2.addComponent(v2, 0, 0);
    g2.addComponent(searchSubject2, 1, 0);
    g2.addComponent(searchApproveTq2, 2, 0);

    addComponent(g2);

    addComponent(lineSeparator2);

    GridLayout g3 = new GridLayout(3, 1);
    g3.setWidth("70%");
    g3.setSpacing(true);

    VerticalLayout v3 = new VerticalLayout();
    v3.setWidth("5px");

    reportType3.addItem("Test Bank Inventory");
    reportType3.setWidth("200px");
    reportType3.addValueChangeListener(optionChangeListener);
    reportType3.setImmediate(true);

    VerticalLayout v = new VerticalLayout();
    v.setWidth("100%");
    v.setSpacing(true);

    testBankInventory.addItem("Summary: Case vs Items");
    testBankInventory.addItem("Summary: Items Group according to the Revised Blooms Taxonomy");
    testBankInventory.setImmediate(true);
    testBankInventory.select("Summary: Case vs Items");

    testBankInventory.setEnabled(false);
    v.addComponent(testBankInventory);

    v3.addComponent(reportType3);
    v3.setExpandRatio(reportType3, 1);
    g3.addComponent(v3, 0, 0);
    g3.setComponentAlignment(v3, Alignment.TOP_LEFT);
    g3.addComponent(v, 1, 0);
    addComponent(g3);

    //        addComponent(new Label("<HR>", ContentMode.HTML));
    addComponent(lineSeparator3);

    Button button = new Button("Calculate & Generate");
    button.addClickListener(reportBtnClickListener);
    button.setWidth("300px");

    addComponent(button);
    setComponentAlignment(button, Alignment.MIDDLE_LEFT);
}

From source file:com.expressui.core.view.form.layout.LeftLabelGridLayout.java

License:Open Source License

private void addFieldImpl(FormField formField) {
    Label label = formField.getFieldLabel();

    HorizontalLayout fieldLayout = new HorizontalLayout();
    String id = StringUtil.generateDebugId("e", this, fieldLayout, "fieldLayout");
    fieldLayout.setDebugId(id);//from   w ww .  j  a  v  a2 s.  c  om
    fieldLayout.setSizeUndefined();
    Field field = formField.getField();
    fieldLayout.addComponent(field);

    Label spacer = new Label();
    spacer.setWidth("1em");

    if (formField.getColumnEnd() != null && formField.getRowEnd() != null) {
        addComponent(label, getLabelColumn(formField), getRowStart(formField), getLabelColumn(formField),
                getRowEnd(formField));

        addComponent(fieldLayout, getFieldColumn(formField), getRowStart(formField), getColumnEnd(formField),
                getRowEnd(formField));

        addComponent(spacer, getSpacerColumn(formField), getRowStart(formField), getSpacerColumn(formField),
                getRowEnd(formField));
    } else {
        addComponent(label, getLabelColumn(formField), getRowStart(formField));

        addComponent(fieldLayout, getFieldColumn(formField), getRowStart(formField));

        addComponent(spacer, getSpacerColumn(formField), getRowStart(formField));
    }
    setComponentAlignment(fieldLayout, Alignment.TOP_LEFT);
    setComponentAlignment(label, Alignment.TOP_RIGHT);
    setComponentAlignment(spacer, Alignment.TOP_LEFT);
}

From source file:com.expressui.core.view.form.ResultsConnectedEntityForm.java

License:Open Source License

private HorizontalLayout createNavigationFormLayout() {
    HorizontalLayout navigationFormLayout = new HorizontalLayout();
    String id = StringUtil.generateDebugId("e", this, navigationFormLayout, "navigationFormLayout");
    navigationFormLayout.setDebugId(id);
    navigationFormLayout.setSizeUndefined();

    VerticalLayout previousButtonLayout = new VerticalLayout();
    id = StringUtil.generateDebugId("e", this, previousButtonLayout, "previousButtonLayout");
    previousButtonLayout.setDebugId(id);

    previousButtonLayout.setSizeUndefined();
    previousButtonLayout.setMargin(false);
    previousButtonLayout.setSpacing(false);
    Label spaceLabel = new Label("</br></br></br>", Label.CONTENT_XHTML);
    spaceLabel.setSizeUndefined();//from   w  w  w .  j  a v  a 2  s .co  m
    previousButtonLayout.addComponent(spaceLabel);

    Button previousButton = new Button(null, this, "previousItem");
    previousButton.setDescription(entityForm.uiMessageSource.getToolTip("entityForm.previous.toolTip"));
    previousButton.setSizeUndefined();
    previousButton.addStyleName("borderless");
    previousButton.setIcon(new ThemeResource("../expressui/icons/16/previous.png"));

    if (entityForm.getViewableToManyRelationships().size() == 0) {
        HorizontalLayout previousButtonHorizontalLayout = new HorizontalLayout();
        id = StringUtil.generateDebugId("e", this, previousButtonHorizontalLayout,
                "previousButtonHorizontalLayout");
        previousButtonHorizontalLayout.setDebugId(id);
        previousButtonHorizontalLayout.setSizeUndefined();
        Label horizontalSpaceLabel = new Label("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", Label.CONTENT_XHTML);
        horizontalSpaceLabel.setSizeUndefined();
        previousButtonHorizontalLayout.addComponent(previousButton);
        previousButtonHorizontalLayout.addComponent(horizontalSpaceLabel);
        previousButtonLayout.addComponent(previousButtonHorizontalLayout);
    } else {
        previousButtonLayout.addComponent(previousButton);
    }

    navigationFormLayout.addComponent(previousButtonLayout);
    navigationFormLayout.setComponentAlignment(previousButtonLayout, Alignment.TOP_LEFT);

    navigationFormLayout.addComponent(entityForm);

    VerticalLayout nextButtonLayout = new VerticalLayout();
    id = StringUtil.generateDebugId("e", this, nextButtonLayout, "nextButtonLayout");
    nextButtonLayout.setDebugId(id);
    nextButtonLayout.setSizeUndefined();
    nextButtonLayout.setMargin(false);
    nextButtonLayout.setSpacing(false);
    spaceLabel = new Label("</br></br></br>", Label.CONTENT_XHTML);
    spaceLabel.setSizeUndefined();
    previousButtonLayout.addComponent(spaceLabel);
    nextButtonLayout.addComponent(spaceLabel);

    Button nextButton = new Button(null, this, "nextItem");
    nextButton.setDescription(entityForm.uiMessageSource.getToolTip("entityForm.next.toolTip"));
    nextButton.setSizeUndefined();
    nextButton.addStyleName("borderless");
    nextButton.setIcon(new ThemeResource("../expressui/icons/16/next.png"));

    HorizontalLayout nextButtonHorizontalLayout = new HorizontalLayout();
    id = StringUtil.generateDebugId("e", this, nextButtonHorizontalLayout, "nextButtonHorizontalLayout");
    nextButtonHorizontalLayout.setDebugId(id);
    nextButtonHorizontalLayout.setSizeUndefined();
    Label horizontalSpaceLabel = new Label("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;", Label.CONTENT_XHTML);
    horizontalSpaceLabel.setSizeUndefined();
    nextButtonHorizontalLayout.addComponent(horizontalSpaceLabel);
    nextButtonHorizontalLayout.addComponent(nextButton);

    nextButtonLayout.addComponent(nextButtonHorizontalLayout);
    navigationFormLayout.addComponent(nextButtonLayout);
    navigationFormLayout.setComponentAlignment(nextButtonLayout, Alignment.TOP_RIGHT);

    navigationFormLayout.setSpacing(false);
    navigationFormLayout.setMargin(false);

    return navigationFormLayout;
}

From source file:com.expressui.core.view.page.SearchPage.java

License:Open Source License

@PostConstruct
@Override/*from   www  .  j a  v a  2  s.  c o  m*/
public void postConstruct() {
    super.postConstruct();

    if (isViewAllowed()) {
        addComponent(getSearchForm());
        addComponent(getResults());
    }

    addCodePopupButtonIfEnabled(Alignment.TOP_LEFT, SearchPage.class);
}

From source file:com.expressui.core.view.page.UserOwnedEntityFormPage.java

License:Open Source License

@PostConstruct
@Override/*  ww  w  . j  a v a  2  s.  com*/
public void postConstruct() {
    super.postConstruct();

    setWidthUndefined();

    addStyleName("opaque");

    getEntityForm().addStyleName("e-entity-form-in-page");
    getEntityForm().addCancelListener(getMainApplication(), "selectPreviousPage");

    if (isViewAllowed()) {
        addComponent(getEntityForm());
    }

    addCodePopupButtonIfEnabled(Alignment.TOP_LEFT, UserOwnedEntityFormPage.class);
}

From source file:com.foc.vaadin.FocWebVaadinWindow.java

License:Apache License

@Override
public void fill() {
    setSizeFull();/*from ww  w. j a  v a2  s .co  m*/
    setSizeFull();
    setSpacing(false);
    setMargin(false);

    //Adding the Header
    //-----------------
    headerMenuBar = new HorizontalLayout();
    headerMenuBar.setMargin(false);
    headerMenuBar.setSpacing(false);
    headerMenuBar.setStyleName("focBanner");

    centerHeaderLayout = new HorizontalLayout();
    centerHeaderLayout.setMargin(false);
    centerHeaderLayout.setSpacing(false);
    centerHeaderLayout.setStyleName("focBanner");

    if (!isCropMarginPanelsInHeaderBanner()) {// The condition should be about mobile not crop
        centerHeaderLayout.setWidth(WIDTH_PORTRAIT);
    }
    headerMenuBar.addComponent(centerHeaderLayout);
    headerMenuBar.setComponentAlignment(centerHeaderLayout, Alignment.MIDDLE_CENTER);

    headerMenuBar.setWidth("100%");
    headerMenuBar.setHeight("-1px");
    addComponent(headerMenuBar);
    setComponentAlignment(headerMenuBar, Alignment.TOP_LEFT);
    //-----------------

    //Adding the Header
    //-----------------
    headerMenuLayout = new HorizontalLayout();
    headerMenuLayout.setMargin(false);
    headerMenuLayout.setSpacing(false);
    headerMenuLayout.setStyleName("foc-menuLayout");
    headerMenuLayout.setHeight("-1px");
    FocXMLGuiComponentStatic.setCaptionMargin_Zero(headerMenuLayout);

    centerHeaderMenuLayout = new HorizontalLayout();
    centerHeaderMenuLayout.setMargin(false);
    centerHeaderMenuLayout.setSpacing(false);
    centerHeaderMenuLayout.setStyleName("foc-menuLayout");
    centerHeaderMenuLayout.setCaption(null);
    centerHeaderMenuLayout.setHeight("-1px");
    FocXMLGuiComponentStatic.setCaptionMargin_Zero(centerHeaderMenuLayout);

    if (!isCropMarginPanelsInHeaderBanner()) {// The condition should be about mobile not crop
        centerHeaderMenuLayout.setWidth(WIDTH_PORTRAIT);
    }
    centerHeaderMenuLayout.addStyleName("foc-red");
    headerMenuLayout.addComponent(centerHeaderMenuLayout);
    headerMenuLayout.setComponentAlignment(centerHeaderMenuLayout, Alignment.MIDDLE_CENTER);

    headerMenuLayout.setWidth("100%");
    headerMenuLayout.setHeight("-1px");
    addComponent(headerMenuLayout);
    setComponentAlignment(headerMenuLayout, Alignment.TOP_CENTER);
    //-----------------

    // Central Layout
    // --------------
    hMainLayout = new HorizontalLayout();
    hMainLayout.setSizeFull();
    hMainLayout.addStyleName("focMainHorizontal");
    hMainLayout.setMargin(false);
    hMainLayout.setSpacing(false);
    addComponent(hMainLayout);
    setExpandRatio(hMainLayout, 1.0f);

    hMainLayout.addComponent(getCentralPanelWrapper());
    hMainLayout.setComponentAlignment(getCentralPanelWrapper(), Alignment.TOP_CENTER);
    getCentralPanelWrapper().setWidth("100%");
    // --------------      
}

From source file:com.foc.vaadin.FocWebVaadinWindow.java

License:Apache License

/**
 * adjustButtonStyleInHeaderBar allows to customize the look of a button displayed in header menu bar 
 * /*  www .  j a  v a  2 s.  co m*/
 * @param nBut
 * @param asFirst
 * @param addButton
 */
protected void adjustButtonStyleInHeaderBar(NativeButton nBut, boolean asFirst, boolean addButton) {
    nBut.setHeight("40px");
    nBut.setStyleName("focBannerButton");
    if (addButton) {
        if (centerHeaderLayout != null) {
            if (asFirst) {
                centerHeaderLayout.addComponentAsFirst(nBut);
            } else {
                centerHeaderLayout.addComponent(nBut);
            }
            centerHeaderLayout.setComponentAlignment(nBut, Alignment.TOP_LEFT);
        }
    }
}