Example usage for com.vaadin.ui Alignment MIDDLE_LEFT

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

Introduction

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

Prototype

Alignment MIDDLE_LEFT

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

Click Source Link

Usage

From source file:com.klwork.explorer.ui.task.TaskEventsPanel.java

License:Apache License

protected void addInputField() {
    HorizontalLayout hLayout = new HorizontalLayout();
    hLayout.setSpacing(true);//from  www .  j  a  v a2  s .  c  om
    hLayout.setWidth(100, Unit.PERCENTAGE);
    pMainContent.addComponent(hLayout);
    //?
    initAddEventInput(hLayout);

    Button addCommentButton = new Button(i18nManager.getMessage(Messages.TASK_ADD_COMMENT));
    hLayout.addComponent(addCommentButton);
    hLayout.setComponentAlignment(addCommentButton, Alignment.MIDDLE_LEFT);
    addCommentButton.addListener(new ClickListener() {
        public void buttonClick(ClickEvent event) {
            addNewComment(commentInputField.getValue().toString());
        }
    });
}

From source file:com.klwork.explorer.ui.task.TaskRelatedContentComponent.java

License:Apache License

protected void initActions() {
    // WW_TODO ?//from  w ww.j  ava 2s.c  o m
    HorizontalLayout actionsContainer = new HorizontalLayout();
    actionsContainer.setSizeFull();

    // Title
    Label processTitle = new Label(i18nManager.getMessage(Messages.TASK_RELATED_CONTENT));
    processTitle.addStyleName(ExplorerLayout.STYLE_H3);
    processTitle.setSizeFull();
    actionsContainer.addComponent(processTitle);
    actionsContainer.setComponentAlignment(processTitle, Alignment.MIDDLE_LEFT);
    actionsContainer.setExpandRatio(processTitle, 1.0f);

    // Add content button
    Button addRelatedContentButton = new Button();
    addRelatedContentButton.addStyleName(ExplorerLayout.STYLE_ADD);
    addRelatedContentButton.addClickListener(new com.vaadin.ui.Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        public void buttonClick(com.vaadin.ui.Button.ClickEvent event) {
            CreateAttachmentPopupWindow popup = new CreateAttachmentPopupWindow();

            if (task.getProcessInstanceId() != null) {
                popup.setProcessInstanceId(task.getProcessInstanceId());
            } else {
                popup.setTaskId(task.getId());
            }

            // Add listener to update attachments when added
            popup.addListener(new SubmitEventListener() {

                private static final long serialVersionUID = 1L;

                @Override
                protected void submitted(SubmitEvent event) {
                    taskDetailPanel.notifyRelatedContentChanged();
                }

                @Override
                protected void cancelled(SubmitEvent event) {
                    // No attachment was added so updating UI isn't
                    // needed.
                }
            });

            ViewToolManager.showPopupWindow(popup);
        }
    });

    actionsContainer.addComponent(addRelatedContentButton);
    actionsContainer.setComponentAlignment(processTitle, Alignment.MIDDLE_RIGHT);

    addComponent(actionsContainer);
}

From source file:com.klwork.explorer.ui.user.ProfilePanel.java

License:Apache License

protected void addProfileInputField(GridLayout layout, String name, AbstractField inputField,
        String inputFieldValue) {
    Label label = new Label(name + ": ");
    label.addStyleName(ExplorerLayout.STYLE_PROFILE_FIELD);
    label.setSizeUndefined();/*from w  w  w .ja v a2s.c  om*/
    layout.addComponent(label);
    layout.setComponentAlignment(label, Alignment.MIDDLE_LEFT);

    if (inputFieldValue != null) {
        inputField.setValue(inputFieldValue);
    }
    layout.addComponent(inputField);
    layout.setComponentAlignment(inputField, Alignment.MIDDLE_LEFT);
}

From source file:com.kpg.diary.ui.MenuLayout.java

License:Apache License

/**
 * Builds the menu./*from ww  w.  j  av  a  2s.com*/
 *
 * @param navigator
 *            the navigator
 * @return the css layout
 */
private CssLayout buildMenu(Navigator navigator) {
    // Add items
    menuItemsMap();
    HorizontalLayout top = new HorizontalLayout();
    top.setWidth("100%");
    top.addStyleName(ValoTheme.MENU_TITLE);

    top.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    top.addStyleName(ValoTheme.MENU_TITLE);
    menu.addComponent(top);
    // menu.addComponent(createThemeSelect());
    menu.addComponent(top);
    Button showMenu = new Button("Menu", new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            if (menu.getStyleName().contains("valo-menu-visible")) {
                menu.removeStyleName("valo-menu-visible");
            } else {
                menu.addStyleName("valo-menu-visible");
            }
        }
    });
    showMenu.addStyleName(ValoTheme.BUTTON_PRIMARY);
    showMenu.addStyleName(ValoTheme.BUTTON_SMALL);
    showMenu.addStyleName("valo-menu-toggle");
    showMenu.setIcon(FontAwesome.LIST);
    menu.addComponent(showMenu);

    Label title = new Label("<h2>Diary</h2>", ContentMode.HTML);
    title.setSizeUndefined();
    top.addComponent(title);
    top.setExpandRatio(title, 1);
    menuItemsLayout.setPrimaryStyleName("valo-menuitems");
    menu.addComponent(menuItemsLayout);
    for (final Entry<String, String> item : menuItems.entrySet()) {
        Button b = new Button(item.getValue(), new ClickListener() {
            @Override
            public void buttonClick(ClickEvent event) {
                navigator.navigateTo(item.getKey());
            }
        });
        b.setHtmlContentAllowed(true);
        b.setPrimaryStyleName(ValoTheme.MENU_ITEM);
        if (IConstants.NavigationMenu.ADDRESS.getKey().equals(item.getKey())) {
            b.setIcon(FontAwesome.BOOK);
        } else if (IConstants.NavigationMenu.PERSON.getKey().equals(item.getKey())) {
            b.setIcon(FontAwesome.USER);
        } else {
            b.setIcon(FontAwesome.APPLE);
        }
        menuItemsLayout.addComponent(b);
    }
    return menu;
}

From source file:com.lizardtech.expresszip.vaadin.FindLayersViewComponent.java

License:Apache License

private void setupAddFilterWindow(Window window) {
    // General variables

    // Layouts/*w w w  . j a va  2s .c o m*/
    GridLayout mainLayout = new GridLayout(1, 3);
    HorizontalLayout axisLayout = new HorizontalLayout();
    HorizontalLayout criteriaLayout = new HorizontalLayout();
    HorizontalLayout buttonLayout = new HorizontalLayout();
    hznCriteria = criteriaLayout;

    // Buttons
    ExpressZipButton btnAdd = new ExpressZipButton("Add", Style.ACTION);
    btnAdd.setClickShortcut(KeyCode.ENTER);
    btnAdd.addStyleName("primary");
    ExpressZipButton btnCancel = new ExpressZipButton("Cancel", Style.ACTION);

    // Fields
    ComboBox cmbAxis = new ComboBox();
    cmbAxis.setTextInputAllowed(false);
    cmbAxis.setNullSelectionAllowed(false);

    // Labels
    Label lblAxis = new Label("Axis");

    btnAdd.addListener(filterButtonListener);
    btnCancel.addListener(filterButtonListener);

    for (Filter.AxisFilters f : Filter.axisArray) {
        cmbAxis.addItem(filter.getNameOfFilter(f));
    }
    cmbAxis.setImmediate(true);
    cmbAxis.addListener(axisSelectedListener);
    cmbAxis.setValue(filter.getNameOfFilter(Filter.axisArray[0]));

    mainLayout.addComponent(axisLayout, 0, 0);
    mainLayout.addComponent(criteriaLayout, 0, 1);
    mainLayout.addComponent(buttonLayout, 0, 2);
    mainLayout.setSpacing(true);

    axisLayout.setSpacing(true);

    axisLayout.addComponent(lblAxis);
    axisLayout.addComponent(cmbAxis);
    axisLayout.setExpandRatio(lblAxis, .2f);
    axisLayout.setExpandRatio(cmbAxis, .8f);
    axisLayout.setComponentAlignment(lblAxis, Alignment.MIDDLE_LEFT);
    axisLayout.setComponentAlignment(cmbAxis, Alignment.MIDDLE_LEFT);
    axisLayout.setSizeFull();

    criteriaLayout.setSizeFull();

    buttonLayout.setSpacing(true);
    buttonLayout.addComponent(btnAdd);
    buttonLayout.addComponent(btnCancel);
    buttonLayout.setComponentAlignment(btnAdd, Alignment.BOTTOM_RIGHT);
    buttonLayout.setComponentAlignment(btnCancel, Alignment.BOTTOM_RIGHT);
    buttonLayout.setExpandRatio(btnAdd, 1f);
    buttonLayout.setExpandRatio(btnCancel, 0f);
    buttonLayout.setSizeFull();

    mainLayout.setRowExpandRatio(0, 1f);
    mainLayout.setRowExpandRatio(1, 1f);
    mainLayout.setRowExpandRatio(2, 1f);
    mainLayout.setSizeFull();

    window.addComponent(mainLayout);
    window.getContent().setSizeFull();
}

From source file:com.lizardtech.expresszip.vaadin.MapToolbarViewComponent.java

License:Apache License

public MapToolbarViewComponent() {
    hznToolbar.setMargin(true);//from   ww  w .  j a v a 2s . co m
    hznToolbar.setSpacing(true);

    help = new ExpressZipButton("Help", Style.MENU, this);
    restart = new ExpressZipButton("Start Over", Style.MENU, this);

    txtZoomTo.setInputPrompt("Search...");
    txtZoomTo.setDescription("Geocoding courtesy of Open Street Map");
    txtZoomTo.addStyleName("searchbox");
    txtZoomTo.setWidth("260px");
    txtZoomTo.setImmediate(true);

    btnJobQueueStatus.setDescription("Job Manager");
    ThemeResource gear = new ThemeResource("img/JobManagementStandard23px.png");
    btnJobQueueStatus.setIcon(gear);
    btnJobQueueStatus.setStyleName(Button.STYLE_LINK);
    btnJobQueueStatus.addListener(this);

    Embedded logo = new Embedded(null, new ThemeResource("img/ExpZip_Logo161x33px.png"));
    hznToolbar.addComponent(logo);
    hznToolbar.setComponentAlignment(logo, Alignment.MIDDLE_LEFT);
    hznToolbar.setExpandRatio(logo, 0.35f);
    hznToolbar.addComponent(txtZoomTo);
    hznToolbar.setComponentAlignment(txtZoomTo, Alignment.MIDDLE_LEFT);
    hznToolbar.setExpandRatio(txtZoomTo, 0.25f);
    hznToolbar.addComponent(help);
    hznToolbar.setComponentAlignment(help, Alignment.MIDDLE_RIGHT);
    hznToolbar.setExpandRatio(help, 0.3f);
    hznToolbar.addComponent(restart);
    hznToolbar.setComponentAlignment(restart, Alignment.MIDDLE_LEFT);
    hznToolbar.setExpandRatio(restart, 0.15f);
    hznToolbar.addComponent(btnJobQueueStatus);
    hznToolbar.setComponentAlignment(btnJobQueueStatus, Alignment.MIDDLE_CENTER);
    hznToolbar.setExpandRatio(btnJobQueueStatus, 0.15f);

    hznToolbar.setSizeFull();

    hznToolbar.addStyleName("header");

    setCompositionRoot(hznToolbar);

    // textFieldListener puts a marker with given input
    txtZoomTo.addListener(new ValueChangeListener() {
        private static final long serialVersionUID = 8461586871780709805L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            String target = txtZoomTo.getValue().toString();
            markAddress(target);
        }
    });
}

From source file:com.lizardtech.expresszip.vaadin.SetupMapViewComponent.java

License:Apache License

public SetupMapViewComponent() {

    listeners = new ArrayList<SetupMapViewListener>();
    cmbProjection = new ComboBox();
    cmbProjection.setTextInputAllowed(false);
    HorizontalLayout projectionLayout = new HorizontalLayout();
    projectionLayout.addComponent(cmbProjection);
    projectionLayout.setWidth(100f, UNITS_PERCENTAGE);

    setSizeFull();// w ww.  jav  a  2  s .  c om

    // main layout
    VerticalLayout layout = new VerticalLayout();
    layout.setMargin(true);
    layout.setSizeFull();

    // instruction banner
    Label step = new Label("Step 2: Select Export Region");
    step.addStyleName("step");
    layout.addComponent(step);

    //
    // setup tree data source
    //
    treeHier = new HierarchicalContainer();
    treeHier.addContainerProperty(ExpressZipTreeTable.LAYER, ExpressZipLayer.class, null);
    treeHier.addContainerProperty(DRAG_PROPERTY, Embedded.class, null);

    // table holding layers
    treeTable = new ExpressZipTreeTable();
    treeTable.setContainerDataSource(treeHier);

    treeTable.setDragMode(TableDragMode.ROW);
    treeTable.setColumnHeaders(new String[] { ExpressZipTreeTable.LAYER, "" });
    treeTable.setColumnExpandRatio(ExpressZipTreeTable.LAYER, 1);
    treeTable.setColumnWidth(DRAG_PROPERTY, 23);

    // upload shape file
    btnUploadShapeFile.setFieldType(FieldType.BYTE_ARRAY);
    btnUploadShapeFile.setButtonCaption("");
    btnUploadShapeFile.setSizeUndefined();
    btnUploadShapeFile.addStyleName("shapefile");

    // remove shape file
    btnRemoveShapeFile.addListener(this);
    btnRemoveShapeFile.setSizeUndefined();
    btnRemoveShapeFile.setVisible(false);
    btnRemoveShapeFile.setIcon(new ThemeResource("img/RemoveShapefileStandard23px.png"));
    btnRemoveShapeFile.setStyleName(BaseTheme.BUTTON_LINK);
    btnRemoveShapeFile.addStyleName("shapefile");
    HorizontalLayout hznUpload = new HorizontalLayout();

    Panel coordPanel = new Panel("Export Extent");

    layout.addComponent(treeTable);
    layout.addComponent(new Panel(PROJECTION, projectionLayout));
    layout.addComponent(new Panel(SHAPEFILE_UPLOAD, hznUpload));
    layout.addComponent(coordPanel);

    layout.setSpacing(true);

    hznUpload.addComponent(btnUploadShapeFile);
    hznUpload.addComponent(btnRemoveShapeFile);
    hznUpload.addComponent(lblCurrentShapeFile);
    hznUpload.setExpandRatio(lblCurrentShapeFile, 1f);
    hznUpload.setComponentAlignment(lblCurrentShapeFile, Alignment.MIDDLE_LEFT);
    hznUpload.setWidth("100%");

    cmbProjection.setWidth("100%");

    topTextField.setWidth(150, UNITS_PIXELS);
    topTextField.setImmediate(true);
    topTextField.setRequired(true);
    topTextField.addListener(topListener);

    leftTextField.setWidth(150, UNITS_PIXELS);
    leftTextField.setImmediate(true);
    leftTextField.setRequired(true);
    leftTextField.addListener(leftListener);

    bottomTextField.setWidth(150, UNITS_PIXELS);
    bottomTextField.setImmediate(true);
    bottomTextField.setRequired(true);
    bottomTextField.addListener(bottomListener);

    rightTextField.setWidth(150, UNITS_PIXELS);
    rightTextField.setImmediate(true);
    rightTextField.setRequired(true);
    rightTextField.addListener(rightListener);

    VerticalLayout coordLayout = new VerticalLayout();
    coordLayout.setSizeFull();
    coordPanel.setContent(coordLayout);
    coordLayout.addComponent(topTextField);

    HorizontalLayout leftRightLayout = new HorizontalLayout();
    leftRightLayout.setWidth("100%");
    leftRightLayout.addComponent(leftTextField);
    leftRightLayout.addComponent(rightTextField);
    leftRightLayout.setComponentAlignment(leftTextField, Alignment.MIDDLE_LEFT);
    leftRightLayout.setComponentAlignment(rightTextField, Alignment.MIDDLE_RIGHT);
    coordLayout.addComponent(leftRightLayout);

    coordLayout.addComponent(bottomTextField);
    coordLayout.setComponentAlignment(topTextField, Alignment.TOP_CENTER);
    coordLayout.setComponentAlignment(bottomTextField, Alignment.BOTTOM_CENTER);

    btnNext = new ExpressZipButton("Next", Style.STEP, this);
    btnBack = new ExpressZipButton("Back", Style.STEP, this);

    HorizontalLayout backNextLayout = new HorizontalLayout();
    backNextLayout.addComponent(btnBack);
    backNextLayout.addComponent(btnNext);
    btnNext.setEnabled(false);

    backNextLayout.setComponentAlignment(btnBack, Alignment.BOTTOM_LEFT);
    backNextLayout.setComponentAlignment(btnNext, Alignment.BOTTOM_RIGHT);
    backNextLayout.setWidth("100%");

    VerticalLayout navLayout = new VerticalLayout();
    navLayout.addComponent(backNextLayout);
    navLayout.setSpacing(true);

    ThemeResource banner = new ThemeResource("img/ProgressBar2.png");
    navLayout.addComponent(new Embedded(null, banner));

    layout.addComponent(navLayout);
    layout.setComponentAlignment(navLayout, Alignment.BOTTOM_CENTER);

    layout.setExpandRatio(treeTable, 1.0f);
    setCompositionRoot(layout);

    // notify when selection changes
    treeTable.addListener(new Property.ValueChangeListener() {

        @Override
        public void valueChange(ValueChangeEvent event) {
            for (SetupMapViewListener listener : listeners) {
                listener.layersSelectedEvent((Set<ExpressZipLayer>) treeTable.getValue());
            }

        }
    });
    treeTable.addActionHandler(this);
    treeHier.removeAllItems();

    //
    // drag n' drop behavior
    //
    treeTable.setDropHandler(new DropHandler() {
        public AcceptCriterion getAcceptCriterion() {
            return AcceptAll.get();
        }

        // Make sure the drag source is the same tree
        public void drop(DragAndDropEvent event) {
            // Wrapper for the object that is dragged
            Transferable t = event.getTransferable();

            // Make sure the drag source is the same tree
            if (t.getSourceComponent() != treeTable)
                return;

            AbstractSelectTargetDetails target = (AbstractSelectTargetDetails) event.getTargetDetails();

            // Get ids of the dragged item and the target item
            Object sourceItemId = t.getData("itemId");
            Object targetItemId = target.getItemIdOver();

            // if we drop on ourselves, ignore
            if (sourceItemId == targetItemId)
                return;

            // On which side of the target the item was dropped
            VerticalDropLocation location = target.getDropLocation();

            // place source after target
            treeHier.moveAfterSibling(sourceItemId, targetItemId);

            // if top, switch them
            if (location == VerticalDropLocation.TOP) {
                treeHier.moveAfterSibling(targetItemId, sourceItemId);
            }

            Collection<ExpressZipLayer> layers = (Collection<ExpressZipLayer>) treeHier.rootItemIds();
            for (SetupMapViewListener listener : listeners)
                listener.layerMovedEvent(layers);
        }
    });

    cmbProjection.setImmediate(true);
    cmbProjection.setNullSelectionAllowed(false);
    cmbProjection.addListener(new Property.ValueChangeListener() {
        private static final long serialVersionUID = -5188369735622627751L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            if (cmbProjection.getValue() != null) {
                selectedEpsg = (String) cmbProjection.getValue();
                String currentProjection = ((ExpressZipWindow) getApplication().getMainWindow())
                        .getExportProps().getMapProjection();
                if (!selectedEpsg.equals(currentProjection))
                    for (SetupMapViewListener listener : new ArrayList<SetupMapViewListener>(listeners))
                        listener.projectionChangedEvent(selectedEpsg);
            }
        }
    });
}

From source file:com.logicbomb.newschool.pages.masterpages.PrimaryMasterPage.java

public PrimaryMasterPage() {

    //ContextWidget c= new ContextWidget();

    HorizontalLayout iHorizontalLayout = new HorizontalLayout();
    //addComponent(iHorizontalLayout,"top:0px;left:0px");
    iHorizontalLayout.setWidth(String.valueOf(Page.getCurrent().getBrowserWindowWidth()));
    iHorizontalLayout.setHeight(String.valueOf(Page.getCurrent().getBrowserWindowHeight()));
    iHorizontalLayout.setStyleName("backColorBlack");

    //String[] captions1 = {"Logo Here", "My Cool School", "Third"};

    //Layout A and its sub components
    Panel AP = new Panel();
    iHorizontalLayout.addComponent(AP);//from ww w .j  a  va2 s  . co  m
    AP.setSizeFull();
    AP.setStyleName("backColorBlack");
    VerticalLayout A1 = new VerticalLayout();
    AP.setContent(A1);
    //A.setSizeFull();
    A1.setSpacing(true);
    iHorizontalLayout.setExpandRatio(AP, 1);

    A1.setStyleName("backColorBlack");
    A1.setMargin(new MarginInfo(true, true, true, true));

    Button logoImage = new Button();
    logoImage.setIcon(FontAwesome.PICTURE_O);
    logoImage.setWidth("80px");
    logoImage.setHeight(logoImage.getWidth(), Unit.PIXELS);
    //logoImage.setWidth("100px");
    A1.addComponent(logoImage);
    A1.setComponentAlignment(logoImage, Alignment.TOP_CENTER);

    Label schoolName = new Label("The School Of Future");
    schoolName.setStyleName("v-label-big");
    A1.addComponent(schoolName);
    //A.setComponentAlignment(schoolName,Alignment.TOP_CENTER);

    Label schoolMinorName = new Label("Random Branch");
    schoolMinorName.setStyleName("v-label-small");
    A1.addComponent(schoolMinorName);

    VerticalLayout A2 = new VerticalLayout();
    A1.addComponent(A2);
    MainMenuWidget iMainMenuWidget = new MainMenuWidget();
    A2.addComponent(iMainMenuWidget);

    //A.setComponentAlignment(schoolName,Alignment.TOP_CENTER);

    //Layout B
    ContextWidgetTop c = new ContextWidgetTop();
    c = ContextWidgetTop.ContextWidgetTransformer(c, new UserDetailsWidget(), SliderMode.TOP,
            SliderPanelStyles.COLOR_RED);
    VerticalLayout B = new VerticalLayout();
    B.setSizeFull();
    //B.setSpacing(true);
    iHorizontalLayout.addComponent(c);
    c.addComponent(B);
    iHorizontalLayout.setExpandRatio(c, 7);

    //Layout B1 and its sub Components
    HorizontalLayout B1 = new HorizontalLayout();
    B.addComponent(B1);
    //B.setExpandRatio(B1, 1);
    //B1.setHeight("70px");
    B1.setSizeFull();
    //B1=ContextWidget.ContextWidgetTransformer(B1, new SliderMasterPage(),SliderMode.RIGHT,SliderPanelStyles.COLOR_RED);

    HorizontalLayout B11 = new HorizontalLayout();
    B1.addComponent(B11);
    B1.setStyleName("backColorBlack");
    B11.setSizeFull();
    B1.setHeight("45px");
    //B1.setStyleName("backColorWhite");
    //B1.setMargin(new MarginInfo(false, true, false, true));

    TextField iTextField = new TextField();
    iTextField.setWidth("200px");
    iTextField.setInputPrompt("Search!");
    iTextField.setStyleName("v-text-type-search");
    iTextField.focus();
    B11.addComponent(iTextField);
    B11.setComponentAlignment(iTextField, Alignment.MIDDLE_LEFT);

    //Layout B2 and its Sub Components
    ContextWidget B2 = new ContextWidget();
    B2.setSizeFull();
    B.addComponent(B2);
    B.setExpandRatio(B2, 10);
    B2 = ContextWidget.ContextWidgetTransformer(B2, new SliderMasterPage(), SliderMode.RIGHT,
            SliderPanelStyles.COLOR_BLUE);
    //B2=ContextWidget.ContextWidgetTransformer(B2, new SliderMasterPage(),SliderMode.TOP,SliderPanelStyles.COLOR_RED);
    VerticalLayout v = new VerticalLayout();
    B2.addComponent(v);

    Button b1111 = new Button(
            "Put all the inner components like this Put all the inner components like this Put all the inner components like this Put all the inner components like this");
    v.addComponent(b1111);
    Button b1112 = new Button("Put all the inner components like this");
    v.addComponent(b1112);

    /*
    Panel p = new Panel();
    VerticalLayout v= new VerticalLayout();
    v.addComponent(new TextField("Name"));
    v.addComponent(new TextField("Street address"));
    v.addComponent(new TextField("Postal code"));
    p.setContent(v);
    B2.addComponent(p);
    v.setWidth(String.valueOf(B2.getWidth()*10)+"px");
    //v.setSizeFull();// <- This will cause issues. Don't do this
    p.setSizeFull();
    */

    //ContextWidget iContextPanel= new ContextWidget(p);
    //B2.addComponent(iContextPanel);
    //setPosition(p, iComponentPositionPanel);

    addComponent(iHorizontalLayout);
}

From source file:com.lst.deploymentautomation.vaadin.core.AppFormConnector.java

License:Open Source License

@Override
public void setContent(Component content) {
    if (content == null) {
        //rendering failed; show a sad face to show how sorry we are
        VerticalLayout layout = new VerticalLayout();
        Label fail = new Label(":-(");
        fail.addStyleName("screen-failed-to-render");
        layout.addComponent(fail);//from   ww  w  . j a  v a 2s . c om
        layout.setExpandRatio(fail, 1);
        layout.setComponentAlignment(fail, Alignment.MIDDLE_LEFT);
        layout.setSizeFull();

        view.setContent(layout);

    } else {
        //if the component has either natural or absolute size, wrap it
        //in a scrollable panel with full size and nice margin
        if (content.getHeightUnits() != Unit.PERCENTAGE) {
            final Panel panel = new Panel();
            panel.addStyleName("l-border-none");
            panel.setContent(content);
            panel.setSizeFull();
            content = panel;
        }

        view.setContent(content);
    }
}

From source file:com.m1kah.ui.TodoComponent.java

License:Open Source License

private void initInputRow() {
    toggleAllButton = new CheckBox();
    toggleAllButton.setId("toggle-all");

    inputField = new TextField();
    inputField.setInputPrompt("What needs to be done?");

    Panel panel = new Panel(inputField);
    panel.addShortcutListener(new ShortcutListener("", ShortcutAction.KeyCode.ENTER, null) {
        @Override//w ww.j  av  a2s.c  o  m
        public void handleAction(Object o, Object o1) {
            addNewTodo();
        }
    });

    HorizontalLayout inputFieldLayout = new HorizontalLayout(toggleAllButton, panel);
    inputFieldLayout.setComponentAlignment(toggleAllButton, Alignment.MIDDLE_LEFT);
    inputFieldLayout.setId("new-todo");
    addComponent(inputFieldLayout);
}