Example usage for com.vaadin.ui Embedded setWidth

List of usage examples for com.vaadin.ui Embedded setWidth

Introduction

In this page you can find the example usage for com.vaadin.ui Embedded setWidth.

Prototype

@Override
    public void setWidth(String width) 

Source Link

Usage

From source file:org.vaadin.alump.fancylayouts.demo.PanelDemo.java

License:Apache License

/**
 * Sample content with more stuff//from   w ww.  j  av a  2  s  .c  om
 * 
 * @return
 */
private ComponentContainer createPanelContentB() {

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

    Label label = new Label(BECON_STR);
    layout.addComponent(label);

    Embedded image = new Embedded();
    image.setSource(new ExternalResource("http://misc.siika.fi/kaljanhimo.jpg"));
    image.setWidth("300px");
    image.setHeight("187px");
    layout.addComponent(image);
    layout.setComponentAlignment(image, Alignment.MIDDLE_CENTER);

    Label label2 = new Label(BECON_STR);
    layout.addComponent(label2);

    return layout;

}

From source file:org.vaadin.johannesh.jfokus2012.touchkit.view.ShowContactView.java

License:Open Source License

private void buildLayout() {
    layout = new CssLayout();
    layout.addStyleName("show-contact-view");
    layout.setWidth("100%");

    VerticalComponentGroup infoGroup = new VerticalComponentGroup("");
    infoGroup.setWidth("100%");

    Component label;//from w  w w  .  j  a  va  2 s  . c o m
    Property p;

    p = item.getItemProperty(ContactUtils.PROPERTY_COMPANY);
    label = new Label(new ContactUtils.CompanyPropertyFormatter(p));
    label.setCaption(ContactUtils.formatFieldCaption(ContactUtils.PROPERTY_COMPANY));
    infoGroup.addComponent(label);

    p = item.getItemProperty(ContactUtils.PROPERTY_MOBILE);
    label = new Label(p);
    label.setCaption(ContactUtils.formatFieldCaption(ContactUtils.PROPERTY_MOBILE));
    infoGroup.addComponent(label);

    p = item.getItemProperty(ContactUtils.PROPERTY_EMAIL);
    label = new Label(p);
    label.setCaption(ContactUtils.formatFieldCaption(ContactUtils.PROPERTY_EMAIL));
    infoGroup.addComponent(label);

    Embedded picture = new Embedded("", new ThemeResource("icon/picture.png"));
    picture.setWidth("57px");
    picture.setHeight("57px");

    Label firstName = new Label(item.getItemProperty(ContactUtils.PROPERTY_FIRST_NAME));
    firstName.addStyleName("strong-name");

    Label lastName = new Label(item.getItemProperty(ContactUtils.PROPERTY_LAST_NAME));
    lastName.addStyleName("strong-name");

    GridLayout nameLayout = new GridLayout(2, 2);
    nameLayout.setWidth("100%");
    nameLayout.setSpacing(true);
    nameLayout.setMargin(true, true, false, true);
    nameLayout.setColumnExpandRatio(1, 1.0f);
    nameLayout.addComponent(picture, 0, 0, 0, 1);
    nameLayout.addComponent(firstName, 1, 0);
    nameLayout.addComponent(lastName, 1, 1);
    nameLayout.setComponentAlignment(firstName, Alignment.MIDDLE_LEFT);
    nameLayout.setComponentAlignment(lastName, Alignment.MIDDLE_LEFT);

    final Favourite favourite = new Favourite();
    favourite.setImmediate(true);
    favourite.setReadOnly(true);
    favourite.setIcon(new ThemeResource("icon/favourite.png"));
    favourite.setPropertyDataSource(item.getItemProperty(ContactUtils.PROPERTY_FAVOURITE));

    layout.addComponent(nameLayout);
    layout.addComponent(favourite);
    layout.addComponent(infoGroup);

    Button editButton = new Button("Edit");
    editButton.addListener(new ClickListener() {
        @Override
        public void buttonClick(ClickEvent event) {
            getNavigationManager().navigateTo(new EditContactView(item));
        }
    });
    setRightComponent(editButton);
    setContent(layout);
}

From source file:ru.codeinside.adm.ui.AdminApp.java

License:Mozilla Public License

private Component registryTab() {
    Embedded embedded = new Embedded("", new ExternalResource("/registry"));
    embedded.setType(Embedded.TYPE_BROWSER);
    embedded.setWidth("100%");
    embedded.setHeight("100%");
    return embedded;
}