Example usage for com.vaadin.server FontAwesome BUILDING_O

List of usage examples for com.vaadin.server FontAwesome BUILDING_O

Introduction

In this page you can find the example usage for com.vaadin.server FontAwesome BUILDING_O.

Prototype

FontAwesome BUILDING_O

To view the source code for com.vaadin.server FontAwesome BUILDING_O.

Click Source Link

Usage

From source file:com.esofthead.mycollab.module.project.view.milestone.AllMilestoneTimelineWidget.java

License:Open Source License

private void displayTimelines(boolean includeNoDateSet, boolean includeClosedMilestone) {
    timelineContainer.removeAllComponents();
    Ul ul = new Ul().setCSSClass("timeline");

    for (SimpleMilestone milestone : milestones) {
        if (!includeClosedMilestone) {
            if (OptionI18nEnum.MilestoneStatus.Closed.name().equals(milestone.getStatus())) {
                continue;
            }/*from   w  w w.ja v a 2  s.c o  m*/
        }
        if (!includeNoDateSet) {
            if (milestone.getEnddate() == null) {
                continue;
            }
        }
        Li li = new Li();
        if (OptionI18nEnum.MilestoneStatus.Closed.name().equals(milestone.getStatus())) {
            li.setCSSClass("li closed");
        } else if (OptionI18nEnum.MilestoneStatus.InProgress.name().equals(milestone.getStatus())) {
            li.setCSSClass("li inprogress");
        } else if (OptionI18nEnum.MilestoneStatus.Future.name().equals(milestone.getStatus())) {
            li.setCSSClass("li future");
        }

        Div timestampDiv = new Div().setCSSClass("timestamp");

        int openAssignments = milestone.getNumOpenBugs() + milestone.getNumOpenTasks();
        int totalAssignments = milestone.getNumBugs() + milestone.getNumTasks();
        if (totalAssignments > 0) {
            timestampDiv.appendChild(
                    new Span().appendText((totalAssignments - openAssignments) * 100 / totalAssignments + "%"));
        } else {
            timestampDiv.appendChild(new Span().appendText("100%"));
        }

        if (milestone.getEnddate() == null) {
            timestampDiv.appendChild(new Span().setCSSClass("date").appendText("No date set"));
        } else {
            if (milestone.isOverdue()) {
                timestampDiv.appendChild(new Span().setCSSClass("date overdue")
                        .appendText(AppContext.formatDate(milestone.getEnddate()) + " (Due in "
                                + AppContext.formatDuration(milestone.getEnddate()) + ")"));
            } else {
                timestampDiv.appendChild(new Span().setCSSClass("date")
                        .appendText(AppContext.formatDate(milestone.getEnddate())));
            }
        }
        li.appendChild(timestampDiv);

        A projectDiv = new A(ProjectLinkBuilder.generateProjectFullLink(milestone.getProjectid())).appendText(
                FontAwesome.BUILDING_O.getHtml() + " " + StringUtils.trim(milestone.getProjectName(), 30, true))
                .setId("tag" + TOOLTIP_ID);
        projectDiv.setAttribute("onmouseover", TooltipHelper
                .projectHoverJsFunction(ProjectTypeConstants.PROJECT, milestone.getProjectid() + ""));
        projectDiv.setAttribute("onmouseleave", TooltipHelper.itemMouseLeaveJsFunction());

        A milestoneDiv = new A(ProjectLinkBuilder.generateMilestonePreviewFullLink(milestone.getProjectid(),
                milestone.getId()))
                        .appendText(ProjectAssetsManager.getAsset(ProjectTypeConstants.MILESTONE).getHtml()
                                + " " + StringUtils.trim(milestone.getName(), 30, true))
                        .setId("tag" + TOOLTIP_ID);
        milestoneDiv.setAttribute("onmouseover",
                TooltipHelper.projectHoverJsFunction(ProjectTypeConstants.MILESTONE, milestone.getId() + ""));
        milestoneDiv.setAttribute("onmouseleave", TooltipHelper.itemMouseLeaveJsFunction());

        Div statusDiv = new Div().setCSSClass("status").appendChild(projectDiv, milestoneDiv);
        li.appendChild(statusDiv);
        ul.appendChild(li);
    }

    timelineContainer.addComponent(new ELabel(ul.write(), ContentMode.HTML).withWidthUndefined());
}

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

License:Open Source License

@Override
public void displayDashboard() {
    mainLayout.removeAllComponents();/*w  w w  .j a  va  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);
}

From source file:com.mycollab.module.project.view.milestone.AllMilestoneTimelineWidget.java

License:Open Source License

private void displayTimelines(boolean includeNoDateSet, boolean includeClosedMilestone) {
    timelineContainer.removeAllComponents();
    Ul ul = new Ul().setCSSClass("timeline");

    for (SimpleMilestone milestone : milestones) {
        if (!includeClosedMilestone) {
            if (MilestoneStatus.Closed.name().equals(milestone.getStatus())) {
                continue;
            }//from w  ww  .j  a  v  a2  s.co m
        }
        if (!includeNoDateSet) {
            if (milestone.getEnddate() == null) {
                continue;
            }
        }
        Li li = new Li();
        if (MilestoneStatus.Closed.name().equals(milestone.getStatus())) {
            li.setCSSClass("li closed");
        } else if (MilestoneStatus.InProgress.name().equals(milestone.getStatus())) {
            li.setCSSClass("li inprogress");
        } else if (MilestoneStatus.Future.name().equals(milestone.getStatus())) {
            li.setCSSClass("li future");
        }

        Div timestampDiv = new Div().setCSSClass("timestamp");

        int openAssignments = milestone.getNumOpenBugs() + milestone.getNumOpenTasks()
                + milestone.getNumOpenRisks();
        int totalAssignments = milestone.getNumBugs() + milestone.getNumTasks() + milestone.getNumRisks();
        if (totalAssignments > 0) {
            timestampDiv.appendChild(
                    new Span().appendText((totalAssignments - openAssignments) * 100 / totalAssignments + "%"));
        } else {
            timestampDiv.appendChild(new Span().appendText("100%"));
        }

        if (milestone.getEnddate() == null) {
            timestampDiv.appendChild(new Span().setCSSClass("date")
                    .appendText(UserUIContext.getMessage(DayI18nEnum.OPT_NO_DATE_SET)));
        } else {
            if (milestone.isOverdue()) {
                timestampDiv
                        .appendChild(
                                new Span().setCSSClass("date overdue")
                                        .appendText(UserUIContext.formatDate(milestone.getEnddate()) + " ("
                                                + UserUIContext.getMessage(ProjectCommonI18nEnum.OPT_DUE_IN,
                                                        UserUIContext.formatDuration(milestone.getEnddate()))
                                                + ")"));
            } else {
                timestampDiv.appendChild(new Span().setCSSClass("date")
                        .appendText(UserUIContext.formatDate(milestone.getEnddate())));
            }
        }
        li.appendChild(timestampDiv);

        A projectDiv = new A(ProjectLinkBuilder.generateProjectFullLink(milestone.getProjectid())).appendText(
                FontAwesome.BUILDING_O.getHtml() + " " + StringUtils.trim(milestone.getProjectName(), 30, true))
                .setId("tag" + TOOLTIP_ID);
        projectDiv.setAttribute("onmouseover", TooltipHelper
                .projectHoverJsFunction(ProjectTypeConstants.PROJECT, milestone.getProjectid() + ""));
        projectDiv.setAttribute("onmouseleave", TooltipHelper.itemMouseLeaveJsFunction());

        A milestoneDiv = new A(ProjectLinkBuilder.generateMilestonePreviewFullLink(milestone.getProjectid(),
                milestone.getId()))
                        .appendText(ProjectAssetsManager.getAsset(ProjectTypeConstants.MILESTONE).getHtml()
                                + " " + StringUtils.trim(milestone.getName(), 30, true))
                        .setId("tag" + TOOLTIP_ID);
        milestoneDiv.setAttribute("onmouseover",
                TooltipHelper.projectHoverJsFunction(ProjectTypeConstants.MILESTONE, milestone.getId() + ""));
        milestoneDiv.setAttribute("onmouseleave", TooltipHelper.itemMouseLeaveJsFunction());

        Div statusDiv = new Div().setCSSClass("status").appendChild(projectDiv, milestoneDiv);
        li.appendChild(statusDiv);
        ul.appendChild(li);
    }

    timelineContainer.addComponent(ELabel.html(ul.write()).withWidthUndefined());
}

From source file:com.mycollab.module.project.view.UserDashboardViewImpl.java

License:Open Source License

public UserDashboardViewImpl() {
    this.withMargin(false).withFullWidth();

    prjService = AppContextUtil.getSpringBean(ProjectService.class);
    prjKeys = prjService.getProjectKeysUserInvolved(UserUIContext.getUsername(), MyCollabUI.getAccountId());

    tabSheet = new TabSheet();
    tabSheet.addTab(buildDashboardComp(), UserUIContext.getMessage(GenericI18Enum.VIEW_DASHBOARD),
            FontAwesome.DASHBOARD);//from  w  w  w  .j  a v a  2 s. c  om
    tabSheet.addTab(buildProjectListComp(), UserUIContext.getMessage(ProjectI18nEnum.LIST),
            FontAwesome.BUILDING_O);
    tabSheet.addTab(buildFollowingTicketComp(), UserUIContext.getMessage(ProjectCommonI18nEnum.VIEW_FAVORITES),
            FontAwesome.EYE);
    if (!SiteConfiguration.isCommunityEdition()) {
        tabSheet.addTab(buildCalendarComp(), UserUIContext.getMessage(ProjectCommonI18nEnum.VIEW_CALENDAR),
                FontAwesome.CALENDAR);
    }

    //        tabSheet.addTab(buildSettingComp(), "Settings", FontAwesome.COG);

    tabSheet.addSelectedTabChangeListener(selectedTabChangeEvent -> {
        CssLayout comp = (CssLayout) tabSheet.getSelectedTab();
        comp.removeAllComponents();
        int tabIndex = tabSheet.getTabPosition(tabSheet.getTab(comp));
        if (tabIndex == 0) {
            UserProjectDashboardPresenter userProjectDashboardPresenter = PresenterResolver
                    .getPresenterAndInitView(UserProjectDashboardPresenter.class);
            userProjectDashboardPresenter.onGo(comp, null);
        } else if (tabIndex == 2) {
            FollowingTicketPresenter followingTicketPresenter = PresenterResolver
                    .getPresenterAndInitView(FollowingTicketPresenter.class);
            followingTicketPresenter.onGo(comp, null);
        } else if (tabIndex == 4) {
            SettingPresenter settingPresenter = PresenterResolver.getPresenter(SettingPresenter.class);
            settingPresenter.onGo(comp, null);
        } else if (tabIndex == 3) {
            ICalendarDashboardPresenter calendarPresenter = PresenterResolver
                    .getPresenterAndInitView(ICalendarDashboardPresenter.class);
            calendarPresenter.go(comp, null);
        } else if (tabIndex == 1) {
            ProjectListPresenter projectListPresenter = PresenterResolver
                    .getPresenterAndInitView(ProjectListPresenter.class);
            projectListPresenter.onGo(comp, null);
        }
    });

    this.with(setupHeader(), tabSheet).expand(tabSheet);
}

From source file:ui.button.ApplyNowButton.java

License:Apache License

public ApplyNowButton(Integer userId, String language, JobOffer job) {
    super(Translator.getTranslation("Apply to Job", language), FontAwesome.BUILDING_O);
    this.userId = userId;
    this.language = language;
    this.job = job;
    addClickListener(this);
}