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.mycollab.shell.view.MainViewImpl.java

License:Open Source License

private CustomLayout createTopMenu() {
    headerLayout = CustomLayoutExt.createLayout("topNavigation");
    headerLayout.setStyleName("topNavigation");
    headerLayout.setHeight("45px");
    headerLayout.setWidth("100%");

    final PopupButton modulePopup = new PopupButton("");

    modulePopup.setHeightUndefined();/*from   w ww .  j  a  v  a  2  s . co m*/
    modulePopup.setDirection(Alignment.BOTTOM_LEFT);
    modulePopup.setIcon(
            AccountAssetsResolver.createLogoResource(AppContext.getBillingAccount().getLogopath(), 150));
    OptionPopupContent modulePopupContent = new OptionPopupContent();
    modulePopup.setContent(modulePopupContent);

    MButton projectModuleBtn = new MButton(AppContext.getMessage(GenericI18Enum.MODULE_PROJECT), clickEvent -> {
        modulePopup.setPopupVisible(false);
        EventBusFactory.getInstance().post(new ShellEvent.GotoProjectModule(this, null));
    }).withIcon(VaadinIcons.TASKS);
    modulePopupContent.addOption(projectModuleBtn);

    MButton crmModuleBtn = new MButton(AppContext.getMessage(GenericI18Enum.MODULE_CRM), clickEvent -> {
        modulePopup.setPopupVisible(false);
        EventBusFactory.getInstance().post(new ShellEvent.GotoCrmModule(this, null));
    }).withIcon(VaadinIcons.MONEY);
    modulePopupContent.addOption(crmModuleBtn);

    MButton fileModuleBtn = new MButton(AppContext.getMessage(GenericI18Enum.MODULE_DOCUMENT), clickEvent -> {
        modulePopup.setPopupVisible(false);
        EventBusFactory.getInstance().post(new ShellEvent.GotoFileModule(this, null));
    }).withIcon(VaadinIcons.SUITCASE);
    modulePopupContent.addOption(fileModuleBtn);

    MButton peopleBtn = new MButton(AppContext.getMessage(GenericI18Enum.MODULE_PEOPLE), clickEvent -> {
        modulePopup.setPopupVisible(false);
        EventBusFactory.getInstance()
                .post(new ShellEvent.GotoUserAccountModule(this, new String[] { "user", "list" }));
    }).withIcon(VaadinIcons.USERS);
    modulePopupContent.addOption(peopleBtn);

    headerLayout.addComponent(
            new MHorizontalLayout().with(modulePopup).withAlign(modulePopup, Alignment.MIDDLE_LEFT),
            "mainLogo");

    accountLayout = new MHorizontalLayout().withMargin(new MarginInfo(false, true, false, false))
            .withHeight("45px");
    accountLayout.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
    buildAccountMenuLayout();

    headerLayout.addComponent(accountLayout, "accountMenu");
    return headerLayout;
}

From source file:com.mycollab.shell.view.MainViewImpl.java

License:Open Source License

private MHorizontalLayout buildAccountMenuLayout() {
    accountLayout.removeAllComponents();

    if (SiteConfiguration.isDemandEdition()) {
        // display trial box if user in trial mode
        SimpleBillingAccount billingAccount = AppContext.getBillingAccount();
        if (AccountStatusConstants.TRIAL.equals(billingAccount.getStatus())) {
            if ("Free".equals(billingAccount.getBillingPlan().getBillingtype())) {
                Label informLbl = new Label(
                        "<div class='informBlock'>FREE CHARGE<br>UPGRADE</div><div class='informBlock'>&gt;&gt;</div>",
                        ContentMode.HTML);
                informLbl.addStyleName("trialEndingNotification");
                informLbl.setHeight("100%");
                MHorizontalLayout informBox = new MHorizontalLayout(informLbl).withFullHeight()
                        .withStyleName("trialInformBox");
                informBox.setMargin(new MarginInfo(false, true, false, false));
                informBox.addLayoutClickListener(layoutClickEvent -> EventBusFactory.getInstance()
                        .post(new ShellEvent.GotoUserAccountModule(this, new String[] { "billing" })));
                accountLayout.with(informBox).withAlign(informBox, Alignment.MIDDLE_LEFT);
            } else {
                Label informLbl = new Label("", ContentMode.HTML);
                informLbl.addStyleName("trialEndingNotification");
                informLbl.setHeight("100%");
                MHorizontalLayout informBox = new MHorizontalLayout(informLbl).withStyleName("trialInformBox")
                        .withMargin(new MarginInfo(false, true, false, false)).withFullHeight();
                informBox.addLayoutClickListener(layoutClickEvent -> EventBusFactory.getInstance()
                        .post(new ShellEvent.GotoUserAccountModule(this, new String[] { "billing" })));
                accountLayout.with(informBox).withAlign(informBox, Alignment.MIDDLE_LEFT);

                Duration dur = new Duration(new DateTime(billingAccount.getCreatedtime()), new DateTime());
                int daysLeft = dur.toStandardDays().getDays();
                if (daysLeft > 30) {
                    informLbl.setValue("<div class='informBlock'>Trial ended<br></div>");
                    AppContext.getInstance().setIsValidAccount(false);
                } else {
                    informLbl.setValue(String.format("<div class='informBlock'>Trial ending<br>%d days "
                            + "left</div><div class='informBlock'>&gt;&gt;</div>", 30 - daysLeft));
                }//from   ww w.j  a  v a 2s  .co  m
            }
        }
    }

    Label accountNameLabel = new Label(AppContext.getSubDomain());
    accountNameLabel.addStyleName("subdomain");
    accountLayout.addComponent(accountNameLabel);

    if (SiteConfiguration.isCommunityEdition()) {
        MButton buyPremiumBtn = new MButton("Upgrade to Pro edition",
                clickEvent -> UI.getCurrent().addWindow(new AdWindow())).withIcon(FontAwesome.SHOPPING_CART)
                        .withStyleName("ad");
        accountLayout.addComponent(buyPremiumBtn);
    }

    LicenseResolver licenseResolver = AppContextUtil.getSpringBean(LicenseResolver.class);
    if (licenseResolver != null) {
        LicenseInfo licenseInfo = licenseResolver.getLicenseInfo();
        if (licenseInfo != null) {
            if (licenseInfo.isExpired()) {
                MButton buyPremiumBtn = new MButton(AppContext.getMessage(LicenseI18nEnum.EXPIRE_NOTIFICATION),
                        clickEvent -> UI.getCurrent().addWindow(new BuyPremiumSoftwareWindow()))
                                .withIcon(FontAwesome.SHOPPING_CART).withStyleName("ad");
                accountLayout.addComponent(buyPremiumBtn);
            } else if (licenseInfo.isTrial()) {
                Duration dur = new Duration(new DateTime(), new DateTime(licenseInfo.getExpireDate()));
                int days = dur.toStandardDays().getDays();
                MButton buyPremiumBtn = new MButton(
                        AppContext.getMessage(LicenseI18nEnum.TRIAL_NOTIFICATION, days),
                        clickEvent -> UI.getCurrent().addWindow(new BuyPremiumSoftwareWindow()))
                                .withIcon(FontAwesome.SHOPPING_CART).withStyleName("ad");
                accountLayout.addComponent(buyPremiumBtn);
            }
        }
    }

    NotificationComponent notificationComponent = new NotificationComponent();
    accountLayout.addComponent(notificationComponent);

    if (StringUtils.isBlank(AppContext.getUser().getAvatarid())) {
        EventBusFactory.getInstance()
                .post(new ShellEvent.NewNotification(this, new RequestUploadAvatarNotification()));
    }

    if (!SiteConfiguration.isDemandEdition()) {
        ExtMailService mailService = AppContextUtil.getSpringBean(ExtMailService.class);
        if (!mailService.isMailSetupValid()) {
            EventBusFactory.getInstance()
                    .post(new ShellEvent.NewNotification(this, new SmtpSetupNotification()));
        }

        SimpleUser user = AppContext.getUser();
        GregorianCalendar tenDaysAgo = new GregorianCalendar();
        tenDaysAgo.add(Calendar.DATE, -10);

        if (Boolean.TRUE.equals(user.getRequestad()) && user.getRegisteredtime().before(tenDaysAgo.getTime())) {
            UI.getCurrent().addWindow(new AdRequestWindow(user));
        }
    }

    Resource userAvatarRes = UserAvatarControlFactory.createAvatarResource(AppContext.getUserAvatarId(), 24);
    final PopupButton accountMenu = new PopupButton("");
    accountMenu.setIcon(userAvatarRes);
    accountMenu.setDescription(AppContext.getUserDisplayName());

    OptionPopupContent accountPopupContent = new OptionPopupContent();

    MButton myProfileBtn = new MButton(AppContext.getMessage(AdminI18nEnum.VIEW_PROFILE), clickEvent -> {
        accountMenu.setPopupVisible(false);
        EventBusFactory.getInstance()
                .post(new ShellEvent.GotoUserAccountModule(this, new String[] { "preview" }));
    }).withIcon(SettingAssetsManager.getAsset(SettingUIConstants.PROFILE));
    accountPopupContent.addOption(myProfileBtn);

    MButton userMgtBtn = new MButton(AppContext.getMessage(AdminI18nEnum.VIEW_USERS_AND_ROLES), clickEvent -> {
        accountMenu.setPopupVisible(false);
        EventBusFactory.getInstance()
                .post(new ShellEvent.GotoUserAccountModule(this, new String[] { "user", "list" }));
    }).withIcon(SettingAssetsManager.getAsset(SettingUIConstants.USERS));
    accountPopupContent.addOption(userMgtBtn);

    MButton generalSettingBtn = new MButton(AppContext.getMessage(AdminI18nEnum.VIEW_SETTING), clickEvent -> {
        accountMenu.setPopupVisible(false);
        EventBusFactory.getInstance()
                .post(new ShellEvent.GotoUserAccountModule(this, new String[] { "setting", "general" }));
    }).withIcon(SettingAssetsManager.getAsset(SettingUIConstants.GENERAL_SETTING));
    accountPopupContent.addOption(generalSettingBtn);

    MButton themeCustomizeBtn = new MButton(AppContext.getMessage(AdminI18nEnum.VIEW_THEME), clickEvent -> {
        accountMenu.setPopupVisible(false);
        EventBusFactory.getInstance()
                .post(new ShellEvent.GotoUserAccountModule(this, new String[] { "setting", "theme" }));
    }).withIcon(SettingAssetsManager.getAsset(SettingUIConstants.THEME_CUSTOMIZE));
    accountPopupContent.addOption(themeCustomizeBtn);

    if (!SiteConfiguration.isDemandEdition()) {
        MButton setupBtn = new MButton(AppContext.getMessage(AdminI18nEnum.VIEW_SETUP), clickEvent -> {
            accountMenu.setPopupVisible(false);
            EventBusFactory.getInstance()
                    .post(new ShellEvent.GotoUserAccountModule(this, new String[] { "setup" }));
        }).withIcon(FontAwesome.WRENCH);
        accountPopupContent.addOption(setupBtn);
    }

    accountPopupContent.addSeparator();

    MButton helpBtn = new MButton(AppContext.getMessage(GenericI18Enum.ACTION_HELP))
            .withIcon(FontAwesome.MORTAR_BOARD);
    ExternalResource helpRes = new ExternalResource("https://community.mycollab.com/meet-mycollab/");
    BrowserWindowOpener helpOpener = new BrowserWindowOpener(helpRes);
    helpOpener.extend(helpBtn);
    accountPopupContent.addOption(helpBtn);

    MButton supportBtn = new MButton(AppContext.getMessage(GenericI18Enum.BUTTON_SUPPORT))
            .withIcon(FontAwesome.LIFE_SAVER);
    ExternalResource supportRes = new ExternalResource("http://support.mycollab.com/");
    BrowserWindowOpener supportOpener = new BrowserWindowOpener(supportRes);
    supportOpener.extend(supportBtn);
    accountPopupContent.addOption(supportBtn);

    MButton translateBtn = new MButton(AppContext.getMessage(GenericI18Enum.ACTION_TRANSLATE))
            .withIcon(FontAwesome.PENCIL);
    ExternalResource translateRes = new ExternalResource(
            "https://community.mycollab.com/docs/developing-mycollab/translating/");
    BrowserWindowOpener translateOpener = new BrowserWindowOpener(translateRes);
    translateOpener.extend(translateBtn);
    accountPopupContent.addOption(translateBtn);

    if (!SiteConfiguration.isCommunityEdition()) {
        MButton myAccountBtn = new MButton(AppContext.getMessage(AdminI18nEnum.VIEW_BILLING), clickEvent -> {
            accountMenu.setPopupVisible(false);
            EventBusFactory.getInstance()
                    .post(new ShellEvent.GotoUserAccountModule(this, new String[] { "billing" }));
        }).withIcon(SettingAssetsManager.getAsset(SettingUIConstants.BILLING));
        accountPopupContent.addOption(myAccountBtn);
    }

    accountPopupContent.addSeparator();
    MButton aboutBtn = new MButton("About MyCollab", clickEvent -> {
        accountMenu.setPopupVisible(false);
        Window aboutWindow = ViewManager.getCacheComponent(AbstractAboutWindow.class);
        UI.getCurrent().addWindow(aboutWindow);
    }).withIcon(FontAwesome.INFO_CIRCLE);
    accountPopupContent.addOption(aboutBtn);

    Button releaseNotesBtn = new Button("Release Notes");
    ExternalResource releaseNotesRes = new ExternalResource(
            "https://community.mycollab.com/docs/hosting-mycollab-on-your-own-server/releases/");
    BrowserWindowOpener releaseNotesOpener = new BrowserWindowOpener(releaseNotesRes);
    releaseNotesOpener.extend(releaseNotesBtn);

    releaseNotesBtn.setIcon(FontAwesome.BULLHORN);
    accountPopupContent.addOption(releaseNotesBtn);

    MButton signoutBtn = new MButton(AppContext.getMessage(GenericI18Enum.BUTTON_SIGNOUT), clickEvent -> {
        accountMenu.setPopupVisible(false);
        EventBusFactory.getInstance().post(new ShellEvent.LogOut(this, null));
    }).withIcon(FontAwesome.SIGN_OUT);
    accountPopupContent.addSeparator();
    accountPopupContent.addOption(signoutBtn);

    accountMenu.setContent(accountPopupContent);
    accountLayout.addComponent(accountMenu);
    return accountLayout;
}

From source file:com.mycollab.vaadin.web.ui.AbstractPreviewItemComp.java

License:Open Source License

public AbstractPreviewItemComp(String headerText, FontAwesome iconResource, ReadViewLayout layout) {
    ELabel headerLbl = ELabel.h2("").withWidthUndefined();
    this.previewLayout = layout;

    header = new MHorizontalLayout().withStyleName("hdr-view").withFullWidth();
    header.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);

    if (iconResource != null) {
        String title = iconResource.getHtml() + " " + headerText;
        headerLbl.setValue(title);/*w  w w . ja  va  2  s .  c o m*/
    } else {
        headerLbl.setValue(headerText);
    }

    if (SiteConfiguration.isCommunityEdition()) {
        header.with(headerLbl).expand(headerLbl);
    } else {
        favoriteBtn = new MButton("", clickEvent -> toggleFavorite()).withIcon(FontAwesome.HEART);

        Label spaceLbl = new Label();
        header.with(headerLbl, favoriteBtn, spaceLbl).expand(spaceLbl);
    }

    this.addComponent(header);
    ComponentContainer extraComp;
    if ((extraComp = createExtraControls()) != null) {
        this.addComponent(extraComp);
    }
    initContent();
}

From source file:com.mycollab.vaadin.web.ui.AddViewLayout.java

License:Open Source License

public AddViewLayout(String viewTitle, FontAwesome viewIcon) {
    super("addView");

    this.viewIcon = viewIcon;

    header = new MHorizontalLayout().withFullWidth().withMargin(new MarginInfo(true, false, true, false));
    header.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);

    titleLbl = ELabel.h2("");
    header.with(titleLbl).expand(titleLbl);
    setHeader(viewTitle);//w  ww  . ja  va  2s  . com
    addComponent(header, "addViewHeader");
}

From source file:com.mycollab.vaadin.web.ui.Depot.java

License:Open Source License

public Depot(String title, ComponentContainer content) {
    this.addStyleName("depotComp");
    header = new MHorizontalLayout().withHeight("40px").withStyleName("depotHeader");
    bodyContent = content;//ww  w  .j  a  v a2  s .co m
    bodyContent.setWidth("100%");
    headerContent = new MHorizontalLayout().withFullHeight().withWidthUndefined().withVisible(false);
    this.addComponent(header);

    headerLbl = new Label(title);
    final MHorizontalLayout headerLeft = new MHorizontalLayout(headerLbl).withStyleName("depot-title")
            .withAlign(headerLbl, Alignment.MIDDLE_LEFT).withFullWidth();
    headerLeft.addLayoutClickListener(layoutClickEvent -> {
        isOpened = !isOpened;
        if (isOpened) {
            bodyContent.setVisible(true);
            removeStyleName("collapsed");
            header.removeStyleName("border-bottom");
        } else {
            bodyContent.setVisible(false);
            addStyleName("collapsed");
            header.addStyleName("border-bottom");
        }
    });
    header.with(headerLeft, headerContent).withAlign(headerLeft, Alignment.MIDDLE_LEFT)
            .withAlign(headerContent, Alignment.MIDDLE_RIGHT).expand(headerLeft);

    bodyContent.addStyleName("depotContent");
    this.addComponent(bodyContent);
}

From source file:com.mycollab.vaadin.web.ui.MultiSelectComp.java

License:Open Source License

@Override
protected Component initContent() {
    MHorizontalLayout content = new MHorizontalLayout().withSpacing(true).withWidth(widthVal)
            .with(componentsText).withAlign(componentsText, Alignment.MIDDLE_LEFT);

    componentPopupSelection.addStyleName(WebThemes.MULTI_SELECT_BG);
    componentPopupSelection.setDirection(Alignment.TOP_LEFT);

    MHorizontalLayout multiSelectComp = new MHorizontalLayout().withSpacing(false)
            .with(componentsText, componentPopupSelection).expand(componentsText);
    content.with(multiSelectComp);/*from   ww w.  j a  v  a  2  s.c o  m*/

    if (canAddNew) {
        MButton newBtn = new MButton(UserUIContext.getMessage(GenericI18Enum.BUTTON_ADD),
                clickEvent -> requestAddNewComp()).withStyleName(WebThemes.BUTTON_LINK);
        content.with(newBtn);
    }
    content.expand(multiSelectComp);
    return content;
}

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

License:Open Source License

@Override
protected Component initContent() {
    componentsText = new TextField();
    componentsText.setNullRepresentation("");
    componentsText.setReadOnly(true);//  w  ww  .  j a  v a 2 s. co  m
    componentsText.addStyleName("noBorderRight");
    componentsText.setWidth("100%");
    componentPopupSelection = new PopupButton();
    componentPopupSelection.addStyleName(WebThemes.MULTI_SELECT_BG);
    componentPopupSelection.setDirection(Alignment.TOP_LEFT);
    componentPopupSelection.addClickListener(clickEvent -> initContentPopup());

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

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

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

From source file:com.mycollab.vaadin.web.ui.StyleCalendarExp.java

License:Open Source License

public StyleCalendarExp() {
    this.setWidth("230px");
    this.setHeightUndefined();
    this.setSpacing(false);
    this.setStyleName("stylecalendar-ext");
    this.setMargin(new MarginInfo(true, false, false, false));

    styleCalendar.setRenderHeader(false);
    styleCalendar.setRenderWeekNumbers(false);
    styleCalendar.setImmediate(true);/*from   w w w. j a  v a  2s  . c om*/
    styleCalendar.setWidth("100%");
    setDateOptionsGenerator();

    btnShowNextYear = new Button();
    btnShowNextYear.setIcon(
            new ExternalResource(StorageFactory.generateAssetRelativeLink("icons/16/cal_year_next.png")));
    btnShowNextYear.setStyleName(WebThemes.BUTTON_LINK);

    btnShowNextMonth = new Button();
    btnShowNextMonth.setIcon(
            new ExternalResource(StorageFactory.generateAssetRelativeLink("icons/16/cal_month_next.png")));
    btnShowNextMonth.setStyleName(WebThemes.BUTTON_LINK);

    btnShowPreviousMonth = new Button();
    btnShowPreviousMonth.setIcon(
            new ExternalResource(StorageFactory.generateAssetRelativeLink("icons/16/cal_month_pre.png")));
    btnShowPreviousMonth.setStyleName(WebThemes.BUTTON_LINK);

    btnShowPreviousYear = new Button();
    btnShowPreviousYear.setIcon(
            new ExternalResource(StorageFactory.generateAssetRelativeLink("icons/16/cal_year_pre.png")));
    btnShowPreviousYear.setStyleName(WebThemes.BUTTON_LINK);

    lbSelectedDate.setValue(UserUIContext.formatDate(new Date()));
    lbSelectedDate.addStyleName("calendarDateLabel");
    lbSelectedDate.setWidth("80");

    HorizontalLayout layoutControl = new HorizontalLayout();
    layoutControl.setStyleName("calendarHeader");
    layoutControl.setWidth("100%");
    layoutControl.setHeight("35px");

    HorizontalLayout layoutButtonPrevious = new HorizontalLayout();
    layoutButtonPrevious.setSpacing(true);
    layoutButtonPrevious.addComponent(btnShowPreviousYear);
    layoutButtonPrevious.setComponentAlignment(btnShowPreviousYear, Alignment.MIDDLE_LEFT);
    layoutButtonPrevious.addComponent(btnShowPreviousMonth);
    layoutButtonPrevious.setComponentAlignment(btnShowPreviousMonth, Alignment.MIDDLE_LEFT);
    layoutControl.addComponent(layoutButtonPrevious);
    layoutControl.setComponentAlignment(layoutButtonPrevious, Alignment.MIDDLE_LEFT);

    layoutControl.addComponent(lbSelectedDate);
    layoutControl.setComponentAlignment(lbSelectedDate, Alignment.MIDDLE_CENTER);

    MHorizontalLayout layoutButtonNext = new MHorizontalLayout();
    layoutButtonNext.addComponent(btnShowNextMonth);
    layoutButtonNext.setComponentAlignment(btnShowNextMonth, Alignment.MIDDLE_RIGHT);
    layoutButtonNext.addComponent(btnShowNextYear);
    layoutButtonNext.setComponentAlignment(btnShowNextYear, Alignment.MIDDLE_RIGHT);
    layoutControl.addComponent(layoutButtonNext);
    layoutControl.setComponentAlignment(layoutButtonNext, Alignment.MIDDLE_RIGHT);

    this.addComponent(layoutControl);
    this.setComponentAlignment(layoutControl, Alignment.TOP_CENTER);

    this.addComponent(styleCalendar);
    this.setExpandRatio(styleCalendar, 1.0f);
}

From source file:com.ocs.dynamo.ui.component.BaseBanner.java

License:Apache License

/**
 * Constructor//from w ww  .ja v a  2s.  c  o m
 * 
 * @param imagePath
 *            the path to the image
 */
public BaseBanner(String imagePath) {
    super(true, false, false);
    this.imagePath = imagePath;

    setId("banner");
    setSizeFull();

    image = new Image(null, new ThemeResource(imagePath));
    image.setWidth(null);
    addComponent(image);
    setComponentAlignment(image, Alignment.MIDDLE_LEFT);
}

From source file:com.oodrive.nuage.webui.component.VvrOperationComponent.java

License:Apache License

@Override
public final AbstractComponent createComponent(final VvrModel model, final ModelCreator handler) {

    final HorizontalLayout operationLayout = new HorizontalLayout();
    operationLayout.setMargin(true);/*from w ww .  j a va 2 s.c  om*/
    operationLayout.setSpacing(true);
    operationLayout.setWidth("100%");

    // Start and description buttons
    // START/STOP
    final Button startStop = new Button();
    startStop.setWidth(BUTTON_WIDTH);
    startStop.addStyleName(Runo.BUTTON_BIG);

    final Resource iconStartStop;
    final String description;
    if (!model.isVvrStarted()) {
        iconStartStop = WebUiResources.getStartIcon();
        description = "Start";
    } else {
        iconStartStop = WebUiResources.getStopIcon();
        description = "Stop";
    }
    startStop.setIcon(iconStartStop);
    startStop.setDescription(description);

    operationLayout.addComponent(startStop);
    operationLayout.setExpandRatio(startStop, 1f);
    operationLayout.setComponentAlignment(startStop, Alignment.MIDDLE_LEFT);

    final UUID vvrUuid = model.getItemUuid();
    startStop.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            final boolean started = model.isVvrStarted();
            // Start/Stop are done in background
            if (!started) {
                WaitingComponent.executeBackground(model, new Background() {
                    @Override
                    public void processing() {
                        model.startVvr();
                    }

                    @Override
                    public void postProcessing() {
                        startStop.setIcon(WebUiResources.getStopIcon());
                        startStop.setDescription("Stop");
                        Notification.show("VVR started ", vvrUuid.toString(),
                                Notification.Type.TRAY_NOTIFICATION);
                    }
                });
            } else {
                WaitingComponent.executeBackground(model, new Background() {
                    @Override
                    public void processing() {
                        model.stopVvr();
                    }

                    @Override
                    public void postProcessing() {
                        startStop.setIcon(WebUiResources.getStartIcon());
                        startStop.setDescription("Start");
                        Notification.show("VVR stopped ", vvrUuid.toString(),
                                Notification.Type.TRAY_NOTIFICATION);
                    }
                });
            }
        }
    });

    // ATTRIBUTES
    final Button attributes = new Button();
    attributes.addStyleName(Runo.BUTTON_BIG);
    attributes.setWidth(BUTTON_WIDTH);

    operationLayout.addComponent(attributes);
    operationLayout.setExpandRatio(attributes, 1f);
    operationLayout.setComponentAlignment(attributes, Alignment.MIDDLE_LEFT);
    attributes.setIcon(WebUiResources.getSettingsIcon());
    attributes.setDescription("Settings");

    attributes.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            try {
                final VvrAttributesWindow attributesWindow = new VvrAttributesWindow(vvrUuid);
                attributesWindow.add(model);
            } catch (final Exception e) {
                LOGGER.error("Can not get VVR attributes: ", e);
                final ErrorWindow err = new ErrorWindow("Can not display VVR Attributes: " + e.getMessage());
                err.add(model);
            }
        }
    });

    // DELETE
    final Button delete = new Button();
    delete.addStyleName(Runo.BUTTON_BIG);
    delete.setWidth(BUTTON_WIDTH);
    delete.setIcon(WebUiResources.getTrashIcon());
    delete.setDescription("Delete");

    operationLayout.addComponent(delete);
    operationLayout.setExpandRatio(delete, 12f);
    operationLayout.setComponentAlignment(delete, Alignment.MIDDLE_RIGHT);

    delete.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(final ClickEvent event) {
            try {
                final VvrDeleteWindow deleteWindow = new VvrDeleteWindow(vvrUuid);
                deleteWindow.add(vvrManagerModel);
            } catch (final Exception e) {
                LOGGER.error("Can not delete VVR: ", e);
                final ErrorWindow err = new ErrorWindow("Can not delete VVR: " + e.getMessage());
                err.add(model);
            }
        }
    });
    return operationLayout;
}