Example usage for com.vaadin.ui VerticalLayout setStyleName

List of usage examples for com.vaadin.ui VerticalLayout setStyleName

Introduction

In this page you can find the example usage for com.vaadin.ui VerticalLayout setStyleName.

Prototype

@Override
    public void setStyleName(String style) 

Source Link

Usage

From source file:com.jain.i18N.definition.PersonDefinitionForm.java

License:Apache License

private void createActions(VerticalLayout layout) {
    if (!viewOnly) {
        JainEditClickListener clickListner = new JainEditClickListener(this);
        HorizontalLayout hLayout = VaadinHelper.createButtonSegment(clickListner, JAction.SAVE, JAction.CANCEL);

        VerticalLayout vLayout = new VerticalLayout();
        vLayout.setSizeUndefined();/*from  w w  w  . jav  a2s  .  c  om*/
        vLayout.setStyleName(ApplicationTheme.VIEW);
        vLayout.addComponent(hLayout);

        layout.addComponent(vLayout);
        layout.setComponentAlignment(vLayout, Alignment.MIDDLE_CENTER);
        layout.setExpandRatio(vLayout, 1);
    }
}

From source file:com.jiangyifen.ec2.ui.mgr.outlinemanage.AddOutline.java

public AddOutline(OutlineManagement outlineManagement) {
    this.center();
    this.setModal(true);
    this.setResizable(false);
    this.setWidth("360px");
    this.setHeight("335px");
    this.setCaption("");
    this.outlineManagement = outlineManagement;

    domain = SpringContextHolder.getDomain();
    sipConfigService = SpringContextHolder.getBean("sipConfigService");
    reloadAsteriskService = SpringContextHolder.getBean("reloadAsteriskService");
    queueMemberRelationService = SpringContextHolder.getBean("queueMemberRelationService");
    phone2PhoneSettingService = SpringContextHolder.getBean("phone2PhoneSettingService");
    userQueueService = SpringContextHolder.getBean("userQueueService");
    queueService = SpringContextHolder.getBean("queueService");
    autoDialoutTaskService = SpringContextHolder.getBean("autoDialoutTaskService");

    //WindowLayout
    VerticalLayout windowContent = new VerticalLayout();
    windowContent.setSizeUndefined();/*  ww w  .jav a 2  s  . c  o  m*/
    windowContent.setMargin(false, true, true, true);
    windowContent.setSpacing(true);
    windowContent.setStyleName(StyleConfig.VERTICAL_STYLE);
    this.setContent(windowContent);

    // Form ?
    createFormComponent(windowContent);
}

From source file:com.jiangyifen.ec2.ui.mgr.outlinemanage.EditOutline.java

public EditOutline(OutlineManagement outlineManagement) {
    this.center();
    this.setModal(true);
    this.setWidth("360px");
    this.setHeight("565px");
    this.setResizable(false);
    this.setCaption("");
    this.outlineManagement = outlineManagement;

    domain = SpringContextHolder.getDomain();
    sipConfigService = SpringContextHolder.getBean("sipConfigService");
    reloadAsteriskService = SpringContextHolder.getBean("reloadAsteriskService");
    queueMemberRelationService = SpringContextHolder.getBean("queueMemberRelationService");
    phone2PhoneSettingService = SpringContextHolder.getBean("phone2PhoneSettingService");
    userQueueService = SpringContextHolder.getBean("userQueueService");
    queueService = SpringContextHolder.getBean("queueService");
    autoDialoutTaskService = SpringContextHolder.getBean("autoDialoutTaskService");

    //WindowLayout
    VerticalLayout windowContent = new VerticalLayout();
    windowContent.setSizeUndefined();// w  w w .  j  a v  a2s  .com
    windowContent.setMargin(false, true, true, true);
    windowContent.setSpacing(true);
    windowContent.setStyleName(StyleConfig.VERTICAL_STYLE);
    this.setContent(windowContent);

    // Form ?
    createFormComponent(windowContent);
}

From source file:com.jiangyifen.ec2.ui.mgr.usermanage.EditUser.java

/**
 * User//ww w. ja va2 s .c  om
 * @param project
 */
public EditUser(UserManagement userManagement) {
    this.center();
    this.setModal(true);
    this.userManagement = userManagement;

    domain = SpringContextHolder.getDomain();
    loginUser = SpringContextHolder.getLoginUser();

    //Service?
    userService = SpringContextHolder.getBean("userService");
    departmentService = SpringContextHolder.getBean("departmentService");
    roleService = SpringContextHolder.getBean("roleService");
    queueService = SpringContextHolder.getBean("queueService");
    queueMemberRelationService = SpringContextHolder.getBean("queueMemberRelationService");
    phone2PhoneSettingService = SpringContextHolder.getBean("phone2PhoneSettingService");
    userQueueService = SpringContextHolder.getBean("userQueueService");

    //WindowLayout
    VerticalLayout windowContent = new VerticalLayout();
    windowContent.setSizeUndefined();
    windowContent.setMargin(false, true, true, true);
    windowContent.setSpacing(true);
    windowContent.setStyleName(StyleConfig.VERTICAL_STYLE);
    this.setContent(windowContent);

    //From
    form = new Form();
    form.setValidationVisibleOnCommit(true);
    form.setValidationVisible(false);
    form.addStyleName("chb");
    //Form?????
    allRoles = roleService.getAll(domain);
    form.setFormFieldFactory(new MyFieldFactory());
    form.setFooter(buildButtonsLayout());
    windowContent.addComponent(form);
}

From source file:com.logicbomb.newschool.MyAppWidgetSet.core.UserDetailsWidget.java

public UserDetailsWidget() {
    HorizontalLayout h = new HorizontalLayout();
    addComponent(h);/* w  ww.  j ava2 s  .co  m*/

    h.setSizeFull();
    //h.setSpacing(true);

    Button userPhoto = new Button();
    userPhoto.setIcon(FontAwesome.USER);
    userPhoto.setHeight("100px");
    userPhoto.setWidth("100px");
    h.addComponent(userPhoto);
    //h.setComponentAlignment(userPhoto, Alignment.TOP_LEFT);

    VerticalLayout v = new VerticalLayout();
    //v.setStyleName("backColorBlack");
    h.addComponent(v);
    v.setStyleName("v-layout-padding-left");
    //h.setComponentAlignment(userPhoto, Alignment.TOP_RIGHT);
    v.setHeight("106px");
    v.setWidth("100px");

    // v.setComponentAlignment(userStatus, Alignment.MIDDLE_CENTER);
    Button editProfile = new Button("Profile");
    editProfile.setStyleName("v-button-type3");
    editProfile.setIcon(FontAwesome.USER);
    editProfile.setWidth("100px");
    editProfile.setWidth("102px");
    v.addComponent(editProfile);
    //v.setComponentAlignment(editProfile, Alignment.TOP_LEFT);

    Button settings = new Button("Settings");
    settings.setStyleName("v-button-type3");
    settings.setIcon(FontAwesome.WRENCH);
    settings.setWidth("100px");
    settings.setWidth("102px");
    v.addComponent(settings);
    //v.setComponentAlignment(editProfile, Alignment.MIDDLE_RIGHT);

    Button logOut = new Button("Log Out");
    logOut.setStyleName("v-button-type3");
    logOut.setIcon(FontAwesome.KEY);
    logOut.setWidth("100px");
    logOut.setWidth("102px");
    v.addComponent(logOut);
    //v.setComponentAlignment(editProfile, Alignment.BOTTOM_RIGHT);

    //v.setComponentAlignment(userStatus, Alignment.MIDDLE_CENTER);
}

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   www  .  j  av  a 2  s.c  o 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.mcparland.john.vaadin_mvn_arch.samples.authentication.LoginScreen.java

License:Apache License

private void buildUI() {
    addStyleName("login-screen");

    // login form, centered in the available part of the screen
    Component loginForm = buildLoginForm();

    // layout to center login form when there is sufficient screen space
    // - see the theme for how this is made responsive for various screen
    // sizes/*from w  w  w. j a  va 2s.  com*/
    VerticalLayout centeringLayout = new VerticalLayout();
    centeringLayout.setStyleName("centering-layout");
    centeringLayout.addComponent(loginForm);
    centeringLayout.setComponentAlignment(loginForm, Alignment.MIDDLE_CENTER);

    // information text about logging in
    CssLayout loginInformation = buildLoginInformation();

    addComponent(centeringLayout);
    addComponent(loginInformation);
}

From source file:com.mcparland.john.vaadin_mvn_arch.samples.crud.SampleCrudView.java

License:Apache License

public SampleCrudView() {
    setSizeFull();/*  w  w  w.j a  v  a 2 s  .  co m*/
    addStyleName("crud-view");
    HorizontalLayout topLayout = createTopBar();

    table = new ProductTable();
    table.addValueChangeListener(new ValueChangeListener() {
        /**
         * The serialVersionUID.
         */
        private static final long serialVersionUID = 1L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            viewLogic.rowSelected(table.getValue());
        }
    });

    form = new ProductForm(viewLogic);
    form.setCategories(DataService.get().getAllCategories());

    VerticalLayout barAndTableLayout = new VerticalLayout();
    barAndTableLayout.addComponent(topLayout);
    barAndTableLayout.addComponent(table);
    barAndTableLayout.setMargin(true);
    barAndTableLayout.setSpacing(true);
    barAndTableLayout.setSizeFull();
    barAndTableLayout.setExpandRatio(table, 1);
    barAndTableLayout.setStyleName("crud-main-layout");

    addComponent(barAndTableLayout);
    addComponent(form);

    viewLogic.init();
}

From source file:com.mycollab.mobile.module.project.ui.ProjectAttachmentDisplayComp.java

License:Open Source License

private void constructUI() {
    this.setStyleName("attachment-display-comp");
    this.addComponent(FormSectionBuilder.build(FontAwesome.FILE, GenericI18Enum.FORM_ATTACHMENTS));
    VerticalLayout comp = new VerticalLayout();
    comp.setStyleName("attachment-view-panel");
    comp.setWidth("100%");

    for (final Content attachment : attachments) {
        Component attachmentRow = MobileAttachmentUtils.renderAttachmentRow(attachment);
        comp.addComponent(attachmentRow);
    }/*from  w w w  . ja v  a2 s  .  co  m*/
    this.addComponent(comp);
}

From source file:com.mycollab.mobile.module.project.view.ProjectDashboardViewImpl.java

License:Open Source License

@Override
public void displayDashboard() {
    mainLayout.removeAllComponents();/*  w ww .  j av  a 2  s .c  o  m*/
    SimpleProject currentProject = CurrentProjectVariables.getProject();
    VerticalLayout projectInfo = new VerticalLayout();
    projectInfo.setStyleName("project-info-layout");
    projectInfo.setWidth("100%");
    projectInfo.setDefaultComponentAlignment(Alignment.TOP_CENTER);

    ELabel projectIcon = ELabel.fontIcon(FontAwesome.BUILDING_O).withStyleName("project-icon")
            .withWidthUndefined();
    projectInfo.addComponent(projectIcon);

    ELabel projectName = new ELabel(currentProject.getName()).withFullWidth().withStyleName("project-name");
    projectInfo.addComponent(projectName);

    MHorizontalLayout metaInfo = new MHorizontalLayout();

    Label projectMemberBtn = ELabel
            .html(FontAwesome.USERS.getHtml() + " " + currentProject.getNumActiveMembers())
            .withDescription(UserUIContext.getMessage(ProjectMemberI18nEnum.OPT_ACTIVE_MEMBERS))
            .withStyleName(UIConstants.META_INFO);

    metaInfo.addComponent(projectMemberBtn);
    Label createdTimeLbl = ELabel
            .html(FontAwesome.CLOCK_O.getHtml() + " "
                    + UserUIContext.formatPrettyTime(currentProject.getCreatedtime()))
            .withDescription(UserUIContext.getMessage(GenericI18Enum.FORM_CREATED_TIME))
            .withStyleName(UIConstants.META_INFO);
    metaInfo.addComponent(createdTimeLbl);

    Label billableHoursLbl = ELabel
            .html(FontAwesome.MONEY.getHtml() + " "
                    + NumberUtils.roundDouble(2, currentProject.getTotalBillableHours()))
            .withDescription(UserUIContext.getMessage(TimeTrackingI18nEnum.OPT_BILLABLE_HOURS))
            .withStyleName(UIConstants.META_INFO);
    metaInfo.addComponent(billableHoursLbl);

    Label nonBillableHoursLbl = ELabel
            .html(FontAwesome.GIFT.getHtml() + " "
                    + NumberUtils.roundDouble(2, currentProject.getTotalNonBillableHours()))
            .withDescription(UserUIContext.getMessage(TimeTrackingI18nEnum.OPT_NON_BILLABLE_HOURS))
            .withStyleName(UIConstants.META_INFO);
    metaInfo.addComponent(nonBillableHoursLbl);
    projectInfo.addComponent(metaInfo);

    int openAssignments = currentProject.getNumOpenBugs() + currentProject.getNumOpenTasks()
            + currentProject.getNumOpenRisks();
    int totalAssignments = currentProject.getNumBugs() + currentProject.getNumTasks()
            + currentProject.getNumRisks();
    ELabel progressInfoLbl;
    if (totalAssignments > 0) {
        progressInfoLbl = new ELabel(UserUIContext.getMessage(ProjectI18nEnum.OPT_PROJECT_TICKET,
                (totalAssignments - openAssignments), totalAssignments,
                (totalAssignments - openAssignments) * 100 / totalAssignments)).withWidthUndefined()
                        .withStyleName(UIConstants.META_INFO);
    } else {
        progressInfoLbl = new ELabel(UserUIContext.getMessage(ProjectI18nEnum.OPT_NO_TICKET))
                .withWidthUndefined().withStyleName(UIConstants.META_INFO);
    }
    projectInfo.addComponent(progressInfoLbl);

    mainLayout.addComponent(projectInfo);

    VerticalComponentGroup btnGroup = new VerticalComponentGroup();

    NavigationButton activityBtn = new NavigationButton(
            UserUIContext.getMessage(ProjectCommonI18nEnum.M_VIEW_PROJECT_ACTIVITIES));
    activityBtn.addClickListener(navigationButtonClickEvent -> EventBusFactory.getInstance()
            .post(new ProjectEvent.MyProjectActivities(this, CurrentProjectVariables.getProjectId())));
    btnGroup.addComponent(new NavigationButtonWrap(FontAwesome.INBOX, activityBtn));

    NavigationButton messageBtn = new NavigationButton(UserUIContext.getMessage(MessageI18nEnum.LIST));
    messageBtn.addClickListener(navigationButtonClickEvent -> EventBusFactory.getInstance()
            .post(new MessageEvent.GotoList(this, null)));
    btnGroup.addComponent(
            new NavigationButtonWrap(ProjectAssetsManager.getAsset(ProjectTypeConstants.MESSAGE), messageBtn));

    NavigationButton milestoneBtn = new NavigationButton(UserUIContext.getMessage(MilestoneI18nEnum.LIST));
    milestoneBtn.addClickListener(navigationButtonClickEvent -> EventBusFactory.getInstance()
            .post(new MilestoneEvent.GotoList(this, null)));
    btnGroup.addComponent(new NavigationButtonWrap(
            ProjectAssetsManager.getAsset(ProjectTypeConstants.MILESTONE), milestoneBtn));

    NavigationButton taskBtn = new NavigationButton(UserUIContext.getMessage(TicketI18nEnum.LIST));
    taskBtn.addClickListener(navigationButtonClickEvent -> EventBusFactory.getInstance()
            .post(new TicketEvent.GotoDashboard(this, null)));
    btnGroup.addComponent(
            new NavigationButtonWrap(ProjectAssetsManager.getAsset(ProjectTypeConstants.TICKET), taskBtn));

    NavigationButton userBtn = new NavigationButton(UserUIContext.getMessage(ProjectMemberI18nEnum.LIST));
    userBtn.addClickListener(navigationButtonClickEvent -> EventBusFactory.getInstance()
            .post(new ProjectMemberEvent.GotoList(this, null)));
    btnGroup.addComponent(new NavigationButtonWrap(FontAwesome.USERS, userBtn));

    mainLayout.addComponent(btnGroup);
}