Example usage for com.vaadin.server FontAwesome CIRCLE_O_NOTCH

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

Introduction

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

Prototype

FontAwesome CIRCLE_O_NOTCH

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

Click Source Link

Usage

From source file:com.esofthead.mycollab.module.project.view.task.TaskReadViewImpl.java

License:Open Source License

@Override
protected void onPreviewItem() {
    ((TaskPreviewFormLayout) previewLayout).displayTaskHeader(beanItem);
    if (beanItem.isCompleted()) {
        addLayoutStyleName(UIConstants.LINK_COMPLETED);
    } else if (beanItem.isPending()) {
        addLayoutStyleName(UIConstants.LINK_PENDING);
    } else if (beanItem.isOverdue()) {
        addLayoutStyleName("headerNameOverdue");
    }/*from w ww  . j  ava 2 s .c  o  m*/

    if (!beanItem.isCompleted()) {
        quickActionStatusBtn.setCaption(AppContext.getMessage(GenericI18Enum.BUTTON_CLOSE));
        quickActionStatusBtn.setIcon(FontAwesome.ARCHIVE);
    } else {
        quickActionStatusBtn.setCaption(AppContext.getMessage(GenericI18Enum.BUTTON_REOPEN));
        quickActionStatusBtn.setIcon(FontAwesome.CIRCLE_O_NOTCH);

    }

    commentList.loadComments("" + beanItem.getId());
    historyList.loadHistory(beanItem.getId());
    followerSheet.displayFollowers(beanItem);
    peopleInfoComp.displayEntryPeople(beanItem);
    dateInfoComp.displayEntryDateTime(beanItem);
    timesheetComp.displayTime(beanItem);
}

From source file:com.esofthead.mycollab.module.project.view.task.TaskReadViewImpl.java

License:Open Source License

@Override
protected ComponentContainer createButtonControls() {
    ProjectPreviewFormControlsGenerator<SimpleTask> taskPreviewForm = new ProjectPreviewFormControlsGenerator<>(
            previewForm);// w  w w  . j a  v a 2  s .c o m
    final HorizontalLayout topPanel = taskPreviewForm.createButtonControls(
            ProjectPreviewFormControlsGenerator.ADD_BTN_PRESENTED
                    | ProjectPreviewFormControlsGenerator.ASSIGN_BTN_PRESENTED
                    | ProjectPreviewFormControlsGenerator.CLONE_BTN_PRESENTED
                    | ProjectPreviewFormControlsGenerator.DELETE_BTN_PRESENTED
                    | ProjectPreviewFormControlsGenerator.EDIT_BTN_PRESENTED,
            ProjectRolePermissionCollections.TASKS);

    quickActionStatusBtn = new Button("", new Button.ClickListener() {
        private static final long serialVersionUID = 1L;

        @Override
        public void buttonClick(ClickEvent event) {
            if (beanItem.isCompleted()) {
                beanItem.setStatus(StatusI18nEnum.Open.name());
                beanItem.setPercentagecomplete(0d);
                TaskReadViewImpl.this.removeLayoutStyleName(UIConstants.LINK_COMPLETED);
                quickActionStatusBtn.setCaption(AppContext.getMessage(GenericI18Enum.BUTTON_CLOSE));
                quickActionStatusBtn.setIcon(FontAwesome.ARCHIVE);
            } else {
                beanItem.setStatus(StatusI18nEnum.Closed.name());
                beanItem.setPercentagecomplete(100d);
                TaskReadViewImpl.this.addLayoutStyleName(UIConstants.LINK_COMPLETED);
                quickActionStatusBtn.setCaption(AppContext.getMessage(GenericI18Enum.BUTTON_REOPEN));
                quickActionStatusBtn.setIcon(FontAwesome.CIRCLE_O_NOTCH);
            }

            ProjectTaskService service = ApplicationContextUtil.getSpringBean(ProjectTaskService.class);
            service.updateWithSession(beanItem, AppContext.getUsername());

        }
    });

    quickActionStatusBtn.setStyleName(UIConstants.THEME_GREEN_LINK);
    taskPreviewForm.insertToControlBlock(quickActionStatusBtn);

    if (!CurrentProjectVariables.canWrite(ProjectRolePermissionCollections.TASKS)) {
        quickActionStatusBtn.setEnabled(false);
    }

    return topPanel;
}